Beispiel #1
0
void init_image__xpm( )
{
   ADD_FUNCTION( "_xpm_write_rows", f__xpm_write_rows,
		 tFunc(tObj tObj tInt tArr(tStr) tArr(tStr), tInt), 0);
   ADD_FUNCTION( "_xpm_trim_rows", f__xpm_trim_rows,
		 tFunc(tArr(tStr),tArr(tStr)), 0);
}
Beispiel #2
0
void cairo_mod_init_path(void)
{
  /*! @decl constant CAIRO_PATH_MOVE_TO
   *! @decl constant CAIRO_PATH_LINE_TO
   *! @decl constant CAIRO_PATH_CURVE_TO
   *! @decl constant CAIRO_PATH_CLOSE_PATH
   *!
   *! The various types of path elements in an Cairo path
   */
  ADD_INT_CONSTANT("CAIRO_PATH_MOVE_TO", CAIRO_PATH_MOVE_TO, 0);
  ADD_INT_CONSTANT("CAIRO_PATH_LINE_TO", CAIRO_PATH_LINE_TO, 0);
  ADD_INT_CONSTANT("CAIRO_PATH_CURVE_TO", CAIRO_PATH_CURVE_TO, 0);
  ADD_INT_CONSTANT("CAIRO_PATH_CLOSE_PATH", CAIRO_PATH_CLOSE_PATH, 0);

  /* Cairo.Path */
  start_new_program();
  {
    ADD_STORAGE(struct cairo_mod_path);
    ADD_FUNCTION("_get_iterator", f_path_get_iterator, tFunc(tVoid,tObj), ID_PUBLIC);
    set_init_callback(init_cairo_mod_path);
    set_exit_callback(exit_cairo_mod_path);
  }
  add_program_constant("Path",
                       cairo_mod_path_program = end_program(),
                       0);

  /* Cairo.PathElement */
  start_new_program();
  {
    ADD_STORAGE(struct cairo_mod_path_element);
    ADD_FUNCTION("get_type", f_path_element_get_type, tFunc(tNone,tInt), ID_PUBLIC);
    ADD_FUNCTION("get_point", f_path_element_get_point, tFunc(tInt, tMapping), ID_PUBLIC);
    ADD_FUNCTION("_sprintf", f_path_element_sprintf, tFunc(tInt tMapping, tStr), ID_STATIC);
    set_init_callback(init_cairo_mod_path_element);
    set_exit_callback(exit_cairo_mod_path_element);
  }
  add_program_constant("PathElement",
                       cairo_mod_path_element_program = end_program(),
                       0);

  /* Cairo.PathIterator */
  start_new_program();
  {
    ADD_STORAGE(struct cairo_mod_path_iterator);
    ADD_FUNCTION("`!", f_path_iterator_not_operator, tFunc(tVoid,tInt), ID_PUBLIC);
    ADD_FUNCTION("`+=", f_path_iterator_add_self, tFunc(tInt,tObj), ID_PUBLIC);
    ADD_FUNCTION("index", f_path_iterator_index, tFunc(tNone,tObj), ID_PUBLIC);
    ADD_FUNCTION("value", f_path_iterator_value, tFunc(tNone,tObj), ID_PUBLIC);
    ADD_FUNCTION("first", f_path_iterator_first, tFunc(tNone,tInt), ID_PUBLIC);
    ADD_FUNCTION("next", f_path_iterator_next, tFunc(tNone,tObj), ID_PUBLIC);
    set_init_callback(init_cairo_mod_path_iterator);
    set_exit_callback(exit_cairo_mod_path_iterator);
  }
  add_program_constant("PathIterator",
                       cairo_mod_path_iterator_program = end_program(),
                       0);
}
Beispiel #3
0
/**
 * Add native methods to the SSL object.
 * [0] - SSL Object
 */
