Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

hooker.h

00001 /* Copyright (C) 1997-2004 The CDG Team <cdg@nats.informatik.uni-hamburg.de> 00002 * 00003 * This file is free software; as a special exception the author gives 00004 * unlimited permission to copy and/or distribute it, with or without 00005 * modifications, as long as this notice is preserved. 00006 * 00007 * This program is distributed in the hope that it will be useful, but 00008 * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 00009 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00010 * 00011 * Author: Michael Schulz (see also AUTHORS and THANKS for more) 00012 * Birth: 12 Juli 1998 00013 */ 00014 00015 /* ------------------------------------------------------------------------- 00016 * @addtogroup HookBindings 00017 * @ingroup Hook 00018 * @{ 00019 */ 00020 00021 #ifndef _HOOKER_H 00022 #define _HOOKER_H 00023 #include <stdarg.h> 00024 00025 #include <tcl.h> 00026 #include <tk.h> 00027 00028 #undef None 00029 #include <blah.h> 00030 #include "hook.h" 00031 #include "parse.h" 00032 00033 00034 /* -- TYPE DEFINITIONS -------------------------------------------------- */ 00035 00036 #ifndef SWIG 00037 00038 /* -------------------------------------------------------------------------- 00039 * buffer of the output channel. 00040 */ 00041 typedef struct { 00042 int size; /**< current size buffered */ 00043 int maxsize; /**< memory allocated in this buffer */ 00044 char *buffer; /**< a chunk of memory to buffer stuff in */ 00045 } LoggerStruct; 00046 typedef LoggerStruct *Logger; /**< type of a Logger */ 00047 00048 /* -------------------------------------------------------------------------- 00049 * type of HookResults. 00050 */ 00051 typedef enum { 00052 HTNone, 00053 HTInt, 00054 HTString, 00055 HTError 00056 } HookResultType; 00057 00058 00059 /* -------------------------------------------------------------------------- 00060 * typed result of a hook. 00061 * This structure tracks the result of a hook execution. The return value 00062 * stored within is used in our special typemaps for the swig interface 00063 * generator. 00064 */ 00065 typedef struct { 00066 HookResultType type; /**< type of the result data */ 00067 union { /** union of different results */ 00068 int intResult; /**< integer result value */ 00069 char *stringResult; /**< string result value */ 00070 } data; /**< result data of different type */ 00071 Hook hook; /**< the hook that produced this result */ 00072 } HookResultStruct; 00073 typedef HookResultStruct *HookResult; /**< type of a HookResult */ 00074 #endif 00075 00076 00077 /* -------------------------------------------------------------------------- 00078 * tagging the tcl result type. 00079 * This typedef is used to allow special typemaps in the swig interface. 00080 */ 00081 typedef int TclResultType; 00082 00083 00084 /* -- VARIABLES --------------------------------------------------------- */ 00085 00086 #ifndef SWIG 00087 extern Tcl_Interp *hkInterp; 00088 extern HookResult hkResult; 00089 #endif 00090 00091 /* -- FUNCTIONS ----------------------------------------------------------- */ 00092 00093 int loggerSize(int); 00094 TclResultType logWriteChar(char); 00095 TclResultType setHookCmd(char *, char *); 00096 TclResultType logWrite(char *); 00097 TclResultType getHookCmd(char *); 00098 TclResultType logPrintf(char *format, va_list ap); 00099 TclResultType logFlush(); 00100 00101 #ifndef SWIG 00102 TclResultType glsInteractionHookHandle(Hook hook, va_list ap); 00103 TclResultType evalHookHandle(Hook hook, va_list ap); 00104 TclResultType netsearchHookHandle(Hook hook, va_list ap); 00105 TclResultType getsHookHandle(Hook hook, String buffer, int size); 00106 TclResultType progressHookHandle(Hook hook, char *format, va_list ap); 00107 TclResultType partialResultHookHandle(Hook hook, va_list ap); 00108 TclResultType ICinteractionHookHandle(Hook hook, va_list ap); 00109 TclResultType tclHookHandle(Hook hook, va_list ap); 00110 void hooker_init(Tcl_Interp * interp); 00111 #endif 00112 00113 00114 /* ---------------------------------------------------------------------- */ 00115 /** @} */ 00116 #endif /* don't insert anything after this #endif */

CDG 0.95 (20 Oct 2004)