gridsolve_module.c

Go to the documentation of this file.
00001 
00006 /* $Id: gridsolve_module.c,v 1.4 2007/03/09 19:35:19 seymour Exp $ */
00007 /* $UTK_Copyright: $ */
00008 
00009 #include <stdio.h>
00010 #include "idl_export.h"
00011 #include "idl_request.h"
00012 
00013 /* IDL Function prototypes */
00014 IDL_VPTR 
00015   gs_call(int argc, IDL_VPTR* argv),
00016   gs_call_async(int argc, IDL_VPTR* argv),
00017   gs_probe(int argc, IDL_VPTR* argv),
00018   gs_cancel(int argc, IDL_VPTR* argv),
00019   gs_wait(int argc, IDL_VPTR* argv),
00020   gs_error_string(int argc, IDL_VPTR* argv),
00021   gs_get_last_error(int argc, IDL_VPTR* argv);
00022 
00023 /* IDL Procedure prototypes */
00024 void
00025   gridsolve(int argc, IDL_VPTR* argv),
00026   gs_info(int argc, IDL_VPTR* argv),
00027   gs_requests(int argc, IDL_VPTR* argv);
00028 
00035 int
00036 IDL_Load(void)
00037 {
00038   /* Definitions of GridSolve functions */
00039   static IDL_SYSFUN_DEF2 function_addr[] = {
00040     {{gs_call},            "GS_CALL",             1, IDL_MAXPARAMS, 0, 0},
00041     {{gs_call_async},      "GS_CALL_ASYNC",       1, IDL_MAXPARAMS, 0, 0},
00042     {{gs_probe},           "GS_PROBE",            1,             1, 0, 0},
00043     {{gs_cancel},          "GS_CANCEL",           1,             1, 0, 0},
00044     {{gs_wait},            "GS_WAIT",             1,             1, 0, 0},
00045     {{gs_error_string},    "GS_ERROR_STRING",     1,             1, 0, 0},
00046     {{gs_get_last_error},  "GS_GET_LAST_ERROR",   0,             0, 0, 0}
00047   };
00048 
00049   /* Definitions of GridSolve procedures */
00050   static IDL_SYSFUN_DEF2 procedure_addr[] = {
00051     {{(IDL_SYSRTN_GENERIC)gridsolve},   "GRIDSOLVE",   0, 0, 0, 0},
00052     {{(IDL_SYSRTN_GENERIC)gs_info},     "GS_INFO",     1, 1, 0, 0},
00053     {{(IDL_SYSRTN_GENERIC)gs_requests}, "GS_REQUESTS", 0, 1, 0, 0}
00054   };
00055 
00056   /* Register all GridSolve functions and procedures */
00057   if(!IDL_SysRtnAdd(function_addr, TRUE, IDL_CARRAY_ELTS(function_addr)) ||
00058      !IDL_SysRtnAdd(procedure_addr, FALSE, IDL_CARRAY_ELTS(procedure_addr)))
00059   {
00060     IDL_Message(IDL_M_GENERIC, IDL_MSG_RET, "Error adding GridSolve functions!");
00061     return FALSE;
00062   }
00063 
00064   /* Initialize the request structures. */
00065   gs_init_req();
00066 
00067   return TRUE;
00068 }