void pike_module_init(void) { #ifdef HAVE_SHADOW_H #ifndef RUNNING_BSD init_interleave_mutex(&at_shadow_mutex); #endif /* RUNNING_BSD */ #endif /* HAVE_SHADOW_H */ init_common("AdminTools"); #ifdef PEXTS_VERSION pexts_init(); #endif /* Shadow stuff */ #ifdef HAVE_SHADOW_H #ifndef RUNNING_BSD shadow_program = _at_shadow_init(); #endif /* RUNNING_BSD */ #endif /* HAVE_SHADOW_H */ /* Dir stuff */ dir_program = _at_directory_init(); /* Quota stuff */ quota_program = _at_quota_init(); /* System stuff */ system_program = _at_system_init(); /* PAM stuff */ #ifdef HAVE_PAM pam_program = _at_pam_init(); #endif }
/* Init the module */ void pike_module_init(void) { #ifdef PEXTS_VERSION pexts_init(); #endif mhash_init_mhash_program(); mhash_init_hmac_program(); mhash_init_globals(); }
void pike_module_init(void) { #ifdef PEXTS_VERSION pexts_init(); #endif struct svalue sv; /* Starting a new class */ start_new_program(); /* Agrega espacio para los datos internos */ low_add_storage(sizeof(struct mcast_storage) - sizeof(struct udp_storage), ALIGNOF(struct mcast_storage),0); /* Hereda Stdio.UDP */ /* NOTA IMPORTANTE * Aparentemente no se puede heredar un objeto * escrito en Pike desde aquí... luego, heredo * el objeto básico (nativo) */ /* Resuelve el objeto (encuentra el archivo) */ push_text("files.UDP"); SAFE_APPLY_MASTER("resolv",1); if(Pike_sp[-1].type != T_FUNCTION) Pike_error("Error in resolving of Stdio.UDP!\n"); /* Obtiene el programa */ stdio_udp = program_from_function(&Pike_sp[-1]); pop_n_elems(1); /* Hereda */ sv.type = T_PROGRAM; sv.subtype = 0; sv.u.program = stdio_udp; do_inherit( &sv, 0, 0); /* Agrega los métodos */ ADD_FUNCTION("join",mcast_join,tFunc(tStr,tVoid),0); ADD_FUNCTION("leave",mcast_leave,tFunc(tStr,tVoid),0); ADD_FUNCTION("setLoopback",mcast_loopback,tFunc(tInt,tVoid),0); ADD_FUNCTION("setTTL",mcast_setTTL,tFunc(tInt,tVoid),0); ADD_FUNCTION("setInterface",mcast_setif,tFunc(tStr,tVoid),0); /* Llama a "init_mcast" antes de crear los objetos */ set_init_callback(init_mcast); end_class("MultiCastUDP",0); }
/* Init the module */ void pike_module_init(void) { #ifdef PEXTS_VERSION pexts_init(); #endif start_new_program(); ADD_STORAGE( PCRE_Regexp ); ADD_FUNCTION( "create", f_pcre_create, tFunc(tOr(tStr,tVoid) tOr(tStr,tVoid), tVoid), 0); ADD_FUNCTION("match", f_pcre_match, tFunc(tStr tOr(tStr,tVoid), tInt), 0); ADD_FUNCTION("split", f_pcre_split, tFunc(tStr tOr(tStr,tVoid), tArr(tStr)), 0); set_init_callback(init_regexp); set_exit_callback(free_regexp); end_class("Regexp", 0); add_integer_constant("version", 2, 0); }
void pike_module_init(void) { #ifdef PEXTS_VERSION pexts_init(); #endif /* Compression program */ start_new_program(); ADD_STORAGE(bz_stream); set_init_callback(init_deflate); set_exit_callback(exit_deflate); ADD_FUNCTION("create", f_deflate_create, tFunc( tOr(tVoid, tInt), tVoid), 0); ADD_FUNCTION("deflate", f_deflate_deflate, tFunc(tString tOr(tInt, tVoid), tString), 0); ADD_FUNCTION("compress_file", f_deflate_file, tFunc(tString tOr(tString, tVoid), tVoid), 0); deflate_program = end_program(); add_program_constant("deflate", deflate_program, 0); /* Decompression program */ start_new_program(); ADD_STORAGE(bz_stream); ADD_FUNCTION("create", f_inflate_create, tFunc(tOr(tInt, tVoid), tVoid), 0); ADD_FUNCTION("inflate", f_inflate_inflate, tFunc(tString, tString), 0); set_init_callback(init_inflate); set_exit_callback(exit_inflate); inflate_program = end_program(); add_program_constant("inflate", inflate_program, 0); }
/* Decompression program */ start_new_program(); ADD_STORAGE(bz_stream); ADD_FUNCTION("create", f_inflate_create, tFunc(tOr(tInt, tVoid), tVoid), 0); ADD_FUNCTION("inflate", f_inflate_inflate, tFunc(tString, tString), 0); set_init_callback(init_inflate); set_exit_callback(exit_inflate); inflate_program = end_program(); add_program_constant("inflate", inflate_program, 0); } void pike_module_exit(void) { free_program(inflate_program); free_program(deflate_program); } #else /* !HAVE_BZLIB_H */ void pike_module_init(void) { #ifdef PEXTS_VERSION pexts_init(); #endif }