dfa0b61997-01-21Fredrik Hübinette (Hubbe) /*\
3e9a462002-01-16Martin Nilsson ||| This file is part of Pike. For copyright information see COPYRIGHT.
dfa0b61997-01-21Fredrik Hübinette (Hubbe) ||| Pike is distributed as GPL (General Public License) ||| See the files COPYING and DISCLAIMER for more information. \*/
24ddc71998-03-28Henrik Grubbström (Grubba) /*
feef142002-05-14Martin Stjernholm  * $Id: module_support.h,v 1.10 2002/05/13 22:14:04 mast Exp $
24ddc71998-03-28Henrik Grubbström (Grubba)  */
dfa0b61997-01-21Fredrik Hübinette (Hubbe) #ifndef MODULE_SUPPORT_H #include <stdarg.h>
c9c1c51997-09-11Henrik Grubbström (Grubba) enum error_type { ERR_NONE, ERR_TOO_FEW, ERR_TOO_MANY, ERR_BAD_ARG }; struct expect_result { enum error_type error_type; int argno; /* Which argument was it */ unsigned INT32 expected; /* What type was expected */ TYPE_T got; /* What type did we actually receive */ };
d7143b2000-12-13Fredrik Hübinette (Hubbe) /* This should be used in module_init */ #define PIKE_MODULE_EXPORT(MOD, SYM) \ pike_module_export_symbol(#MOD "." #SYM, CONSTANT_STRLEN(#MOD "." #SYM), SYM) #define PIKE_MODULE_IMPORT(MOD, SYM) \ pike_module_import_symbol(#MOD "." #SYM, CONSTANT_STRLEN(#MOD "." #SYM), #MOD, CONSTANT_STRLEN(#MOD))
1f21332000-07-28Fredrik Hübinette (Hubbe)  /* Prototypes begin here */ PMOD_EXPORT int check_args(int args, ...); PMOD_EXPORT void check_all_args(const char *fnname, int args, ... );
dfa0b61997-01-21Fredrik Hübinette (Hubbe) int va_get_args(struct svalue *s, INT32 num_args, char *fmt,
fdd2291997-01-27Fredrik Hübinette (Hubbe)  va_list ap);
1f21332000-07-28Fredrik Hübinette (Hubbe) PMOD_EXPORT int get_args(struct svalue *s,
dfa0b61997-01-21Fredrik Hübinette (Hubbe)  INT32 num_args, char *fmt, ...);
1f21332000-07-28Fredrik Hübinette (Hubbe) PMOD_EXPORT void get_all_args(char *fname, INT32 args, char *format, ... );
d7143b2000-12-13Fredrik Hübinette (Hubbe) PMOD_EXPORT void pike_module_export_symbol(char *str, int len, void *ptr); PMOD_EXPORT void *pike_module_import_symbol(char *str, int len, char *module, int module_len);
feef142002-05-14Martin Stjernholm void cleanup_module_support (void);
dfa0b61997-01-21Fredrik Hübinette (Hubbe) /* Prototypes end here */ #endif