home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / S12442.ZIP / DI.H < prev    next >
C/C++ Source or Header  |  1989-07-31  |  3KB  |  75 lines

  1. /* di.h RHS 7/15/89
  2.  *
  3.  */
  4.  
  5. #define    DIRINFOQNAME    "\\QUEUES\\DIRINFO.QUE"
  6. #define    MAXSEGSIZE    (USHORT)65536
  7.  
  8. #if    defined(DICODE)
  9.  
  10. typedef struct _dirinforesult
  11.     {
  12.     USHORT                    attributes;        /* attributes this request        */
  13.     PCH                        filespec;        /* filespec to use                */
  14.     PCH                        currentdir;        /* currentdir this request        */
  15.     PFILEFINDBUF            firstfile;        /* first result                    */
  16.     PFILEFINDBUF            nextfile;        /* next result                        */
  17.     USHORT                    numfound;        /* number of files found        */
  18.     USHORT                    errorval;        /* error value returned            */
  19.     struct _dirinforesult    *next;        /* related structure if found    */
  20.     } DIRINFORESULT;
  21. typedef DIRINFORESULT FAR *PDIRINFORESULT;
  22.  
  23. typedef struct _requestheader
  24.     {
  25.     ULONG                RAMsem;                    /* RAM semaphore for client    */
  26.     SEL                    rselector;            /* client selector to results    */
  27.     HQUEUE                qhandle;                /* handle to server's queue    */
  28.     PID                    qowner;                /* PID of server (queue owner)*/
  29.     VOID FAR            *resultptr;                /* server pointer to work area*/
  30.     SEL                    serverhsel;            /* server selector to header    */
  31.     SEL                    serverwsel;            /* server selector to results    */
  32.     PCH                    currentdir;            /* client's dir in work area    */
  33.     PCH                    requestspec;        /* next part of work area        */
  34.     USHORT                size;                    /* curr. size header    segment    */
  35.     USHORT                resultsize;            /* new size of result segment    */
  36.     USHORT                totalresults;        /* total results found            */
  37.     USHORT                numRequests;        /* # of requests being made    */
  38.     DIRINFORESULT        resultArray[1];    /* request structures            */
  39.     } REQUESTHEADER;
  40. typedef REQUESTHEADER FAR *PREQUESTHEADER;
  41.  
  42.  
  43. void DiInit(PID *qowner, HQUEUE *qhandle);
  44. void DiMakeRequest(PREQUESTHEADER *hptr, PCH filespec, USHORT att);
  45. void DiSendRequest(PREQUESTHEADER header);
  46. void DiGetNumResults(PREQUESTHEADER header,USHORT *numresults,USHORT *numrequests);
  47. void DiDestroyRequest(PREQUESTHEADER *header);
  48. char *DiGetResultFspec(PDIRINFORESULT result);
  49. char *DiGetResultDir(PDIRINFORESULT result);
  50. void DiGetResultHdl(PREQUESTHEADER header,USHORT requestnum,USHORT *num, PDIRINFORESULT *resulthdl);
  51. void DiGetFirstResult(PDIRINFORESULT result, char *buffer);
  52. void DiGetNextResult(PDIRINFORESULT result, char *buffer);
  53. void DiGetFirstResultPtr(PDIRINFORESULT result, PFILEFINDBUF *ptr);
  54. void DiGetNextResultPtr(PDIRINFORESULT result, PFILEFINDBUF *ptr);
  55.  
  56. #else
  57.  
  58. void DiInit(PID *qowner, HQUEUE *qhandle);
  59. void DiMakeRequest(PVOID *hptr, PCH filespec, USHORT att);
  60. void DiSendRequest(PVOID header);
  61. void DiGetNumResults(PVOID header,USHORT *numresults,USHORT *numrequests);
  62. void DiDestroyRequest(PVOID *header);
  63. char *DiGetResultFspec(PVOID result);
  64. char *DiGetResultDir(PVOID result);
  65. void DiGetResultHdl(PVOID header,USHORT requestnum,USHORT *num,
  66.         PVOID *resulthdl);
  67. void DiGetFirstResult(PVOID result, char *buffer);
  68. void DiGetNextResult(PVOID result, char *buffer);
  69. void DiGetFirstResultPtr(PVOID result, PFILEFINDBUF *ptr);
  70. void DiGetNextResultPtr(PVOID result, PFILEFINDBUF *ptr);
  71.  
  72. #endif
  73.  
  74.  
  75.