home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / REMUTIL.H < prev    next >
C/C++ Source or Header  |  1997-09-05  |  10KB  |  233 lines

  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*              IBM OS/2(tm) File and Print Client Services               */
  4. /* (c) Copyright International Business Machines Corporation, 1988, 1996  */
  5. /*                                                                        */
  6. /**************************************************************************/
  7. /********************************************************************/
  8.  
  9. /********************************************************************
  10.  *                                                                  *
  11.  *  About this file ...  REMUTIL.H                                  *
  12.  *                                                                  *
  13.  *  This file contains information about the NetRemote APIs.        *
  14.  *                                                                  *
  15.  *      Function prototypes.                                        *
  16.  *                                                                  *
  17.  *      Data structure templates.                                   *
  18.  *                                                                  *
  19.  *      Definition of special values.                               *
  20.  *                                                                  *
  21.  *                                                                  *
  22.  *  NOTE:  You must include NETCONS.H before this file, since this  *
  23.  *         file depends on values defined in NETCONS.H.             *
  24.  *                                                                  *
  25.  ********************************************************************/
  26.  
  27.  
  28. #ifndef NETREMUTIL_INCLUDED
  29.  
  30. #define NETREMUTIL_INCLUDED
  31.  
  32. #ifdef  ANY_32_BIT
  33. #pragma pack(1)
  34. #endif
  35.  
  36.  
  37. /****************************************************************
  38.  *                                                              *
  39.  *              Function prototypes - REMOTE                    *
  40.  *                                                              *
  41.  ****************************************************************/
  42.  
  43. extern API_FUNCTION
  44.   NetRemoteCopy ( const unsigned char LSFAR * pszSourcePath,
  45.                   const unsigned char LSFAR * pszDestPath,
  46.                   const unsigned char LSFAR * pszSourcePasswd,
  47.                   const unsigned char LSFAR * pszDestPasswd,
  48.                   unsigned short     fsOpen,
  49.                   unsigned short     fsCopy,
  50.                   unsigned char LSFAR *       pbBuffer,
  51.                   unsigned short     cbBuffer );
  52.  
  53. extern API_FUNCTION
  54.   NetRemoteExec ( unsigned char LSFAR *       pszReserved1,
  55.                   unsigned char LSFAR *       pszFailName,
  56.                   unsigned LSINT     cbFailName,
  57.                   unsigned LSINT     fAsync,
  58.                   const unsigned char LSFAR * pszArgs,
  59.                   const unsigned char LSFAR * pszEnvs,
  60.                   unsigned char LSFAR *       pReturnCodes,
  61.                   const unsigned char LSFAR * pszPgmName,
  62.                   unsigned char LSFAR *       pszReserved2,
  63.                   unsigned short     fsRemoteExec );
  64.  
  65. extern API_FUNCTION
  66.   NetRemoteMove ( const unsigned char LSFAR * pszSourcePath,
  67.                   const unsigned char LSFAR * pszDestPath,
  68.                   const unsigned char LSFAR * pszSourcePasswd,
  69.                   const unsigned char LSFAR * pszDestPasswd,
  70.                   unsigned short     fsOpen,
  71.                   unsigned short     fsMove,
  72.                   unsigned char LSFAR *       pbBuffer,
  73.                   unsigned short     cbBuffer );
  74.  
  75. extern API_FUNCTION
  76.   NetRemoteTOD ( const unsigned char LSFAR * pszServer,
  77.                  unsigned char LSFAR *       pbBuffer,
  78.                  unsigned short     cbBuffer );
  79.  
  80. extern API_FUNCTION
  81.   NetRemoteTODSet ( const unsigned char LSFAR * pszServer,
  82.                     unsigned char LSFAR *       pbBuffer,
  83.                     unsigned short              cbBuffer,
  84.                     unsigned long               reserved );
  85.  
  86.  
  87. /****************************************************************
  88.  *                                                              *
  89.  *              Data structure templates - REMOTE               *
  90.  *                                                              *
  91.  ****************************************************************/
  92.  
  93. struct copy_info {
  94.         unsigned short  ci_num_copied;
  95.         unsigned char   ci_err_buf[1];
  96. };      /* copy_info */
  97.  
  98.  
  99. struct move_info {
  100.         unsigned short  mi_num_moved;
  101.         unsigned char   mi_err_buf[1];
  102. };      /* move_info */
  103.  
  104. struct time_of_day_info {
  105.     unsigned long   tod_elapsedt;   /* time from 1-1-1970 in seconds */
  106.     unsigned long   tod_msecs;      /* milliseconds */
  107.     unsigned char   tod_hours;      /* hours */
  108.     unsigned char   tod_mins;       /* minutes */
  109.     unsigned char   tod_secs;       /* seconds */
  110.     unsigned char   tod_hunds;      /* hundredths */
  111.     unsigned short  tod_timezone;   /* time zone in minutes from GMT */
  112.     unsigned short  tod_tinterval;  /* timer interval (units = 0.0001 sec) */
  113.     unsigned char   tod_day;        /* day */
  114.     unsigned char   tod_month;      /* month */
  115.     unsigned short  tod_year;       /* year */
  116.     unsigned char   tod_weekday;    /* day of week */
  117. };      /* time_of_day_info */
  118.  
  119.  
  120. #ifdef PURE_32
  121. /****************************************************************
  122.  *                                                              *
  123.  *              Function prototypes - REMOTE                    *
  124.  *              For "pure" 32-bit code                          *
  125.  ****************************************************************/
  126.  
  127. extern API32_FUNCTION
  128. Net32RemoteCopy ( const unsigned char      * pszSourcePath,
  129.                   const unsigned char      * pszDestPath,
  130.                   const unsigned char      * pszSourcePasswd,
  131.                   const unsigned char      * pszDestPasswd,
  132.                   unsigned long      fsOpen,          /* was short */
  133.                   unsigned long      fsCopy,          /* was short */
  134.                   unsigned char    * pbBuffer,
  135.                   unsigned long      ulBuffer );      /* was short */
  136.  
  137. extern API32_FUNCTION
  138. Net32RemoteExec ( unsigned char    * pszReserved1,
  139.                   unsigned char    * pszFailName,
  140.                   unsigned long      cbFailName,    /* was unsigned LSINT */
  141.                   unsigned long      fAsync,        /* was unsigned LSINT */
  142.                   const unsigned char      * pszArgs,
  143.                   const unsigned char      * pszEnvs,
  144.                   unsigned char    * pReturnCodes,
  145.                   const unsigned char      * pszPgmName,
  146.                   unsigned char    * pszReserved2,
  147.                   unsigned long      fsRemoteExec );  /* was short */
  148.  
  149. extern API32_FUNCTION
  150. Net32RemoteMove ( const unsigned char      * pszSourcePath,
  151.                   const unsigned char      * pszDestPath,
  152.                   const unsigned char      * pszSourcePasswd,
  153.                   const unsigned char      * pszDestPasswd,
  154.                   unsigned long      fsOpen,          /* was short */
  155.                   unsigned long      fsMove,          /* was short */
  156.                   unsigned char    * pbBuffer,
  157.                   unsigned long      ulBuffer );      /* was short */
  158.  
  159. extern API32_FUNCTION
  160. Net32RemoteTOD ( const unsigned char      * pszServer,
  161.                  unsigned char    * pbBuffer,
  162.                  unsigned long      ulBuffer );       /* was short */
  163.  
  164. extern API32_FUNCTION
  165. Net32RemoteTODSet ( const unsigned char * pszServer,
  166.                     unsigned char *       pbBuffer,
  167.                     unsigned long         ulBuffer,
  168.                     unsigned long         reserved );
  169. #endif /* PURE_32 */
  170.  
  171.  
  172. /****************************************************************
  173.  *                                                              *
  174.  *           Special values and constants - REMOTE              *
  175.  *                                                              *
  176.  ****************************************************************/
  177.  
  178. /*
  179.  *      Bit values for the "copyflags" parameter of NetRemoteCopy
  180.  *      and the "moveflags" parameter of NetRemoteMove.
  181.  *
  182.  *      bit 0:          1 - destination mode must be a file
  183.  *      bit 1:          1 - destination mode must be a directory
  184.  *
  185.  *      The following bits are defined for NetRemoteCopy ONLY.
  186.  *
  187.  *      bit 2:          0 - destination copy mode is binary.
  188.  *                      1 - destination copy mode is ASCII.
  189.  *      bit 3:          0 - source copy mode is binary.
  190.  *                      1 - source copy mode is ASCII.
  191.  *      bit 4:          1 - verify all writes.
  192.  */
  193.  
  194. #define MUST_BE_FILE    0x1
  195. #define MUST_BE_DIR     0x2
  196. #define ASCII_DEST      0x4
  197. #define ASCII_SOURCE    0x8
  198. #define VERIFY          0x10
  199.  
  200.  
  201. /*
  202.  *      Bit values for the "remexecflags" parameter of NetRemoteExec.
  203.  *
  204.  *      bit 0:          0 - use msg mode pipe for std in
  205.  *                      1 - use unsigned charmode pipe for std in
  206.  *      bit 1:          0 - CWait for process tree before returning
  207.  *                          ExitCode to Ghost
  208.  *                      1 - CWait for exec'ed process before returning
  209.  *                          ExitCode to Ghost
  210.  *      bit 2:          0 - Map SIGINTR and SIGBREAK to SIGKILL when
  211.  *                          remoting signals
  212.  *                      1 - Send signals as received
  213.  */
  214.  
  215. #define REM_PIPE_MODE           1
  216. #define REM_PIPE_MODE_MSG       0
  217. #define REM_PIPE_MODE_CHAR      1
  218.  
  219. #define REM_WAIT_MODE           2
  220. #define REM_WAIT_MODE_PROCESS   0
  221. #define REM_WAIT_MODE_TREE      2
  222.  
  223. #define REM_SIGL_MODE           4
  224. #define REM_SIGL_MODE_MAP       0
  225. #define REM_SIGL_MODE_RAW       4
  226.  
  227.  
  228. #ifdef  ANY_32_BIT
  229. #pragma pack()
  230. #endif
  231.  
  232. #endif /* NETREMUTIL_INCLUDED */
  233.