#if !defined (_FORMS_DEFINED) #define _FORMS_DEFINED /* ** ++ ** FACILITY: ** ** DECforms ** ** ABSTRACT: ** ** Include file for the DECforms API. ** ** NOTE: This file must remain both C and C++ compatible. ** Do not use C++ style comments or commands in this file. ** ** -- */ /* * COPYRIGHT (c) 1995 BY * DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. * * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY * TRANSFERRED. * * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT * CORPORATION. * * DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS * SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. * */ /* Possible values for the default terminal type option */ /* These are used in the Forms_Request_Options, for */ /* the forms_c_opt_default_term option (below) */ typedef enum { forms_c_dev_vt100 = 0, forms_c_dev_vt100_noavo = 1, forms_c_dev_vt200 = 2, forms_c_dev_vt300 = 3, forms_c_dev_vt400 = 4, forms_c_dev_vt500 = 5, forms_c_dev_mswindows = 6 } Forms_Default_Term_Values; typedef long int Forms_Default_Term_Type; /* Possible values for the default color type option */ /* These are used in the Forms_Request_Options, for */ /* the forms_c_opt_default_color option (below) */ typedef enum { forms_c_color_mono = 0, forms_c_color_regis = 4, forms_c_color_ansi = 8 } Forms_Default_Color_Values; typedef long int Forms_Default_Color_Type; /* * Define Forms_Form_Object, which points to the global symbol created by the commands: * "forms extract object" (on OpenVms and Digital Unix) * "forms object" (on Windows) */ #if defined(__DECC) && !defined(__DECC_MODE_VAXC) /* DEC C */ #pragma extern_model save #pragma extern_model common_block shr #define Forms_Form_Object extern void * #pragma extern_model restore #elif defined (vms) || defined (__DECC_MODE_VAXC) /* OpenVms VAX C */ #define Forms_Form_Object globalref void * #elif defined (_WIN32) && defined (__cplusplus) /* _WIN32, C++ */ #define Forms_Form_Object extern "C" void * #elif defined (_WIN32) && !defined (__cplusplus) /* _WIN32, C */ #define Forms_Form_Object extern void * #elif defined (MSDOS) && defined (__cplusplus) /* MSDOS, C++ */ #define Forms_Form_Object extern "C" void __far * #elif defined (MSDOS) && !defined (__cplusplus) /* MSDOS, C */ #define Forms_Form_Object extern void __far * #elif !defined (MSDOS) && defined (__cplusplus) /* Ultrix, C++ */ #define Forms_Form_Object extern "C" void * #elif !defined (MSDOS) && !defined (__cplusplus) /* Ultrix, C */ #define Forms_Form_Object extern void * #endif /* * Define Forms_Callback for PEU routine declarations * * If your PEU routine is NOT returning a value, you can declare it as: * * void Forms_Callback peu_routine(...); * * If your PEU routine IS returning a value, you can declare it as: * * long Forms_Callback peu_routine(...); */ #if defined(vms) /* OpenVms */ #define Forms_Callback #elif defined (MSDOS) /* MSDOS */ #define Forms_Callback __far __pascal __export #elif defined (_WIN32) /* WIN32 */ #define Forms_Callback __declspec(dllexport) #else /* Ultrix */ #define Forms_Callback #endif /* Define the pointer and routine linkages -- only used internally to this .H file */ #if defined (MSDOS) #define _Mem_Access_ __far #define _Rtn_Access_ __far __pascal __export #elif defined (_WIN32) #define _Mem_Access_ #define _Rtn_Access_ #else #define _Mem_Access_ #define _Rtn_Access_ #endif /* * Define datatypes which are referenced in the structures, parameters, * and calls of the DECforms requests. */ typedef long int Forms_Status; /* type definition for status of a request call */ typedef long int _Mem_Access_ * Forms_Status_Ptr; /* Pointer to Forms_Status return value */ typedef char Forms_Session_Id[16]; /* Session id text string of 16 characters */ typedef char Forms_Control_Text_Item[5]; /* Control text item of 5 characters */ typedef char Forms_Control_Text[5][5]; /* Control text array of 5 Control_Text_Items */ typedef Forms_Control_Text _Mem_Access_ * Forms_Control_Text_Ptr; /* Pointer to Forms_Control_Text */ typedef long int Forms_Data_Length; /* Data record length contained in 4 bytes */ typedef long int Forms_Shadow_Length; /* Shadow record length contained in 4 bytes */ typedef long int Forms_Count; /* Count of objects contained in 4 bytes */ typedef long int _Mem_Access_ * Forms_Count_Ptr; /* Pointer to Forms_Count, a 4 byte value */ typedef void _Mem_Access_ * Forms_Generic_Ptr; /* General pointer to an object contained in 4 bytes */ typedef long int Forms_Value; /* Data value contained in 4 bytes */ typedef long int Forms_Time_Value; /* element of ANSI struct tm (see time.h) */ typedef long int Forms_Flags; /* 4 bytes of binary flags value */ typedef char Forms_Text; /* Text character */ typedef long int Forms_Text_Length; /* Count of text characters in a string */ typedef char _Mem_Access_ * Forms_Text_Ptr; /* Pointer to Forms_Text, one or more text characters */ typedef void _Mem_Access_ * Forms_Routine_Arg_Ptr; /* Pointer (any type) to Completion routine argument */ typedef void (_Rtn_Access_ * Forms_Routine_Ptr) (Forms_Routine_Arg_Ptr); /* Pointer to Completion routine returning Void */ typedef void _Mem_Access_ * Forms_Form_Object_Ptr; /* Pointer to linked in Form file */ typedef char Forms_Request_Id[24]; /* Parent request id text string of 24 characters */ typedef char _Mem_Access_ * Forms_Request_Id_Ptr; /* Pointer to Forms_Request_Id */ /***********************************************************************************************/ /* */ /* Structure for passing send and receive record data and shadow record data */ /* */ /***********************************************************************************************/ typedef struct { Forms_Data_Length data_length; /* length of the actual record data area */ Forms_Generic_Ptr data_record; /* pointer to the actual record data area */ Forms_Shadow_Length shadow_length; /* length of the shadow record data area */ Forms_Generic_Ptr shadow_record; /* pointer to the shadow record data area */ } Forms_Record_Data; /***********************************************************************************************/ /* */ /* Structure for building a field in a record message which maps to a record field */ /* of IFDL data type TM. ANSI C doesn't say how long the tm data type is, only that */ /* it contains certain "int" fields. The DECforms TM data type is an implementation of the */ /* ANSI C data type, but your C compiler may have a different (but still standard-conforming) */ /* definition of TM. Hence this structure can be used to load and unload the record message */ /* even if your C compiler's implementation of tm contains additional fields. */ /* */ /***********************************************************************************************/ typedef struct { Forms_Time_Value tm_sec, tm_min, tm_hour; Forms_Time_Value tm_mday, tm_mon, tm_year; Forms_Time_Value tm_wday, tm_yday, tm_isdst; } Forms_Tm; /***********************************************************************************************/ /* */ /* Option names for Forms_Request_Options */ /* */ /***********************************************************************************************/ typedef enum { forms_c_opt_selection_label = -10, /* selection label value */ forms_c_opt_default_color = -9, /* default color type */ forms_c_opt_default_term = -8, /* default terminal type */ forms_c_opt_no_term_io = -7, /* suppresses terminal I/O */ forms_c_opt_form = -6, /* DECforms form Object */ forms_c_opt_trace = -5, /* name of the trace file and options */ forms_c_opt_print = -4, /* name of printfile to use */ forms_c_opt_language = -3, /* name of language to match */ forms_c_opt_completion_status = -2, /* location to store completion status */ forms_c_opt_completion_routine = -1, /* completion routine and parameter */ forms_c_opt_end = 0, /* indicates end of request options */ forms_c_opt_parent_request = 1, /* specifies parent request id */ forms_c_opt_receive_record = 2, /* number of records being passed */ forms_c_opt_send_record = 3, /* number of records being passed */ forms_c_opt_receive_control = 4, /* receive control text info */ forms_c_opt_send_control = 5, /* send control text info */ forms_c_opt_timeout = 6, /* describes timeout period */ forms_c_opt_stack_size = 7 /* amount to use for request stack size */ } Forms_Request_Options_Values; typedef long int Forms_Request_Options_Type; /***********************************************************************************************/ /* */ /* Forms_Request_Options for API request calls */ /* */ /***********************************************************************************************/ typedef union { /* Discriminate Tag */ Forms_Request_Options_Type option; struct { /* forms_c_opt_selection_label */ Forms_Request_Options_Type option; Forms_Text_Ptr name; /* Name of layout to choose */ Forms_Text_Length name_length; /* length of name */ } selection_label; struct { /* forms_c_opt_default_color */ Forms_Request_Options_Type option; Forms_Default_Color_Type type; /* when runtime can't detect whether you have color, set this value */ } default_color; struct { /* forms_c_opt_default_term */ Forms_Request_Options_Type option; Forms_Default_Term_Type type; /* when runtime can't detect the terminal type, set this value */ } default_term; struct { /* forms_c_opt_no_term_io */ Forms_Request_Options_Type option; Forms_Flags flag; } no_term_io; struct { /* forms_c_opt_form */ Forms_Request_Options_Type option; Forms_Form_Object_Ptr object; /* Pointer created by Forms_Form_Object, in application program */ } form; struct { /* forms_c_opt_trace */ Forms_Request_Options_Type option; Forms_Text_Ptr file_name; /* Name of trace file */ Forms_Text_Length file_name_length; /* length of name */ Forms_Flags flag; } trace; struct { /* forms_c_opt_print */ Forms_Request_Options_Type option; Forms_Text_Ptr file_name; /* Name of file or device that the PRINT step uses */ Forms_Text_Length file_name_length; /* length of name */ } print; struct { /* forms_c_opt_language */ Forms_Request_Options_Type option; Forms_Text_Ptr name; /* Name to use when selecting a layout, matches the LANGUAGE clause */ Forms_Text_Length name_length; /* length of name */ } language; struct { /* forms_c_opt_completion_status */ Forms_Request_Options_Type option; Forms_Status_Ptr address; /* Address to load completion status when request completes */ } completion_status; struct { /* forms_c_opt_completion_routine */ Forms_Request_Options_Type option; Forms_Routine_Ptr address; /* Address of routine to call when request completes */ Forms_Routine_Arg_Ptr parameter; /* Address of parameter to pass to completion routine */ } completion_routine; struct { /* forms_c_opt_end */ Forms_Request_Options_Type option; } end; struct { /* forms_c_opt_parent_request */ Forms_Request_Options_Type option; Forms_Request_Id_Ptr id; /* Pointer to parent request id, for calls to DECforms while a */ } parent_request; /* DECforms request is still active (such as from an Escape Routine) */ struct { /* forms_c_opt_receive_record */ Forms_Request_Options_Type option; Forms_Count count; /* Number of unique receive records in the request */ } receive_record; struct { /* forms_c_opt_send_record */ Forms_Request_Options_Type option; Forms_Count count; /* Number of unique send records in the request */ } send_record; struct { /* forms_c_opt_receive_control */ Forms_Request_Options_Type option; Forms_Count_Ptr text_count; /* Pointer to Number of control text items returned by DECforms - write only */ Forms_Control_Text_Ptr text; /* Receive control text must be an array of 25 bytes */ } receive_control; struct { /* forms_c_opt_send_control */ Forms_Request_Options_Type option; Forms_Count text_count; /* Number of control text being sent to DECforms - read only */ Forms_Control_Text_Ptr text; /* Send control text could be up to 25 bytes, in multiples of 5 */ } send_control; struct { /* forms_c_opt_timeout */ Forms_Request_Options_Type option; Forms_Value period; /* Timeout value is limited to the range 0 to 32767 seconds on VMS. */ } timeout; struct { /* forms_c_opt_stack_size */ Forms_Request_Options_Type option; Forms_Value value; /* Stack size value. */ } stack_size; struct { Forms_Request_Options_Type option; /* This structure is placed here to ensure extensibility. */ char forms_reserved_bytes[28]; /* Please do not use this structure. */ } forms_reserved_struct; } Forms_Request_Options; /* */ /* FIMS specified status value */ /* */ /* Note: S000 and ESnnn are corresponding FIMS control texts. */ /* */ /* Severity of each status is indicated by: */ /* */ /* (E) - Fatal error(s) occurred during request. Must be fixed before continuing. */ /* (W) - Warning error(s) occurred during request. Should fix before continuing. */ /* (I) - Informational event(s) occurred during request. */ /* (S) - Request processed successfully. */ /* */ typedef enum { forms_s_normal = 0, /* S000: (S) Request calls completed successfully */ forms_s_timeout = 1, /* ES001: (E) Input did not complete in the time specified */ forms_s_formerror = 2, /* ES002: (E) Encountered problem when using form file */ forms_s_nolayout = 3, /* ES003: (E) No layout fit terminal type, language and display size */ forms_s_invdevice = 4, /* ES004: (E) Invalid device specified in ENABLE */ forms_s_hangup = 5, /* ES005: (E) Data set hangup; session disabled */ forms_s_norecord = 7, /* ES007: (E) Specified record identifier not in form */ forms_s_badreclen = 8, /* ES008: (E) Record length argument did not match length of record in form */ forms_s_inuse = 10, /* ES010: (E) Attempted to disable a form still in use */ forms_s_nosession = 11, /* ES011: (E) Session id in argument did not match existing session */ forms_s_return_immed = 12, /* ES012: (S) Request completed due to REQUEST IMMEDIATE */ forms_s_nodecpt = 14, /* ES014: (E) Decimal or comma decimal point positioned incorrectly in record field */ forms_s_bad_rshdwreclen = 15, /* ES015: (E) Receive-shadow-record-length did not match length specified in form */ forms_s_bad_sshdwreclen = 16, /* ES016: (E) Send-shadow-record-length is something other than 1 */ forms_s_cancelled = 17, /* ES017: (E) Request interrupted by arrival of CANCEL */ forms_s_noactreq = 19, /* ES019: (E) No active requests to CANCEL */ forms_s_invlobound = 24, /* ES024: (E) Subscript reference less than base */ forms_s_invhibound = 25, /* ES025: (E) Subscript reference greater than array dimension defined */ /* */ /* DECforms specific status values */ /* */ /* Note: EInnn are corresponding DECforms control texts. Any status relating to parameter checking */ /* of DECforms request calls or license checking of DECforms will not have a corresponding */ /* control text. */ /* */ /* Severity of each status is indicated by: */ /* */ /* (E) - Fatal error(s) occurred during request. Must be fixed before continuing. */ /* (W) - Warning error(s) occurred during request. Should fix before continuing. */ /* (I) - Informational event(s) occurred during request. */ /* (S) - Request processed successfully. */ /* */ forms_s_illdtcvt = -1, /* EI001: (W) Illegal DATE, TIME, ADT conversion */ forms_s_badreccnt = -2, /* EI002: (E) number of records did not match number specified in record list */ forms_s_converr = -3, /* EI003: (I) Error while converting from one data type to another */ forms_s_aborted = -4, /* EI004: (E) Session aborted due to severe error in another request */ forms_s_badarg = -5, /* : (E) Bad argument or incorrect format */ forms_s_baditmlstcode = -6, /* : (E) Invalid item code found in item list */ forms_s_baditmlstcomb = -7, /* : (E) Invalid combination of item codes found in item list */ forms_s_blocked_by_ast = -8, /* EI008: (E) Cannot process request; block by application AST */ forms_s_bad_devhlr = -9, /* EI009: (E) Invalid device handler */ forms_s_caninprog = -10, /* EI010: (E) A previous CANCEL is still in progress */ forms_s_closetrace = -11, /* EI011: (W) Cannot close trace file */ forms_s_deverr = -12, /* EI012: (E) Device I/O error */ forms_s_disinprog = -13, /* EI013: (E) A previous DISABLE is still in progress */ forms_s_exprevalerr = -14, /* EI014: (E) Cannot convert operands into common data type */ forms_s_fatinterr = -15, /* EI015: (E) Fatal Internal error */ forms_s_illctltxtcnt = -16, /* : (E) Illegal control text count argument */ forms_s_illfldvaluectx = -17, /* EI017: (E) Illegal FIELDVALUE context */ forms_s_illvpuse = -18, /* EI018: (E) Illegal use of print viewport */ forms_s_intdatcor = -19, /* EI019: (E) Database consistency check failed */ forms_s_invrange = -20, /* EI020: (E) Invalid subscript range */ forms_s_invreccnt = -21, /* EI021: (E) Invalid record count value */ forms_s_invrecdes = -22, /* EI022: (E) Invalid record message descriptor */ forms_s_nohandler = -23, /* EI023: (E) No device handler for such device */ forms_s_nolicense = -24, /* : (E) No DECforms software license is active */ forms_s_noparent = -25, /* EI025: (E) Specified parent request did not exist */ forms_s_no_read_access = -26, /* : (E) No read access to user argument */ forms_s_openout = -27, /* EI027: (E) The specified output file cannot be opened */ forms_s_opentrace = -28, /* EI028: (W) Cannot open trace file for output */ forms_s_paramovrflow = -29, /* EI029: (E) An escape routine parameter has overflowed */ forms_s_procesc_not_found = -30, /* EI030: (E) Address of procedural escape not found */ forms_s_proc_escape_error = -31, /* EI031: (E) Request terminated due to severe error in PEU */ forms_s_recvrecitems = -32, /* : (E) # of receive record items did not match record count value */ forms_s_reqdarg = -33, /* : (E) Required argument missing */ forms_s_sendrecitems = -34, /* : (E) # of send record items did not match record count value */ forms_s_strtooshort = -35, /* EI035: (E) length of string is too small */ forms_s_writetrace = -36, /* EI036: (W) Cannot write to trace file */ forms_s_no_write_access = -37, /* : (E) No write access to user argument */ forms_s_bckgrndio = -38, /* EI038: (E) Attempted read or write I/O from background process */ forms_s_timeract = -39, /* EI039: (E) Attempted timed field input while alarm active */ forms_s_blkbyreq = -40, /* EI040: (E) Attempted synchronous request while another request active */ forms_s_imgmismatch = -41, /* : (E) Shareable image mismatch */ forms_s_nyi = -42, /* EI042: (E) Requested operation is not yet implemented */ forms_s_cantopendic = -46 /* EI046: (E) Can't open the Kana-Kanji conversion dictionary */ } Forms_Status_Values; /*************************************************************************/ /* */ /* Forms_Quadword is a structure which is used to represent a quad */ /* word support on platforms which do not natively support quadword */ /* data types (like in DECforms for MS Windows) */ /* */ /*************************************************************************/ typedef struct forms_quad_struct { unsigned long lo; long hi; } Forms_Quadword; /* Prevent the name mangling that C++ does, so that we keep these external names */ #if defined (__cplusplus) extern "C" { #endif /*************************************************************************/ /* */ /* Define the function prototypes for the 6 DECforms calls */ /* */ /* These are the definitions for those compilers that DO */ /* support function prototypes with parameter definitions */ /* */ /*************************************************************************/ #if defined(__STDC__) || defined (vaxc) || defined (MSDOS) || defined (__cplusplus) Forms_Status _Rtn_Access_ forms_enable (char _Mem_Access_ * session_id, Forms_Text_Ptr device_name, Forms_Text_Ptr form_file_name, Forms_Text_Ptr form_name, Forms_Request_Options _Mem_Access_ request_options[]); Forms_Status _Rtn_Access_ forms_send (char _Mem_Access_ * session_id, Forms_Text_Ptr send_record_name, Forms_Record_Data _Mem_Access_ send_record[], Forms_Request_Options _Mem_Access_ request_options[]); Forms_Status _Rtn_Access_ forms_receive (char _Mem_Access_ * session_id, Forms_Text_Ptr receive_record_name, Forms_Record_Data _Mem_Access_ receive_record[], Forms_Request_Options _Mem_Access_ request_options[]); Forms_Status _Rtn_Access_ forms_transceive (char _Mem_Access_ * session_id, Forms_Text_Ptr send_record_name, Forms_Record_Data _Mem_Access_ send_record[], Forms_Text_Ptr receive_record_name, Forms_Record_Data _Mem_Access_ receive_record[], Forms_Request_Options _Mem_Access_ request_options[]); Forms_Status _Rtn_Access_ forms_disable (char _Mem_Access_ * session_id, Forms_Request_Options _Mem_Access_ request_options[]); Forms_Status _Rtn_Access_ forms_cancel (char _Mem_Access_ * session_id, Forms_Request_Options _Mem_Access_ request_options[]); /* * Include the routine that converts a Forms_Status code into a * text string. Make sure that the Error_Message_Text_String is * char array of 256 characters (pre-allocated). */ void _Rtn_Access_ forms_errormsg (Forms_Status Status_Return_Code, Forms_Text_Ptr Error_Message_Text_String); #else /*************************************************************************/ /* */ /* Define the function prototypes for the 6 DECforms calls */ /* */ /* These are the definitions for those compilers that do NOT */ /* support function prototypes with parameter definitions */ /* */ /*************************************************************************/ Forms_Status forms_enable(); Forms_Status forms_send(); Forms_Status forms_receive(); Forms_Status forms_transceive(); Forms_Status forms_disable(); Forms_Status forms_cancel(); void _Rtn_Access_ forms_errormsg(); #endif /* End of "if defined STDC, etc" */ /* End of "Prevent the name mangling that C++ does, so that we keep these external names" */ #if defined (__cplusplus) } #endif #undef _Rtn_Access_ #undef _Mem_Access_ #endif /* if !defined _FORMS_DEFINED */