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

  1. /* export.h */
  2.  
  3.  
  4. /*
  5.  *  Copyright (c) 1992-20, Research Systems Inc.  All rights reserved.
  6.  *  Reproduction by any means whatsoever is prohibited without express
  7.  *  written permission.
  8. */
  9.  
  10. #ifndef export_IDL_DEF
  11. #define export_IDL_DEF
  12.  
  13. #ifdef __cplusplus
  14.     extern "C" {
  15. #endif
  16.  
  17.  
  18. /***** Definitions from msg_code *****/
  19.  
  20. #ifndef msg_code_IDL_DEF
  21. #define msg_code_IDL_DEF
  22.  
  23. /* Warning: These codes can change between releases. */
  24.  
  25. #define IDL_M_GENERIC                    -1
  26. #define IDL_M_NAMED_GENERIC              -2
  27. #define IDL_M_SYSERR                     -4
  28. #define IDL_M_NOSUPPORT                  -5
  29. #define IDL_M_NOPROCSUPPORT              -6
  30. #define IDL_M_UNDEFVAR                   -154
  31. #define IDL_M_NOTARRAY                   -155
  32. #define IDL_M_NOTSCALAR                  -156
  33. #define IDL_M_NOEXPR                     -157
  34. #define IDL_M_NOCONST                    -158
  35. #define IDL_M_NOFILE                     -159
  36. #define IDL_M_NOCOMPLEX                  -162
  37. #define IDL_M_NOSTRING                   -163
  38. #define IDL_M_NOSTRUCT                   -164
  39. #define IDL_M_REQSTR                     -165
  40. #define IDL_M_STRUC_REQ                  -187
  41. #define IDL_M_REQPTR                     -569
  42. #define IDL_M_REQOBJREF                  -570
  43.  
  44. #endif                         /* msg_code_IDL_DEF */
  45.  
  46.  
  47.  
  48.  
  49. /***** Definitions from config *****/
  50.  
  51. #ifndef config_IDL_DEF
  52. #define config_IDL_DEF
  53.  
  54. #ifndef IDL_DEBUGGING
  55. #define IDL_DEBUGGING 1
  56. #endif
  57.  
  58.  
  59. #ifdef sun
  60. #ifdef SUN_OS_4_1
  61. #define SUN_BSD
  62. #else                /* SunOS 5.0 and later is SVR4 based */
  63. #define SUN_SYSV
  64. #ifdef sparc
  65. #define SUN_SYSV_SPARC
  66. #else
  67. #define SUN_SYSV_X86
  68. #endif
  69. #endif
  70. #endif                /* sun */
  71.  
  72. #ifdef vms
  73. #ifdef vax
  74. #define VAX_VMS
  75. #else                /* vax */
  76. #define ALPHA_VMS
  77. #endif                /* vax */
  78. #endif                /* vms */
  79.  
  80. #if defined(__alpha) && defined(__osf__)
  81. #define ALPHA_OSF
  82. #endif
  83.  
  84. /*
  85.  * Proper ANSI C doesn't allow pre-defined cpp macros that don't start
  86.  * with an underscore. Explictly define the ones we use.
  87.  */
  88. #if !defined(unix) && (defined(__unix__) || defined(__unix) || defined(_AIX))
  89. #define unix
  90. #endif
  91. #if defined(__hpux) && !defined(hpux)
  92. #define hpux
  93. #endif
  94. #if defined(__hp9000s300) && !defined(hp9000s300)
  95. #define hp9000s300
  96. #endif
  97. #if defined(__hp9000s800) && !defined(hp9000s800)
  98. #define hp9000s800
  99. #endif
  100.  
  101.  
  102.  
  103. /*
  104.  * In IDL terms, a longword is 32 bits. By using this typedef in place
  105.  * of the standard C "long", we can handle systems where this assumption
  106.  * does not hold.
  107.  */
  108. #ifdef ALPHA_OSF
  109. #define LONG_NOT_32        /* Can be used to configure code */
  110. #endif
  111.  
  112.  
  113. /*
  114.  * IDL is built with ANSI C on all platforms. However, there are
  115.  * still a few K&R compilers out there. If you are using such a
  116.  * compiler, define the preprocessor symbol IDL_CC_NOT_ANSI before
  117.  * including this header file.
  118.  *
  119.  * The following macro will suppress argument prototypes in function
  120.  * declarations allowing them to compile with a K&R compiler. Please be
  121.  * aware, however, that the actual functions were compiled with an ANSI
  122.  * compiler with full prototypes, so the default K&R type promotion rules
  123.  * will cause runtime errors if you pass char, short, or float arguments.
  124.  * K&R C widens these to int or double, but the actual routines expect
  125.  * the un-widened types. Routines with these argument types should not
  126.  * be called from K&R compiled code.
  127.  */
  128. #ifdef IDL_CC_NOT_ANSI
  129. #define IDL_ARG_PROTO(args) ()
  130. #else
  131. #define IDL_ARG_PROTO(args) args
  132. #endif
  133.  
  134.  
  135. #ifdef FALSE
  136. #undef FALSE
  137. #endif
  138. #define FALSE   (0)
  139.  
  140. #ifdef TRUE
  141. #undef TRUE
  142. #endif
  143. #define TRUE    (1)
  144.  
  145. /*
  146.  * The following definitions are to be used in all modules. They
  147.  * are used by cx to generate .x files. publish is used for functions that
  148.  * are used outside a module, but which are RSI private. export is used
  149.  * for functions that people outside of RSI can use.
  150. */
  151.  
  152. #define publish            /* publish is C default file scope */
  153. #define export            /* Useable outside of RSI */
  154.  
  155. /*
  156.  * Some platforms support tty based user interaction (Unix, VMS)
  157.  * while others (Macintosh, Windows) don't. On those that don't, we
  158.  * want to avoid compiling code that will never be called.
  159.  * This symbol is defined on those systems that support ttys.
  160.  */
  161. #if defined(unix) || defined(VMS)
  162. #define IDL_OS_HAS_TTYS
  163. #endif
  164.  
  165.  
  166. #if (IDL_DEBUGGING < 2) && !defined(__convex__) && !defined(_UNICOS)
  167. #define IDL_REGISTER register    /* Use explicit register declarations */
  168. #else
  169. #define IDL_REGISTER
  170. #endif
  171.  
  172.  
  173. /**** Maximum # of array dimensions ****/
  174. #define IDL_MAX_ARRAY_DIM 8
  175.  
  176. /**** Maximum # of params allowed in a call ****
  177.   NEVER make this > 127.  */
  178. #define IDL_MAXPARAMS 64
  179.  
  180. /**** Longest allowed file path specification ****/
  181. #if defined(MAC) || defined(WIN32)
  182. #define IDL_MAXPATH 255
  183. #endif
  184. #ifdef unix
  185. #define IDL_MAXPATH    1024        /* That's what BSD allows */
  186. #endif
  187. #ifdef VMS
  188. #define IDL_MAXPATH    264
  189. #endif
  190.  
  191.  
  192.  
  193. #endif                /* config_IDL_DEF */
  194.  
  195.  
  196.  
  197.  
  198. /***** Definitions from defs *****/
  199.  
  200. #ifndef defs_IDL_DEF
  201. #define defs_IDL_DEF
  202.  
  203. #if !defined(WIN32) || !defined(PLTYPES)
  204. typedef unsigned char UCHAR;    /* Unsigned character type */
  205. #endif
  206.  
  207. /* Boolean. */ 
  208. typedef enum {
  209.     IDL_FALSE = 0,
  210.     IDL_TRUE = 1
  211. } IDLBool_t;
  212.  
  213. /*
  214.  * In IDL terms, a longword is 32 bits. By using this typedef in place
  215.  * of the standard C "long", we can handle systems where this assumption
  216.  * does not hold.
  217.  */
  218. #ifdef LONG_NOT_32
  219. typedef int IDL_LONG;
  220. typedef unsigned int IDL_ULONG;
  221. #else
  222. typedef long IDL_LONG;
  223. typedef unsigned long IDL_ULONG;
  224. #endif
  225.  
  226. /* Type used for pointer and object reference variables is same as IDL_LONG */
  227. typedef IDL_ULONG IDL_HVID;
  228.  
  229.  
  230. /*
  231.  * Define IDL_VARIABLE type values - Note that IDL_TYP_UNDEF is always 0 by
  232.  * definition. It is correct to use the value 0 in place of IDL_TYP_UNDEF.
  233.  * It is not correct to assume the value assigned to any other
  234.  * type - the preprocessor definitions below must be used.
  235.  */
  236.  
  237. #define IDL_TYP_UNDEF        0
  238. #define IDL_TYP_BYTE            1
  239. #define IDL_TYP_INT             2
  240. #define IDL_TYP_LONG            3
  241. #define IDL_TYP_FLOAT           4
  242. #define IDL_TYP_DOUBLE          5
  243. #define IDL_TYP_COMPLEX         6
  244. #define IDL_TYP_STRING          7
  245. #define IDL_TYP_STRUCT          8
  246. #define IDL_TYP_DCOMPLEX        9
  247. #define IDL_TYP_PTR        10
  248. #define IDL_TYP_OBJREF        11
  249.  
  250. #define IDL_MAX_TYPE            11
  251. #define IDL_NUM_TYPES           12
  252.  
  253.  
  254.  
  255.  
  256. /*
  257.  * The above type codes each have a bit mask value associated with
  258.  * them. The bit mask value is computed as (2**Type_code), but the
  259.  * following definitions can also be used. Some routines request the
  260.  * bit mask value instead of the type code value.
  261. */
  262. #define IDL_TYP_B_SIMPLE            767
  263. #define IDL_TYP_B_ALL               4095
  264.  
  265. /* This macro turns it's argument into its bit mask equivalent.
  266.  * The argument type_code should be one of the type codes defined
  267.  * above.
  268. */ 
  269. #define IDL_TYP_MASK(dim_code)      (1 << dim_code)
  270.  
  271.  
  272.  
  273. /***** IDL_VARIABLE flag values ********/
  274.  
  275. #define IDL_V_CONST         1
  276. #define IDL_V_TEMP          2
  277. #define IDL_V_ARR           4
  278. #define IDL_V_FILE          8
  279. #define IDL_V_DYNAMIC       16
  280. #define IDL_V_STRUCT        32
  281. #define IDL_V_NOT_SCALAR    (IDL_V_ARR | IDL_V_FILE | IDL_V_STRUCT)
  282.  
  283. /**** IDL_ARRAY flag values ****/
  284. #define IDL_A_FILE          1    /* Array is a FILE variable (ASSOC) */
  285. #define IDL_A_NO_GUARD      2    /* Indicates no data guards for array */
  286.  
  287.  
  288. /**** Basic IDL structures: ****/
  289.  
  290. typedef struct {
  291.   float r,i;
  292. } IDL_COMPLEX;
  293.  
  294. typedef struct {
  295.   double r,i;
  296. } IDL_DCOMPLEX;
  297.  
  298. typedef struct {        /* Define string descriptor */
  299.   unsigned short slen;        /* Length of string, 0 for null */
  300.   short stype;            /* type of string, static or dynamic */
  301.   char *s;            /* Addr of string */
  302. } IDL_STRING;
  303.  
  304.  
  305. /**** IDL identifiers ****/
  306. typedef struct _idl_ident {
  307.   struct _idl_ident *hash;    /* Must be the first field */
  308.   char *name;                   /* Identifier text (NULL terminated */
  309.   int len;            /* # of characters in id, not counting NULL
  310.                    termination. */
  311. } IDL_IDENT;
  312.  
  313.  
  314. /*
  315.  * Type of the free_cb field of IDL_ARRAY. When IDL deletes a variable and
  316.  * the free_cb field of ARRAY non-NULL, IDL calls the function that field
  317.  * references, passing the value of the data field as it's sole argument.
  318.  * The primary use for this notification is to let programs know when
  319.  * to clean up after calls to IDL_ImportArray(), which is used to create
  320.  * arrays using memory that IDL does not allocate.
  321.  */
  322.  
  323. typedef void (* IDL_ARRAY_FREE_CB) IDL_ARG_PROTO((UCHAR *));
  324.  
  325. typedef struct {        /* Its important that this block
  326.                    be an integer number of longwords
  327.                    in length to ensure that array
  328.                    data is longword aligned.  */
  329.   IDL_LONG elt_len;        /* Length of element in char units */
  330.   IDL_LONG arr_len;        /* Length of entire array (char) */
  331.   IDL_LONG n_elts;        /* total # of elements */
  332.   UCHAR *data;            /* ^ to beginning of array data */
  333.   UCHAR n_dim;            /* # of dimensions used by array */
  334.   UCHAR flags;            /* Array block flags */
  335.   short file_unit;        /* # of assoc file if file var */
  336.   IDL_LONG dim[IDL_MAX_ARRAY_DIM];   /* dimensions */
  337.   IDL_ARRAY_FREE_CB free_cb;    /* Free callback */
  338.   IDL_LONG data_guard;        /* Guard longword */
  339. } IDL_ARRAY;
  340.  
  341. typedef struct {        /* Reference to a structure */
  342.   IDL_ARRAY *arr;        /* ^ to array block containing data */
  343.   struct _idl_structure *sdef;    /* ^ to structure definition */
  344. } IDL_SREF;
  345.  
  346. /* IDL_ALLTYPES can be used to represent all IDL_VARIABLE types */
  347. typedef union {
  348.   char sc;            /* A standard char, where "standard" is defined
  349.                    by the compiler. This isn't an IDL data
  350.                    type, but having this field is sometimes
  351.                    useful for internal code */
  352.   UCHAR c;            /* Byte value */
  353.   short i;            /* Integer short value */
  354.   IDL_LONG l;            /* Long value */
  355.   float f;            /* Floating value */
  356.   double d;            /* Double value */
  357.   IDL_COMPLEX cmp;        /* Complex value */
  358.   IDL_DCOMPLEX dcmp;        /* Double complex value */
  359.   IDL_STRING str;        /* String descriptor */
  360.   IDL_ARRAY *arr;        /* ^ to array descriptor */
  361.   IDL_SREF s;            /* Descriptor of structure */
  362.   IDL_HVID hvid;        /* Heap variable identifier */
  363. } IDL_ALLTYPES;
  364.  
  365. typedef struct {        /* IDL_VARIABLE definition */
  366.   UCHAR type;            /* Type byte */
  367.   UCHAR flags;            /* Flags byte */
  368.   IDL_ALLTYPES value;
  369. } IDL_VARIABLE;
  370. typedef IDL_VARIABLE *IDL_VPTR;
  371.  
  372. typedef void (* IDL_PRO_PTR)();    /* ^ to interpreter procedure (ret is void) */
  373.                 /* ^ to interp. function (ret ^ to VAR) */
  374. typedef IDL_VARIABLE *(* IDL_FUN_RET)();
  375.  
  376. /* Possible values for the flags field of IDL_SYSFUN_DEF */
  377. #define IDL_SYSFUN_DEF_F_OBSOLETE    1   /* Routine is obsolete */
  378. #define IDL_SYSFUN_DEF_F_KEYWORDS    2   /* Routine accepts keywords */
  379. #define IDL_SYSFUN_DEF_F_XSTUDENT    4   /* Routine not allowed in
  380.                            Student edition */
  381.  
  382. /* This structure defines the format of a system procedure
  383.    or function table entry. */
  384. typedef struct {        /* System function definition */
  385.   IDL_FUN_RET funct_addr;    /* Address of function, or procedure.  */
  386.   char *name;            /* The name of the function */
  387.   UCHAR arg_min;        /* Minimum allowed argument count. */
  388.   UCHAR arg_max;        /* Maximum argument count.  The top
  389.                    bit in arg_min is set to indicate that
  390.                    the routine accepts keywords. */
  391.   UCHAR flags;            /* IDL_SYSFUN_DEF_F_* flags */
  392. } IDL_SYSFUN_DEF;
  393.  
  394. /*
  395.  * Setting the top bit in the arg_min field of an IDL_SYSFUN_DEF passed to
  396.  * IDL_AddSystemRoutine() is equivalent to the setting the
  397.  * IDL_SYSFUNDEF_F_KEYWORDS bit in the flags field. This is strictly for
  398.  * backwards compatability. Direct use of the flags field is preferred.
  399.  */
  400. #define IDL_KW_ARGS 128        /* Bit set in argmin indicating kw's allowed */
  401.  
  402.  
  403. /*
  404.  * Type of pointer to an IDL structure definition. This is an opaque type
  405.  * not to be directly referenced.
  406.  */
  407. typedef void *IDL_StructDefPtr;
  408.  
  409. #endif                /* defs_IDL_DEF */
  410.  
  411.  
  412.  
  413.  
  414. /***** Definitions from message *****/
  415.  
  416. #ifndef message_IDL_DEF
  417. #define message_IDL_DEF
  418.  
  419. /*
  420.  * action parameter to message is composed of two parts. These two masks
  421.  * are used to separate them out.
  422.  */
  423. #define IDL_MSG_ACTION_CODE    0x0000ffff
  424. #define IDL_MSG_ACTION_ATTR    0xffff0000
  425.  
  426. /* Allowed codes for action parameter to IDL_Message() */
  427. #define IDL_MSG_RET        0   /* Return to caller */
  428. #define IDL_MSG_EXIT        1   /* Terminate process via exit(3) */
  429. #define IDL_MSG_LONGJMP        2   /* General error. Obey the error handling
  430.                    established by the ON_ERROR user
  431.                    procedure. */
  432. #define IDL_MSG_IO_LONGJMP  3   /* I/O error. Obey the error handling
  433.                    established by the ON_IOERROR user
  434.                    procedure. */
  435. #define IDL_MSG_INFO        4   /* Informational. Like IDL_MSG_RET, but won't
  436.                    set !ERR or !ERR_STRING. Also,
  437.                    inhibited by !QUIET */
  438.  
  439.  
  440. /* Allowed attribute masks that can be OR'd into the action code */
  441. #define IDL_MSG_ATTR_NOPRINT  0x00010000   /* Suppress the printing of
  442.                           the error text to stderr,
  443.                           but do everything else in
  444.                           the normal way. */
  445. #define IDL_MSG_ATTR_MORE  0x00020000   /* Use IDL_more() instead of printf(3S)
  446.                        to output the message. The calling
  447.                        routine must worry about calling
  448.                        IDL_more_reset(). A side effect of
  449.                        this is that the message goes to the
  450.                        file named in IDL_more_reset(), not
  451.                        necessarily stderr. */
  452. #define IDL_MSG_ATTR_NOPREFIX  0x00040000   /* Don't output the normal
  453.                            message (from !MSG_PREFIX),
  454.                            just the message text. */
  455. #define IDL_MSG_ATTR_QUIET     0x00080000   /* If the message would normally
  456.                            be printed and !QUIET is
  457.                            non-zero, the printing
  458.                            is suppressed. Everything
  459.                            else is updated as expected. */
  460. #define IDL_MSG_ATTR_NOTRACE   0x00100000   /* Suppress traceback message */
  461. #define IDL_MSG_ATTR_BELL      0x00200000   /* Ring the bell */
  462. #define IDL_MSG_ATTR_SYS       0x00400000   /* IDL_Message() only: Include
  463.                            system supplied error message,
  464.                            via errno or whatever source
  465.                            is appropriate for the
  466.                            current platform. */
  467.  
  468. #endif                /* message_IDL_DEF */
  469.  
  470.  
  471.  
  472.  
  473. /***** Definitions from macros *****/
  474.  
  475. #ifndef macros_IDL_DEF
  476. #define macros_IDL_DEF
  477.  
  478. /* General math macros */
  479. #define IDL_MIN(x,y) (((x) < (y)) ? (x) : (y))
  480. #define IDL_MAX(x,y) (((x) > (y)) ? (x) : (y))
  481. #define IDL_ABS(x) (((x) >= 0) ? (x) : -(x))
  482.  
  483. /* Return x in the range of min <= x <= max */
  484. #define IDL_CLIP_TO_RANGE(x, min, max) \
  485.   ((x) < (min) ? (min) : ((x) > (max) ? (max) : (x)))
  486.  
  487. /* Round x up modulo m. m must be a power of 2 : */
  488. #define IDL_ROUND_UP(x,m) \
  489.   (((x) + (m-1)) & (~(m-1)))
  490.  
  491. /**** Cast a pointer to (char *) ****/
  492. #define IDL_CHAR(x) ((char *) x)
  493.  
  494. /**** Take the address of a variable and cast to a desired type ****/
  495. #define IDL_CHARA(x) ((char *) &(x))
  496. #define IDL_UCHARA(x) ((UCHAR *) &(x))
  497. #define IDL_SHORTA(x) ((short *) &(x))
  498. #define IDL_INTA(x) ((int *) &(x))
  499. #define IDL_LONGA(x) ((IDL_LONG *) &(x))
  500.  
  501. /**** Get pointer to a valid string from an IDL_STRING descriptor */
  502. #define IDL_STRING_STR(desc) ((desc)->slen ? (desc)->s : "")
  503.  
  504. #define IDL_DELTMP(v) { if ((v->flags) & IDL_V_TEMP) IDL_Deltmp(v); }
  505.  
  506. #define IDL_EXCLUDE_UNDEF(v) { if (!v->type) \
  507.     IDL_MessageVarError(IDL_M_UNDEFVAR, v, IDL_MSG_LONGJMP); }
  508. #define IDL_EXCLUDE_CONST(v)        { if (v->flags & IDL_V_CONST) \
  509.     IDL_MessageVarError(IDL_M_NOCONST, v, IDL_MSG_LONGJMP); }
  510. #define IDL_EXCLUDE_EXPR(v)  { if (v->flags & (IDL_V_CONST | IDL_V_TEMP)) \
  511.     IDL_MessageVarError(IDL_M_NOEXPR, v, IDL_MSG_LONGJMP); }
  512. #define IDL_EXCLUDE_FILE(v) { if (v->flags & IDL_V_FILE) \
  513.     IDL_MessageVarError(IDL_M_NOFILE, v, IDL_MSG_LONGJMP); }
  514. #define IDL_EXCLUDE_STRUCT(v)       { if (v->flags & IDL_V_STRUCT) \
  515.     IDL_MessageVarError(IDL_M_NOSTRUCT, v, IDL_MSG_LONGJMP); }
  516. #define IDL_EXCLUDE_FILE_OR_STRUCT(v) {if(v->flags &(IDL_V_FILE|IDL_V_STRUCT))\
  517.     IDL_VarExclude(v, IDL_TYP_MASK(TYP_STRUCT), FALSE, FALSE, TRUE);}
  518. #define IDL_EXCLUDE_COMPLEX(v)      { if ((v->type == IDL_TYP_COMPLEX) \
  519.                       || (v->type == IDL_TYP_DCOMPLEX)) \
  520.     IDL_MessageVarError(IDL_M_NOCOMPLEX, v, IDL_MSG_LONGJMP); }
  521. #define IDL_EXCLUDE_STRING(v)       { if (v->type == IDL_TYP_STRING)  \
  522.     IDL_MessageVarError(IDL_M_NOSTRING, v, IDL_MSG_LONGJMP); }
  523. #define IDL_EXCLUDE_SCALAR(v) { if (!(v->flags & IDL_V_NOT_SCALAR)) \
  524.     IDL_MessageVarError(M_NOSCALAR, v, IDL_MSG_LONGJMP);}
  525.  
  526.  
  527. /**** Ensure that variables possess certain attributes ****/
  528. #define IDL_ENSURE_ARRAY(v) { if (!(v->flags & IDL_V_ARR)) \
  529.     IDL_MessageVarError(IDL_M_NOTARRAY, v, IDL_MSG_LONGJMP); }
  530. #define IDL_ENSURE_SCALAR(v) { if (v->flags & IDL_V_NOT_SCALAR) \
  531.     IDL_MessageVarError(IDL_M_NOTSCALAR, v, IDL_MSG_LONGJMP);}
  532. #define IDL_ENSURE_STRING(v) { if (v->type != IDL_TYP_STRING)  \
  533.     IDL_MessageVarError(IDL_M_REQSTR, v, IDL_MSG_LONGJMP);}
  534. #ifndef IDL_ENSURE_SIMPLE
  535. #define IDL_ENSURE_SIMPLE(v) IDL_VarEnsureSimple(v)
  536. #endif
  537. #define IDL_ENSURE_STRUCTURE(v) { if (!(v->flags & IDL_V_STRUCT)) \
  538.     IDL_MessageVarError(IDL_M_STRUC_REQ, v, IDL_MSG_LONGJMP);}
  539. #define IDL_ENSURE_PTR(v) { if (v->type != IDL_TYP_PTR)  \
  540.     IDL_MessageVarError(IDL_M_REQPTR, v, IDL_MSG_LONGJMP);}
  541. #define IDL_ENSURE_OBJREF(v) { if (v->type != IDL_TYP_OBJREF)  \
  542.     IDL_MessageVarError(IDL_M_REQOBJREF, v, IDL_MSG_LONGJMP);}
  543.  
  544.  
  545.      /* Check if var has a dynamic part. If so, delete it using IDL_Delvar  */
  546. #define IDL_DELVAR(v) { if (((v)->flags) & IDL_V_DYNAMIC) IDL_Delvar(v); }
  547.  
  548.  
  549. /*
  550.  * For systems that lack the bcopy() routines, mimic them using
  551.  * the memcpy() routines. Under VMS, DEC C will inline these
  552.  * because string.h is included.
  553.  */
  554. #if defined(SUN_SYSV) || !defined(unix)
  555. #include <string.h>
  556. #ifndef bcopy
  557. #define bcopy(src,dest,len)     (memcpy((dest), (src), (len)))
  558. #endif
  559. #ifndef bzero
  560. #define bzero(dest,len)         (memset((dest), 0, (len)))
  561. #endif
  562. #ifndef bcmp
  563. #define bcmp(b1,b2,len)         (memcmp((b1), (b2), (len)))
  564. #endif
  565. #endif
  566.  
  567. #endif                /* macros_IDL_DEF */
  568.  
  569.  
  570.  
  571.  
  572. /***** Definitions from crearr *****/
  573.  
  574. #ifndef crearr_IDL_DEF
  575. #define crearr_IDL_DEF
  576.  
  577. /* The following define the valid values for the init arg to basic_array */
  578. #define IDL_BARR_INI_ZERO   0    /* Zero data area */
  579. #define IDL_BARR_INI_NOP    1    /* Don't do anything to data area */
  580. #define IDL_BARR_INI_INDEX  2    /* Put 1-D index into each elt. */
  581. #define IDL_BARR_INI_TEST   3    /* Test if enough memory is available */
  582.  
  583. #endif                /* crearr_IDL_DEF */
  584.  
  585.  
  586.  
  587.  
  588. /***** Definitions from ez *****/
  589.  
  590. #ifndef ez_IDL_DEF
  591. #define ez_IDL_DEF
  592.  
  593. /* These constants can be ORd together to form the value for the
  594.    access field of IDL_EZ_ARG */
  595. #define IDL_EZ_ACCESS_R     1    /* Arg is readable */
  596. #define IDL_EZ_ACCESS_W     2    /* Arg is writable */
  597. #define IDL_EZ_ACCESS_RW    3    /* Arg is readable and writable */
  598.  
  599.  
  600. /* This macro turns it's argument into a bit mask suitable for
  601.  * the allowed_dims field of IDL_EZ_ARG. The argument dim_code should be
  602.  * 0 for scalar, 1 for 1D, 2 for 2D, etc...
  603.  */ 
  604. #define IDL_EZ_DIM_MASK(dim_code)   (1 << dim_code)
  605.  
  606. /* Define type mask of all numeric types: */
  607. #define IDL_EZ_TYP_NUMERIC \
  608.     ( IDL_TYP_MASK(TYP_INT) | IDL_TYP_MASK(TYP_LONG) \
  609.      | IDL_TYP_MASK(TYP_FLOAT) | IDL_TYP_MASK(TYP_DOUBLE) \
  610.      | IDL_TYP_MASK(TYP_COMPLEX) | IDL_TYP_MASK(TYP_BYTE))
  611.  
  612.  
  613. /* These constants should be used instead of IDL_EZ_DIM_MASK when appropriate */
  614. #define IDL_EZ_DIM_ARRAY    510      /* Allow all but scalar */
  615. #define IDL_EZ_DIM_ANY      511      /* Allow anything */
  616.  
  617.  
  618. /* These constants can be ORd together to form the value for the
  619.    pre field of IDL_EZ_ARG. These actions are taken only if the argument
  620.    has IDL_EZ_ACCESS_R. */
  621. #define IDL_EZ_PRE_SQMATRIX         1    /* Arg must be a square matrix. */
  622. #define IDL_EZ_PRE_TRANSPOSE        2    /* Transpose arg. This only happens
  623.                        with read access. */
  624.  
  625.  
  626. /* These constants can be ORd together to form the value for the
  627.    post field of IDL_EZ_ARG. These actions are taken only if the argument
  628.    has IDL_EZ_ACCESS_W.  If IDL_EZ_POST_WRITEBACK is not present, none of the
  629.    other actions are considered, since that would imply wasted effort. */
  630. #define IDL_EZ_POST_WRITEBACK       1    /* Transfer the contents of
  631.                        uargv to the actual argument. */
  632. #define IDL_EZ_POST_TRANSPOSE       2    /* Transpose uargv prior to writing. */
  633.  
  634.  
  635. /*
  636.  * IDL_EZ_ARG is the definition for the structure used by IDL_EzCall()
  637.  * and IDL_EzCallCleanup() to define the plain arguments being passed
  638.  * to a routine.
  639.  */
  640. typedef struct {
  641.   short allowed_dims;        /* A bit mask that specifies the
  642.                    allowed dimensions. Bit 0 means scalar,
  643.                    bit 1 is 1D, etc. Use the EZ_DIM_* constants
  644.                    defined in this file to specify this
  645.                    value. */
  646.   short allowed_types;        /* This is a bit mask defining the
  647.                    allowed data types for the argument.
  648.                    To convert the TYP_* type codes defined
  649.                    in defs.h to the appropriate bits,
  650.                    use the formula 2**(type_code) or use
  651.                    the TYP_B_* bit masks defined in defs.h
  652.                    NOTE: If you specify a value for convert,
  653.                    its a good idea to specify IDL_TYP_B_ALL or
  654.                    IDL_TYP_B_SIMPLE here. The type conversion
  655.                    will catch any problems and your routine
  656.                    will be more flexible. */
  657.   short access;            /* Some combination of the EZ_ACCESS
  658.                    constants defined above. */
  659.   short convert;        /* If non-zero, the TYP_* type code to
  660.                    which the argument will be converted.
  661.                    A value of zero means that no conversion
  662.                    will be applied. */
  663.   short pre;            /* A bit mask that specifies special purpose
  664.                    processing that should be performed on
  665.                    the variable by IDL_EzCall(). These bits
  666.                    are specified with the IDL_EZ_PRE_*
  667.                    constants. This processing occurs *AFTER*
  668.                    any type conversions specified by
  669.                    convert. */
  670.   short post;            /* A bit mask that specifies special purpose
  671.                    processing that should be performed on
  672.                    the variable by IDL_EzCallCleanup(). These
  673.                    bits are specified with the IDL_EZ_POST_*
  674.                    constants. */
  675.   IDL_VPTR to_delete;        /* RESERVED TO EZ MODULE. DO NOT MAKE
  676.                    USE OF OR CHANGE THIS FIELD. If EZ
  677.                    allocated a temporary variable to satisfy
  678.                    the conversion requirements given by the
  679.                    convert field, the IDL_VPTR to that temp
  680.                    is stashed here by IDL_EzCall for use by
  681.                    IDL_EzCallCleanup(). */
  682.   IDL_VPTR uargv;        /* After calling IDL_EzCall(), uargv contains
  683.                    a pointer to the IDL_VARIABLE which is
  684.                    the argument. */
  685.   IDL_ALLTYPES value;        /* This is a copy of the value field
  686.                    of the variable pointed at by uargv.
  687.                    For scalar variables, it contains the
  688.                    value, for arrays it points at the
  689.                    array block. */
  690. } IDL_EZ_ARG;
  691.  
  692. #endif                /* ez_IDL_DEF */
  693.  
  694.  
  695.  
  696.  
  697. /***** Definitions from graphics *****/
  698.  
  699. #ifndef graphics_IDL_DEF
  700. #define graphics_IDL_DEF
  701.  
  702. /* *** Structure defining current device and parameters: *** */
  703. #define IDL_MAX_TICKN 60    /* Max # of axis annotations */
  704.  
  705. #define IDL_COLOR_MAP_SIZE 256     /* Size of internal color map. */
  706.  
  707. #define IDL_NUM_LINESTYLES 6    /* # of line styles */
  708. #define IDL_X0 0        /* Subscripts of fields for rect structures */
  709. #define IDL_Y0 1
  710. #define IDL_X1 2
  711. #define IDL_Y1 3
  712. #define IDL_Z0 4
  713. #define IDL_Z1 5
  714.  
  715.  
  716. #define IDL_AX_LOG 1        /* Axis type values */
  717. #define IDL_AX_MAP 2        /* Old style maps */
  718. #define IDL_AX_MAP1 3        /* New style maps */
  719.  
  720. #define IDL_AX_EXACT 1        /* Axis style values: */
  721. #define IDL_AX_EXTEND 2
  722. #define IDL_AX_NONE 4
  723. #define IDL_AX_NOBOX 8
  724. #define IDL_AX_NOZERO 16
  725.  
  726. typedef struct {        /* System variable for axis */
  727.   IDL_STRING title;        /* Axis title */
  728.   int type;            /* 0 = normal linear, 1=log. */
  729.   int style;            /* 0 = norm, AX_EXTEND, AX_EXACT, AX_NONE,
  730.                    AX_NOBOX. */
  731.   int nticks;            /* # of ticks, 0=auto, -1 = none */
  732.   float ticklen;        /* Tick length, normalized */
  733.   float thick;            /* Axis thickness */
  734.   float range[2];        /* Min and max of endpoints */
  735.   float crange[2];        /* Current min & max */
  736.   float s[2];            /* Scale factors, screen = data*s[1]+s[0] */
  737.   float margin[2];        /* Margin size, in char units. */
  738.   float omargin[2];        /* Outer margin, in char units */
  739.   float window[2];        /* data WINDOW coords, normal units */
  740.   float region[2];        /* Plot region, normal units */
  741.   float charsize;        /* Size of annotations */
  742.   int minor_ticks;        /* Minor ticks */
  743.   float tickv[IDL_MAX_TICKN];    /* Position of ticks */
  744.   IDL_STRING annot[IDL_MAX_TICKN];   /* Annotation */
  745.   IDL_LONG gridstyle;        /* tick linestyle */
  746.   IDL_STRING format;        /* Axis label format/procedure */
  747.   /* After here, the elements are not accessible to the user via
  748.    the system variables: */
  749.   IDL_VPTR ret_values;        /* Returned tick values */
  750. } IDL_AXIS;
  751.  
  752. /* Define cursor function codes: */
  753.  
  754. #define IDL_CURS_SET 1        /* Set cursor */
  755. #define IDL_CURS_RD  2        /* Read cursor pos */
  756. #define IDL_CURS_RD_WAIT 3    /* Read cursor with wait */
  757. #define IDL_CURS_HIDE 4        /* Disable cursor */
  758. #define IDL_CURS_SHOW 5        /* Display cursor */
  759. #define IDL_CURS_RD_MOVE 6    /* Read & wait for movement or button */
  760. #define IDL_CURS_RD_BUTTON_UP 7      /* Wait for button up transition */
  761. #define IDL_CURS_RD_BUTTON_DOWN 8   /* Wait for button down transition */
  762. #define IDL_CURS_HIDE_ORIGINAL 9   /* Restore cursor to its original shape
  763.                       (window systems) instead of blanking
  764.                       it. */
  765.  
  766. /* Define coordinate system types: */
  767. #define IDL_COORD_DATA 0
  768. #define IDL_COORD_DEVICE 1
  769. #define IDL_COORD_NORMAL 2
  770. #define IDL_COORD_MARGIN 3
  771. #define IDL_COORD_IDEVICE 4
  772.  
  773. #define IDL_PX 0        /* Subscripts for each point member */
  774. #define IDL_PY 1
  775. #define IDL_PZ 2
  776. #define IDL_PH 3
  777.  
  778. typedef union {            /* Describe a point: */
  779.   struct {            /* Discrete point, ref by .x, .y, or .z: */
  780.     float x,y,z,h;        /* Homogenous coordinates */
  781.   } d;
  782.   struct {            /* Integer discrete: */
  783.     int x,y,z,h;
  784.   } i;
  785.   float p[4];            /* Point refered to by [0],[1],... for
  786.                    x, y, etc.*/
  787.   int ip[4];            /* Integer representation, only valid
  788.                    for COORD_IDEVICE. */
  789. } IDL_GR_PT;
  790.  
  791. typedef struct {
  792.     IDL_GR_PT origin;
  793.     IDL_GR_PT size;
  794. } IDL_GR_BOX;
  795.     
  796. typedef struct {        /* Attributes structure for points & lines */
  797.   IDL_ULONG color;        /* Specifys all that can go wrong w/ graphic */
  798.   float thick;
  799.   int linestyle;
  800.   float *t;            /* NULL for no 3d transform, or pointer to
  801.                    4 by 4 matrix. */
  802.   int *clip;            /* NULL for no clipping or ^ to [2][2]
  803.                    clipping rectangle in device coord. */
  804.   IDL_AXIS *ax,*ay,*az;        /* Axis definitions */
  805.   int chl;            /* For devices with multiple channels */
  806. } IDL_ATTR_STRUCT;
  807.  
  808. typedef struct {        /* Graphic text attribute structure.
  809.                    Passed to text routines. */
  810.   int font;            /* 0 for hdw text, -1 for hershey */
  811.   int axes;            /* Text axes, 0 = xy, 1 = xz, 2 =yz,
  812.                    3 = yx, 4 = zx, 5 = zy */
  813.   float size;            /* Text size, 1.0 = normal */
  814.   float orien;            /* Orientation, degrees CCW from normal */
  815.   float align;            /* Justification, 0.0 = left, 1.0 = right,
  816.                    0.5  = centered. */
  817. } IDL_TEXT_STRUCT;
  818.  
  819.  
  820. /* Structure that defines secondary paramenters for imaging */
  821. typedef struct {        /* Imaging attribute structure */
  822.   short xsize_exp;        /* Non-0 if xsize is EXPlictily set by user */
  823.   short ysize_exp;        /* Non-0 if ysize is EXPlictily set by user */
  824.   IDL_LONG xsize, ysize;    /* Requested size of image (dev coords) */
  825.   int chl;            /* Channel */
  826.   int order;            /* Image order - 0 bottom to top */
  827.   /* Three element array giving the stride between colors of the same
  828.      pixel, adjacent pixels of the same color, and rows of the same color.
  829.      color_stride[0] is non-zero for true color. */
  830.   int color_stride[3];
  831.   int image_is_scratch;        /* True if source image is a temp */
  832.   int b_per_pixel;        /* # of bytes/pixel */
  833. } IDL_TV_STRUCT;
  834.  
  835.  
  836.  
  837. typedef struct {        /* Structure defining polygon fills */
  838.   enum {
  839.     POLY_SOLID, POLY_PATTERN, POLY_IMAGE, POLY_GOURAUD, POLY_IMAGE3D
  840.     } fill_type;
  841.   IDL_ATTR_STRUCT *attr;        /* Graphics attribute structure */
  842.   IDL_PRO_PTR routine;        /* Drawing routine to use */
  843.     union {            /* Operation dependent params: */
  844.     struct {            /* Image fill  */
  845.       UCHAR *data;        /* Fill data for image fill */
  846.       int d1, d2;        /* Dimensions of fill data */
  847.       float *im_verts;        /* Image coords of verts */
  848.       float *im_w;        /* Screen vert W coords */
  849.       UCHAR interp;        /* TRUE to interpolate in image space */
  850.       UCHAR transparent;    /* Transparency threshold, 0 for none */
  851.     } image;
  852.     struct {            /* Line-pattern fill: */
  853.       float angle;        /* Fill orientation in degrees */
  854.       int spacing;        /* Line spacing, in device units */
  855.       float ct, st;        /* Cos / sin of rotation */
  856.     } lines;
  857.     int fill_style;        /* Hardware dependent fill style for
  858.                    POLY_SOLID */
  859.   } extra;
  860.   struct {            /* Info used only with Z buffer device */
  861.     float *z;            /* The Z values */
  862.     int *shades;        /* Shading values at verts for POLY_GOURAUD */
  863.   } three;
  864. } IDL_POLYFILL_ATTR;
  865.  
  866.  
  867. typedef struct {        /* Struct containing last mouse status */
  868.   int x,y;            /* X & Y device coordinates */
  869.   int button;            /* Button status bits */
  870.   int time;            /* Time stamp,  not present in all devices */
  871. } IDL_MOUSE_STRUCT;
  872.  
  873. /*
  874.  * IDL_DEVICE_CORE defines the core functions required by every
  875.  * device driver. Most fields can be filled with
  876.  * a NULL indicating the ability dosen't exist. draw and erase are
  877.  * exceptions to this --- If you can't do that much, why bother with a driver?
  878. */
  879. typedef struct {
  880.   void (* draw)(IDL_GR_PT *p0, IDL_GR_PT *p1, IDL_ATTR_STRUCT *a);
  881.   int (* text)(IDL_GR_PT *p, IDL_ATTR_STRUCT *ga, IDL_TEXT_STRUCT *ta,
  882.            char *text);
  883.   void (* erase)(IDL_ATTR_STRUCT *a);    /* erase */
  884.                 /* cursor inquire and set */
  885.   void (* cursor)(int funct, IDL_MOUSE_STRUCT *m);
  886.                 /* Fill irregular polygon */
  887.   void (* polyfill)(int *x, int *y, int n, IDL_POLYFILL_ATTR *poly);
  888.                 /* Returning to interactive mode */
  889.   void (* inter_exit)(void);
  890.   void (* flush)(void);        /* Flush entry */
  891.   void (* load_color)(IDL_LONG start, IDL_LONG n);
  892.                 /* Pixel input/output */
  893.   void (* rw_pixels)(UCHAR *data, int x0, int y0, int nx,
  894.              int ny, int dir, IDL_TV_STRUCT *secondary);
  895.                 /* DEVICE procedure */
  896.   void (* dev_specific)(int argc, IDL_VPTR *argv, char *argk);
  897.                 /* HELP,/DEVICE */
  898.   void (* dev_help)(int argc, IDL_VPTR *argv);
  899.   void (* load_rtn)(void);    /* Call when driver is loaded */
  900. } IDL_DEVICE_CORE;
  901.  
  902.  
  903. /*
  904.  * IDL_DEVICE_WINDOW contains pointers to functions that accomplish
  905.  * window system operations. If the device is a window system,
  906.  * every field in this struct must point at a valid function,
  907.  * they're called without checking.
  908.  */
  909. /*
  910.  * Older mips compilers (Ultrix 4.2) can't handle Ansi function prototypes
  911.  * inside a struct, so we typedef each function and use the defined
  912.  * type inside the struct.
  913.  */
  914. typedef struct {        /* Procedures & functions for image device: */
  915.   void (* window_create)(int argc, IDL_VPTR *argv,char *argk);
  916.   void (* window_delete)(int argc, IDL_VPTR *argv);
  917.   void (* window_show)(int argc, IDL_VPTR *argv, char *argk);
  918.   void (* window_set)(int argc, IDL_VPTR *argv);
  919.   IDL_VPTR (* window_menu)(int argc, IDL_VPTR *argv, char *argk);
  920. } IDL_DEVICE_WINDOW;
  921.  
  922. /*
  923.  * IDL_DEVICE_DEF is the interface between a device driver and the rest
  924.  * of the Structure defining a graphics device. Every field in this
  925.  * structure must contain valid information --- it is used without
  926.  * any error checking.
  927.  */
  928. typedef struct {        /* Device descriptor, mostly static attributes
  929.                    and definitions: */
  930.   IDL_STRING name;        /* Device name */
  931.   int t_size[2];        /* Total size in device coordinates */
  932.   int v_size[2];        /* Visible area size, device coords */
  933.   int ch_size[2];        /* Default character sizes */
  934.   float px_cm[2];        /* Device units / centimeter, x & y. */
  935.   int n_colors;            /* # of possible simultaneous colors */
  936.   int table_size;        /* # of color table elements */
  937.   int fill_dist;        /* minimum line spacing for solid fill */
  938.   int window;            /* Current window number */
  939.   int unit;            /* Unit number of output file */
  940.   int flags;            /* Advertise limitations and abilities */
  941.   int origin[2];        /* Display XY (pan/scroll) origin */
  942.   int zoom[2];            /* Display XY zoom factors */
  943.   float aspect;            /* Aspect ratio, = v_size[0] / v_size[1]. */
  944.   IDL_DEVICE_CORE core;        /* Core graphics */
  945.   IDL_DEVICE_WINDOW winsys;    /* Window system. Only required if D_WINDOWS */
  946.   char *reserved;        /* Set to zero. */
  947. } IDL_DEVICE_DEF;
  948.  
  949.  
  950. /* Define bits in IDL_DEVICE_DEF flags: */
  951.  
  952. #define IDL_D_SCALABLE_PIXELS 1      /* True if pixel size is variable (e.g. PS)*/
  953. #define IDL_D_ANGLE_TEXT (1 << 1)   /* True if device can output text at
  954.                        angles */
  955. #define IDL_D_THICK (1 << 2)    /* True if line thickness can be set */
  956. #define IDL_D_IMAGE (1 << 3)    /* True if capable of imaging */
  957. #define IDL_D_COLOR (1 << 4)    /* True if device supports color */
  958. #define IDL_D_POLYFILL (1 << 5)      /* True if device can do polyfills */
  959. #define IDL_D_MONOSPACE (1<<6)     /* True if device has only monspaced text */
  960. #define IDL_D_READ_PIXELS (1<<7)   /* True if device can read back pixels */
  961. #define IDL_D_WINDOWS (1<<8)    /* True if device supports windows */
  962. #define IDL_D_WHITE_BACKGROUND (1<<9)    /* True if device background is
  963.                        white, like PostScript. */
  964. #define IDL_D_NO_HDW_TEXT (1<<10)   /* True if device has no hardware text */
  965. #define IDL_D_POLYFILL_LINE (1<<11)   /* True to use device driver for line
  966.                      style polyfills. */
  967. #define IDL_D_HERSH_CONTROL (1<<12)   /* True if device accepts hershey style
  968.                      control characters. */
  969. #define IDL_D_PLOTTER (1<<13)    /* True if pen plotter */
  970. #define IDL_D_WORDS (1<<14)    /* True if device images can be words */
  971. #define IDL_D_KANJI (1 << 15)    /* Device has Kanji characters */
  972. #define IDL_D_WIDGETS (1 << 16)      /* Device supports graphical user
  973.                      interfaces */
  974. #define IDL_D_Z (1 << 17)    /* Device is 3d */
  975.  
  976. typedef struct {
  977.   int background;        /* Background color */
  978.   float charsize;        /* Global Character size */
  979.   float charthick;        /* Character thickness */
  980.   int clip[6];            /* Clipping rectangle, normalized coords */
  981.   IDL_ULONG color;        /* Current color */
  982.   int font;            /* Font */
  983.   int linestyle;        /* Line style */
  984.   int  multi[5];        /* Cnt, Cols/rows, major dir for multi plts. */
  985.   int clip_off;            /* True if clipping is disabled */
  986.   int noerase;            /* No erase flag */
  987.   int nsum;            /* Number of points to sum */
  988.   float position[4];        /* Default window */
  989.   int psym;            /* Marker symbol */
  990.   float region[4];        /* Default plotting region */
  991.   IDL_STRING subtitle;        /* Plot subtitle */
  992.   float symsize;        /* Symbol size */
  993.   float t[16];            /* Matrix (4x4) of homogeneous transform */
  994.   int  t3d_on;            /* True if 3d homo transform is on */
  995.   float thick;            /* Line thickness */
  996.   IDL_STRING title;        /* Main plot title */
  997.   float ticklen;        /* Tick length */
  998.   int chl;            /* Default channel */
  999.   IDL_DEVICE_DEF *dev;        /* Current output device, not user accesible */
  1000. } IDL_PLOT_COM;
  1001.  
  1002.  
  1003.  
  1004. #endif                /* graphics_IDL_DEF */
  1005.  
  1006.  
  1007.  
  1008.  
  1009. /***** Definitions from keyword *****/
  1010.  
  1011.  
  1012. #ifndef keyword_IDL_DEF
  1013. #define keyword_IDL_DEF
  1014.  
  1015. /* Bit values of IDL_KW_PAR flags field: */
  1016.  
  1017. #define IDL_KW_ARRAY (1 << 12)
  1018. /* If specified array is required, otherwise scalar required */
  1019.  
  1020. #define IDL_KW_OUT (1 << 13)
  1021. /* Indicates parameter is an OUTPUT parameter passed by reference.
  1022.    Expressions are excluded.  The address of the IDL_VARIABLE is stored in
  1023.    the value field.  Otherwise, no checking is performed.  Special hint:
  1024.    to find out if a IDL_KW_OUT parameter is specified, use 0 for the type,
  1025.    and IDL_KW_OUT | IDL_KW_ZERO for the flags.  The value field will either
  1026.    contain NULL or the pointer to the variable. */
  1027.  
  1028.  
  1029. #define IDL_KW_VIN (IDL_KW_OUT | IDL_KW_ARRAY)
  1030. /* Parameter is an INPUT parameter passed by reference.  The address
  1031.    of the IDL_VARIABLE or expression is stored in the value field as with
  1032.    IDL_KW_OUT.  If this flag is specified, kw_cleanup() must be called to
  1033.    properly reap temporaries that may have been allocated. */
  1034.  
  1035.  
  1036. #define IDL_KW_ZERO (1 << 14)
  1037. /* If set, zero the parameter before parsing the keywords.  I.e. if
  1038.    this bit is set, and the parameter is not specified, the value will
  1039.    always be 0. */
  1040.  
  1041. #define IDL_KW_VALUE (1 << 15)
  1042. /* If this bit is set and the keyword is present, and its value is
  1043.    non-zero, the low 12 bits of this field will be inclusive 'or'ed with
  1044.    the longword pointed to by IDL_KW_PAR.value.  Be sure that the type field
  1045.    contains TYP_LONG.  The largest value that may be specified is
  1046.    (2^12)-1.  Negative values are not allowed.  For example, if the
  1047.    IDL_KW_PAR struct contains:
  1048.  
  1049.    "DEVICE", TYP_LONG, 1, IDL_KW_VALUE | 4 |IDL_KW_ZERO,NULL,&(char *) xxx,
  1050.    "NORMAL", TYP_LONG, 1, IDL_KW_VALUE | 3, NULL, &(char *) xxx,
  1051.  
  1052.    then xxx will contain a 3 if /NORMAL, or NORMAL = (expr) is
  1053.    present, a 4 if /DEVICE is present, 7 if both are set, and 0 if
  1054.    neither.  IDL_KW_ZERO can also be used in combination with this flag, use
  1055.    it only once for each IDL_KW_PAR.value.  */
  1056.  
  1057.  
  1058. #define IDL_KW_VALUE_MASK ((1 << 12) -1)   /* Mask for value part */
  1059.  
  1060. /* Use IDL_KW_FAST_SCAN as the first element of the keyword array if
  1061.    there are more than approximately 5 or 10 elements in the keyword
  1062.    array.  The IDL_KW_PAR structure defined by this macro is used to
  1063.    point to a list of elements to zero, and speeds processing of long
  1064.    keyword lists.  NEVER touch the contents of this structure.
  1065.    */
  1066. #define IDL_KW_FAST_SCAN { (char *)"", 0,0,0,0,0 }
  1067.  
  1068.  
  1069. typedef struct {
  1070.   char *keyword;        /* ^ to Keyword string, NULL terminated.
  1071.                    A NULL keyword string pointer value
  1072.                    terminates the keyword structure.  Strings
  1073.                    must be UPPER case and in LEXICAL order .*/
  1074.   UCHAR type;            /* Type of data required.  For scalars the
  1075.                    only allowable types are TYP_STRING,
  1076.                    TYP_LONG, TYP_FLOAT and
  1077.                    TYP_DOUBLE. For arrays, this may be
  1078.                    any simple type or 0 for no conversion. */
  1079.   unsigned short mask;        /* Enable mask.  This field is AND'ed with
  1080.                    the mask field in the call to
  1081.                    GET_IDL_KW_PARAMS, and if the result is
  1082.                    non-zero the keyword is used. If it is 0,
  1083.                    the keyword is ignored.  */
  1084.   unsigned short flags;        /* Contains  flags as described above */
  1085.   int *specified;        /* Address of int to set on return if
  1086.                    param is specified.  May be null if this
  1087.                    information is not required. */
  1088.   char *value;            /* Address of value to return.  In the
  1089.                    case of arrays,  this value points to
  1090.                    the IDL_KW_ARR_DESC structure for the data
  1091.                    to be returned.
  1092.                    */
  1093. } IDL_KW_PAR;
  1094.  
  1095. typedef struct {        /* Descriptor for array's that are returned */
  1096.   char *data;            /* Address of array to receive data. */
  1097.   int nmin;            /* Minimum # of elements allowed. */
  1098.   int nmax;            /* Maximum # of elements allowed. */
  1099.   int n;            /* # present, (Returned value). */
  1100. } IDL_KW_ARR_DESC;
  1101.  
  1102.  
  1103. #define IDL_KW_CLEAN_ALL 0    /* Codes for kw_cleanup, clean all temps
  1104.                    and strings */
  1105. #define IDL_KW_MARK 1        /* Mark string stack before calling get_
  1106.                    kw_params.  */
  1107. #define IDL_KW_CLEAN 2        /* Clean temps & strings created since
  1108.                    last call with KW_MARK. */
  1109.  
  1110. #endif                /* keyword_IDL_DEF */
  1111.  
  1112.  
  1113.  
  1114.  
  1115. /***** Definitions from os *****/
  1116.  
  1117. #ifndef os_IDL_DEF
  1118. #define os_IDL_DEF
  1119.  
  1120. /* Structure passed to IDL_GetUserInfo() */
  1121. typedef struct {
  1122.      char *logname;            /* Users login name */
  1123.      char host[64];            /* The machine name */
  1124.      char wd[IDL_MAXPATH];        /* The current directory */
  1125.      char date[25];            /* The current date */
  1126.    } IDL_USER_INFO;
  1127.  
  1128. #ifdef VMS
  1129. #include <descrip.h>
  1130. #endif
  1131.  
  1132. #endif                /* os_IDL_DEF */
  1133.  
  1134.  
  1135.  
  1136.  
  1137. /***** Definitions from pout *****/
  1138.  
  1139. #ifndef pout_IDL_DEF
  1140. #define pout_IDL_DEF
  1141.  
  1142. /*** Mask values for flags argument to pout() ***/
  1143. #define IDL_POUT_SL         1    /* Start on a new line */
  1144. #define IDL_POUT_FL         2    /* Finish current line */
  1145. #define IDL_POUT_NOSP       4    /* Don't add leading space */
  1146. #define IDL_POUT_NOBREAK    8    /* Don't start a new line if too long */
  1147. #define IDL_POUT_LEADING    16    /* Print leading text at start of line */
  1148. #define IDL_POUT_GET_POS    32    /* Get current file position */
  1149. #define IDL_POUT_SET_POS    64    /* Set current file position */
  1150.  
  1151.  
  1152. /*** Structure for control argument to pout() ***/
  1153. typedef struct {
  1154.   int unit;            /* LUN of open file */
  1155.   int curcol;            /* Current output column */
  1156.   int wrap;            /* # chars at which buf should flush */
  1157.   char *leading;        /* String to output at start of each line */
  1158.   int leading_len;        /* Length of leading w/o terminating null */
  1159.   char *buf;            /* ^ to output buffer. Must be max_len chars */
  1160.   int max_len;            /* Length of buffer */
  1161. } IDL_POUT_CNTRL;
  1162.  
  1163. #endif                /* pout_IDL_DEF */
  1164.  
  1165.  
  1166.  
  1167.  
  1168. /***** Definitions from raster *****/
  1169.  
  1170. #ifndef raster_IDL_DEF
  1171. #define raster_IDL_DEF
  1172.  
  1173.  
  1174. /*** Allowed values for dither_method field of IDL_RASTER_DEF struct ***/
  1175. #define IDL_DITHER_REVERSE          0 /* "Un-dither" back to bytes */
  1176. #define IDL_DITHER_THRESHOLD        1 /* Threshold dithering  */
  1177. #define IDL_DITHER_FLOYD_STEINBERG  2 /* Floyd Steinberg method */
  1178. #define IDL_DITHER_ORDERED          3 /* Ordered dither */
  1179.  
  1180. /* Values for flags field: */
  1181. #define IDL_DITHER_F_WHITE 1    /* Device has white background, dithering
  1182.                    module then sets the black bits. */
  1183.  
  1184. /*** Convenience values for the bit_tab array of IDL_RASTER_DEF struct ***/
  1185. #define IDL_RASTER_MSB_LEFT { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }
  1186. #define IDL_RASTER_MSB_RIGHT { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }
  1187.  
  1188. typedef struct {        /* Information that characterizes a raster */
  1189.   UCHAR *fb;            /* Address of frame buffer */
  1190.   int nx, ny;            /* Size of frame buffer in pixels */
  1191.   int bytes_line;        /* # of bytes per scan line, must be whole. */
  1192.   int byte_padding;        /* Pad lines to a multiple of this amount,
  1193.                    Must be a power of 2.  */
  1194.   int dot_width;        /* The length of a dot for the linestyles.
  1195.                    Default = 1. */
  1196.   int dither_method;        /* Dithering method code. */
  1197.   int dither_threshold;        /* Threshold value for threshold dither */
  1198.   UCHAR bit_tab[8];        /* Table of set bits, bit_tab[0] is leftmost,
  1199.                    bit_tab[7] is right most. */
  1200.   int flags;            /* Raster flags, see above */
  1201. } IDL_RASTER_DEF;
  1202.  
  1203. #endif                /* raster_IDL_DEF */
  1204.  
  1205.  
  1206.  
  1207.  
  1208. /***** Definitions from rline *****/
  1209.  
  1210. #ifndef rline_IDL_DEF
  1211. #define rline_IDL_DEF
  1212.  
  1213. /**** Flags to OR together for options parameter to IDL_Rline() ****/
  1214. #define IDL_RLINE_OPT_NOSAVE        1   /* Don't save in recall buffer */
  1215. #define IDL_RLINE_OPT_NOJOURNAL     2   /* Don't journal */
  1216. #define IDL_RLINE_OPT_JOURCMT       4   /* Put a '; ' at start in journal */
  1217. #define IDL_RLINE_OPT_NOEDIT        8   /* Like (!EDIT_INPUT = 0) for one call*/
  1218.  
  1219. #endif                /* rline_IDL_DEF */
  1220.  
  1221.  
  1222.  
  1223.  
  1224. /***** Definitions from sig *****/
  1225.  
  1226. #ifndef sig_IDL_DEF
  1227. #define sig_IDL_DEF
  1228.  
  1229.  
  1230. #include <signal.h>
  1231.  
  1232. /* Dialect confusion from HP-UX */
  1233. #if defined(SIGWINDOW) && !defined(SIGWINCH)
  1234. #define SIGWINCH SIGWINDOW
  1235. #endif
  1236.  
  1237. /*
  1238.  * Signal sets are represented by this opaque type. The type and length
  1239.  * have been selected to be suitable for any platform.
  1240.  */
  1241. typedef struct {
  1242.   double set[4];
  1243. } IDL_SignalSet_t;
  1244.  
  1245. /* The IDL definition for all signal handler functions. */
  1246. typedef void (* IDL_SignalHandler_t) IDL_ARG_PROTO((int signo));
  1247.  
  1248. #endif                /* sig_IDL_DEF */
  1249.  
  1250.  
  1251.  
  1252.  
  1253. /***** Definitions from structs *****/
  1254.  
  1255. #ifndef structs_IDL_DEF
  1256. #define structs_IDL_DEF
  1257.  
  1258.  
  1259. /* Valid bits for flags field of IDL_STRUCT_TAG_DEF */
  1260. #define IDL_STD_INHERIT    1    /* Type must be a structure. This flag
  1261.                    indicates that the structure is inherited
  1262.                    (inlined) instead of making it a
  1263.                    sub-structure as usual. */
  1264.  
  1265. typedef struct {        /* A tag definition for K_MakeSTruct */
  1266.   char *name;            /* Name of the tag. Must be upper case
  1267.                    and obey the rules for IDL identifiers.
  1268.                    In the case of inherited structures, this
  1269.                    can be NULL if type is set. Otherwise, it
  1270.                    is the name of the structure being inherited
  1271.                    and IDL will call a __DEFINE procedure
  1272.                    based on that name to define it. */
  1273.   IDL_LONG *dims;        /* NULL pointer for a scalar tag, otherwise
  1274.                    an array giving the array dimensions. The
  1275.                    first element is the number of dimensions,
  1276.                    and is followed in order by the dimensions
  1277.                    themselves. */
  1278.   void *type;            /* This may be either a pointer to another
  1279.                    structure definition, or a simple IDL
  1280.                    type code (IDL_TYP_*) cast to void
  1281.                    (e.g. (void *) IDL_TYP_BYTE). If this
  1282.                    field is NULL, it indicates that IDL
  1283.                    should search for a structure of the
  1284.                    given name and fill in the pointer to
  1285.                    its structure definition. */
  1286.   UCHAR flags;            /* Bitmask made up of IDL_STD_* bits */
  1287. } IDL_STRUCT_TAG_DEF;
  1288. #endif                /* structs_IDL_DEF */
  1289.  
  1290.  
  1291.  
  1292.  
  1293. /***** Definitions from sysnames *****/
  1294.  
  1295. #ifndef sysnames_IDL_DEF
  1296. #define sysnames_IDL_DEF
  1297.  
  1298. /* Structure used for IDL_SysvVersion global variable */
  1299. typedef struct {
  1300.   IDL_STRING arch;        /* Machine architecture */
  1301.   IDL_STRING os;        /* Operating System */
  1302.   IDL_STRING os_family;        /* Operating System family
  1303.                    (e.g. Unix vs SunOS) */
  1304.   IDL_STRING release;        /* Software release */
  1305.   IDL_STRING build_date;    /* Date on which this executable was built */
  1306. } IDL_SYS_VERSION;
  1307.  
  1308. #endif                /* sysnames_IDL_DEF */
  1309.  
  1310.  
  1311.  
  1312.  
  1313. /***** Definitions from tout *****/
  1314.  
  1315. #ifndef tout_IDL_DEF
  1316. #define tout_IDL_DEF
  1317.  
  1318. typedef void (* IDL_TOUT_OUTF)(int flags, char *buf, int n);
  1319.  
  1320. #define IDL_TOUT_F_STDERR   1    /* Output to stderr instead of stdout */
  1321. #define IDL_TOUT_F_NLPOST   4    /* Output a newline at end of line */
  1322.      
  1323. #endif                /* tout_IDL_DEF */
  1324.  
  1325.  
  1326.  
  1327.  
  1328. /***** Definitions from ur_main *****/
  1329.  
  1330. #ifndef ur_main_IDL_DEF
  1331. #define ur_main_IDL_DEF
  1332.  
  1333.  
  1334. /* Values that are OR'd together to form the options argument to IDL_Init() */
  1335. #define IDL_INIT_GUI    1    /* Use the GUI interface. */
  1336. #define IDL_INIT_GUI_AUTO (IDL_INIT_GUI|2)
  1337.                 /* Try to use a GUI if possible. If that
  1338.                    fails and the OS supports ttys, use
  1339.                    the standard tty interface. Note that
  1340.                    this code includes IDL_INIT_GUI. */
  1341. #define IDL_INIT_RUNTIME 4    /* RunTime IDL. */
  1342. #define IDL_INIT_EMBEDDED (IDL_INIT_RUNTIME|8)
  1343.                 /* Embedded IDL. Note that this code includes
  1344.                    IDL_INIT_RUNTIME. */
  1345. #define IDL_INIT_NOLICALIAS 16     /* Our FlexLM (Unix/VMS) floating license
  1346.                     policy is to alias all IDL sessions that
  1347.                     share the same user/system/display to the
  1348.                     same license. If no_lic_alias is set,
  1349.                     this IDL session will force a unique
  1350.                     license to be checked out. In this case,
  1351.                     we allow the user to change the DISPLAY
  1352.                     environment variable. This is useful for
  1353.                     RPC servers that don't know where their
  1354.                     output will need to go before invocation.*/
  1355. #define IDL_INIT_NOTTYEDIT 32    /* Under Unix, if IDL sees that stdin and
  1356.                    stdout are ttys, it puts the tty into
  1357.                    raw mode and uses termcap/terminfo to handle
  1358.                    command line editing. When using
  1359.                    callable IDL in a background process that
  1360.                    isn't doing I/O to the tty, the termcap
  1361.                    initialization can cause the process
  1362.                    to block because of job control from the
  1363.                    shell with a message like "Stopped (tty
  1364.                    output) idl". Setting this option prevents
  1365.                    all tty edit functions and disables the
  1366.                    calls to termcap. I/O to the tty is done
  1367.                    with a simple fgets()/printf().
  1368.                    In the case of IDL_INIT_GUI, this is
  1369.                    ignored. */
  1370.  
  1371.  
  1372. #define IDL_INIT_STUDENT 128    /* IDL Student Edition */
  1373.  
  1374. #endif                /* main_IDL_DEF */
  1375.  
  1376.  
  1377.  
  1378.  
  1379. /***** Definitions from widgets *****/
  1380.  
  1381. #ifndef widgets_IDL_DEF
  1382. #define widgets_IDL_DEF
  1383.  
  1384. typedef void (* IDL_WIDGET_STUB_SET_SIZE_FUNC)
  1385.      IDL_ARG_PROTO((IDL_ULONG id, int width, int height));
  1386.  
  1387. #endif  /* widgets_DEF */
  1388.  
  1389.  
  1390.  
  1391.  
  1392. /***** Definitions from zfiles *****/
  1393.  
  1394. #ifndef zfiles_IDL_DEF
  1395. #define zfiles_IDL_DEF
  1396. /**** Access field bits in IDL_FILE_DESC and IDL_FILE_STAT ****/
  1397. #define IDL_OPEN_R          1    /* Open file for reading */
  1398. #define IDL_OPEN_W          2    /* Open file for writing */
  1399. #define IDL_OPEN_NEW        4    /* Unix - Truncate old file contents.
  1400.                                    VMS - Use a new file. */
  1401. #define IDL_OPEN_APND       8    /* File open with pointer at EOF */
  1402.  
  1403. /**** Flags field bits in IDL_FILE_DESC and IDL_FILE_STAT ****/
  1404. #define IDL_F_ISATTY        1    /* Is a terminal */
  1405. #define IDL_F_ISAGUI        2    /* Is a Graphical User Interface */
  1406. #define IDL_F_NOCLOSE       4    /* Don't let user close */
  1407. #define IDL_F_MORE          8    /* Use more(1) like pager for fmt output */
  1408. #define IDL_F_XDR           16     /* Is a XDR file */
  1409. #define IDL_F_DEL_ON_CLOSE  32     /* Delete on close */
  1410. #define IDL_F_SR            64     /* Is a SAVE/RESTORE file.` */
  1411. #define IDL_F_UNIX_F77      128      /* Unformatted f77(1) I/O */
  1412. #define IDL_F_UNIX_PIPE     (1 << 8)   /* fptr is to a socketpair(2) */
  1413. #define IDL_F_UNIX_NOSTDIO (1 << 9)   /* Call read(2) and write(2) directly */
  1414. #define IDL_F_UNIX_SPECIAL  (1 << 10)    /* It's a device/special file */
  1415. #define IDL_F_VMS_FIXED     (1 << 11)   /* Fixed length records */
  1416. #define IDL_F_VMS_VARIABLE  (1 << 12)   /* Variable length records */
  1417. #define IDL_F_VMS_SEGMENTED (1 << 13)   /* FORTRAN segmented var len records */
  1418. #define IDL_F_VMS_STREAM    (1 << 14)   /* Stream file */
  1419.                 /* When reading a non-stream file via
  1420.                    VMS stdio, there are two possible
  1421.                    approaches. One is to simply read
  1422.                    the file as a stream and let the RMS
  1423.                    stuff show. The other is to try to
  1424.                    re-write the data into a "logical
  1425.                    data stream". Normally, IDL takes
  1426.                    the second approach because it
  1427.                    allows  code to work easily between Unix and
  1428.                    VMS. For the user OPEN though, the
  1429.                    first approach is better because it
  1430.                    is more robust and avoids RMS
  1431.                    buffer size limitations. the
  1432.                    STREAM_STRICT modifier flag is used
  1433.                    in this case. */
  1434. #define IDL_F_VMS_STREAM_STRICT (1 << 15)
  1435. #define IDL_F_VMS_RMSBLK    (1 << 16)   /* RMS Block Mode access */
  1436. #define IDL_F_VMS_RMSBLKUDF (1 << 17)   /* RMS block mode files are created
  1437.                        with FIXED length 512 byte records.
  1438.                        This bit indicates that the RMS
  1439.                        UNDEFINED record type should be
  1440.                        used. */
  1441. #define IDL_F_VMS_INDEXED    (1 << 18)   /* Indexed file */
  1442. #define IDL_F_VMS_PRINT      (1 << 19)   /* Send to SYS$PRINT on close */
  1443. #define IDL_F_VMS_SUBMIT     (1 << 20)   /* Send to SYS$BATCH on close */
  1444. #define IDL_F_VMS_TRCLOSE    (1 << 21)   /* Truncate file allocation on close */
  1445. #define IDL_F_VMS_CCLIST     (1 << 22)   /* CR/LF carriage control */
  1446. #define IDL_F_VMS_CCFORTRAN  (1 << 23)   /* FORTRAN style carriage control */
  1447. #define IDL_F_VMS_CCNONE     (1 << 24)   /* Explicit carriage control */
  1448. #define IDL_F_VMS_SHARED     (1 << 25)   /* Shared access */
  1449. #define IDL_F_VMS_SUPERSEDE  (1 << 26)   /* Supersede existing version on open*/
  1450. #define IDL_F_DOS_NOAUTOMODE (1 << 27)   /* Don't switch the mode */
  1451. #define IDL_F_DOS_BINARY     (1 << 28)   /* File is in binary mode (^J) */
  1452.   
  1453. /* Sets the IDL_F_NOCLOSE bit for file unit. */
  1454. #define IDL_FILE_NOCLOSE(unit) IDL_FileSetClose((unit), FALSE)
  1455.  
  1456. /* Clear the IDL_F_NOCLOSE bit for file unit. */
  1457. #define IDL_FILE_CLOSE(unit) IDL_FileSetClose((unit), TRUE)
  1458.  
  1459. /**** File units that map to standard units ****/
  1460. #define IDL_STDIN_UNIT      0
  1461. #define IDL_STDOUT_UNIT     -1
  1462. #define IDL_STDERR_UNIT     -2
  1463. #define IDL_NON_UNIT        -100    /* Gauranteed to be an invalid unit */
  1464.  
  1465. /* Valid flags to bit-OR together for IDL_FileEnsureStatus() flags argument */
  1466. #define IDL_EFS_USER        1       /* Must be user unit (1 - MAX_USER_FILES) */
  1467. #define IDL_EFS_OPEN        2       /* Unit must be open */
  1468. #define IDL_EFS_CLOSED      4       /* Unit must be closed */
  1469. #define IDL_EFS_READ        8       /* Unit must be open for input */
  1470. #define IDL_EFS_WRITE       16      /* Unit must be open for output */
  1471. #define IDL_EFS_NOTTY       32      /* Unit cannot be a tty */
  1472. #define IDL_EFS_NOGUI       64      /* Unit cannot be a tty */
  1473. #define IDL_EFS_NOPIPE      128      /* Unit cannot be a pipe */
  1474. #define IDL_EFS_NOXDR       256     /* Unit cannot be a XDR file */
  1475. #define IDL_EFS_ASSOC       512     /* Unit can be assoc'd. This implies USER,
  1476.                                    OPEN, NOTTY, NOPIPE, and NOXDR, in
  1477.                                    addition to other OS specific concerns */
  1478. #define IDL_EFS_NOT_NOSTDIO 1024    /* Under Unix, file wasn't opened with
  1479.                    IDL_F_UNIX_NOSTDIO attribute. */
  1480.  
  1481.  
  1482. /**** Struct for global variable term, filled by IDL_FileInit() ****/
  1483. typedef struct {
  1484. #ifdef IDL_OS_HAS_TTYS
  1485.   char *name;                   /* Name of terminal type */
  1486.   char is_tty;                  /* True if stdin is a terminal */
  1487. #endif
  1488.   int lines;                    /* Lines on screen */
  1489.   int columns;                  /* Width of output */
  1490. } IDL_TERMINFO;
  1491.  
  1492.  
  1493. /**** Struct that is filled in by IDL_FileStat() ****/
  1494. typedef struct {
  1495.   char *name;
  1496.   short access;
  1497.   IDL_LONG flags;
  1498.   FILE *fptr;
  1499.   struct {
  1500.     unsigned short mrs;
  1501.   } rms;
  1502. } IDL_FILE_STAT;
  1503.  
  1504. #endif                /* zfiles_IDL_DEF */
  1505.  
  1506.  
  1507.  
  1508.  
  1509. /***** Definitions from ztimer *****/
  1510.  
  1511. #ifndef ztimer_IDL_DEF
  1512. #define ztimer_IDL_DEF
  1513.  
  1514. typedef void (* IDL_TIMER_CB)();
  1515. #ifdef VMS
  1516. typedef long IDL_TIMER_CONTEXT;
  1517. #else
  1518. typedef void (* IDL_TIMER_CONTEXT)();
  1519. #endif
  1520. typedef IDL_TIMER_CONTEXT *IDL_TIMER_CONTEXT_PTR;
  1521.  
  1522. #endif                /* ztimer_IDL_DEF */
  1523.  
  1524.  
  1525.  
  1526.  
  1527. extern char *IDL_FilePathFromRoot IDL_ARG_PROTO(
  1528.                                  (char *pathbuf, IDL_STRING *root,
  1529.                                   char *file, char *ext, int nsubdir, 
  1530.                                   char **subdir));
  1531. extern char *IDL_FilePath IDL_ARG_PROTO(
  1532.                          (char *pathbuf, char *file, char *ext,
  1533.                           int nsubdir, char **subdir));
  1534. extern void *IDL_MemAlloc IDL_ARG_PROTO(
  1535.                          (unsigned int n, char *err_str, int action));
  1536. extern void IDL_MemFree IDL_ARG_PROTO(
  1537.                        (IDL_REGISTER void *m, char *err_str, int action));
  1538. extern void *IDL_MemAllocPerm IDL_ARG_PROTO(
  1539.                              (unsigned int n, char *err_str, int action));
  1540. extern void IDL_TimerSet IDL_ARG_PROTO(
  1541.                         (IDL_LONG length, IDL_TIMER_CB callback,
  1542.                          int from_callback, IDL_TIMER_CONTEXT_PTR context));
  1543. extern void IDL_TimerCancel IDL_ARG_PROTO((IDL_TIMER_CONTEXT context));
  1544. extern void IDL_TimerBlock IDL_ARG_PROTO((int stop));
  1545. extern void IDL_TimerSet IDL_ARG_PROTO(
  1546.                         (IDL_LONG length, IDL_TIMER_CB callback,
  1547.                          int from_callback, IDL_TIMER_CONTEXT_PTR context));
  1548. extern void IDL_TimerCancel IDL_ARG_PROTO((IDL_TIMER_CONTEXT context));
  1549. extern void IDL_TimerSet IDL_ARG_PROTO(
  1550.                         (IDL_LONG length, IDL_TIMER_CB callback,
  1551.                          int from_callback, IDL_TIMER_CONTEXT_PTR context));
  1552. extern void IDL_TimerSet IDL_ARG_PROTO(
  1553.                         (IDL_LONG length, IDL_TIMER_CB callback,
  1554.                          int from_callback, IDL_TIMER_CONTEXT_PTR context));
  1555. extern void IDL_SignalSetInit IDL_ARG_PROTO(
  1556.                              (IDL_SignalSet_t *set, int signo));
  1557. extern void IDL_SignalSetAdd IDL_ARG_PROTO(
  1558.                             (IDL_SignalSet_t *set, int signo));
  1559. extern void IDL_SignalSetDel IDL_ARG_PROTO(
  1560.                             (IDL_SignalSet_t *set, int signo));
  1561. extern int IDL_SignalSetIsMember IDL_ARG_PROTO(
  1562.                                 (IDL_SignalSet_t *set, int signo));
  1563. extern void IDL_SignalMaskGet IDL_ARG_PROTO((IDL_SignalSet_t *set));
  1564. extern void IDL_SignalMaskSet IDL_ARG_PROTO(
  1565.                              (IDL_SignalSet_t *set, IDL_SignalSet_t *oset));
  1566. extern void IDL_SignalMaskBlock IDL_ARG_PROTO(
  1567.                                (IDL_SignalSet_t *set, IDL_SignalSet_t *oset));
  1568. extern void IDL_SignalBlock IDL_ARG_PROTO(
  1569.                            (int signo, IDL_SignalSet_t *oset));
  1570. extern void IDL_SignalSuspend IDL_ARG_PROTO((IDL_SignalSet_t *set));
  1571. extern int IDL_SignalRegister IDL_ARG_PROTO(
  1572.                              (int signo, IDL_SignalHandler_t func,
  1573.                               int msg_action));
  1574. extern int IDL_SignalUnregister IDL_ARG_PROTO(
  1575.                                (int signo, IDL_SignalHandler_t func,
  1576.                                 int msg_action));
  1577. extern int IDL_GetKbrd IDL_ARG_PROTO((int should_wait));
  1578. extern void IDL_TerminalRaw IDL_ARG_PROTO((int to_from, int fnin));
  1579. extern void IDL_Pout IDL_ARG_PROTO((IDL_POUT_CNTRL *control, ...));
  1580. extern void IDL_PoutRaw IDL_ARG_PROTO((int unit, char *buf, int n));
  1581. extern IDL_PLOT_COM IDL_PlotCom;
  1582. extern UCHAR IDL_ColorMap[];
  1583. extern IDL_PLOT_COM *IDL_PlotComAddr IDL_ARG_PROTO((void));
  1584. extern UCHAR *IDL_ColorMapAddr IDL_ARG_PROTO((void));
  1585. extern void IDL_PolyfillSoftware IDL_ARG_PROTO(
  1586.                                 (int *x, int *y, int n, IDL_POLYFILL_ATTR *s));
  1587. extern double IDL_GraphText IDL_ARG_PROTO(
  1588.                            (IDL_GR_PT *p, IDL_ATTR_STRUCT *ga, IDL_TEXT_STRUCT *a,
  1589.                             char *text));
  1590. extern void IDL_StrDup IDL_ARG_PROTO(
  1591.                       (IDL_REGISTER IDL_STRING *str, IDL_REGISTER IDL_LONG n));
  1592. extern void IDL_StrDelete IDL_ARG_PROTO((IDL_STRING *str, IDL_LONG n));
  1593. extern void IDL_StrStore IDL_ARG_PROTO((IDL_STRING *s, char *fs));
  1594. extern void IDL_StrEnsureLength IDL_ARG_PROTO((IDL_STRING *s, int n));
  1595. extern IDL_VPTR IDL_StrToSTRING IDL_ARG_PROTO((char *s));
  1596. extern void IDL_TerminalRaw IDL_ARG_PROTO((int to_from, int fnin));
  1597. extern int IDL_GetKbrd IDL_ARG_PROTO((int should_wait));
  1598. extern int IDL_GetKbrd IDL_ARG_PROTO((int should_wait));
  1599. extern void IDL_ExitRegister IDL_ARG_PROTO((IDL_PRO_PTR proc));
  1600. extern void IDL_WidgetIssueStubEvent IDL_ARG_PROTO(
  1601.                                     (char *rec, IDL_LONG value));
  1602. extern void IDL_WidgetSetStubIds IDL_ARG_PROTO(
  1603.                                 (char *rec, unsigned long t_id,
  1604.                                  unsigned long b_id));
  1605. extern void IDL_WidgetGetStubIds IDL_ARG_PROTO(
  1606.                                 (char *rec, unsigned long *t_id,
  1607.                                  unsigned long *b_id));
  1608. extern void IDL_WidgetStubLock IDL_ARG_PROTO((int set));
  1609. extern char *IDL_WidgetStubLookup IDL_ARG_PROTO((IDL_ULONG id));
  1610. extern void IDL_WidgetStubSetSizeFunc IDL_ARG_PROTO((char *rec,
  1611.                                       IDL_WIDGET_STUB_SET_SIZE_FUNC func));
  1612. extern int IDL_FindDefinition IDL_ARG_PROTO(
  1613.                              (char *routine, char **filename, int *line));
  1614. extern char *IDL_MakeTempArray IDL_ARG_PROTO(
  1615.                               (int type, int n_dim, IDL_LONG dim[], int init,
  1616.                                IDL_VPTR *var));
  1617. extern void IDL_EzCall IDL_ARG_PROTO(
  1618.                       (int argc, IDL_VPTR argv[], IDL_EZ_ARG arg_struct[]));
  1619. extern void IDL_EzCallCleanup IDL_ARG_PROTO(
  1620.                              (int argc, IDL_VPTR argv[], IDL_EZ_ARG arg_struct[]));
  1621. extern void IDL_MessageErrno IDL_ARG_PROTO((int code, ...));
  1622. extern void IDL_Message IDL_ARG_PROTO((int code, int action, ...));
  1623. extern void IDL_MessageVarError IDL_ARG_PROTO(
  1624.                                (int code, IDL_VPTR var, int action));
  1625. extern void IDL_MessageVMS IDL_ARG_PROTO((int code,...));
  1626. extern char *IDL_Rline IDL_ARG_PROTO(
  1627.                       (char *s, int n, int unit, FILE *stream,
  1628.                        int is_tty, char *prompt, int opt));
  1629. extern void IDL_RlineSetStdinOptions IDL_ARG_PROTO((int opt));
  1630. extern void IDL_Logit IDL_ARG_PROTO((char *s));
  1631. extern int IDL_Win32Init IDL_ARG_PROTO(
  1632.                         (int iOpts, void *hinstExe, void *hwndExe, void *hAccel));
  1633. extern void IDL_ToutPush IDL_ARG_PROTO((IDL_TOUT_OUTF outf));
  1634. extern IDL_TOUT_OUTF IDL_ToutPop IDL_ARG_PROTO((void));
  1635. extern char *IDL_VarName IDL_ARG_PROTO((IDL_VPTR v));
  1636. extern IDL_VPTR IDL_GetVarAddr1 IDL_ARG_PROTO((char *name, int ienter));
  1637. extern IDL_VPTR IDL_GetVarAddr IDL_ARG_PROTO((char *name));
  1638. extern IDL_VPTR IDL_FindNamedVariable IDL_ARG_PROTO(
  1639.                                      (char *name, int ienter));
  1640. extern void IDL_Wait IDL_ARG_PROTO((int argc, IDL_VPTR argv[]));
  1641. extern void IDL_GetUserInfo IDL_ARG_PROTO((IDL_USER_INFO *user_info));
  1642. extern short IDL_TapeChl[];
  1643. extern short *IDL_TapeChlAddr IDL_ARG_PROTO((void));
  1644. extern int IDL_AddToQueue IDL_ARG_PROTO((char* pString));
  1645. extern int IDL_GetWait IDL_ARG_PROTO((int fType));
  1646. extern int IDL_SetWait IDL_ARG_PROTO((int fType, int iVal));
  1647. extern char *IDL_MakeTempStruct IDL_ARG_PROTO(
  1648.                                (IDL_StructDefPtr sdef, int n_dim,
  1649.                                 IDL_LONG *dim, IDL_VPTR *var, int zero));
  1650. extern IDL_StructDefPtr IDL_MakeStruct IDL_ARG_PROTO(
  1651.                                       (char *name, IDL_STRUCT_TAG_DEF *tags));
  1652. extern IDL_LONG IDL_StructTagInfoByName IDL_ARG_PROTO(
  1653.                                        (IDL_StructDefPtr sdef, char *name,
  1654.                                         int msg_action, IDL_VPTR *var));
  1655. extern IDL_LONG IDL_StructTagInfoByIndex IDL_ARG_PROTO(
  1656.                                         (IDL_StructDefPtr sdef, int index,
  1657.                                          int msg_action, IDL_VPTR *var));
  1658. extern void IDL_Print IDL_ARG_PROTO((int argc, IDL_VPTR *argv, char *argk));
  1659. extern void IDL_PrintF IDL_ARG_PROTO((int argc, IDL_VPTR *argv, char *argk));
  1660. extern void IDL_Win32MessageLoop  IDL_ARG_PROTO((int fFlush));
  1661. extern void IDL_VarCopy IDL_ARG_PROTO(
  1662.                        (IDL_REGISTER IDL_VPTR src, IDL_REGISTER IDL_VPTR dst));
  1663. extern void IDL_StoreScalar IDL_ARG_PROTO(
  1664.                            (IDL_VPTR dest, int type, IDL_ALLTYPES *value));
  1665. extern int IDL_KWGetParams IDL_ARG_PROTO(
  1666.                           (int argc, IDL_VPTR *argv, char *argk,
  1667.                            IDL_KW_PAR *kw_list, IDL_VPTR *plain_args, 
  1668.                            int imask));
  1669. extern void IDL_KWCleanup IDL_ARG_PROTO((int fcn));
  1670. extern char *IDL_DitherMethodNames[];
  1671. extern char *IDL_DitherMethodNamesFunc IDL_ARG_PROTO((int method));
  1672. extern void IDL_RasterDrawThick IDL_ARG_PROTO(
  1673.                                (IDL_GR_PT *p0, IDL_GR_PT *p1, IDL_ATTR_STRUCT *a,
  1674.                                 IDL_PRO_PTR routine, int dot_width));
  1675. extern void IDL_RasterPolyfill IDL_ARG_PROTO(
  1676.                               (int *x, int *y, int n, IDL_POLYFILL_ATTR *p,
  1677.                                IDL_RASTER_DEF *r));
  1678. extern void IDL_RasterDraw IDL_ARG_PROTO(
  1679.                           (IDL_GR_PT *p0, IDL_GR_PT *p1, IDL_ATTR_STRUCT *a, IDL_RASTER_DEF *r));
  1680. extern void IDL_Dither IDL_ARG_PROTO(
  1681.                       (UCHAR *data, int ncols, int nrows, IDL_RASTER_DEF *r,
  1682.                        int x0, int y0, IDL_TV_STRUCT *secondary));
  1683. extern void IDL_BitmapLandscape IDL_ARG_PROTO(
  1684.                                (IDL_RASTER_DEF *in, IDL_RASTER_DEF *out, int y0));
  1685. extern IDL_LONG IDL_LongScalar IDL_ARG_PROTO((IDL_REGISTER IDL_VPTR p));
  1686. extern double IDL_DoubleScalar IDL_ARG_PROTO((IDL_REGISTER IDL_VPTR p));
  1687. extern IDL_VPTR IDL_BasicTypeConversion IDL_ARG_PROTO(
  1688.                                        (int argc, IDL_VPTR argv[],
  1689.                                         IDL_REGISTER int type));
  1690. extern IDL_VPTR IDL_CvtByte IDL_ARG_PROTO((int argc, IDL_VPTR argv[]));
  1691. extern IDL_VPTR IDL_CvtFix IDL_ARG_PROTO((int argc, IDL_VPTR argv[]));
  1692. extern IDL_VPTR IDL_CvtLng IDL_ARG_PROTO((int argc, IDL_VPTR argv[]));
  1693. extern IDL_VPTR IDL_CvtFlt IDL_ARG_PROTO((int argc, IDL_VPTR argv[]));
  1694. extern IDL_VPTR IDL_CvtDbl IDL_ARG_PROTO((int argc, IDL_VPTR argv[]));
  1695. extern IDL_VPTR IDL_CvtComplex IDL_ARG_PROTO((int argc, IDL_VPTR argv[]));
  1696. extern IDL_VPTR IDL_CvtDComplex IDL_ARG_PROTO((int argc, IDL_VPTR argv[]));
  1697. extern IDL_VPTR IDL_CvtString IDL_ARG_PROTO(
  1698.                              (int argc, IDL_VPTR argv[], char *argk));
  1699. extern int IDL_GetKbrd IDL_ARG_PROTO((int should_wait));
  1700. extern void IDL_VarGetData IDL_ARG_PROTO(
  1701.                           (IDL_VPTR v, IDL_LONG *n, char **pd,
  1702.                            int ensure_simple));
  1703. extern IDL_VPTR IDL_ImportArray IDL_ARG_PROTO(
  1704.                                (int n_dim, IDL_LONG dim[], int type,
  1705.                                 UCHAR *data, IDL_ARRAY_FREE_CB free_cb, 
  1706.                                 IDL_StructDefPtr s));
  1707. extern IDL_VPTR IDL_ImportNamedArray IDL_ARG_PROTO(
  1708.                                     (char *name, int n_dim, IDL_LONG dim[],
  1709.                                      int type, UCHAR *data, 
  1710.                                      IDL_ARRAY_FREE_CB free_cb, 
  1711.                                      IDL_StructDefPtr s));
  1712. extern void IDL_Delvar IDL_ARG_PROTO((IDL_VPTR var));
  1713. extern void IDL_VarEnsureSimple IDL_ARG_PROTO((IDL_VPTR v));
  1714. extern IDL_VPTR IDL_CvtBytscl IDL_ARG_PROTO(
  1715.                              (int argc, IDL_VPTR *argv, char *argk));
  1716. extern void IDL_Freetmp IDL_ARG_PROTO((IDL_REGISTER IDL_VPTR p));
  1717. extern void IDL_Deltmp IDL_ARG_PROTO((IDL_REGISTER IDL_VPTR p));
  1718. extern IDL_VPTR IDL_Gettmp IDL_ARG_PROTO((void));
  1719. extern char *IDL_GetScratch IDL_ARG_PROTO((IDL_REGISTER IDL_VPTR *p,
  1720.                             IDL_REGISTER IDL_LONG n_elts, 
  1721.                             IDL_REGISTER IDL_LONG elt_size));
  1722. extern void IDL_RgbToHsv IDL_ARG_PROTO(
  1723.                         (UCHAR *r, UCHAR *g, UCHAR *b, float *h,
  1724.                          float *s, float *v, int n));
  1725. extern void IDL_RgbToHls IDL_ARG_PROTO(
  1726.                         (UCHAR *r, UCHAR *g, UCHAR *b, float *h,
  1727.                          float *l, float *s, int n));
  1728. extern int IDL_AddDevice IDL_ARG_PROTO((
  1729.                          IDL_DEVICE_DEF *dev, 
  1730.                          int msg_action));
  1731. extern char *IDL_OutputFormat[];
  1732. extern char *IDL_OutputFormatFunc IDL_ARG_PROTO((int type));
  1733. extern int IDL_OutputFormatLen[];
  1734. extern int IDL_OutputFormatLenFunc IDL_ARG_PROTO((int type));
  1735. extern IDL_LONG IDL_TypeSize[];
  1736. extern int IDL_TypeSizeFunc IDL_ARG_PROTO((int type));
  1737. extern char *IDL_TypeName[];
  1738. extern char *IDL_TypeNameFunc IDL_ARG_PROTO((int type));
  1739. extern int IDL_LMGRCheckoutVal IDL_ARG_PROTO(( long lVal));
  1740. extern IDL_SYS_VERSION IDL_SysvVersion;
  1741. extern IDL_STRING *IDL_SysvVersionArch IDL_ARG_PROTO((void));
  1742. extern IDL_STRING *IDL_SysvVersionOS IDL_ARG_PROTO((void));
  1743. extern IDL_STRING *IDL_SysvVersionOSFamily IDL_ARG_PROTO((void));
  1744. extern IDL_STRING *IDL_SysvVersionRelease IDL_ARG_PROTO((void));
  1745. extern char *IDL_ProgramName;
  1746. extern char *IDL_ProgramNameFunc IDL_ARG_PROTO((void));
  1747. extern char *IDL_ProgramNameLC;
  1748. extern char *IDL_ProgramNameLCFunc IDL_ARG_PROTO((void));
  1749. extern IDL_STRING IDL_SysvDir;
  1750. extern IDL_STRING *IDL_SysvDirFunc IDL_ARG_PROTO((void));
  1751. extern IDL_STRING IDL_SysvErrString;
  1752. extern IDL_STRING *IDL_SysvErrStringFunc IDL_ARG_PROTO((void));
  1753. extern IDL_STRING IDL_SysvSyserrString;
  1754. extern IDL_STRING *IDL_SysvSyserrStringFunc IDL_ARG_PROTO((void));
  1755. extern IDL_LONG IDL_SysvErrCode;
  1756. extern IDL_LONG IDL_SysvErrCodeValue IDL_ARG_PROTO((void));
  1757. extern IDL_LONG IDL_SysvErrorCode;
  1758. extern IDL_LONG IDL_SysvErrorCodeValue IDL_ARG_PROTO((void));
  1759. extern IDL_LONG *IDL_SysvSyserrorCodes;
  1760. extern IDL_LONG *IDL_SysvSyserrorCodesAddr IDL_ARG_PROTO((void));
  1761. extern IDL_LONG IDL_SysvOrder;
  1762. extern IDL_LONG IDL_SysvOrderValue IDL_ARG_PROTO((void));
  1763. extern int IDL_AddSystemRoutine IDL_ARG_PROTO(
  1764.                                (IDL_SYSFUN_DEF *defs, int is_function, int cnt));
  1765. extern int IDL_BailOut IDL_ARG_PROTO((int stop));
  1766. extern int IDL_Cleanup IDL_ARG_PROTO((int just_cleanup));
  1767. extern int IDL_Init IDL_ARG_PROTO((int options, int *argc, char *argv[]));
  1768. extern int IDL_Main IDL_ARG_PROTO(
  1769.                    (int init_options, int argc, char *argv[]));
  1770. extern int IDL_ExecuteStr IDL_ARG_PROTO((char *cmd));
  1771. extern int IDL_Execute IDL_ARG_PROTO((int argc, char *argv[]));
  1772. extern int IDL_RuntimeExec IDL_ARG_PROTO((char *file));
  1773. extern void IDL_Runtime IDL_ARG_PROTO(
  1774.                        (int options, int *argc, char *argv[], char *file));
  1775. extern IDL_TERMINFO IDL_FileTerm;
  1776. extern char *IDL_FileTermName IDL_ARG_PROTO((void));
  1777. extern int IDL_FileTermIsTty IDL_ARG_PROTO((void));
  1778. extern int IDL_FileTermLines IDL_ARG_PROTO((void));
  1779. extern int IDL_FileTermColumns IDL_ARG_PROTO((void));
  1780. extern int IDL_FileEnsureStatus IDL_ARG_PROTO(
  1781.                                (int action, int unit, int flags));
  1782. extern int IDL_FileOpen IDL_ARG_PROTO(
  1783.                        (int argc, IDL_VPTR argv[], char *argk,
  1784.                         int access_mode, int extra_flags, int longjmp_safe));
  1785. extern void IDL_FileClose IDL_ARG_PROTO(
  1786.                          (int argc, IDL_VPTR argv[], char *argk));
  1787. extern void IDL_FileFlushUnit IDL_ARG_PROTO((int unit));
  1788. extern void IDL_FileGetUnit IDL_ARG_PROTO((int argc, IDL_VPTR argv[]));
  1789. extern void IDL_FileFreeUnit IDL_ARG_PROTO((int argc, IDL_VPTR argv[]));
  1790. extern int IDL_FileEOF IDL_ARG_PROTO((int unit));
  1791. extern void IDL_FileStat IDL_ARG_PROTO((int unit, IDL_FILE_STAT *stat_blk));
  1792. extern void IDL_FileSetClose IDL_ARG_PROTO((int unit, int allow));
  1793. /* Forward declarations for all exported routines and data */
  1794.  
  1795.  
  1796.  
  1797.  
  1798. #ifdef __cplusplus
  1799.     }
  1800. #endif
  1801.  
  1802. #endif                               /* export_IDL_DEF */
  1803.