duk_ret_t ModuleSSL(duk_context *ctx) {

	ADD_FUNCTION("create_dukf_ssl_context", js_ssl_create_dukf_ssl_context, 2);
	ADD_FUNCTION("debugThreshold",          js_ssl_debug_set_threshold,     1);
	ADD_FUNCTION("free_dukf_ssl_context",   js_ssl_free_dukf_ssl_context,   1);
	ADD_FUNCTION("read",                    js_ssl_read,                    2);
	ADD_FUNCTION("write",                   js_ssl_write,                   2);

	return 0;
} // ModuleSSL
Beispiel #4
0
void init_image_xbm(void)
{
  ADD_FUNCTION( "_decode", image_xbm__decode,
		tFunc(tStr tOr(tVoid,tMapping),tMap(tStr,tObj)), 0);
  ADD_FUNCTION( "decode", image_xbm_decode, tFunc(tStr,tObj), 0);
  ADD_FUNCTION( "encode", image_xbm_encode,
		tFunc(tObj tOr(tVoid,tMapping),tStr), 0);
  param_name=make_shared_string("name");
  param_fg=make_shared_string("fg");
  param_bg=make_shared_string("bg");
  param_invert=make_shared_string("invert");
}
Beispiel #5
0
void init_context()
{
  set_init_callback(ctx_init);
  set_exit_callback(ctx_exit);
    
  ADD_STORAGE(js_context);
  ADD_FUNCTION("create", ctx_create,
               tFunc(tOr(tVoid, tInt) tOr(tVoid, tInt), tVoid), 0);
  ADD_FUNCTION("evaluate", ctx_evaluate,
               tFunc(tString tOr(tVoid, tInt), tOr(tMapping, tInt)), 0);
  ADD_FUNCTION("set_id", ctx_set_id,
               tFunc(tObj, tVoid), 0);
}
Beispiel #6
0
int _init_xml_sax(void)
{
  start_new_program();
  ADD_STORAGE(sax_storage);

  set_init_callback(init_sax);
  set_exit_callback(exit_sax);

  ADD_FUNCTION("create", f_create,
               tFunc(tOr(tString, tObj) tObj tOr(tMapping, tVoid) tOr(tMixed, tVoid) tOr(tInt, tVoid), tVoid), 0);
  ADD_FUNCTION("parse", f_parse_xml, tFunc(tVoid, tInt), 0);
  ADD_FUNCTION("getLineNumber", f_getLineNumber, tFunc(tVoid, tInt), 0);
  ADD_FUNCTION("getColumnNumber", f_getColumnNumber, tFunc(tVoid, tInt), 0);
  
  xml_program = end_program();
  add_program_constant("SAX", xml_program, 0);

  start_new_program();
  ADD_STORAGE(sax_storage);
  
  set_init_callback(init_sax);
  set_exit_callback(exit_sax);

  ADD_FUNCTION("create", f_create,
               tFunc(tOr(tString, tObj) tObj tOr(tMapping, tVoid) tOr(tMixed, tVoid) tOr(tInt, tVoid), tVoid), 0);
  ADD_FUNCTION("parse", f_parse_html, tFunc(tOr(tString,tVoid), tInt), 0);
  ADD_FUNCTION("getLineNumber", f_getLineNumber, tFunc(tVoid, tInt), 0);
  ADD_FUNCTION("getColumnNumber", f_getColumnNumber, tFunc(tVoid, tInt), 0);
  
  html_program = end_program();
  add_program_constant("HTML", html_program, 0);
  
  return 1;
}
Beispiel #7
0
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);
}
Beispiel #8
0
void
pike_module_init()
{
    ADD_FUNCTION("crypt_md5", f_crypt_md5,
		 tOr(tFunc(tStr,tStr), tFunc(tStr tStr,tStr)), 0);

}
Beispiel #9
0
void source_pikestream_init( )
{
  start_new_program();
  ADD_STORAGE( struct callback_prog );
  ADD_FUNCTION("`()", f_got_data, tFunc(tInt tStr,tVoid),0);
  callback_program = end_program();
}
Beispiel #10
0
Datei: pcre.c Projekt: hww3/pexts
/* 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);
}
Beispiel #11
0
/* Initialized the sender */
void init_nbio(void) {
  start_new_program();
  ADD_STORAGE( nbio_storage );
  set_init_callback(alloc_nb_struct);
  set_exit_callback(free_nb_struct);
  ADD_FUNCTION("start", f_nbio_start, tFunc(tVoid, tVoid), 0);
  ADD_FUNCTION("nbio_status", f_nbio_status, tFunc(tVoid, tArray), 0);
  ADD_FUNCTION("input",  f_input, tFunc(tObj tOr(tInt, tVoid), tVoid), 0);
  ADD_FUNCTION("write",  f_write, tFunc(tStr, tVoid), 0);
  ADD_FUNCTION("output", f_output, tFunc(tObj, tVoid), 0);
  ADD_FUNCTION("_output_write_cb", f__output_write_cb, tFunc(tInt, tVoid), 0);
  ADD_FUNCTION("_input_read_cb", f__input_read_cb, tFunc(tInt tStr, tVoid), 0);
  ADD_FUNCTION("_input_close_cb", f__input_close_cb, tFunc(tInt, tVoid), 0);
  ADD_FUNCTION("set_done_callback", f_set_done_callback, tFunc(tOr(tVoid,tFunc(tMix, tMix)) tOr(tVoid,tMix),tVoid),0);
  ADD_FUNCTION("bytes_sent", f_bytes_sent, tFunc(tNone,tInt), 0);
  nbio_program = end_program();
  add_program_constant("nbio", nbio_program, 0);
  
  output_write_cb_off = find_identifier("_output_write_cb", nbio_program);
  input_read_cb_off   = find_identifier("_input_read_cb", nbio_program);
  input_close_cb_off  = find_identifier("_input_close_cb", nbio_program);
}
Beispiel #12
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);
}
Beispiel #13
0
void mhash_init_mhash_program(void) {
  start_new_program();
  ADD_STORAGE( mhash_storage  );
  ADD_FUNCTION("create", f_hash_create,   tFunc(tOr(tInt,tVoid),tVoid), 0);
  ADD_FUNCTION("update", f_hash_feed,   	tFunc(tStr,tObj), 0 ); 
  ADD_FUNCTION("feed", f_hash_feed,     	tFunc(tStr,tObj), 0 );
  ADD_FUNCTION("digest", f_hash_digest, 	tFunc(tVoid,tStr), 0);
  ADD_FUNCTION("query_name", f_hash_query_name, tFunc(tVoid,tStr), 0 ); 
  ADD_FUNCTION("reset", f_hash_reset,   	tFunc(tVoid,tVoid), 0 ); 
  ADD_FUNCTION("set_type", f_hash_set_type, 	tFunc(tInt,tVoid), 0 ); 
  set_init_callback(init_hash_storage);
  set_exit_callback(free_hash_storage);
  end_class("Hash", 0);
}
Beispiel #14
0
Datei: rcs.c Projekt: johan/pike
void init_parser_rcs(void)
{
    ADD_FUNCTION("tokenize",f_tokenize,tFunc(tStr,tArray),0);
}
Beispiel #15
0
IFACE_MON_N2PEAK4_A_NAME = A_NAME_FUNCTION( COND_MON_N2PEAK4_A_NAME );
IFACE_MON_N2PEAK4DT_A_NAME = A_NAME_FUNCTION( COND_MON_N2PEAK4DT_A_NAME );
IFACE_MON_N2PEAK4TM_A_NAME = A_NAME_FUNCTION( COND_MON_N2PEAK4TM_A_NAME );
IFACE_MON_N2PEAK5_A_NAME = A_NAME_FUNCTION( COND_MON_N2PEAK5_A_NAME );
IFACE_MON_N2PEAK5DT_A_NAME = A_NAME_FUNCTION( COND_MON_N2PEAK5DT_A_NAME );
IFACE_MON_N2PEAK5TM_A_NAME = A_NAME_FUNCTION( COND_MON_N2PEAK5TM_A_NAME );
IFACE_MON_NOX_RAW_A_NAME = A_NAME_FUNCTION( 999_0 );
IFACE_MON_O2_RAW_A_NAME = A_NAME_FUNCTION( 999_0 );
IFACE_MON_OP_HRSG_A_NAME = A_NAME_FUNCTION( COND_MON_OP_HRSG_A_NAME );
IFACE_MON_OSPD_COUNT_A_NAME = A_NAME_FUNCTION( COND_MON_OSPD_COUNT_A_NAME );
IFACE_MON_PEAKT3_HR_A_NAME = A_NAME_FUNCTION( COND_MON_PEAKT3_HR_A_NAME );
IFACE_MON_PEAKT48_HR_A_NAME = A_NAME_FUNCTION( COND_MON_PEAKT48_HR_A_NAME );
IFACE_MON_PKPDF_BC_A_NAME = A_NAME_FUNCTION( COND_MON_PKPDF_BC_A_NAME );
IFACE_MON_PKPDF_OTHR_A_NAME = A_NAME_FUNCTION( COND_MON_PKPDF_OTHR_A_NAME );
IFACE_MON_PKT48_BC2A_A_NAME = A_NAME_FUNCTION( COND_MON_PKT48_BC2A_A_NAME );
IFACE_MON_S2IFORACO_A_NAME = A_NAME_FUNCTION( COND_MON_S2IFORACO_A_NAME );
IFACE_MON_SIOTHER_A_NAME = A_NAME_FUNCTION( COND_MON_SIOTHER_A_NAME );
IFACE_MON_SPRINTHRS_A_NAME = A_NAME_FUNCTION( IFACE_MON_SPRINT_TM_ADD );
IFACE_MON_SPRINT_TM_ADD = ADD_FUNCTION( 0 , SPRINT_HSPR_HRS_A_NAME , SPRINT_LSPR_HRS_A_NAME );
IFACE_MON_SPRNTFLOW_A_NAME = A_NAME_FUNCTION( TOTALIZER_FT62231HI_A_NAME );
IFACE_MON_SPRTFLOWLO_A_NAME = A_NAME_FUNCTION( TOTALIZER_FT62231LO_A_NAME );
IFACE_MON_STARTSG_A_NAME = A_NAME_FUNCTION( COND_MON_STARTSG_A_NAME );
IFACE_MON_TFLP10S_A_NAME = A_NAME_FUNCTION( COND_MON_TFLP10S_A_NAME );
IFACE_MON_TFLP15S_A_NAME = A_NAME_FUNCTION( COND_MON_TFLP15S_A_NAME );
IFACE_MON_TPEAK_HRG_A_NAME = A_NAME_FUNCTION( COND_MON_TPEAK_HRG_A_NAME );
IFACE_MON_TRFBBVIB_A_NAME = A_NAME_FUNCTION( NEVADA_XE6877A_CALCULATE );
IFACE_MON_TRFN25VIB_A_NAME = A_NAME_FUNCTION( 999_0 );
IFACE_MON_TRFN2VIB_A_NAME = A_NAME_FUNCTION( 999_0 );
IFACE_MON_TRIPSG_A_NAME = A_NAME_FUNCTION( COND_MON_TRIPSD_A_NAME );
IFACE_MON_UHC_RAW_A_NAME = A_NAME_FUNCTION( SIMMS_UHC_A_NAME );
static bool InitParamMap()
{
	paramMap.clear();

	paramMap["next"]  = DataElement(READONLY_TYPE);
	paramMap["pairs"] = DataElement(READONLY_TYPE);

	// dummy FeatureDef for address lookups
	const FeatureDef fd;
	const char* start = ADDRESS(fd);

	ADD_FUNCTION("model", fd, ModelTable);
	ADD_FUNCTION("collisionVolume", fd.collisionVolume, ColVolTable);

	ADD_FUNCTION("modelname", fd, ModelName);
	ADD_FUNCTION("height", fd, ModelHeight);
	ADD_FUNCTION("radius", fd, ModelRadius);
	ADD_FUNCTION("drawTypeString", fd, ModelDrawType);

	ADD_FUNCTION("customParams", fd.customParams, CustomParamsTable);

	ADD_INT("id", fd.id);
	ADD_INT("deathFeatureID", fd.deathFeatureDefID);

	ADD_STRING("name",     fd.name);
	ADD_STRING("tooltip",  fd.description);

	ADD_FLOAT("metal",       fd.metal);
	ADD_FLOAT("energy",      fd.energy);
	ADD_FLOAT("maxHealth",   fd.health);
	ADD_FLOAT("reclaimTime", fd.reclaimTime);

	ADD_FLOAT("mass", fd.mass);

	ADD_INT("xsize", fd.xsize);
	ADD_INT("zsize", fd.zsize);

	ADD_INT("drawType",     fd.drawType);

	ADD_BOOL("upright",      fd.upright);
	ADD_BOOL("destructable", fd.destructable);
	ADD_BOOL("reclaimable",  fd.reclaimable);
	ADD_BOOL("autoreclaim",  fd.autoreclaim);
	ADD_BOOL("blocking",     fd.collidable);
	ADD_BOOL("burnable",     fd.burnable);
	ADD_BOOL("floating",     fd.floating);
	ADD_BOOL("geoThermal",   fd.geoThermal);
	ADD_BOOL("noSelect",     fd.selectable);
	ADD_INT("resurrectable", fd.resurrectable);

	ADD_INT("smokeTime",    fd.smokeTime);

	ADD_DEPRECATED_LUADEF_KEY("minx");
	ADD_DEPRECATED_LUADEF_KEY("miny");
	ADD_DEPRECATED_LUADEF_KEY("minz");
	ADD_DEPRECATED_LUADEF_KEY("midx");
	ADD_DEPRECATED_LUADEF_KEY("midy");
	ADD_DEPRECATED_LUADEF_KEY("midz");
	ADD_DEPRECATED_LUADEF_KEY("maxx");
	ADD_DEPRECATED_LUADEF_KEY("maxy");
	ADD_DEPRECATED_LUADEF_KEY("maxz");
	ADD_DEPRECATED_LUADEF_KEY("deathFeature");

	return true;
}
Beispiel #17
0
COND_MON_GLBDCMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "MIN" , 0 , COND_MON_GLBDCSECVB_A_TO_T );
COND_MON_GLBDCMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "SEC" , 0 , COND_MON_GLBDCSECVB_A_TO_T );
COND_MON_GLBDCMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "MICROSEC" , 0 , COND_MON_GLBDCSECVB_A_TO_T );
COND_MON_GLBDCSECVB_A_TO_T = A_TO_T_FUNCTION( COND_MON_GLUBDC_2_S_MULTIPLY );
COND_MON_GLBDPMPTMR_A_NAME = A_NAME_FUNCTION( COND_MON_NV_LOG_OUT_139 );
COND_MON_GLUBAMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "YEAR" , 0 , COND_MON_GLUBASECVB_A_TO_T );
COND_MON_GLUBAMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "MONTH" , 0 , COND_MON_GLUBASECVB_A_TO_T );
COND_MON_GLUBAMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "DAY" , 0 , COND_MON_GLUBASECVB_A_TO_T );
COND_MON_GLUBAMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "HOUR" , 0 , COND_MON_GLUBASECVB_A_TO_T );
COND_MON_GLUBAMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "MIN" , 0 , COND_MON_GLUBASECVB_A_TO_T );
COND_MON_GLUBAMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "SEC" , 0 , COND_MON_GLUBASECVB_A_TO_T );
COND_MON_GLUBAMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "MICROSEC" , 0 , COND_MON_GLUBASECVB_A_TO_T );
COND_MON_GLUBASEC_DIVIDE = DIVIDE_FUNCTION( 0 , COND_MON_GLUBA_Z_T_TO_AN , 3600_0 );
COND_MON_GLUBASECVB_A_TO_T = A_TO_T_FUNCTION( COND_MON_GLUBA_2_S_MULTIPLY );
COND_MON_GLUBA_2_S_MULTIPLY = MULTIPLY_FUNCTION( 0 , COND_MON_GLUBA_SW_A_SW , 3600_0 );
COND_MON_GLUBA_ADD_ADD = ADD_FUNCTION( 0 , COND_MON_GLUBASEC_DIVIDE , COND_MON_GLBAPMPTMR_A_NAME );
COND_MON_GLUBA_ANLG_I_TO_AN = I_TO_AN_FUNCTION( "OUT_1" , 0 , COND_MON_GLUBA_INT_OUT_1 , COND_MON_GLUBA_INT_OUT_2 );
COND_MON_GLUBA_ANLG_I_TO_AN = I_TO_AN_FUNCTION( "OUT_2" , 0 , COND_MON_GLUBA_INT_OUT_1 , COND_MON_GLUBA_INT_OUT_2 );
COND_MON_GLUBA_HR_A_NAME = A_NAME_FUNCTION( COND_MON_GLUBA_ANLG_OUT_1 );
COND_MON_GLUBA_INT_A_TO_INT = A_TO_INT_FUNCTION( "OUT_1" , 0 , COND_MON_GLUBA_SW_A_SW , COND_MON_GLUBA_TNTH_DIVIDE );
COND_MON_GLUBA_INT_A_TO_INT = A_TO_INT_FUNCTION( "OUT_2" , 0 , COND_MON_GLUBA_SW_A_SW , COND_MON_GLUBA_TNTH_DIVIDE );
COND_MON_GLUBA_MIN_A_NAME = A_NAME_FUNCTION( COND_MON_GLUBA_ANLG_OUT_2 );
COND_MON_GLUBA_NV_A_NAME = A_NAME_FUNCTION( COND_MON_GLUBA_SW_A_SW );
COND_MON_GLUBA_SET_I_TO_AN = I_TO_AN_FUNCTION( 0 , *0 (0, 99999999) );
COND_MON_GLUBA_SW_A_SW = A_SW_FUNCTION( COND_MON_MANUAL_OS_ONE_SHOT , COND_MON_GLUBA_Z2_ZMINUS1 , COND_MON_GLUBA_SET_OUT_1 );
COND_MON_GLUBA_TMR_ACCUM = ACCUM_FUNCTION( "ELAP_TIME" , A1_A08_DO_MOT6033_DISPLAY , 0 , COND_MON_NV_RESET_B_NAME , 1_0 , "HR" );
COND_MON_GLUBA_TMR_ACCUM = ACCUM_FUNCTION( "OUT_1" , A1_A08_DO_MOT6033_DISPLAY , 0 , COND_MON_NV_RESET_B_NAME , 1_0 , "HR" );
COND_MON_GLUBA_TNTH_DIVIDE = DIVIDE_FUNCTION( 0 , COND_MON_GLUBAMINPK_MIN , 6_0 );
COND_MON_GLUBA_Z_T_TO_AN = T_TO_AN_FUNCTION( 0 , COND_MON_GLUBA_TMR_ELAP_TIME );
COND_MON_GLUBA_Z2_ZMINUS1 = ZMINUS1_FUNCTION( COND_MON_GLUBA_ADD_ADD );
COND_MON_GLUBBMINPK_T_TO_HMS = T_TO_HMS_FUNCTION( "YEAR" , 0 , COND_MON_GLUBBSECVB_A_TO_T );
Beispiel #18
0
void init_stdio_port(void)
{
  ptrdiff_t offset;
  START_NEW_PROGRAM_ID (STDIO_PORT);
  offset = ADD_STORAGE(struct port);
  PIKE_MAP_VARIABLE("_accept_callback",
                    offset + OFFSETOF(port, accept_callback),
                    tMix, PIKE_T_MIXED, 0);
  PIKE_MAP_VARIABLE("_id",
                    offset + OFFSETOF(port, id), tMix, PIKE_T_MIXED, 0);
  /* function(int|string,void|mixed,void|string:int) */
  ADD_FUNCTION("bind", port_bind,
	       tFunc(tOr(tInt,tStr) tOr(tVoid,tMix) tOr(tVoid,tStr) tOr(tVoid,tInt),tInt), 0);
#ifdef HAVE_SYS_UN_H
  /* function(int|string,void|mixed,void|string:int) */
  ADD_FUNCTION("bind_unix", bind_unix,
               tFunc(tStr tOr(tVoid,tMix),tInt), ID_OPTIONAL);
#endif /* HAVE_SYS_UN_H */
  ADD_FUNCTION("close",port_close,tFunc(tNone,tVoid),0);
  /* function(int,void|mixed:int) */
  ADD_FUNCTION("listen_fd",port_listen_fd,tFunc(tInt tOr(tVoid,tMix),tInt),0);
  /* function(mixed:mixed) */
  ADD_FUNCTION("set_id",port_set_id,tFunc(tMix,tMix),0);
  /* function(:mixed) */
  ADD_FUNCTION("query_id",port_query_id,tFunc(tNone,tMix),0);
  /* function(:string) */
  ADD_FUNCTION("query_address",socket_query_address,tFunc(tNone,tStr),0);
  /* function(:int) */
  ADD_FUNCTION("errno",port_errno,tFunc(tNone,tInt),0);
  /* function(:object) */
  port_fd_factory_fun_num =
    ADD_FUNCTION("fd_factory", port_fd_factory, tFunc(tNone,tObjIs_STDIO_FD),
                 ID_PROTECTED);
  ADD_FUNCTION("accept",port_accept,tFunc(tNone,tObjIs_STDIO_FD),0);
  /* function(void|string|int,void|mixed,void|string:void) */
  ADD_FUNCTION("create", port_create,
	       tFunc(tOr3(tVoid,tStr,tInt) tOr(tVoid,tMix) tOr(tVoid,tStr),
		     tVoid), 0);
  ADD_FUNCTION ("set_backend", port_set_backend, tFunc(tObj,tVoid), 0);
  ADD_FUNCTION ("query_backend", port_query_backend, tFunc(tVoid,tObj), 0);
  ADD_FUNCTION ("query_fd", port_query_fd, tFunc(tVoid,tInt), 0);

#ifdef SO_REUSEPORT
  ADD_INT_CONSTANT( "SO_REUSEPORT_SUPPORT", SO_REUSEPORT, ID_OPTIONAL );
#endif
#ifdef TCP_FASTOPEN
  ADD_INT_CONSTANT( "TCP_FASTOPEN_SUPPORT", TCP_FASTOPEN, ID_OPTIONAL );
#endif
  set_init_callback(init_port_struct);
  set_exit_callback(exit_port_struct);

  port_program = end_program();
  add_program_constant( "_port", port_program, 0 );

}
Beispiel #19
0
void
_ol_ldap_program_init(void)
{
    start_new_program();
    ADD_STORAGE(OLSTORAGE);

    set_init_callback(init_ldap);
    set_exit_callback(exit_ldap);
    
    ADD_FUNCTION("create", f_create,
                 tFunc(tString, tVoid), 0);
    ADD_FUNCTION("bind", f_ldap_bind,
                 tFunc(tOr(tString, tVoid) tOr(tString, tVoid) tOr(tInt, tVoid),
                       tInt), 0);
    ADD_FUNCTION("unbind", f_ldap_unbind,
                 tFunc(tVoid, tInt), 0);

    ADD_FUNCTION("enable_cache", f_ldap_enable_cache,
                 tFunc(tOr(tInt, tVoid) tOr(tInt, tVoid), tInt), 0);
    ADD_FUNCTION("disable_cache", f_ldap_disable_cache,
                 tFunc(tVoid, tVoid), 0);
    ADD_FUNCTION("destroy_cache", f_ldap_destroy_cache,
                 tFunc(tVoid, tVoid), 0);
    ADD_FUNCTION("flush_cache", f_ldap_flush_cache,
                 tFunc(tVoid, tVoid), 0);
    ADD_FUNCTION("uncache_entry", f_ldap_uncache_entry,
                 tFunc(tString, tVoid), 0);
    ADD_FUNCTION("set_cache_options", f_ldap_set_cache_options,
                 tFunc(tInt, tVoid), 0);
    ADD_FUNCTION("err2string", f_ldap_err2string,
                 tFunc(tInt, tVoid), 0);
    ADD_FUNCTION("set_base_dn", f_set_base_dn,
                 tFunc(tString, tString), 0);
    ADD_FUNCTION("set_basedn", f_set_base_dn,
                 tFunc(tString, tString), 0);
    ADD_FUNCTION("set_scope", f_set_scope,
                 tFunc(tInt, tVoid), 0);
    ADD_FUNCTION("dn2ufn", f_ldap_dn2ufn,
                 tFunc(tString, tString), 0);
    ADD_FUNCTION("explode_dn", f_ldap_explode_dn,
                 tFunc(tString tOr(tInt, tVoid), tArr(tString)), 0);
    ADD_FUNCTION("search", f_ldap_search,
                 tFunc(tOr(tMapping,
                           tString tOr(tArray, tVoid) tOr(tInt, tVoid) tOr(tInt, tVoid)),
                       tOr(tObj, tInt)), 0);
    ADD_FUNCTION("modify", f_ldap_modify,
                 tFunc(tString tArr(tMap(tString, tMixed)), tVoid), 0);
    ADD_FUNCTION("add", f_ldap_add,
                 tFunc(tString tArr(tMap(tString, tMixed)), tVoid), 0);
    ADD_FUNCTION("delete", f_ldap_delete,
                 tFunc(tString, tVoid), 0);
    
    _ol_result_program_init();
    
    ldap_program = end_program();
    add_program_constant("Client", ldap_program, 0);
    add_program_constant("client", ldap_program, 0);
}
static bool InitParamMap()
{
	paramMap["next"]  = DataElement(READONLY_TYPE);
	paramMap["pairs"] = DataElement(READONLY_TYPE);

	// dummy WeaponDef for offset generation
	const WeaponDef wd;
	const char* start = ADDRESS(wd);

	ADD_FUNCTION("damages",   wd.damages,   DamagesArray);
	ADD_FUNCTION("visuals",   wd.visuals,   VisualsTable);
	ADD_FUNCTION("hitSound",  wd.soundhit,  GuiSoundSetTable);
	ADD_FUNCTION("fireSound", wd.firesound, GuiSoundSetTable);

	ADD_FUNCTION("customParams",         wd.customParams,   CustomParamsTable);
	ADD_FUNCTION("noEnemyCollide",       wd.collisionFlags, NoEnemyCollide);
	ADD_FUNCTION("noFriendlyCollide",    wd.collisionFlags, NoFriendlyCollide);
	ADD_FUNCTION("noFeatureCollide",     wd.collisionFlags, NoFeatureCollide);
	ADD_FUNCTION("noNeutralCollide",     wd.collisionFlags, NoNeutralCollide);
	ADD_FUNCTION("noGroundCollide",      wd.collisionFlags, NoGroundCollide);

	ADD_DEPRECATED_LUADEF_KEY("areaOfEffect");
	ADD_DEPRECATED_LUADEF_KEY("maxVelocity");
	ADD_DEPRECATED_LUADEF_KEY("onlyTargetCategories");

	ADD_INT("id", wd.id);

	ADD_INT("tdfId", wd.tdfId);

	ADD_STRING("name",        wd.name);
	ADD_STRING("description", wd.description);
	ADD_STRING("cegTag",      wd.cegTag);

	ADD_STRING("type", wd.type);

	ADD_FLOAT("range", wd.range);
	ADD_FLOAT("heightMod", wd.heightmod);
	ADD_FLOAT("accuracy", wd.accuracy);
	ADD_FLOAT("sprayAngle", wd.sprayAngle);
	ADD_FLOAT("movingAccuracy", wd.movingAccuracy);
	ADD_FLOAT("targetMoveError", wd.targetMoveError);
	ADD_FLOAT("leadLimit", wd.leadLimit);
	ADD_FLOAT("leadBonus", wd.leadBonus);
	ADD_FLOAT("predictBoost", wd.predictBoost);
	ADD_INT("highTrajectory", wd.highTrajectory);

	ADD_BOOL("noSelfDamage",  wd.noSelfDamage);
	ADD_BOOL("impactOnly",    wd.impactOnly);

	ADD_FLOAT("craterAreaOfEffect", wd.craterAreaOfEffect);
	ADD_FLOAT("damageAreaOfEffect", wd.damageAreaOfEffect);
	ADD_FLOAT("edgeEffectiveness",  wd.edgeEffectiveness);
	ADD_FLOAT("fireStarter",        wd.fireStarter);
	ADD_FLOAT("size",               wd.size);
	ADD_FLOAT("sizeGrowth",         wd.sizeGrowth);
	ADD_FLOAT("collisionSize",      wd.collisionSize);

	ADD_INT("salvoSize",    wd.salvosize);
	ADD_INT("projectiles",  wd.projectilespershot);
	ADD_FLOAT("salvoDelay", wd.salvodelay);
	ADD_FLOAT("reload",     wd.reload);
	ADD_FLOAT("beamtime",   wd.beamtime);
	ADD_BOOL("beamburst",   wd.beamburst);

	ADD_BOOL("waterbounce",    wd.waterBounce);
	ADD_BOOL("groundbounce",   wd.groundBounce);
	ADD_FLOAT("groundslip",    wd.bounceSlip);
	ADD_FLOAT("bouncerebound", wd.bounceRebound);
	ADD_INT("numbounce",       wd.numBounce);

	ADD_FLOAT("maxAngle", wd.maxAngle);
	ADD_FLOAT("restTime", wd.restTime);

	ADD_FLOAT("uptime", wd.uptime);

	ADD_FLOAT("metalCost",  wd.metalcost);
	ADD_FLOAT("energyCost", wd.energycost);

	ADD_BOOL("turret", wd.turret);
	ADD_BOOL("onlyForward", wd.onlyForward);
	ADD_BOOL("waterWeapon", wd.waterweapon);
	ADD_BOOL("tracks", wd.tracks);
	ADD_BOOL("paralyzer", wd.paralyzer);

	ADD_BOOL("noAutoTarget",   wd.noAutoTarget);
	ADD_BOOL("manualFire",     wd.manualfire);
	ADD_INT("targetable",      wd.targetable);
	ADD_BOOL("stockpile",      wd.stockpile);
	ADD_INT("interceptor",     wd.interceptor);
	ADD_FLOAT("coverageRange", wd.coverageRange);

	ADD_FLOAT("stockpileTime", wd.stockpileTime);

	ADD_FLOAT("intensity", wd.intensity);
	ADD_FLOAT("duration", wd.duration);
	ADD_INT("beamTTL", wd.beamLaserTTL);

	ADD_BOOL("soundTrigger", wd.soundTrigger);

	ADD_BOOL("selfExplode", wd.selfExplode);
	ADD_BOOL("gravityAffected", wd.gravityAffected);
	ADD_FLOAT("myGravity", wd.myGravity);
	ADD_BOOL("noExplode", wd.noExplode);
	ADD_FLOAT("startvelocity", wd.startvelocity);
	ADD_FLOAT("weaponAcceleration", wd.weaponacceleration);
	ADD_FLOAT("turnRate", wd.turnrate);

	ADD_FLOAT("projectilespeed", wd.projectilespeed);
	ADD_FLOAT("explosionSpeed", wd.explosionSpeed);

	ADD_FLOAT("wobble", wd.wobble);
	ADD_FLOAT("dance",  wd.dance);

	ADD_FLOAT("trajectoryHeight", wd.trajectoryHeight);

	ADD_BOOL("largeBeamLaser", wd.largeBeamLaser);
	ADD_BOOL("laserHardStop", wd.laserHardStop);

	ADD_BOOL("isShield",                wd.isShield);
	ADD_BOOL("shieldRepulser",          wd.shieldRepulser);
	ADD_BOOL("smartShield",             wd.smartShield);
	ADD_BOOL("exteriorShield",          wd.exteriorShield);
	ADD_BOOL("visibleShield",           wd.visibleShield);
	ADD_BOOL("visibleShieldRepulse",    wd.visibleShieldRepulse);
	ADD_INT( "visibleShieldHitFrames",  wd.visibleShieldHitFrames);
	ADD_FLOAT("shieldEnergyUse",        wd.shieldEnergyUse);
	ADD_FLOAT("shieldRadius",           wd.shieldRadius);
	ADD_FLOAT("shieldForce",            wd.shieldForce);
	ADD_FLOAT("shieldMaxSpeed",         wd.shieldMaxSpeed);
	ADD_FLOAT("shieldPower",            wd.shieldPower);
	ADD_FLOAT("shieldPowerRegen",       wd.shieldPowerRegen);
	ADD_FLOAT("shieldPowerRegenEnergy", wd.shieldPowerRegenEnergy);
	ADD_INT(  "shieldRechargeDelay",    wd.shieldRechargeDelay);
	ADD_FLOAT("shieldGoodColorR",       wd.shieldGoodColor.x);
	ADD_FLOAT("shieldGoodColorG",       wd.shieldGoodColor.y);
	ADD_FLOAT("shieldGoodColorB",       wd.shieldGoodColor.z);
	ADD_FLOAT("shieldBadColorR",        wd.shieldBadColor.x);
	ADD_FLOAT("shieldBadColorG",        wd.shieldBadColor.y);
	ADD_FLOAT("shieldBadColorB",        wd.shieldBadColor.z);
	ADD_FLOAT("shieldAlpha",            wd.shieldAlpha);

	ADD_INT("shieldInterceptType",      wd.shieldInterceptType);
	ADD_INT("interceptedByShieldType",  wd.interceptedByShieldType);

	ADD_BOOL("avoidFriendly", wd.avoidFriendly);
	ADD_BOOL("avoidFeature",  wd.avoidFeature);
	ADD_BOOL("avoidNeutral",  wd.avoidNeutral);

	ADD_FLOAT("targetBorder",       wd.targetBorder);
	ADD_FLOAT("cylinderTargetting", wd.cylinderTargetting);
	ADD_FLOAT("minIntensity",       wd.minIntensity);
	ADD_FLOAT("heightBoostFactor",  wd.heightBoostFactor);
	ADD_FLOAT("proximityPriority",  wd.proximityPriority);

	ADD_BOOL("sweepFire", wd.sweepFire);

	ADD_BOOL("canAttackGround", wd.canAttackGround);

	return true;
}
Beispiel #21
0
COND_MON_T3PEAKTM_ACCUM = ACCUM_FUNCTION( "OUT_1" , COND_MON_T3PEAK_AND , 0 , COND_MON_NV_RESET_B_NAME , 1_0 , "HR" );
COND_MON_T3PEAKTM_ACCUM = ACCUM_FUNCTION( "ELAP_TIME" , COND_MON_T3PEAK_AND , 0 , COND_MON_NV_RESET_B_NAME , 1_0 , "HR" );
COND_MON_T48BASE_AND = AND_FUNCTION( COND_MON_T48GT1575_A_COMPARE , COND_MON_T48LT1584_A_COMPARE , CORE_DIGITAL_FUELON );
COND_MON_T48BASETM_ACCUM = ACCUM_FUNCTION( "ELAP_TIME" , COND_MON_T48BASE_AND , 0 , COND_MON_NV_RESET_B_NAME , 1_0 , "HR" );
COND_MON_T48BASETM_ACCUM = ACCUM_FUNCTION( "OUT_1" , COND_MON_T48BASE_AND , 0 , COND_MON_NV_RESET_B_NAME , 1_0 , "HR" );
COND_MON_T48GT1575_A_COMPARE = A_COMPARE_FUNCTION( "A_COMPARE" , CORE_ANALOG_T48SEL , 1575_0 , 0 );
COND_MON_T48GT1575_A_COMPARE = A_COMPARE_FUNCTION( "A_EQUAL" , CORE_ANALOG_T48SEL , 1575_0 , 0 );
COND_MON_T48GT1585_A_COMPARE = A_COMPARE_FUNCTION( "A_COMPARE" , CORE_ANALOG_T48SEL , 1585_0 , 0 );
COND_MON_T48GT1585_A_COMPARE = A_COMPARE_FUNCTION( "A_EQUAL" , CORE_ANALOG_T48SEL , 1585_0 , 0 );
COND_MON_T48LT1584_A_COMPARE = A_COMPARE_FUNCTION( "A_COMPARE" , 1584_9 , CORE_ANALOG_T48SEL , 0 );
COND_MON_T48LT1584_A_COMPARE = A_COMPARE_FUNCTION( "A_EQUAL" , 1584_9 , CORE_ANALOG_T48SEL , 0 );
COND_MON_T48PEAK_AND = AND_FUNCTION( COND_MON_T48GT1585_A_COMPARE , CORE_DIGITAL_FUELON , IFACE_CORE_Z_SWPEAK_B_NAME );
COND_MON_T48PEAKTM_ACCUM = ACCUM_FUNCTION( "ELAP_TIME" , COND_MON_T48PEAK_AND , 0 , COND_MON_NV_RESET_B_NAME , 1_0 , "HR" );
COND_MON_T48PEAKTM_ACCUM = ACCUM_FUNCTION( "OUT_1" , COND_MON_T48PEAK_AND , 0 , COND_MON_NV_RESET_B_NAME , 1_0 , "HR" );
COND_MON_TM1HRS_DIVIDE = DIVIDE_FUNCTION( 0 , COND_MON_TM1SEC_T_TO_AN , 3600_0 );
COND_MON_TM1RSETADD_ADD = ADD_FUNCTION( 0 , COND_MON_TM1HRS_DIVIDE , COND_MON_FB_HRS_1_A_NAME );
COND_MON_TM1SEC_T_TO_AN = T_TO_AN_FUNCTION( 0 , COND_MON_T48BASETM_ELAP_TIME );
COND_MON_TM2HRS_DIVIDE = DIVIDE_FUNCTION( 0 , COND_MON_TM2TA_T_TO_AN , 3600_0 );
COND_MON_TM2RSETADD_ADD = ADD_FUNCTION( 0 , COND_MON_TM2HRS_DIVIDE , COND_MON_FB_HRS_2_A_NAME );
COND_MON_TM2TA_T_TO_AN = T_TO_AN_FUNCTION( 0 , COND_MON_T48PEAKTM_ELAP_TIME );
COND_MON_TM3HRS_DIVIDE = DIVIDE_FUNCTION( 0 , COND_MON_TM3TA_T_TO_AN , 3600_0 );
COND_MON_TM3RSETADD_ADD = ADD_FUNCTION( 0 , COND_MON_TM3HRS_DIVIDE , COND_MON_FB_HRS_3_A_NAME );
COND_MON_TM3TA_T_TO_AN = T_TO_AN_FUNCTION( 0 , COND_MON_T3BASETM_ELAP_TIME );
COND_MON_TM4HRS_DIVIDE = DIVIDE_FUNCTION( 0 , COND_MON_TM4TA_T_TO_AN , 3600_0 );
COND_MON_TM4RSETADD_ADD = ADD_FUNCTION( 0 , COND_MON_TM4HRS_DIVIDE , COND_MON_FB_HRS_4_A_NAME );
COND_MON_TM4TA_T_TO_AN = T_TO_AN_FUNCTION( 0 , COND_MON_T3PEAKTM_ELAP_TIME );
COND_MON_WAIT_TMR01_ZMINUS1 = ZMINUS1_FUNCTION( COND_MON_TM1RSETADD_ADD );
COND_MON_WAIT_TMR02_ZMINUS1 = ZMINUS1_FUNCTION( COND_MON_TM2RSETADD_ADD );
COND_MON_WAIT_TMR03_ZMINUS1 = ZMINUS1_FUNCTION( COND_MON_TM3RSETADD_ADD );
COND_MON_WAIT_TMR04_ZMINUS1 = ZMINUS1_FUNCTION( COND_MON_TM4RSETADD_ADD );
Beispiel #22
0
static bool InitParamMap()
{
	paramMap["next"]  = DataElement(READONLY_TYPE);
	paramMap["pairs"] = DataElement(READONLY_TYPE);

	// dummy UnitDef for address lookups
	const UnitDef& ud = *unitDefHandler->unitDefs[0];
	const char* start = ADDRESS(ud);

/*
ADD_FLOAT("maxRange",       maxRange);       // CUSTOM
ADD_BOOL("hasShield",       hasShield);      // CUSTOM
ADD_BOOL("canParalyze",     canParalyze);    // CUSTOM
ADD_BOOL("canStockpile",    canStockpile);   // CUSTOM
ADD_BOOL("canAttackWater",  canAttackWater); // CUSTOM
*/
// ADD_INT("buildOptionsCount", ud.buildOptions.size(")); // CUSTOM

	ADD_FUNCTION("builder", ud, ReturnFalse); // DEPRECATED
	ADD_FUNCTION("floater", ud, ReturnFalse); // DEPRECATED
	ADD_FUNCTION("canDGun", ud, ReturnFalse); // DEPRECATED
	ADD_FUNCTION("canCrash", ud, ReturnFalse); // DEPRECATED
	ADD_FUNCTION("isCommander", ud, ReturnFalse); // DEPRECATED
	ADD_FUNCTION("moveData", ud.pathType, ReturnNil); // DEPRECATED
	ADD_FUNCTION("type", ud, ReturnEmptyString); // DEPRECATED
	ADD_FUNCTION("maxSlope", ud, ReturnMinusOne); // DEPRECATED

	ADD_FUNCTION("totalEnergyOut", ud, TotalEnergyOut);

	ADD_FUNCTION("modCategories",      ud.categoryString,  CategorySetFromString);
	ADD_FUNCTION("springCategories",   ud.category,        CategorySetFromBits);
	ADD_FUNCTION("noChaseCategories",  ud.noChaseCategory, CategorySetFromBits);

	ADD_FUNCTION("customParams",       ud.customParams,       CustomParamsTable);
	ADD_FUNCTION("buildOptions",       ud.buildOptions,       BuildOptions);
	ADD_FUNCTION("decoyDef",           ud.decoyDef,           UnitDefToID);
	ADD_FUNCTION("weapons",            ud.weapons,            WeaponsTable);
	ADD_FUNCTION("sounds",             ud.sounds,             SoundsTable);
	ADD_FUNCTION("model",              ud,                    ModelTable);
	ADD_FUNCTION("moveDef",            ud.pathType,           MoveDefTable);
	ADD_FUNCTION("shieldWeaponDef",    ud.shieldWeaponDef,    WeaponDefToID);
	ADD_FUNCTION("stockpileWeaponDef", ud.stockpileWeaponDef, WeaponDefToID);
	ADD_FUNCTION("iconType",           ud.iconType,           SafeIconType);

	ADD_FUNCTION("isTransport", ud, IsTransportUnit);
	ADD_FUNCTION("isImmobile", ud, IsImmobileUnit);
	ADD_FUNCTION("isBuilding", ud, IsBuildingUnit);
	ADD_FUNCTION("isBuilder", ud, IsBuilderUnit);
	ADD_FUNCTION("isMobileBuilder", ud, IsMobileBuilderUnit);
	ADD_FUNCTION("isStaticBuilder", ud, IsStaticBuilderUnit);
	ADD_FUNCTION("isFactory", ud, IsFactoryUnit);
	ADD_FUNCTION("isExtractor", ud, IsExtractorUnit);
	ADD_FUNCTION("isGroundUnit", ud, IsGroundUnit);
	ADD_FUNCTION("isAirUnit", ud, IsAirUnit);
	ADD_FUNCTION("isStrafingAirUnit", ud, IsStrafingAirUnit);
	ADD_FUNCTION("isHoveringAirUnit", ud, IsHoveringAirUnit);
	ADD_FUNCTION("isFighterAirUnit", ud, IsFighterAirUnit);
	ADD_FUNCTION("isBomberAirUnit", ud, IsBomberAirUnit);

	ADD_FUNCTION("height",  ud, ModelHeight);
	ADD_FUNCTION("radius",  ud, ModelRadius);
	ADD_FUNCTION("minx",    ud, ModelMinx);
	ADD_FUNCTION("midx",    ud, ModelMidx);
	ADD_FUNCTION("maxx",    ud, ModelMaxx);
	ADD_FUNCTION("miny",    ud, ModelMiny);
	ADD_FUNCTION("midy",    ud, ModelMidy);
	ADD_FUNCTION("maxy",    ud, ModelMaxy);
	ADD_FUNCTION("minz",    ud, ModelMinz);
	ADD_FUNCTION("midz",    ud, ModelMidz);
	ADD_FUNCTION("maxz",    ud, ModelMaxz);

	ADD_INT("id", ud.id);
	ADD_INT("cobID", ud.cobID);

	ADD_STRING("name",      ud.name);
	ADD_STRING("humanName", ud.humanName);

	ADD_STRING("tooltip", ud.tooltip);

	ADD_STRING("wreckName", ud.wreckName);

	ADD_FUNCTION("deathExplosion", ud.deathExpWeaponDef, WeaponDefToName);
	ADD_FUNCTION("selfDExplosion", ud.selfdExpWeaponDef, WeaponDefToName);

	ADD_STRING("buildpicname", ud.buildPicName);

	ADD_INT("techLevel",   ud.techLevel);
	ADD_INT("maxThisUnit", ud.maxThisUnit);

	ADD_FLOAT("metalUpkeep",    ud.metalUpkeep);
	ADD_FLOAT("energyUpkeep",   ud.energyUpkeep);
	ADD_FLOAT("metalMake",      ud.metalMake);
	ADD_FLOAT("makesMetal",     ud.makesMetal);
	ADD_FLOAT("energyMake",     ud.energyMake);
	ADD_FLOAT("metalCost",      ud.metal);
	ADD_FLOAT("energyCost",     ud.energy);
	ADD_FLOAT("buildTime",      ud.buildTime);
	ADD_FLOAT("extractsMetal",  ud.extractsMetal);
	ADD_FLOAT("extractRange",   ud.extractRange);
	ADD_FLOAT("windGenerator",  ud.windGenerator);
	ADD_FLOAT("tidalGenerator", ud.tidalGenerator);
	ADD_FLOAT("metalStorage",   ud.metalStorage);
	ADD_FLOAT("energyStorage",  ud.energyStorage);

	ADD_DEPRECATED_LUADEF_KEY("extractSquare");

	ADD_FLOAT("power", ud.power);

	ADD_FLOAT("health",       ud.health);
	ADD_FLOAT("autoHeal",     ud.autoHeal);
	ADD_FLOAT("idleAutoHeal", ud.idleAutoHeal);

	ADD_INT("idleTime", ud.idleTime);

	ADD_BOOL("canSelfD", ud.canSelfD);
	ADD_INT("selfDCountdown", ud.selfDCountdown);

	ADD_FLOAT("speed",    ud.speed);
	ADD_FLOAT("turnRate", ud.turnRate);
	ADD_BOOL("turnInPlace", ud.turnInPlace);
	ADD_FLOAT("turnInPlaceSpeedLimit", ud.turnInPlaceSpeedLimit);

	ADD_BOOL("upright", ud.upright);
	ADD_BOOL("collide", ud.collide);

	ADD_FLOAT("losHeight",     ud.losHeight);
	ADD_FLOAT("losRadius",     ud.losRadius);
	ADD_FLOAT("airLosRadius",  ud.airLosRadius);

	ADD_INT("radarRadius",    ud.radarRadius);
	ADD_INT("sonarRadius",    ud.sonarRadius);
	ADD_INT("jammerRadius",   ud.jammerRadius);
	ADD_INT("sonarJamRadius", ud.sonarJamRadius);
	ADD_INT("seismicRadius",  ud.seismicRadius);

	ADD_FLOAT("seismicSignature", ud.seismicSignature);

	ADD_BOOL("stealth",      ud.stealth);
	ADD_BOOL("sonarStealth", ud.sonarStealth);

	ADD_FLOAT("mass", ud.mass);

	ADD_FLOAT("maxHeightDif",  ud.maxHeightDif);
	ADD_FLOAT("minWaterDepth", ud.minWaterDepth);
	ADD_FLOAT("maxWaterDepth", ud.maxWaterDepth);
	ADD_FLOAT("waterline",     ud.waterline);

	ADD_INT("flankingBonusMode",   ud.flankingBonusMode);
	ADD_FLOAT("flankingBonusMax",  ud.flankingBonusMax);
	ADD_FLOAT("flankingBonusMin",  ud.flankingBonusMin);
	ADD_FLOAT("flankingBonusDirX", ud.flankingBonusDir.x);
	ADD_FLOAT("flankingBonusDirY", ud.flankingBonusDir.y);
	ADD_FLOAT("flankingBonusDirZ", ud.flankingBonusDir.z);
	ADD_FLOAT("flankingBonusMobilityAdd", ud.flankingBonusMobilityAdd);

	ADD_INT("armorType",         ud.armorType);
	ADD_FLOAT("armoredMultiple", ud.armoredMultiple);

	ADD_FLOAT("minCollisionSpeed", ud.minCollisionSpeed);
	ADD_FLOAT("slideTolerance",    ud.slideTolerance);

	ADD_FLOAT("maxWeaponRange", ud.maxWeaponRange);
	ADD_FLOAT("maxCoverage", ud.maxCoverage);

	ADD_BOOL( "buildRange3D",   ud.buildRange3D);
	ADD_FLOAT("buildDistance",  ud.buildDistance);
	ADD_FLOAT("buildSpeed",     ud.buildSpeed);
	ADD_FLOAT("repairSpeed",    ud.repairSpeed);
	ADD_FLOAT("maxRepairSpeed", ud.repairSpeed);
	ADD_FLOAT("reclaimSpeed",   ud.reclaimSpeed);
	ADD_FLOAT("resurrectSpeed", ud.resurrectSpeed);
	ADD_FLOAT("captureSpeed",   ud.captureSpeed);
	ADD_FLOAT("terraformSpeed", ud.terraformSpeed);

	ADD_BOOL("canSubmerge",       ud.canSubmerge);
	ADD_BOOL("floatOnWater",      ud.floatOnWater);
	ADD_BOOL("canFly",            ud.canfly);
	ADD_BOOL("canMove",           ud.canmove);
	ADD_BOOL("onOffable",         ud.onoffable);
	ADD_BOOL("activateWhenBuilt", ud.activateWhenBuilt);

	ADD_DEPRECATED_LUADEF_KEY("canHover");

	ADD_BOOL("reclaimable", ud.reclaimable);
	ADD_BOOL("capturable",  ud.capturable);
	ADD_BOOL("repairable",  ud.repairable);

	ADD_BOOL("canManualFire",         ud.canManualFire);
	ADD_BOOL("canCloak",              ud.canCloak);
	ADD_BOOL("canRestore",            ud.canRestore);
	ADD_BOOL("canRepair",             ud.canRepair);
	ADD_BOOL("canSelfRepair",         ud.canSelfRepair);
	ADD_BOOL("canReclaim",            ud.canReclaim);
	ADD_BOOL("canAttack",             ud.canAttack);
	ADD_BOOL("canPatrol",             ud.canPatrol);
	ADD_BOOL("canFight",              ud.canFight);
	ADD_BOOL("canGuard",              ud.canGuard);
	ADD_BOOL("canAssist",             ud.canAssist);
	ADD_BOOL("canBeAssisted",         ud.canBeAssisted);
	ADD_BOOL("canRepeat",             ud.canRepeat);
	ADD_BOOL("canCapture",            ud.canCapture);
	ADD_BOOL("canResurrect",          ud.canResurrect);
	ADD_BOOL("canLoopbackAttack",     ud.canLoopbackAttack);
	ADD_BOOL("canFireControl",        ud.canFireControl);
	ADD_INT( "fireState",             ud.fireState);
	ADD_INT( "moveState",             ud.moveState);
	ADD_BOOL("fullHealthFactory",     ud.fullHealthFactory);
	ADD_BOOL("factoryHeadingTakeoff", ud.factoryHeadingTakeoff);

	//aircraft stuff
	ADD_DEPRECATED_LUADEF_KEY("drag");
	ADD_FLOAT("wingDrag",     ud.wingDrag);
	ADD_FLOAT("wingAngle",    ud.wingAngle);
	ADD_FLOAT("crashDrag",    ud.crashDrag);
	ADD_FLOAT("frontToSpeed", ud.frontToSpeed);
	ADD_FLOAT("speedToFront", ud.speedToFront);
	ADD_FLOAT("myGravity",    ud.myGravity);
	ADD_FLOAT("verticalSpeed",ud.verticalSpeed);

	ADD_FLOAT("maxBank",      ud.maxBank);
	ADD_FLOAT("maxPitch",     ud.maxPitch);
	ADD_FLOAT("turnRadius",   ud.turnRadius);
	ADD_FLOAT("wantedHeight", ud.wantedHeight);
	ADD_BOOL("hoverAttack",   ud.hoverAttack);
	ADD_BOOL("airStrafe",     ud.airStrafe);
	ADD_BOOL("bankingAllowed",ud.bankingAllowed);
	ADD_BOOL("useSmoothMesh", ud.useSmoothMesh);

	// < 0 means it can land,
	// >= 0 indicates how much the unit will move during hovering on the spot
	ADD_FLOAT("dlHoverFactor", ud.dlHoverFactor);

//	bool DontLand (") { return dlHoverFactor >= 0.0f; }

	ADD_FLOAT("maxAcc",      ud.maxAcc);
	ADD_FLOAT("maxDec",      ud.maxDec);
	ADD_FLOAT("maxAileron",  ud.maxAileron);
	ADD_FLOAT("maxElevator", ud.maxElevator);
	ADD_FLOAT("maxRudder",   ud.maxRudder);

	ADD_FLOAT("maxFuel",    ud.maxFuel);
	ADD_FLOAT("refuelTime", ud.refuelTime);

	ADD_FLOAT("minAirBasePower", ud.minAirBasePower);

//	unsigned char* yardmapLevels[6];
//	unsigned char* yardmaps[4];			//Iterations of the Ymap for building rotation

	ADD_INT("xsize", ud.xsize);
	ADD_INT("zsize", ud.zsize);

	// transport stuff
	ADD_INT(  "transportCapacity",     ud.transportCapacity);
	ADD_INT(  "transportSize",         ud.transportSize);
	ADD_FLOAT("transportMass",         ud.transportMass);
	ADD_FLOAT("loadingRadius",         ud.loadingRadius);
	ADD_BOOL( "isAirBase",             ud.isAirBase);
	ADD_BOOL( "isFirePlatform",        ud.isFirePlatform);
	ADD_BOOL( "holdSteady",            ud.holdSteady);
	ADD_BOOL( "releaseHeld",           ud.releaseHeld);
	ADD_BOOL( "cantBeTransported",     ud.cantBeTransported);
	ADD_BOOL( "transportByEnemy",      ud.transportByEnemy);
	ADD_INT(  "transportUnloadMethod", ud.transportUnloadMethod);
	ADD_FLOAT("fallSpeed",             ud.fallSpeed);
	ADD_FLOAT("unitFallSpeed",         ud.unitFallSpeed);

	ADD_BOOL( "startCloaked",     ud.startCloaked);
	ADD_FLOAT("cloakCost",        ud.cloakCost);
	ADD_FLOAT("cloakCostMoving",  ud.cloakCostMoving);
	ADD_FLOAT("decloakDistance",  ud.decloakDistance);
	ADD_BOOL( "decloakSpherical", ud.decloakSpherical);
	ADD_BOOL( "decloakOnFire",    ud.decloakOnFire);
	ADD_INT(  "cloakTimeout",     ud.cloakTimeout);

	ADD_BOOL( "canKamikaze",    ud.canKamikaze);
	ADD_FLOAT("kamikazeDist",   ud.kamikazeDist);
	ADD_BOOL( "kamikazeUseLOS", ud.kamikazeUseLOS);

	ADD_BOOL("targfac", ud.targfac);

	ADD_BOOL("needGeo",   ud.needGeo);
	ADD_BOOL("isFeature", ud.isFeature);

	ADD_BOOL("hideDamage",     ud.hideDamage);
	ADD_BOOL("showPlayerName", ud.showPlayerName);

	ADD_INT("highTrajectoryType", ud.highTrajectoryType);

	ADD_BOOL( "leaveTracks",   ud.decalDef.leaveTrackDecals);
	ADD_INT(  "trackType",     ud.decalDef.trackDecalType);
	ADD_FLOAT("trackWidth",    ud.decalDef.trackDecalWidth);
	ADD_FLOAT("trackOffset",   ud.decalDef.trackDecalOffset);
	ADD_FLOAT("trackStrength", ud.decalDef.trackDecalStrength);
	ADD_FLOAT("trackStretch",  ud.decalDef.trackDecalStretch);

	ADD_BOOL( "canDropFlare",     ud.canDropFlare);
	ADD_FLOAT("flareReloadTime",  ud.flareReloadTime);
	ADD_FLOAT("flareEfficiency",  ud.flareEfficiency);
	ADD_FLOAT("flareDelay",       ud.flareDelay);
	ADD_FLOAT("flareDropVectorX", ud.flareDropVector.x);
	ADD_FLOAT("flareDropVectorY", ud.flareDropVector.y);
	ADD_FLOAT("flareDropVectorZ", ud.flareDropVector.z);
	ADD_INT(  "flareTime",        ud.flareTime);
	ADD_INT(  "flareSalvoSize",   ud.flareSalvoSize);
	ADD_INT(  "flareSalvoDelay",  ud.flareSalvoDelay);

	ADD_BOOL("levelGround", ud.levelGround);
	ADD_BOOL("strafeToAttack", ud.strafeToAttack);

	ADD_BOOL( "useBuildingGroundDecal",  ud.decalDef.useGroundDecal);
	ADD_INT(  "buildingDecalType",       ud.decalDef.groundDecalType);
	ADD_INT(  "buildingDecalSizeX",      ud.decalDef.groundDecalSizeX);
	ADD_INT(  "buildingDecalSizeY",      ud.decalDef.groundDecalSizeY);
	ADD_FLOAT("buildingDecalDecaySpeed", ud.decalDef.groundDecalDecaySpeed);

	ADD_BOOL("showNanoFrame", ud.showNanoFrame);
	ADD_BOOL("showNanoSpray", ud.showNanoSpray);
	ADD_FLOAT("nanoColorR",   ud.nanoColor.x);
	ADD_FLOAT("nanoColorG",   ud.nanoColor.y);
	ADD_FLOAT("nanoColorB",   ud.nanoColor.z);

	ADD_STRING("scriptName", ud.scriptName);
	ADD_STRING("scriptPath", ud.scriptName); //FIXME // backward compability

	return true;
}
Beispiel #23
0
void pike_module_init() {
	struct utsname utsname;
	char *p;
	uname(&utsname);
	if ((p = strchr (utsname.nodename, '.')))
		*p = 0;
	Hostname=strdup(utsname.nodename);
	Tempdir=(char *) LIBMUTT_TEMPDIR;

	ADD_INT_CONSTANT("M_READ",M_READ,0);
	ADD_INT_CONSTANT("M_REPLIED",M_REPLIED,0);
	ADD_INT_CONSTANT("M_OLD",M_OLD,0);
	ADD_INT_CONSTANT("M_FLAG",M_FLAG,0);
	ADD_INT_CONSTANT("M_DELETE",M_DELETE,0);
	ADD_INT_CONSTANT("M_TAG",M_TAG,0);
	ADD_INT_CONSTANT("M_NEW",M_NEW,0);

	/* constants for mx_check_mailbox() */
	ADD_INT_CONSTANT("M_NEW_MAIL",M_NEW_MAIL,0);
	ADD_INT_CONSTANT("M_REOPENED",M_REOPENED,0);
	ADD_INT_CONSTANT("M_FLAGS",M_FLAGS,0);

	start_new_program();
	 ADD_STORAGE(MAILSTORE_STORAGE);
	
	 set_init_callback(init_mailstore);
	 set_exit_callback(exit_mailstore);


	// public pike methods
	ADD_FUNCTION("create", f_create,
		tFunc(tString, tVoid), 0);
	ADD_FUNCTION("_sizeof", f__sizeof,
		tFunc(tVoid, tInt), 0);
	ADD_FUNCTION("stat", f_stat,
		tFunc(tVoid, tMapping), 0); 
	ADD_FUNCTION("get_header", f_get_header,
		tFunc(tInt, tMapping), 0);
	ADD_FUNCTION("debug", f_debug,
		tFunc(tInt, tInt), 0);
	ADD_FUNCTION("set_flag", f_set_flag,
		tFunc(tInt tInt, tVoid), 0);
	ADD_FUNCTION("reset_flag", f_reset_flag,
		tFunc(tInt tInt, tVoid), 0);
	ADD_FUNCTION("check_mailbox", f_check_mailbox,
		tFunc(tVoid, tInt), 0);

	/* Mailbox.Message */
	start_new_program();
 	  set_init_callback(init_message_storage);
	  set_exit_callback(exit_message_storage);
	  ADD_STORAGE( MESSAGE_STORAGE );
	  ADD_FUNCTION("create", f_msg_create,
			tFunc(tInt, tVoid), 0);
	  ADD_FUNCTION("getFD", f_msg_getfd,   
			tFunc(tVoid, tInt), 0);
	  ADD_FUNCTION("get_header",f_msg_get_header, 
			tFunc(tVoid, tMapping), 0);
	 end_class("Message",0);

	end_class("Mailbox",0);
	
	mutt_error=libmutt_error;
	/* reference it so that it's not optimized out */
	__dummy_variable[0] = (void*)NULL;
}
Beispiel #24
0
    /* Function: alureGetProcAddress
     *
     * Returns a pointer for the named ALURE function.
     *
     * Returns:
     * NULL on error.
     *
     * *Version Added*: 1.1
     */
    ALURE_API void* ALURE_APIENTRY alureGetProcAddress(const ALchar *funcname)
    {
        static const struct {
            const char *name;
            void *func;
        } FunctionList[] = {
#define ADD_FUNCTION(x) { #x, (void*)x },
            ADD_FUNCTION(alureGetVersion)
            ADD_FUNCTION(alureGetErrorString)
            ADD_FUNCTION(alureGetDeviceNames)
            ADD_FUNCTION(alureFreeDeviceNames)
            ADD_FUNCTION(alureInitDevice)
            ADD_FUNCTION(alureShutdownDevice)
            ADD_FUNCTION(alureGetSampleFormat)
            ADD_FUNCTION(alureSleep)
            ADD_FUNCTION(alureCreateBufferFromFile)
            ADD_FUNCTION(alureCreateBufferFromMemory)
            ADD_FUNCTION(alureBufferDataFromFile)
            ADD_FUNCTION(alureBufferDataFromMemory)
            ADD_FUNCTION(alureCreateStreamFromFile)
            ADD_FUNCTION(alureCreateStreamFromMemory)
            ADD_FUNCTION(alureCreateStreamFromStaticMemory)
            ADD_FUNCTION(alureCreateStreamFromCallback)
            ADD_FUNCTION(alureRewindStream)
            ADD_FUNCTION(alureDestroyStream)
            ADD_FUNCTION(alureInstallDecodeCallbacks)
            ADD_FUNCTION(alureSetIOCallbacks)
            ADD_FUNCTION(alureGetProcAddress)
            ADD_FUNCTION(alurePlaySourceStream)
            ADD_FUNCTION(alurePlaySource)
            ADD_FUNCTION(alureStopSource)
            ADD_FUNCTION(alureGetSourceOffset)
#undef ADD_FUNCTION
            {
                NULL, NULL
            }
        };

        size_t i;
        for(i = 0; FunctionList[i].name; i++)
        {
            if(strcmp(FunctionList[i].name, funcname) == 0)
                break;
        }

        if(!FunctionList[i].name)
            SetError("Function not found");
        return FunctionList[i].func;
    }
/**
 * Add native methods to the Bluetooth object.
 * [0] - Bluetooth Object
 */
duk_ret_t ModuleBluetooth(duk_context *ctx) {
	ADD_FUNCTION("init", js_bluetooth_init, 0);
	return 0;
} // ModuleBluetooth