FDllCall.h

Go to the documentation of this file.
00001 
00002 /*  $Id: FDllCall.h 1196 2006-04-05 21:50:20Z karstenw $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #ifndef FDLLCALL_H
00029 #define FDLLCALL_H
00030 
00031 
00032 typedef struct odb_ * odbRef;
00033 
00034 typedef unsigned char odbBool;
00035 
00036 typedef unsigned char odbString [256];
00037 
00038 #ifndef isFrontier
00039 
00040 #ifdef MACVERSION
00041 typedef short hdlfilenum;
00042 #endif
00043 
00044 #ifdef WIN32
00045 #define Handle HANDLE
00046 typedef unsigned long FourCharCode;
00047 
00048 typedef FourCharCode OSType;
00049 
00050 typedef struct tyPoint
00051     {
00052     short   v;
00053     short h;
00054     } Point, *PointPtr;
00055 
00056 typedef RECT Rect;
00057 
00058 typedef HANDLE hdlfilenum;
00059 #endif
00060 
00061 #endif
00062 
00063 typedef enum odbDirection {
00064     
00065     dir_nodirection = 0, 
00066     
00067     dir_up = 1, 
00068     
00069     dir_down = 2, 
00070     
00071     dir_left = 3,
00072     
00073     dir_right = 4, 
00074     
00075     dir_flatup = 5, 
00076     
00077     dir_flatdown = 6, 
00078     
00079     dir_sorted = 8,
00080     
00081     dir_pageup = 9,
00082     
00083     dir_pagedown = 10,
00084     
00085     dir_pageleft = 11,
00086     
00087     dir_pageright = 12
00088     } odbDirection;
00089 
00090 
00091 typedef enum odbValueType  {
00092     
00093     odb_unknownvaluetype = '\?\?\?\?',
00094     
00095     odb_charvaluetype = 'char',
00096     
00097     odb_shortvaluetype = 'shor',
00098     
00099     odb_longvaluetype = 'long',
00100     
00101     odb_binaryvaluetype = 'data',
00102     
00103     odb_booleanvaluetype = 'bool',
00104     
00105     odb_tokenvaluetype = 'tokn',
00106     
00107     odb_datevaluetype = 'date',
00108     
00109     odb_addressvaluetype = 'addr',
00110     
00111     odb_codevaluetype = 'code',
00112     
00113     odb_extendedvaluetype = 'exte',
00114     
00115     odb_stringvaluetype = 'TEXT',
00116     
00117     odb_externalvaluetype = 'xtrn',
00118     
00119     odb_directionvaluetype = 'dir ',
00120     
00121     odb_string4valuetype = 'type',
00122     
00123     odb_pointvaluetype = 'QDpt',
00124     
00125     odb_rectvaluetype = 'qdrt',
00126     
00127     odb_patternvaluetype = 'tptn',
00128     
00129     odb_rgbvaluetype = 'cRGB',
00130     
00131     odb_fixedvaluetype = 'fixd',
00132     
00133     odb_singlevaluetype = 'sing',
00134     
00135 //  doublevaluetype = 'exte',
00136     odb_doublevaluetype = 'doub',
00137     
00138     odb_objspecvaluetype = 'obj ',
00139     
00140     odb_filespecvaluetype = 'fss ',
00141     
00142     odb_aliasvaluetype = 'alis',
00143     
00144     odb_enumeratorvaluetype = 'enum',
00145     
00146     odb_listvaluetype = 'list',
00147     
00148     odb_recordvaluetype = 'reco',
00149     
00150     odb_outlinevaluetype = 'optx',
00151     
00152     odb_wptextvaluetype = 'wptx',
00153     
00154     odb_tablevaluetype = 'tabl',
00155     
00156     odb_scriptvaluetype = 'scpt',
00157     
00158     odb_menubarvaluetype = 'mbar',
00159     
00160     odb_picturevaluetype = 'pict'
00161     
00162     } odbValueType;
00163 
00164 
00165 typedef union odbValueData {
00166     
00167     odbBool flvalue;
00168     
00169     unsigned char chvalue;
00170     
00171     short intvalue;
00172     
00173     long longvalue;
00174     
00175     unsigned long datevalue;
00176     
00177     odbDirection dirvalue;
00178     
00179     OSType ostypevalue;
00180     
00181     Handle stringvalue;
00182     
00183     Handle addressvalue;
00184     
00185     Handle binaryvalue;
00186     
00187     Handle externalvalue;
00188     
00189     Point pointvalue;
00190     
00191     Rect **rectvalue;
00192 
00193 #ifdef MACVERSION
00194     Pattern **patternvalue;
00195     
00196     RGBColor **rgbvalue;
00197     
00198     Fixed fixedvalue;
00199     
00200     FSSpec **filespecvalue;
00201 #endif
00202     
00203     float singlevalue;
00204     
00205 //  extended80 **doublevalue;
00206     double **doublevalue;
00207     
00208     Handle objspecvalue;
00209     
00210     Handle aliasvalue; /*AliasHandle*/
00211     
00212     OSType enumvalue;
00213     
00214     Handle listvalue;
00215     
00216     Handle recordvalue;
00217     } odbValueData;
00218 
00219 
00220 typedef struct odbValueRecord {
00221     
00222     odbValueType valuetype;
00223     
00224     odbValueData data;
00225     } odbValueRecord;
00226 
00227 #ifdef MACVERSION
00228 #define xCALLBACK
00229 #endif
00230 
00231 #ifdef WIN32
00232 #define xCALLBACK CALLBACK
00233 #endif
00234 
00235 typedef struct tyXDLLProcTable {
00236     Handle (xCALLBACK *xMemAlloc) (long sz);
00237     Handle (xCALLBACK *xMemResize)(Handle m, long sz);
00238     char * (xCALLBACK *xMemLock) (Handle m);
00239     void (xCALLBACK *xMemUnlock) (Handle  m);
00240     void (xCALLBACK *xMemFree) (Handle m);
00241     long (xCALLBACK *xMemGetSize) (Handle m);
00242 
00243     odbRef (xCALLBACK *xOdbGetCurrentRoot) ();
00244     odbBool (xCALLBACK *xOdbNewFile) (hdlfilenum);
00245     odbBool (xCALLBACK *xOdbOpenFile) (hdlfilenum, odbRef *odb);
00246     odbBool (xCALLBACK *xOdbSaveFile) (odbRef odb);
00247     odbBool (xCALLBACK *xOdbCloseFile) (odbRef odb);
00248     odbBool (xCALLBACK *xOdbDefined) (odbRef odb, odbString bspath);
00249     odbBool (xCALLBACK *xOdbDelete) (odbRef odb, odbString bspath);
00250     odbBool (xCALLBACK *xOdbGetType) (odbRef odb, odbString bspath, OSType *type);
00251     odbBool (xCALLBACK *xOdbCountItems) (odbRef odb, odbString bspath, long *count);
00252     odbBool (xCALLBACK *xOdbGetNthItem) (odbRef odb, odbString bspath, long n, odbString bsname);
00253     odbBool (xCALLBACK *xOdbGetValue) (odbRef odb, odbString bspath, odbValueRecord *value);
00254     odbBool (xCALLBACK *xOdbSetValue) (odbRef odb, odbString bspath, odbValueRecord *value);
00255     odbBool (xCALLBACK *xOdbNewTable) (odbRef odb, odbString bspath);
00256     odbBool (xCALLBACK *xOdbGetModDate) (odbRef odb, odbString bspath, unsigned long *date);
00257     void (xCALLBACK *xOdbDisposeValue) (odbRef odb, odbValueRecord *value);
00258     void (xCALLBACK *xOdbGetError) (odbString bs);
00259 
00260     odbBool (xCALLBACK *xDoScript) (char * script, long len, odbValueRecord *value);
00261     odbBool (xCALLBACK *xDoScriptText) (char * script, long len, Handle *text);
00262 
00263     odbBool (xCALLBACK *xOdbNewListValue) (odbRef odb, odbValueRecord *value, odbBool flRecord);
00264     odbBool (xCALLBACK *xOdbGetListCount) (odbRef odb, odbValueRecord *value, long * cnt);
00265 
00266     // 2006-04-04 - kw --- removed parameter names
00267     // odbBool (xCALLBACK *xOdbDeleteListValue) (odbRef odb, odbValueRecord *value, long index, char * recordname);
00268     odbBool (xCALLBACK *xOdbDeleteListValue) (odbRef, odbValueRecord *, long, char *);
00269     // odbBool (xCALLBACK *xOdbSetListValue) (odbRef odb, odbValueRecord *value, long index, char * recordname, odbValueRecord *valueData);
00270     odbBool (xCALLBACK *xOdbSetListValue) (odbRef, odbValueRecord *, long, char *, odbValueRecord *);
00271     // odbBool (xCALLBACK *xOdbGetListValue) (odbRef odb, odbValueRecord *value, long index, char * recordname, odbValueRecord *valueReturn);
00272     odbBool (xCALLBACK *xOdbGetListValue) (odbRef, odbValueRecord *, long, char *, odbValueRecord *);
00273 
00274     odbBool (xCALLBACK *xOdbAddListValue) (odbRef odb, odbValueRecord *value, char * recordname, odbValueRecord *valueData);
00275 
00276     odbBool (xCALLBACK *xInvoke) (odbString bsscriptname, void * params, odbValueRecord * value, odbBool *flfound, unsigned int * errarg);
00277     odbBool (xCALLBACK *xCoerce) (odbValueRecord * odbval, odbValueType newtype);
00278 
00279     odbBool (xCALLBACK *xCallScript) (odbString bspath, odbValueRecord *vparams, odbValueRecord *value); /* 2002-10-13 AR */
00280     odbBool (xCALLBACK *xCallScriptText) (odbString bspath, odbValueRecord *vparams, Handle * text); /* 2002-10-13 AR */
00281 
00282     odbBool (xCALLBACK *xThreadYield) (); /* 2003-04-22 AR */
00283     odbBool (xCALLBACK *xThreadSleep) (long sleepticks); /* 2003-04-22 AR */
00284     } XDLLProcTable;
00285 
00286 
00287 #define maxdllparams 16
00288 
00289 typedef struct tydllparamblock {
00290     
00291     long ctparams;
00292     
00293     long paramdata [maxdllparams];
00294     
00295     long paramsize [maxdllparams];
00296     
00297     long resultdata;
00298     
00299     long resultsize;
00300     
00301 //  XDLLProcTable * proctable;
00302     
00303     unsigned char errormessage [256]; // c string on pc, p string on mac
00304     } tydllparamblock;
00305 
00306 
00307 typedef odbBool (xCALLBACK * tyDLLEXTROUTINE) (tydllparamblock * data, XDLLProcTable * proctable);
00308 
00309 
00310 #endif
00311 

Generated on Wed May 31 18:19:46 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6