home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / freeWAIS-0.202.tar.gz / freeWAIS-0.202.tar / freeWAIS-0.202 / ir / zprot.h < prev    next >
C/C++ Source or Header  |  1993-10-05  |  6KB  |  185 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE:
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.    
  4.   
  5.    3.26.90    Harry Morris, morris@think.com
  6.    3.30.90  Harry Morris - Changed any->bits to any->bytes
  7. */
  8.  
  9. /* Copyright (c) CNIDR (see ../COPYRIGHT) */
  10.  
  11.  
  12. #ifndef _H_Z39_50
  13.  
  14. #define _H_Z39_50
  15.  
  16. #include "cdialect.h"
  17.  
  18. #include "zutil.h"
  19.  
  20. /*----------------------------------------------------------------------*/
  21. /* APDU types */
  22.  
  23. typedef struct InitAPDU {
  24.     pdu_type        PDUType;
  25.     boolean            willSearch,willPresent,willDelete;
  26.     boolean            supportAccessControl,supportResourceControl;
  27.     long            PreferredMessageSize;
  28.     long            MaximumRecordSize;
  29.     char*            IDAuthentication;
  30.     char*            ImplementationID;
  31.     char*             ImplementationName;
  32.     char*            ImplementationVersion;
  33.     any*            ReferenceID;
  34.     void*            UserInformationField;
  35.     } InitAPDU;
  36.  
  37. typedef struct InitResponseAPDU {
  38.     pdu_type        PDUType;
  39.     boolean            Result;
  40.     boolean            willSearch,willPresent,willDelete;
  41.     boolean            supportAccessControl,supportResourceControl;
  42.     long            PreferredMessageSize;
  43.     long             MaximumRecordSize;
  44.     char*            IDAuthentication;
  45.     char*            ImplementationID;
  46.     char*             ImplementationName;
  47.     char*            ImplementationVersion;
  48.     any*            ReferenceID;
  49.     void*            UserInformationField;
  50.     } InitResponseAPDU;
  51.  
  52. typedef struct SearchAPDU {
  53.     pdu_type        PDUType;
  54.     long             SmallSetUpperBound;
  55.     long            LargeSetLowerBound;
  56.     long             MediumSetPresentNumber;
  57.     boolean         ReplaceIndicator;
  58.     char*            ResultSetName;
  59.     char**            DatabaseNames;   
  60.     char*            QueryType;
  61.     char**            ElementSetNames;  
  62.     any*            ReferenceID;
  63.     void*            Query;
  64.     } SearchAPDU;
  65.  
  66. typedef struct SearchResponseAPDU {
  67.     pdu_type        PDUType;
  68.     long            SearchStatus;
  69.     long            ResultCount;
  70.     long            NumberOfRecordsReturned;
  71.     long             NextResultSetPosition;
  72.     long            ResultSetStatus;
  73.     long             PresentStatus;
  74.     any*            ReferenceID;
  75.     void*            DatabaseDiagnosticRecords;
  76.     } SearchResponseAPDU;
  77.  
  78. typedef struct PresentAPDU {
  79.     pdu_type        PDUType;
  80.     long            NumberOfRecordsRequested;
  81.     long            ResultSetStartPosition;
  82.     char*             ResultSetID;
  83.     char*            ElementSetNames;
  84.     any*            ReferenceID;
  85.     void*            PresentInfo;
  86.     } PresentAPDU;
  87.  
  88. typedef struct PresentResponseAPDU {
  89.     pdu_type        PDUType;
  90.     boolean            PresentStatus;
  91.     long            NumberOfRecordsReturned;
  92.     long            NextResultSetPosition;
  93.     any*            ReferenceID;
  94.     void*            DatabaseDiagnosticRecords;
  95.     } PresentResponseAPDU;
  96.  
  97. /*----------------------------------------------------------------------*/
  98. /* Functions */
  99.  
  100. #ifdef __cplusplus
  101. /* declare these as C style functions */
  102. extern "C"
  103.     {
  104. #endif /* def __cplusplus */
  105.  
  106. InitAPDU* makeInitAPDU _AP((boolean search,boolean present,boolean deleteIt,
  107.                 boolean accessControl,boolean resourceControl,
  108.                 long prefMsgSize,long maxMsgSize,
  109.                 char* auth,char* id,char* name, char* version,
  110.                 any* refID,void* userInfo));
  111. void freeInitAPDU _AP((InitAPDU* init));
  112. char* writeInitAPDU _AP((InitAPDU* init,char* buffer,long* len));
  113. char* readInitAPDU _AP((InitAPDU** init,char* buffer));
  114.  
  115.  
  116. InitResponseAPDU* makeInitResponseAPDU _AP((boolean result,
  117.                         boolean search,boolean present,boolean deleteIt,
  118.                         boolean accessControl,boolean resourceControl,
  119.                         long prefMsgSize,long maxMsgSize,
  120.                         char* auth,char* id,char* name, char* version,
  121.                         any* refID,void* userInfo));
  122. void freeInitResponseAPDU _AP((InitResponseAPDU* init));
  123. char* writeInitResponseAPDU _AP((InitResponseAPDU* init,char* buffer,long* len));
  124. char* readInitResponseAPDU _AP((InitResponseAPDU** init,char* buffer));
  125. InitResponseAPDU* replyToInitAPDU _AP((InitAPDU* init,boolean result,void* userInfo));
  126.  
  127. SearchAPDU* makeSearchAPDU _AP((long small,long large, long medium,
  128.                 boolean replace,char* name,char** databases,
  129.                 char* type,char** elements,any* refID,void* queryInfo));
  130. void freeSearchAPDU _AP((SearchAPDU* query));
  131. char* writeSearchAPDU _AP((SearchAPDU* query,char* buffer,long* len));
  132. char* readSearchAPDU _AP((SearchAPDU** query,char* buffer));
  133.  
  134. SearchResponseAPDU* makeSearchResponseAPDU _AP((long result,long count,
  135.                         long recordsReturned,long nextPos,
  136.                         long resultStatus,long presentStatus,
  137.                         any* refID,void* records));
  138. void freeSearchResponseAPDU _AP((SearchResponseAPDU* queryResponse));
  139. char* writeSearchResponseAPDU _AP((SearchResponseAPDU* queryResponse,char* buffer,long* len));
  140. char* readSearchResponseAPDU _AP((SearchResponseAPDU** queryResponse,char* buffer));
  141.  
  142. PresentAPDU* makePresentAPDU _AP((long recsReq, long startPos,
  143.                   char* resultID,any* refID,void* info));
  144. void freePresentAPDU _AP((PresentAPDU* present));
  145. char* writePresentAPDU _AP((PresentAPDU* present,char* buffer,long* len));
  146. char* readPresentAPDU _AP((PresentAPDU** present,char* buffer));
  147.  
  148. PresentResponseAPDU* makePresentResponseAPDU _AP((boolean status,long recsRet,
  149.                           long nextPos,any* refID,
  150.                           void* records));
  151. void freePresentResponseAPDU _AP((PresentResponseAPDU* present));
  152. char* writePresentResponseAPDU _AP((PresentResponseAPDU* present,char* buffer,long* len));
  153. char* readPresentResponseAPDU _AP((PresentResponseAPDU** present,char* buffer));
  154.  
  155. /*----------------------------------------------------------------------*/
  156. /* user extension hooks: */
  157.  
  158. extern char* writeInitInfo _AP((InitAPDU* init,char* buffer,long* len));
  159. extern char* readInitInfo _AP((void** info,char* buffer));
  160.  
  161. extern char* writeInitResponseInfo _AP((InitResponseAPDU* init,char* buffer,long* len));
  162. extern char* readInitResponseInfo _AP((void** info,char* buffer));
  163.  
  164. extern char* writeSearchInfo _AP((SearchAPDU* query,char* buffer,long* len));
  165. extern char* readSearchInfo _AP((void** info,char* buffer));
  166.  
  167. extern char* writeSearchResponseInfo _AP((SearchResponseAPDU* query,char* buffer,long* len));
  168. extern char* readSearchResponseInfo _AP((void** info,char* buffer));
  169.  
  170. extern char* writePresentInfo _AP((PresentAPDU* present,char* buffer,long* len));
  171. extern char* readPresentInfo _AP((void** info,char* buffer));
  172.  
  173. extern char* writePresentResponseInfo _AP((PresentResponseAPDU* present,char* buffer,long* len));
  174. extern char* readPresentResponseInfo _AP((void** info,char* buffer));
  175.  
  176. #ifdef __cplusplus
  177.     }
  178. #endif /* def __cplusplus */
  179.  
  180. /*----------------------------------------------------------------------*/
  181.  
  182. #endif /* ndef _H_Z39_50 */
  183.  
  184.  
  185.