int IDL_Load(void) { /* These tables contain information on the functions and procedures that make up the cmdline_tools DLM. The information contained in these tables must be identical to that contained in cmdline_tools.dlm. */ static IDL_SYSFUN_DEF2 function_addr[] = { { IDL_mg_zlib_version, "MG_ZLIB_VERSION", 0, 0, 0, 0 }, }; static IDL_SYSFUN_DEF2 procedure_addr[] = { { (IDL_SYSRTN_GENERIC) IDL_mg_compress, "MG_COMPRESS", 2, 2, 0, 0 }, { (IDL_SYSRTN_GENERIC) IDL_mg_decompress, "MG_DECOMPRESS", 2, 2, 0, 0 }, }; if (!(msg_block = IDL_MessageDefineBlock("mg_zlib_dlm", IDL_CARRAY_ELTS(msg_arr), msg_arr))) return IDL_FALSE; /* Register our routines. The routines must be specified exactly the same as in cmdline_tools.dlm. */ return IDL_SysRtnAdd(procedure_addr, FALSE, IDL_CARRAY_ELTS(procedure_addr)) && IDL_SysRtnAdd(function_addr, TRUE, IDL_CARRAY_ELTS(function_addr)); }
int IDL_Load(void) { IDL_StructDefPtr mg_mysql_field_sdef; /* These tables contain information on the functions and procedures that make up the MySQL DLM. The information contained in these tables must be identical to that contained in mg_mysql.dlm. */ static IDL_SYSFUN_DEF2 function_addr[] = { { IDL_mg_mysql_get_client_info, "MG_MYSQL_GET_CLIENT_INFO", 0, 0, 0, 0 }, { IDL_mg_mysql_get_client_version, "MG_MYSQL_GET_CLIENT_VERSION", 0, 0, 0, 0 }, { IDL_mg_mysql_get_proto_info, "MG_MYSQL_GET_PROTO_INFO", 1, 1, 0, 0 }, { IDL_mg_mysql_get_host_info, "MG_MYSQL_GET_HOST_INFO", 1, 1, 0, 0 }, { IDL_mg_mysql_get_server_info, "MG_MYSQL_GET_SERVER_INFO", 1, 1, 0, 0 }, { IDL_mg_mysql_get_server_version, "MG_MYSQL_GET_SERVER_VERSION", 1, 1, 0, 0 }, { IDL_mg_mysql_info, "MG_MYSQL_INFO", 1, 1, 0, 0 }, { IDL_mg_mysql_init, "MG_MYSQL_INIT", 0, 0, 0, 0 }, { IDL_mg_mysql_options, "MG_MYSQL_OPTIONS", 3, 3, 0, 0 }, { IDL_mg_mysql_list_tables, "MG_MYSQL_LIST_TABLES", 1, 2, 0, 0 }, { IDL_mg_mysql_list_dbs, "MG_MYSQL_LIST_DBS", 1, 2, 0, 0 }, { IDL_mg_mysql_real_connect, "MG_MYSQL_REAL_CONNECT", 8, 8, 0, 0 }, { IDL_mg_mysql_select_db, "MG_MYSQL_SELECT_DB", 2, 2, 0, 0 }, { IDL_mg_mysql_query, "MG_MYSQL_QUERY", 2, 2, 0, 0 }, { IDL_mg_mysql_error, "MG_MYSQL_ERROR", 1, 1, 0, 0 }, { IDL_mg_mysql_errno, "MG_MYSQL_ERRNO", 1, 1, 0, 0 }, { IDL_mg_mysql_store_result, "MG_MYSQL_STORE_RESULT", 1, 1, 0, 0 }, { IDL_mg_mysql_num_fields, "MG_MYSQL_NUM_FIELDS", 1, 1, 0, 0 }, { IDL_mg_mysql_num_rows, "MG_MYSQL_NUM_ROWS", 1, 1, 0, 0 }, { IDL_mg_mysql_fetch_row, "MG_MYSQL_FETCH_ROW", 1, 1, 0, 0 }, { IDL_mg_mysql_field_count, "MG_MYSQL_FIELD_COUNT", 1, 1, 0, 0 }, { IDL_mg_mysql_get_field, "MG_MYSQL_GET_FIELD", 2, 2, 0, 0 }, { IDL_mg_mysql_get_blobfield, "MG_MYSQL_GET_BLOBFIELD", 3, 3, 0, 0 }, { IDL_mg_mysql_insert_id, "MG_MYSQL_INSERT_ID", 1, 1, 0, 0 }, { IDL_mg_mysql_fetch_field, "MG_MYSQL_FETCH_FIELD", 1, 1, 0, 0 }, { IDL_mg_mysql_fetch_lengths, "MG_MYSQL_FETCH_LENGTHS", 1, 1, 0, 0 }, { IDL_mg_mysql_next_result, "MG_MYSQL_NEXT_RESULT", 1, 1, 0, 0 }, { IDL_mg_mysql_real_escape_string, "MG_MYSQL_REAL_ESCAPE_STRING", 4, 4, 0, 0 }, { IDL_mg_mysql_real_query, "MG_MYSQL_REAL_QUERY", 3, 3, 0, 0 }, }; static IDL_SYSFUN_DEF2 procedure_addr[] = { { (IDL_SYSRTN_GENERIC) IDL_mg_mysql_close, "MG_MYSQL_CLOSE", 1, 1, 0, 0 }, { (IDL_SYSRTN_GENERIC) IDL_mg_mysql_free_result, "MG_MYSQL_FREE_RESULT", 1, 1, 0, 0 }, }; mg_mysql_field_sdef = IDL_MakeStruct("MG_MYSQL_FIELD", mg_mysql_field); /* Register our routines. The routines must be specified exactly the same as in mg_mysql.dlm. */ return IDL_SysRtnAdd(procedure_addr, FALSE, IDL_CARRAY_ELTS(procedure_addr)) && IDL_SysRtnAdd(function_addr, TRUE, IDL_CARRAY_ELTS(function_addr)); }
// // IDL_Load // int IDL_Load (void) { int status; int nmsgs, nfcns, npros; static IDL_SYSFUN_DEF2 function_addr[] = { { idlpgr_CreateContext, "IDLPGR_CREATECONTEXT", 0, 0, 0, 0 }, { idlpgr_GetNumOfCameras, "IDLPGR_GETNUMOFCAMERAS", 1, 1, 0, 0 }, { idlpgr_GetCameraFromIndex, "IDLPGR_GETCAMERAFROMINDEX", 1, 2, 0, 0 }, { idlpgr_GetCameraInfo, "IDLPGR_GETCAMERAINFO", 1, 1, 0, 0 }, { idlpgr_CreateImage, "IDLPGR_CREATEIMAGE", 0, 0, 0, 0 }, { idlpgr_AllocateImage, "IDLPGR_ALLOCATEIMAGE", 1, 1, 0, 0 }, { idlpgr_ReadRegister, "IDLPGR_READREGISTER", 2, 2, 0, 0 }, { idlpgr_GetPropertyInfo, "IDLPGR_GETPROPERTYINFO", 2, 2, 0, 0 }, { idlpgr_GetProperty, "IDLPGR_GETPROPERTY", 2, 2, 0, 0 }, }; static IDL_SYSFUN_DEF2 procedure_addr[] = { { (IDL_SYSRTN_GENERIC) idlpgr_DestroyContext, "IDLPGR_DESTROYCONTEXT", 1, 1, 0, 0 }, { (IDL_SYSRTN_GENERIC) idlpgr_Connect, "IDLPGR_CONNECT", 2, 2, 0, 0 }, { (IDL_SYSRTN_GENERIC) idlpgr_StartCapture, "IDLPGR_STARTCAPTURE", 1, 1, 0, 0 }, { (IDL_SYSRTN_GENERIC) idlpgr_StopCapture, "IDLPGR_STOPCAPTURE", 1, 1, 0, 0 }, { (IDL_SYSRTN_GENERIC) idlpgr_DestroyImage, "IDLPGR_DESTROYIMAGE", 1, 1, 0, 0 }, { (IDL_SYSRTN_GENERIC) idlpgr_RetrieveBuffer, "IDLPGR_RETRIEVEBUFFER", 2, 2, 0, 0 }, { (IDL_SYSRTN_GENERIC) idlpgr_GetImage, "IDLPGR_GETIMAGE", 2, 2, 0, 0 }, { (IDL_SYSRTN_GENERIC) idlpgr_WriteRegister, "IDLPGR_WRITEREGISTER", 3, 3, 0, 0 }, { (IDL_SYSRTN_GENERIC) idlpgr_SetProperty, "IDLPGR_SETPROPERTY", 2, 2, 0, 0 }, }; nmsgs = IDL_CARRAY_ELTS(msg_arr); msgs = IDL_MessageDefineBlock("idlpgr", nmsgs, msg_arr); if (!msgs) return IDL_FALSE; nfcns = IDL_CARRAY_ELTS(function_addr); status = IDL_SysRtnAdd(function_addr, TRUE, nfcns); npros = IDL_CARRAY_ELTS(procedure_addr); status |= IDL_SysRtnAdd(procedure_addr, FALSE, npros); return status; }
/* Register the routines available for IDL; they must be specified exactly as in mg_lineplots.dlm. */ int IDL_Load(void) { // functions to register static IDL_SYSFUN_DEF2 function_addr[] = { { IDL_mg_rasterpolyline, "MG_RASTERPOLYLINE", 6, 6, 0, 0 }, }; return IDL_SysRtnAdd(function_addr, TRUE, IDL_CARRAY_ELTS(function_addr)); }
int IDL_Load(void) { static IDL_SYSFUN_DEF2 fnaddr[]={ { IDLOldCnvMapRead,"OLDCNVMAPREAD",7,7,0,0}, { IDLOldCnvMapWrite,"OLDCNVMAPWRITE",7,7,0,0}, { IDLOldCnvMapLoadInx,"OLDCNVMAPLOADINX",2,2,0,0}, { IDLOldCnvMapSeek,"OLDCNVMAPSEEK",7,8,IDL_SYSFUN_DEF_F_KEYWORDS,0}, { IDLOldCnvMapOpen,"OLDCNVMAPOPEN",1,1,IDL_SYSFUN_DEF_F_KEYWORDS,0}, { IDLOldCnvMapClose,"OLDCNVMAPCLOSE",1,1,0,0}, }; if (!(msg_block = IDL_MessageDefineBlock("oldcnvmap", IDL_CARRAY_ELTS(msg_arr), msg_arr))) return IDL_FALSE; return IDL_SysRtnAdd(fnaddr,TRUE,IDL_CARRAY_ELTS(fnaddr)); }
int IDL_Load(void) { static IDL_SYSFUN_DEF2 fnaddr[]={ { IDLOldRawRead,"OLDRAWREAD",3,3,0,0}, { IDLOldRawSeek,"OLDRAWSEEK",7,7,IDL_SYSFUN_DEF_F_KEYWORDS,0}, { IDLOldRawWrite,"OLDRAWWRITE",4,4,0,0}, { IDLOldRawOpen,"OLDRAWOPEN",1,2,0,0}, { IDLOldRawClose,"OLDRAWCLOSE",1,1,0,0}, { IDLOldRawWriteHeader,"OLDRAWWRITEHEADER",3,3,0,0}, }; if (!(msg_block = IDL_MessageDefineBlock("oldraw", IDL_CARRAY_ELTS(msg_arr), msg_arr))) return IDL_FALSE; return IDL_SysRtnAdd(fnaddr,TRUE,IDL_CARRAY_ELTS(fnaddr)); }
int IDL_Load(void) { static IDL_SYSFUN_DEF2 fnaddr[]={ { IDLOldGridRead,"OLDGRIDREAD",4,4,0,0}, { IDLOldGridWrite,"OLDGRIDWRITE",4,4,0,0}, { IDLOldGridLoadInx,"OLDGRIDLOADINX",2,2,0,0}, { IDLOldGridSeek,"OLDGRIDSEEK",7,8,IDL_SYSFUN_DEF_F_KEYWORDS,0}, { IDLOldGridOpen,"OLDGRIDOPEN",1,1,IDL_SYSFUN_DEF_F_KEYWORDS,0}, { IDLOldGridClose,"OLDGRIDCLOSE",1,1,0,0}, }; if (!(msg_block = IDL_MessageDefineBlock("grd", IDL_CARRAY_ELTS(msg_arr), msg_arr))) return IDL_FALSE; return IDL_SysRtnAdd(fnaddr,TRUE,IDL_CARRAY_ELTS(fnaddr)); }
int IDL_Load(void) { #ifdef WIN32 WORD wVersionRequested; WSADATA wsaData; int err; wVersionRequested = MAKEWORD(2, 0); err = WSAStartup(wVersionRequested, &wsaData); if (!err) iInitW2 = 1; #endif if (!(msg_block = IDL_MessageDefineBlock("mg_net", IDL_CARRAY_ELTS(msg_arr), msg_arr))) { return IDL_FALSE; } if (!IDL_SysRtnAdd(net_functions, TRUE, IDL_CARRAY_ELTS(net_functions))) { IDL_Message(IDL_M_GENERIC, IDL_MSG_RET, "Error adding MG_NET system routines"); return IDL_FALSE; } IDL_ExitRegister(mg_net_exit_handler); return IDL_TRUE; }
int IDL_Load(void) { /* These tables contain information on the functions and procedures that make up the cmdline_tools DLM. The information contained in these tables must be identical to that contained in cmdline_tools.dlm. */ static IDL_SYSFUN_DEF2 function_addr[] = { { IDL_mg_termlines, "MG_TERMLINES", 0, 0, 0, 0 }, { IDL_mg_termcolumns, "MG_TERMCOLUMNS", 0, 0, 0, 0 }, { IDL_mg_termistty, "MG_TERMISTTY", 0, 0, 0, 0 }, { IDL_mg_heapid, "MG_HEAPID", 1, 1, 0, 0 }, { IDL_mg_tout_pop, "MG_TOUT_POP", 0, 0, 0, 0 }, { IDL_IDL_OutputFormatFunc, "MG_OUTPUTFORMATFUNC", 1, 1, 0, 0 }, { IDL_IDL_OutputFormatLenFunc, "MG_OUTPUTFORMATLENFUNC", 1, 1, 0, 0 }, { IDL_IDL_TypeSizeFunc, "MG_TYPESIZEFUNC", 1, 1, 0, 0 }, { IDL_IDL_TypeNameFunc, "MG_TYPENAMEFUNC", 1, 1, 0, 0 }, { IDL_IDL_SysRtnNumEnabled, "MG_SYSRTNNUMENABLED", 2, 2, 0, 0 }, }; static IDL_SYSFUN_DEF2 procedure_addr[] = { { (IDL_SYSRTN_GENERIC) IDL_mg_print, "MG_PRINT", 0, IDL_MAXPARAMS, IDL_SYSFUN_DEF_F_KEYWORDS, 0 }, { (IDL_SYSRTN_GENERIC) IDL_mg_tout_push, "MG_TOUT_PUSH", 0, 1, 0, 0 }, { (IDL_SYSRTN_GENERIC) IDL_IDL_TTYReset, "MG_TTYRESET", 0, 0, 0, 0 }, }; if (!(msg_block = IDL_MessageDefineBlock("MG_Cmdline_tools_DLM", IDL_CARRAY_ELTS(msg_arr), msg_arr))) return IDL_FALSE; /* Register our routines. The routines must be specified exactly the same as in cmdline_tools.dlm. */ return IDL_SysRtnAdd(procedure_addr, FALSE, IDL_CARRAY_ELTS(procedure_addr)) && IDL_SysRtnAdd(function_addr, TRUE, IDL_CARRAY_ELTS(function_addr)); }
int IDL_Load(void) { /* * These tables contain information on the functions and procedures * that make up the cmdline_tools DLM. The information contained in these * tables must be identical to that contained in mg_introspection.dlm. */ static IDL_SYSFUN_DEF2 function_addr[] = { { IDL_mg_sizeof, "MG_SIZEOF", 1, 1, 0, 0 }, }; /* * Register our routines. The routines must be specified exactly the same * as in mg_introspection.dlm. */ return IDL_SysRtnAdd(function_addr, TRUE, IDL_CARRAY_ELTS(function_addr)); }
int IDL_Load(void) { /* * These tables contain information on the functions and procedures * that make up the analysis DLM. The information contained in these * tables must be identical to that contained in mg_analysis.dlm. */ static IDL_SYSFUN_DEF2 function_addr[] = { { IDL_mg_nc_isncdf, "MG_NC_ISNCDF", 1, 1, 0, 0 }, { IDL_mg_nc_inq_format, "MG_NC_INQ_FORMAT", 1, 1, 0, 0 }, }; /* * Register our routines. The routines must be specified exactly the same * as in mg_netcdf.dlm. */ return IDL_SysRtnAdd(function_addr, TRUE, IDL_CARRAY_ELTS(function_addr)); }
int IDL_Load(void) { /* * These tables contain information on the functions and procedures * that make up the analysis DLM. The information contained in these * tables must be identical to that contained in mg_analysis.dlm. */ static IDL_SYSFUN_DEF2 function_addr[] = { { IDL_mg_fdtrc, "MG_FDTR", 3, 3, 0, 0 }, { IDL_mg_fdtrc, "MG_FDTRC", 3, 3, 0, 0 }, { IDL_mg_fdtrc, "MG_FDTRI", 3, 3, 0, 0 }, }; /* * Register our routines. The routines must be specified exactly the same * as in mg_analysis.dlm. */ return IDL_SysRtnAdd(function_addr, TRUE, IDL_CARRAY_ELTS(function_addr)); }
/** rIDL main loop. */ int main(int argc, char *argv[]) { ridl_handleswitches(argc, argv, 1); IDL_INIT_DATA init_data; init_data.options = ridl_options; init_data.clargs.argc = argc; init_data.clargs.argv = argv; ridl_welcome(); IDL_UicbRegInitTextDone(ridl_inittextdone); if (!IDL_Initialize(&init_data)) { ridl_warning("failed to initialize Callable IDL session.\n"); return(EXIT_FAILURE); } IDL_ExitRegister(ridl_exit_handler); IDL_UicbRegExitDone(ridl_exit); IDL_UicbRegShowCompileErr(ridl_show_compile_error); IDL_UicbRegPromptChange(ridl_changeprompt); IDL_UicbRegDeathHint(ridl_deathhint); IDL_UicbRegWorkingDirChange(ridl_changewdir); // TODO: will need to use something like this to fix ticket #1, but this // will crash now; this specifies a routine that will be called when // IDL needs to do a readline (as in RIDL_STOPTEST) IDL_UicbRegRlineFromKbrd(ridl_readline_callback); ridl_handleswitches(argc, argv, 0); ridl_cmdnumber = ridl_initialize_history() + 1; if (!(msg_block = IDL_MessageDefineBlock("RIDL_MSG_BLOCK", IDL_CARRAY_ELTS(msg_arr), msg_arr))) return(1); IDL_GetUserInfo(&user_info); ridl_changewdir(user_info.wd); IDL_ExecuteStr("!prompt = !prompt"); // triggers prompt to be set IDL_ExecuteStr("!path = filepath('', subdir=['share', 'idl'], root=getenv('RIDL_DIR')) + path_sep(/search_path) + !path"); // handle functions called by rIDL (instead of compile_opt strictarr) IDL_ExecuteStr("forward_function ridl_class_hierarchy_helper, ridl_cmp_version, ridl_getfields, ridl_getmethods, ridl_getroutines, ridl_getuserroutines, ridl_launcheditor, ridl_preflocation"); rl_readline_name = "rIDL"; ridl_completion_init(); rl_attempted_completion_function = ridl_completion; ridl_get_userdefinedroutines_list(); IDL_UicbRegPathChange(ridl_changepath); ridl_read_preferences(); // load -pref filename if present on the command line if (preferences_file_set) { // TODO: make this work (doing a PREF_SET will not change the preferences // values unless COMMIT is set, but doing so will change the user's // preferences file permanently); how to change preferences just for this // session of IDL? //char *pref_set_format = "pref_set, filename='%s'"; //char *pref_set_cmd = (char *)malloc(strlen(pref_set_format) - 2 + strlen(preferences_filename) + 1); //sprintf(pref_set_cmd, pref_set_format, preferences_filename); //int error = IDL_ExecuteStr(pref_set_cmd); //free(pref_set_cmd); } // handle -rt or -em options if one of them was present on the command line if (runtime_exec) { int error = IDL_RuntimeExec(runtime_filename); return(IDL_Cleanup(IDL_FALSE)); } // handle -e option if it was present on the command line if (execute_cmd) { int error = IDL_ExecuteStr(cmd); return(IDL_Cleanup(IDL_FALSE)); } // execute batch file if present on the command line if (execute_batch_file) { ridl_execute_batch_file(batch_file); } ridl_updateprompt(); rl_event_hook = ridl_event_hook; // bind these commands to keys in an Readline configuration file, i.e., // like ~/.inputrc (an example inputrc is given in the src/ directory of the // distribution) int f; for (f = 0; f < N_FUNMAP_FUNCTIONS; f++) { rl_add_funmap_entry(funmap_function_names[f], funmap_functions[f]); } while (1) { char *line = ridl_readline(); ridl_getevents(); int error = ridl_executeline(line, 1); free(line); } return(EXIT_FAILURE); }
extern "C" int IDL_Load(void) { if (!(bam_cxc_msg_block = IDL_MessageDefineBlock("BAM_CXC", ARRLEN(bam_cxc_msg_arr), bam_cxc_msg_arr))) { return IDL_FALSE; } return IDL_SysRtnAdd(idl_bam_cxc_functions, TRUE, IDL_CARRAY_ELTS(idl_bam_cxc_functions)); }