home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / external / rpc / idl_rpc_obsolete.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-08  |  4.7 KB  |  130 lines

  1. /*
  2.  *    $Id: idl_rpc_obsolete.h,v 1.2 1997/01/29 23:24:49 kirk Exp $
  3.  */
  4.  
  5. /*
  6.   Copyright (c) 1992-1997, Research Systems Inc.  All rights reserved.
  7.   This software includes information which is proprietary to and a
  8.   trade secret of Research Systems, Inc.  It is not to be disclosed
  9.   to anyone outside of this organization. Reproduction by any means
  10.   whatsoever is  prohibited without express written permission.
  11.   */
  12.  
  13. /*
  14.  * If we are a client, define name lenght macros
  15.  */
  16.  
  17. #ifndef MAXIDLEN
  18. #define MAXIDLEN     128
  19. #endif
  20.  
  21. /*              Biggest string we can XDR                       */
  22.  
  23. #define         MAX_STRING_LEN          512
  24.  
  25. /*              Version/portmapper id                           */
  26.  
  27. #define         IDL_DEFAULT_ID          0x2010CAFE
  28. #define         IDL_DEFAULT_VERSION     1
  29.  
  30. /*              Server requests available                       */
  31.  
  32. #define         OLDGET_VARIABLE         1
  33. #define         OLDSET_VARIABLE         2
  34. #define         RUN_COMMAND             3
  35. #define         FORCED_EXIT             4
  36. #define        RUN_INTERACTIVE        5
  37. #define         GET_VARIABLE            8
  38. #define         SET_VARIABLE            9
  39.  
  40. /*      Data Extraction Macros                                  */
  41.  
  42. #define         VarIsArray(v)           ((v)->Variable->flags & IDL_V_ARR)
  43. #define         GetVarType(v)           ((v)->Variable->type)
  44. #define         GetVarByte(v)           ((v)->Variable->value.c)
  45. #define         GetVarInt(v)            ((v)->Variable->value.i)
  46. #define         GetVarLong(v)           ((v)->Variable->value.l)
  47. #define         GetVarFloat(v)          ((v)->Variable->value.f)
  48. #define         GetVarDouble(v)         ((v)->Variable->value.d)
  49. #define         GetVarComplex(v)        ((v)->Variable->value.cmp)
  50. #define         GetVarDComplex(v)        ((v)->Variable->value.dcmp)
  51. #define         GetVarString(v)         STRING_STR((v)->Variable->value.str)
  52.  
  53. #define         GetArrayData(v)         (v)->Variable->value.arr->data
  54. #define         GetArrayNumDims(v)      (v)->Variable->value.arr->n_dim
  55. #define         GetArrayDimensions(v)   (v)->Variable->value.arr->dim
  56.  
  57.  
  58. /* 
  59.  * Define a variable name that can be used to variable type conversions
  60.  */
  61.  
  62. #define IDL_RPC_CON_VAR "_THIS$VARIABLE$IS$FOR$RPC$VARIABLE$CONVERSION$ONLY_"
  63.  
  64. /*      XDR structure used to transfer a variable                       */
  65.  
  66. typedef struct _VARINFO {
  67.  
  68.     char        Name[MAXIDLEN+1];    /* Variable name in IDL         */
  69.     IDL_VPTR        Variable;        /* IDL internal definition      */
  70.     IDL_LONG        Length;    /* Array length (0 for dynamic, */
  71.                     /* sizeof(data) for statics     */
  72. } varinfo_t;
  73.  
  74. /************************************************************************/
  75. /*      IDL RPC interface routines                                      */
  76. /************************************************************************/
  77.  
  78. publish  CLIENT *register_idl_client IDL_ARG_PROTO((IDL_LONG server_id,
  79.                            char *hostname,
  80.                            struct timeval *timeout));
  81. publish  void unregister_idl_client IDL_ARG_PROTO((CLIENT *client));
  82. publish  int  kill_server IDL_ARG_PROTO((CLIENT *client));
  83. publish  int  set_idl_timeout IDL_ARG_PROTO((struct timeval *timeout));
  84. publish  int  send_idl_command IDL_ARG_PROTO((CLIENT* client, char* cmd));
  85. publish  void free_idl_var IDL_ARG_PROTO((varinfo_t* var ));
  86. publish  int  set_idl_variable IDL_ARG_PROTO((CLIENT* client, varinfo_t* var));
  87. publish  int  get_idl_variable IDL_ARG_PROTO((CLIENT* client,
  88.                          char* name,
  89.                          varinfo_t* var,
  90.                          int typecode));
  91.  
  92. /************************************************************************/
  93. /*      Helper function declarations                                    */
  94. /************************************************************************/
  95.  
  96. publish  int     v_make_byte IDL_ARG_PROTO((varinfo_t* var,
  97.                        char* name,
  98.                        unsigned int c));
  99. publish  int     v_make_int IDL_ARG_PROTO((varinfo_t* var,
  100.                       char* name,
  101.                       int i));
  102. publish  int     v_make_long IDL_ARG_PROTO((varinfo_t* var,
  103.                        char* name,
  104.                        IDL_LONG l));
  105. publish  int     v_make_float IDL_ARG_PROTO((varinfo_t* var,
  106.                         char* name,
  107.                         double f));
  108. publish  int     v_make_double IDL_ARG_PROTO((varinfo_t* var,
  109.                          char* name,
  110.                          double d));
  111. publish  int     v_make_complex IDL_ARG_PROTO((varinfo_t* var,
  112.                           char* name,
  113.                           double real, double imag));
  114. publish  int     v_make_dcomplex IDL_ARG_PROTO((varinfo_t* var,
  115.                           char* name,
  116.                           double real, double imag));
  117. publish  int     v_make_string IDL_ARG_PROTO((varinfo_t* var,
  118.                          char* name,
  119.                          char* s));
  120. publish  int     v_fill_array IDL_ARG_PROTO((varinfo_t* var,
  121.                         char* name, int type,
  122.                         int ndims, IDL_LONG dims[],
  123.                         UCHAR* data,IDL_LONG data_length));
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.