00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef INC_SML_FUNCTION_H
00030 #define INC_SML_FUNCTION_H
00031
00032 #ifndef INC_SML_FUNCSIG
00033 #include <sml/funcsig.h>
00034 #endif
00035
00036 #ifndef INC_SML_ARG_H
00037 #include <sml/arg.h>
00038 #endif
00039
00040 #ifndef INC_SML_PARM_H
00041 #include <sml/parm.h>
00042 #endif
00043
00044 #ifdef RVCSYSDLL
00045 #define RVCSYSLIBEXPORT MI_DLLEXPORT
00046 #define RVCSYSLIBCLASSEXPORT MI_DLLCLASSEXPORT
00047 #else
00048 #define RVCSYSLIBEXPORT MI_DLLIMPORT
00049 #define RVCSYSLIBCLASSEXPORT MI_DLLCLASSIMPORT
00050 #endif
00051
00052
00053 #ifdef WIN32
00054 #pragma warning (disable: 4018)
00055 #pragma warning (disable: 4251)
00056 #endif
00057
00062 #define SML_RETIRE_IN_68 "RetireIn6.8"
00063 #define SML_RETIRE_IN_69 "RetireIn6.9"
00064
00065
00066 namespace SML {
00067 class CONTEXT;
00068 }
00069
00070
00077 typedef void (*VOIDFUNC)(int, SMLARG *, UINT8*, SML::CONTEXT *);
00078 #ifndef GENERATING_DOXYGEN_OUTPUT
00079 class SOMECLASS;
00080 #endif // GENERATING_DOXYGEN_OUTPUT
00081 typedef void (SOMECLASS::*METHODPTR)();
00082
00083 namespace SML {
00084 class CLASSHASH;
00085
00086
00088 #define SMLFUNC_NotInWin32 0x00000001
00089 #define SMLFUNC_NotInX 0x00000002
00090 #define SMLFUNC_IsMemberFunc 0x00000004
00091 #define SMLFUNC_UseSignature 0x00000008
00092 #define SMLFUNC_HasProtoParms 0x00000010
00093 #define SMLFUNC_Prototype 0x00000020
00094 #define SMLFUNC_Deprecated 0x00000040
00095 #define SMLFUNC_Required 0x00000080
00096
00097
00157 class RVCSYSLIBCLASSEXPORT FUNC {
00158 public:
00159
00160 const char *name;
00161 STYPE type;
00162 VOIDFUNC func;
00163 PARM *parms;
00164 const char *ClassName;
00165 INT32 CreateDate, ModDate;
00166 int minparms, maxparms;
00167 const char *description;
00168 int sizeofSMLFUNC;
00169 int sizeofSMLPARM;
00170 UINT32 flags;
00171 SMLFUNCSIG signature;
00172 METHODPTR method;
00173
00174 int GetFuncGroupNum (
00175 ) const;
00176
00185 const PARM* GetCallbackParms (
00186 ) const;
00187
00188
00189 #ifndef GENERATING_DOXYGEN_OUTPUT
00192 int m_funcgroup;
00193 #endif // GENERATING_DOXYGEN_OUTPUT
00195 };
00196
00197
00200 class FUNCDEF : public FUNC {
00201 public:
00202
00203 #ifndef NO_DEPRECATED
00207 DEPRECATED_MSG("Use the version that doesn't take createdate, modifydate, or description parameters")
00208 FUNCDEF (
00209 const char* p_name,
00210 void (* p_func)(int numargs, ARG *args, UINT8 *argtypes, CONTEXT *context),
00211 PARM * p_parms,
00212 int p_createdate,
00213 int p_modifydate = 0,
00214 const char * p_description = 0,
00215 bool p_bInWin32 = true
00216 ) {
00217 Init(p_name, p_parms, p_createdate, p_modifydate, p_description, p_bInWin32);
00218 type = STYPE_BProcedure;
00219 func = p_func;
00220 }
00221 #endif
00222
00223
00224
00225
00226
00228 FUNCDEF (
00229 const char* p_name,
00230 void (* p_func)(int numargs, ARG *args, UINT8 *argtypes, CONTEXT *context),
00231 PARM * p_parms,
00232 bool p_bInWin32 = true
00233 ) {
00234 Init(p_name, p_parms, 0, 0, 0, p_bInWin32);
00235 type = STYPE_BProcedure;
00236 func = p_func;
00237 }
00239
00240 #ifndef NO_DEPRECATED
00244 DEPRECATED_MSG("Use the version that doesn't take createdate, modifydate, or descriptor parameters")
00245 FUNCDEF (
00246 const char* p_name,
00247 double (* p_func)(int numargs, ARG *args, UINT8 *argtypes, CONTEXT *context),
00248 PARM * p_parms,
00249 int p_createdate,
00250 int p_modifydate = 0,
00251 const char * p_description = 0,
00252 bool p_bInWin32 = true
00253 ) {
00254 Init(p_name, p_parms, p_createdate, p_modifydate, p_description, p_bInWin32);
00255 type = STYPE_BFunction;
00256 func = (VOIDFUNC)p_func;
00257 }
00258 #endif
00259
00261 FUNCDEF (
00262 const char* p_name,
00263 double (* p_func)(int numargs, ARG *args, UINT8 *argtypes, CONTEXT *context),
00264 PARM * p_parms,
00265 bool p_bInWin32 = true
00266 ) {
00267 Init(p_name, p_parms, 0, 0, 0, p_bInWin32);
00268 type = STYPE_BFunction;
00269 func = (VOIDFUNC)p_func;
00270 }
00271
00272 #ifndef NO_DEPRECATED
00277 DEPRECATED_MSG("Use the version that doesn't take createdate, modifydate, or description parameters")
00278 FUNCDEF (
00279 const char* p_name,
00280 STRING* (* p_func)(int numargs, ARG *args, UINT8 *argtypes, CONTEXT *context),
00281 PARM * p_parms,
00282 int p_createdate,
00283 int p_modifydate = 0,
00284 const char * p_description = 0,
00285 bool p_bInWin32 = true
00286 ) {
00287 Init(p_name, p_parms, p_createdate, p_modifydate, p_description, p_bInWin32);
00288 type = STYPE_BSFunction;
00289 func = (VOIDFUNC)p_func;
00290 }
00291 #endif
00292
00295 FUNCDEF (
00296 const char* p_name,
00297 STRING* (* p_func)(int numargs, ARG *args, UINT8 *argtypes, CONTEXT *context),
00298 PARM * p_parms,
00299 bool p_bInWin32 = true
00300 ) {
00301 Init(p_name, p_parms, 0, 0, 0, p_bInWin32);
00302 type = STYPE_BSFunction;
00303 func = (VOIDFUNC)p_func;
00304 }
00305
00306 #ifndef NO_DEPRECATED
00310 DEPRECATED_MSG("Use the version that doesn't take createdate, modifydate, or description parameters")
00311 FUNCDEF (
00312 const char* p_name,
00313 CLASSHASH* (* p_func)(int numargs, ARG *args, UINT8 *argtypes, CONTEXT *context),
00314 STYPE p_type,
00315 PARM * p_parms,
00316 const char *p_classname,
00317 int p_createdate,
00318 int p_modifydate = 0,
00319 const char * p_description = 0,
00320 bool p_bInWin32 = true
00321 ) {
00322 Init(p_name, p_parms, p_createdate, p_modifydate, p_description, p_bInWin32);
00323 type = p_type;
00324 func = (VOIDFUNC)p_func;
00325 ClassName = p_classname;
00326 }
00327 #endif
00328
00330 FUNCDEF (
00331 const char* p_name,
00332 CLASSHASH* (* p_func)(int numargs, ARG *args, UINT8 *argtypes, CONTEXT *context),
00333 STYPE p_type,
00334 PARM * p_parms,
00335 const char *p_classname,
00336 bool p_bInWin32 = true
00337 ) {
00338 Init(p_name, p_parms, 0, 0, 0, p_bInWin32);
00339 type = p_type;
00340 func = (VOIDFUNC)p_func;
00341 ClassName = p_classname;
00342 }
00343
00344 #ifndef NO_DEPRECATED
00348 DEPRECATED_MSG("Use the version that doesn't take createdate, modifydate, or description parameters")
00349 FUNCDEF (
00350 const char* p_name,
00351 void* (* p_func)(int numargs, ARG *args, UINT8 *argtypes, CONTEXT *context),
00352 STYPE p_type,
00353 PARM * p_parms,
00354 const char *p_classname,
00355 int p_createdate,
00356 int p_modifydate = 0,
00357 const char * p_description = 0,
00358 bool p_bInWin32 = true
00359 ) {
00360 Init(p_name, p_parms, p_createdate, p_modifydate, p_description, p_bInWin32);
00361 type = p_type;
00362 func = (VOIDFUNC)p_func;
00363 ClassName = p_classname;
00364 }
00365 #endif
00366
00368 FUNCDEF (
00369 const char* p_name,
00370 void* (* p_func)(int numargs, ARG *args, UINT8 *argtypes, CONTEXT *context),
00371 STYPE p_type,
00372 PARM * p_parms,
00373 const char *p_classname,
00374 bool p_bInWin32 = true
00375 ) {
00376 Init(p_name, p_parms, 0, 0, 0, p_bInWin32);
00377 type = p_type;
00378 func = (VOIDFUNC)p_func;
00379 ClassName = p_classname;
00380 }
00381
00382 #ifndef NO_DEPRECATED
00387 DEPRECATED_MSG("Use the version that doesn't take createdate, modifydate, or description parameters")
00388 FUNCDEF (
00389 const char* p_name,
00390 VOIDFUNC p_func,
00391 SMLFUNCSIG p_signature,
00392 PARM *p_parms,
00393 int p_createdate,
00394 int p_modifydate = 0,
00395 const char *p_ClassName = 0,
00396 bool p_bInWin32 = true
00397 ) {
00398 Init(p_name, p_parms, p_createdate, p_modifydate, 0, p_bInWin32);
00399 SMLFUNCSIG retsig = FUNCSIG_GetRetType(p_signature);
00400
00401 if (retsig == SIG_v) type = STYPE_BProcedure;
00402 else if (retsig == SIG_pv) type = STYPE_ClassRefFunc;
00403 else if (retsig == SIG_pva) type = STYPE_ClassCopyFunc;
00404 else if (retsig == SIG_U || retsig == SIG_cU || retsig == SIG_c || retsig == SIG_cc) type = STYPE_BSFunction;
00405 else type = STYPE_BFunction;
00406
00407 func = (VOIDFUNC)p_func;
00408 ClassName = p_ClassName;
00409
00410 signature = p_signature;
00411 flags |= SMLFUNC_UseSignature;
00412 if (!p_bInWin32) flags |= SMLFUNC_NotInWin32;
00413 }
00414 #endif
00415
00418 FUNCDEF (
00419 const char* p_name,
00420 VOIDFUNC p_func,
00421 SMLFUNCSIG p_signature,
00422 PARM *p_parms,
00423 const char *p_ClassName = 0,
00424 bool p_bInWin32 = true
00425 ) {
00426 Init(p_name, p_parms, 0, 0, 0, p_bInWin32);
00427 SMLFUNCSIG retsig = FUNCSIG_GetRetType(p_signature);
00428
00429 if (retsig == SIG_v) type = STYPE_BProcedure;
00430 else if (retsig == SIG_pv) type = STYPE_ClassRefFunc;
00431 else if (retsig == SIG_pva) type = STYPE_ClassCopyFunc;
00432 else if (retsig == SIG_U || retsig == SIG_cU || retsig == SIG_c || retsig == SIG_cc) type = STYPE_BSFunction;
00433 else type = STYPE_BFunction;
00434
00435 func = (VOIDFUNC)p_func;
00436 ClassName = p_ClassName;
00437
00438 signature = p_signature;
00439 flags |= SMLFUNC_UseSignature;
00440 if (!p_bInWin32) flags |= SMLFUNC_NotInWin32;
00441 }
00442
00443
00444 #ifndef NO_DEPRECATED
00448 DEPRECATED_MSG("Use SML::AUTOCLASS templates instead")
00449 FUNCDEF (
00450 const char* p_name,
00451 METHODPTR p_method,
00452 SMLFUNCSIG p_signature,
00453 PARM *p_parms,
00454 int p_createdate,
00455 int p_modifydate = 0,
00456 const char *p_ClassName = 0,
00457 bool p_bInWin32 = true
00458 ) {
00459 Init(p_name, p_parms, p_createdate, p_modifydate, 0, p_bInWin32);
00460
00461 SMLFUNCSIG retsig = FUNCSIG_GetRetType(p_signature);
00462
00463 if (retsig == SIG_v) type = STYPE_BProcedure;
00464 else if (retsig == SIG_pv) type = STYPE_ClassRefFunc;
00465 else if (retsig == SIG_pva) type = STYPE_ClassCopyFunc;
00466 else if (retsig == SIG_U || retsig == SIG_cU || retsig == SIG_c || retsig == SIG_cc) type = STYPE_BSFunction;
00467 else type = STYPE_BFunction;
00468
00469 func = 0;
00470 method = p_method;
00471 ClassName = p_ClassName;
00472 signature = p_signature;
00473 flags |= SMLFUNC_UseSignature | SMLFUNC_IsMemberFunc;
00474 }
00475 #endif
00476
00477 #ifndef GENERATING_DOXYGEN_OUTPUT
00478
00479
00480 FUNCDEF (
00481 const char* p_name,
00482 METHODPTR p_method,
00483 SMLFUNCSIG p_signature,
00484 PARM *p_parms,
00485 const char *p_ClassName = 0,
00486 bool p_bInWin32 = true
00487 ) {
00488 Init(p_name, p_parms, 0, 0, 0, p_bInWin32);
00489
00490 SMLFUNCSIG retsig = FUNCSIG_GetRetType(p_signature);
00491
00492 if (retsig == SIG_v) type = STYPE_BProcedure;
00493 else if (retsig == SIG_pv) type = STYPE_ClassRefFunc;
00494 else if (retsig == SIG_pva) type = STYPE_ClassCopyFunc;
00495 else if (retsig == SIG_U || retsig == SIG_cU || retsig == SIG_c || retsig == SIG_cc) type = STYPE_BSFunction;
00496 else type = STYPE_BFunction;
00497
00498 func = 0;
00499 method = p_method;
00500 ClassName = p_ClassName;
00501 signature = p_signature;
00502 flags |= SMLFUNC_UseSignature | SMLFUNC_IsMemberFunc;
00503 }
00504 #endif
00505
00506 #ifndef NO_DEPRECATED
00510 DEPRECATED_MSG("Use SML::AUTOCLASS templates instead")
00511 FUNCDEF (
00512 const char* p_name,
00513 SMLFUNCSIG p_signature,
00514 PARM *p_parms,
00515 int p_createdate,
00516 int p_modifydate = 0,
00517 const char *p_ClassName = 0
00518 ) {
00519 Init(p_name, p_parms, p_createdate, p_modifydate, 0, false);
00520
00521 SMLFUNCSIG retsig = FUNCSIG_GetRetType(p_signature);
00522
00523 if (retsig == SIG_v) type = STYPE_BProcedure;
00524 else if (retsig == SIG_pv) type = STYPE_ClassRefFunc;
00525 else if (retsig == SIG_pva) type = STYPE_ClassCopyFunc;
00526 else if (retsig == SIG_U || retsig == SIG_cU || retsig == SIG_c || retsig == SIG_cc) type = STYPE_BSFunction;
00527 else type = STYPE_BFunction;
00528
00529 func = 0;
00530 method = 0;
00531 ClassName = p_ClassName;
00532 signature = p_signature;
00533 flags |= SMLFUNC_UseSignature | SMLFUNC_IsMemberFunc;
00534 }
00535 #endif
00536
00537 #ifndef NO_DEPRECATED
00541 DEPRECATED_MSG("Use SML::AUTOCLASS templates instead")
00542 FUNCDEF (
00543 const char* p_name,
00544 STYPE p_type,
00545 PARM * p_parms,
00546 const char *p_classname,
00547 int p_createdate,
00548 int p_modifydate = 0,
00549 const char * p_description = 0,
00550 bool bInWin32Native = false
00551 ) {
00552 Init(p_name, p_parms, p_createdate, p_modifydate, p_description, bInWin32Native);
00553 ClassName = p_classname;
00554 type = p_type;
00555 func = 0;
00556 }
00557 #endif
00558
00559 #ifndef GENERATING_DOXYGEN_OUTPUT
00560 private:
00561
00562 void Init (
00563 const char* p_name,
00564 PARM * p_parms,
00565 int p_createdate,
00566 int p_modifydate,
00567 const char * p_description,
00568 bool p_bInWin32
00569 ) {
00570 name = p_name;
00571 func = 0;
00572 parms = p_parms;
00573 ClassName = 0;
00574 CreateDate = p_createdate;
00575 ModDate = p_modifydate;
00576 minparms = 0;
00577 maxparms = 0;
00578 description = p_description;
00579 sizeofSMLFUNC = sizeof(FUNC);
00580 sizeofSMLPARM = sizeof(PARM);
00581 flags = 0;
00582 signature = SIG_OldStyle;
00583 method = 0;
00584 m_funcgroup = 0;
00585 if (!p_bInWin32) flags |= SMLFUNC_NotInWin32;
00586 }
00587 #endif // GENERATING_DOXYGEN_OUTPUT
00588 };
00589
00590 }
00591
00592 typedef SML::FUNC SMLFUNC;
00593 typedef SML::FUNCDEF SMLFUNCDEF;
00594
00597 #define SMLCLASSFUNCDEF2(func) { #func, func##_FuncType, (VOIDFUNC)func, func##_Parms, func##_RetVal, func##_CreateDate, func##_ModDate, 0,0, NULL, sizeof(SML::FUNC), sizeof(SML::PARM), 0, SIG_OldStyle, 0, 0 }
00598
00599
00600 #define SMLFUNCDEF2(func) { #func, func##_FuncType, (VOIDFUNC)func, func##_Parms, NULL, func##_CreateDate, func##_ModDate, 0,0, NULL, sizeof(SML::FUNC), sizeof(SML::PARM), 0, SIG_OldStyle, 0, 0 }
00601
00602 #ifdef WIN32_NATIVE
00603 #define SMLCLASSFUNCDEF_NOWIN32_NATIVE(func) {#func, func##_FuncType, NULL, func##_Parms, func##_RetVal, func##_CreateDate, func##_ModDate, 0,0, NULL, sizeof(SML::FUNC), sizeof(SML::PARM), SMLFUNC_NotInWin32, SIG_OldStyle, 0, 0}
00604 #define SMLFUNCDEF_NOWIN32_NATIVE(func) {#func, func##_FuncType, NULL, func##_Parms, NULL, func##_CreateDate, func##_ModDate, 0,0, NULL, sizeof(SML::FUNC), sizeof(SML::PARM), SMLFUNC_NotInWin32, SIG_OldStyle, 0, 0}
00605 #else
00606 #define SMLCLASSFUNCDEF_NOWIN32_NATIVE(func) {#func, func##_FuncType, (VOIDFUNC)func, func##_Parms, func##_RetVal, func##_CreateDate, func##_ModDate, 0,0, NULL, sizeof(SML::FUNC), sizeof(SML::PARM), SMLFUNC_NotInWin32, SIG_OldStyle, 0, 0}
00607 #define SMLFUNCDEF_NOWIN32_NATIVE(func) {#func, func##_FuncType, (VOIDFUNC)func, func##_Parms, NULL, func##_CreateDate, func##_ModDate, 0,0, NULL, sizeof(SML::FUNC), sizeof(SML::PARM), SMLFUNC_NotInWin32, SIG_OldStyle, 0, 0}
00608 #endif
00609
00610
00611 #if !defined(NO_DEPRECATED)
00612 #ifdef WIN32
00613 #pragma deprecated(SMLCLASSFUNCDEF)
00614 #endif
00615 #endif
00616
00624 #define SMLFUNCDEF3(func) {func##_RealName, func##_FuncType, (VOIDFUNC)func, func##_Parms, NULL, func##_CreateDate, func##_ModDate,0,0, NULL, sizeof(SML::FUNC), sizeof(SML::PARM), 0, SIG_OldStyle, 0, 0}
00625
00626 #define SMLCLASSFUNCDEF3(func) { func##_RealName, func##_FuncType, (VOIDFUNC)func, func##_Parms, func##_RetVal, func##_CreateDate, func##_ModDate, 0,0, NULL, sizeof(SML::FUNC), sizeof(SML::PARM), 0, SIG_OldStyle, 0, 0 }
00627
00628
00629 #undef RVCSYSLIBEXPORT
00630 #undef RVCSYSLIBCLASSEXPORT
00631
00632 #endif // INC_SML_FUNCTION_H
00633
00634