home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / extensions / lib / PEX / include / psl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-15  |  4.3 KB  |  144 lines

  1. /* $XConsortium: psl.h,v 5.1 91/02/16 09:49:18 rws Exp $ */
  2.  
  3. /***********************************************************
  4. Copyright 1989, 1990, 1991 by Sun Microsystems, Inc. and the X Consortium.
  5.  
  6.                         All Rights Reserved
  7.  
  8. Permission to use, copy, modify, and distribute this software and its 
  9. documentation for any purpose and without fee is hereby granted, 
  10. provided that the above copyright notice appear in all copies and that
  11. both that copyright notice and this permission notice appear in 
  12. supporting documentation, and that the names of Sun Microsystems,
  13. the X Consortium, and MIT not be used in advertising or publicity 
  14. pertaining to distribution of the software without specific, written 
  15. prior permission.  
  16.  
  17. SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
  18. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 
  19. SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  20. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23. SOFTWARE.
  24. ******************************************************************/
  25.  
  26. #ifndef PHG_PSL_H_INCLUDED
  27. #define PHG_PSL_H_INCLUDED
  28.  
  29. /* phigs state list */
  30.  
  31. #ifndef MAXNAMLEN
  32. #define MAXNAMLEN        255
  33. #endif
  34.  
  35. #  define MAX_NO_OPEN_WS    PDT_MAX_SIM_OPEN_WS
  36.  
  37. #define MAX_NO_OPEN_ARFILES    PDT_MAX_SIM_OPEN_ARFILES
  38.  
  39. #define PSL_SYS_STATE( psl) \
  40.     ((psl)->phg_sys_state)
  41.  
  42. #define PSL_WS_STATE( psl) \
  43.     ((psl)->phg_ws_state)
  44.  
  45. #define PSL_STRUCT_STATE( psl) \
  46.     ((psl)->phg_struct_state)
  47.  
  48. #define PSL_AR_STATE( psl) \
  49.     ((psl)->phg_ar_state)
  50.  
  51. #define PSL_ARCHIVE_CONFLICT( psl) \
  52.     ((psl)->ar_res)
  53.  
  54. #define PSL_RETRIEVE_CONFLICT( psl) \
  55.     ((psl)->retr_res)
  56.  
  57. #define PSL_MORE_SIMULTEV( psl) \
  58.     ((psl)->more_simultev)
  59.  
  60. #define PSL_SET_CUR_EVENT_ID( _psl, _id) \
  61.     ((_psl)->cur_event.id = (_id))
  62.  
  63. #define PSL_SET_CUR_EVENT_DATA( _psl, _data) \
  64.     ((_psl)->cur_event.data = (_data))
  65.  
  66. #define PSL_CUR_EVENT_CLASS( _psl) \
  67.     ((_psl)->cur_event.id.class)
  68.  
  69. #define PSL_CUR_EVENT_DATA( _psl, _class) \
  70.     ((_psl)->cur_event.data._class)
  71.  
  72. #define PSL_CLEAR_CUR_EVENT( _psl) \
  73.     {   switch ((_psl)->cur_event.id.class) { \
  74.       case PIN_STROKE: \
  75.         if ( (_psl)->cur_event.data.stk.num_points > 0) \
  76.         free((char*)((_psl)->cur_event.data.stk.points)); \
  77.         break; \
  78.       case PIN_PICK: \
  79.         if ( (_psl)->cur_event.data.pik.status == PIN_STATUS_OK \
  80.         && (_psl)->cur_event.data.pik.pick_path.depth > 0) \
  81.         free((char*)((_psl)->cur_event.data.pik.pick_path.path_list)); \
  82.         break; \
  83.       case PIN_STRING: \
  84.         if ( (_psl)->cur_event.data.str.length > 0) \
  85.         free((char*)((_psl)->cur_event.data.str.string)); \
  86.         break; \
  87.     } \
  88.     (_psl)->cur_event.id.class = PIN_NONE; \
  89.     }
  90.  
  91. typedef struct {
  92.     Pint    used;
  93.     Pint    wsid;
  94.     char    *connid;
  95.     Wst        *wstype;
  96.     int        lun;    /* logical unit number for FORTRAN (only). */
  97. } Psl_ws_info;
  98.  
  99. typedef struct {
  100.     Pint    used;
  101.     char    *fname;
  102.     Pint    arid;
  103.     int        lun;    /* logical unit number for FORTRAN (only). */
  104. } Psl_ar_info;
  105.  
  106. typedef struct {
  107.     Pevent        id;
  108.     Phg_inp_event_data    data;
  109. } Psl_inp_event;
  110.  
  111. typedef struct _Phg_state_list {
  112.     Psys_st    phg_sys_state;        /* system state */
  113.     Pws_st        phg_ws_state;        /* workstation state */
  114.     Pstruct_st    phg_struct_state;    /* structure state */
  115.     Par_st    phg_ar_state;        /* archive state */
  116.     Psl_ws_info        open_ws[MAX_NO_OPEN_WS]; /* open workstations */
  117.     Psl_ar_info        ar_files[MAX_NO_OPEN_ARFILES]; /* open archives */ 
  118.     Pconf_res        ar_res;        /* archival conflict resolution */
  119.     Pconf_res        retr_res;    /* retrieval conflict resolution */
  120.     Pmore_simult_events    more_simultev;    /* more simultaneous events */
  121.     Psl_inp_event    cur_event;
  122.     Pedit_mode        edit_mode;
  123.     Pint        open_struct;
  124. } Phg_state_list;
  125.  
  126. typedef Phg_state_list    *Psl_handle;
  127.  
  128. extern Psl_handle    phg_psl_init();
  129. extern void        phg_psl_destroy();
  130. extern int        phg_psl_ws_free_slot();
  131. extern int        phg_psl_add_ws();
  132. extern void        phg_psl_rem_ws();
  133. extern int        phg_psl_inq_ws_open();
  134. extern int        phg_psl_inq_wsids();
  135. extern Psl_ws_info*    phg_psl_get_ws_info();
  136.  
  137. extern Psl_ar_info*    phg_psl_get_ar_info();
  138. extern int        phg_psl_ar_free_slot();
  139. extern int        phg_psl_add_ar();
  140. extern void        phg_psl_rem_ar();
  141. extern int        phg_psl_inq_ar_open();
  142.  
  143. #endif
  144.