home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 November / PCWorld_2000-11_cd.bin / Komunik / sambar444 / _SETUP.1 / sambar.h < prev    next >
C/C++ Source or Header  |  2000-09-28  |  24KB  |  889 lines

  1. /*
  2. ** SAMBAR.H
  3. **
  4. **      This is the public WIN32 header file for the Sambar 
  5. **        Server application.
  6. **
  7. **        Confidential Property of Tod Sambar
  8. **        (c) Copyright Tod Sambar 1996-1997
  9. **        All rights reserved.
  10. **
  11. **
  12. ** History:
  13. ** Chg#    Date    Description                                                Resp
  14. ** ----    -------    -------------------------------------------------------    ----
  15. **        10AUG96    Created                                                    sambar
  16. **        11APR97    Added server start/stop APIs                            sambar
  17. */
  18.  
  19. #if     !defined(__SAMBAR_H__)
  20. #define __SAMBAR_H__
  21.  
  22. /*
  23. ** Types
  24. */
  25. typedef int                            SA_RETCODE;
  26. typedef long                        SA_INT;
  27. typedef int                            SA_BOOL;
  28. typedef void                        SA_VOID;
  29. typedef unsigned char                SA_BYTE;
  30. typedef unsigned char                SA_CHAR;
  31.  
  32. #ifndef TEXT
  33. #define TEXT(x)                        (x)
  34. #endif
  35.  
  36. #ifndef MAX
  37. #define MAX(a,b)                    ((SA_INT)(a) > (SA_INT)(b) ? (a) : (b))
  38. #endif
  39.  
  40. #ifndef MIN
  41. #define MIN(a,b)                    ((SA_INT)(a) < (SA_INT)(b) ? (a) : (b))
  42. #endif
  43.  
  44. /*
  45. ** Public Structures
  46. */
  47. #define SA_CTX                        SA_VOID
  48. #define SA_CONN                        SA_VOID
  49. #define SA_PARAMS                    SA_VOID
  50. #define SA_REC                        SA_VOID
  51. #define SA_PROFILE                    SA_VOID
  52.  
  53.  
  54. /*
  55. ** Return Codes
  56. */
  57. #define SA_SUCCEED                    1
  58. #define SA_FAIL                        0
  59.  
  60.  
  61. /*
  62. ** Error Codes
  63. */
  64. #define SA_E_DOCFOLLOWS                (SA_INT)-1
  65. #define SA_E_INTERNALSYSTEM            (SA_INT)0
  66. #define SA_E_ALREADYLOGGEDIN        (SA_INT)1
  67. #define SA_E_BADCOOKIE                (SA_INT)2
  68. #define SA_E_INVALIDLOGIN            (SA_INT)3
  69. #define SA_E_MAXLOGINS                (SA_INT)4
  70. #define SA_E_ALREADYDEFINED            (SA_INT)5
  71. #define SA_E_INVALIDDATA            (SA_INT)6
  72. #define SA_E_NOTIMPLEMENTED            (SA_INT)7
  73. #define SA_E_FORBIDDEN                (SA_INT)8
  74. #define SA_E_NOTFOUND                (SA_INT)9
  75. #define SA_E_DUPLICATE                (SA_INT)10
  76. #define SA_E_DBOPFAILED                (SA_INT)11
  77. #define SA_E_BADGATEWAY                (SA_INT)12
  78. #define SA_E_REDIRECT                (SA_INT)13
  79. #define SA_E_USRDEF1                (SA_INT)14
  80. #define SA_E_USRDEF2                (SA_INT)15
  81. #define SA_E_USRDEF3                (SA_INT)16
  82. #define SA_E_USRDEF4                (SA_INT)17
  83. #define SA_E_USRDEF5                (SA_INT)18
  84. #define SA_E_USRDEF6                (SA_INT)19
  85. #define SA_E_USRDEF7                (SA_INT)20
  86. #define SA_E_USRDEF8                (SA_INT)21
  87. #define SA_E_USRDEF9                (SA_INT)22
  88. #define SA_E_USRDEF10                (SA_INT)23
  89. #define SA_E_USRDEF11                (SA_INT)24
  90. #define SA_E_USRDEF12                (SA_INT)25
  91. #define SA_E_USRDEF13                (SA_INT)26
  92. #define SA_E_USRDEF14                (SA_INT)27
  93. #define SA_E_USRDEF15                (SA_INT)28
  94. #define SA_E_USRDEF16                (SA_INT)29
  95. #define SA_E_USRDEF17                (SA_INT)30
  96. #define SA_E_USRDEF18                (SA_INT)31
  97. #define SA_E_USRDEF19                (SA_INT)32
  98. #define SA_E_USRDEF20                (SA_INT)33
  99. #define SA_E_TIMEOUT                (SA_INT)34
  100. #define SA_E_SHUTDOWN                (SA_INT)35
  101. #define SA_E_SERVERDOWN                (SA_INT)36
  102. #define SA_E_PAUSED                    (SA_INT)37
  103. #define SA_E_MAXCGIS                (SA_INT)38
  104. #define SA_E_INUSE                    (SA_INT)39
  105. #define SA_E_RESTART                (SA_INT)40
  106. #define SA_E_INTERRUPTED            (SA_INT)41
  107. #define SA_E_SSLONLY                (SA_INT)42
  108. #define SA_E_VERSIONCONTROL            (SA_INT)43
  109. #define SA_E_PERMANENTREDIRECT        (SA_INT)44
  110. #define SA_E_GONE                    (SA_INT)45
  111.  
  112.  
  113. /*
  114. ** Actions
  115. */
  116. #define    SA_GET                        (SA_INT)1
  117. #define    SA_SET                        (SA_INT)2
  118. #define    SA_CLEAR                    (SA_INT)3
  119.  
  120. /*
  121. ** Misc Defines
  122. */
  123. #define SA_NULLTERM                    (SA_INT)-3
  124.  
  125. /*
  126. ** Context Properties
  127. */
  128. #define SA_CTXPROP_SYSADMIN            (SA_INT)1
  129. #define SA_CTXPROP_HOMEDIR            (SA_INT)2
  130. #define SA_CTXPROP_LOGDIR            (SA_INT)3
  131. #define SA_CTXPROP_DBCACHE            (SA_INT)4
  132. #define SA_CTXPROP_APPLICDIR        (SA_INT)5
  133. #define SA_CTXPROP_SERVERSW            (SA_INT)7
  134. #define SA_CTXPROP_SERVERPORT        (SA_INT)8
  135. #define SA_CTXPROP_SERVERNAME        (SA_INT)9
  136. #define SA_CTXPROP_SERVERIP            (SA_INT)10
  137. #define SA_CTXPROP_BUILDID            (SA_INT)11
  138. #define SA_CTXPROP_HTTPLOGFUNC        (SA_INT)12
  139. #define SA_CTXPROP_SECURITYMODEL    (SA_INT)13
  140. #define SA_CTXPROP_LICENSETYPE        (SA_INT)14
  141. #define SA_CTXPROP_AUTHLOGINS        (SA_INT)15
  142. #define SA_CTXPROP_NTAUTH            (SA_INT)16
  143.  
  144. /*
  145. ** Connection Properties
  146. */
  147. #define SA_CONNPROP_HOST            (SA_INT)1
  148. #define SA_CONNPROP_AGENT            (SA_INT)2
  149. #define SA_CONNPROP_REFERER            (SA_INT)3
  150. #define SA_CONNPROP_REQUEST            (SA_INT)4
  151. #define SA_CONNPROP_REQUESTMETHOD    (SA_INT)5
  152. #define SA_CONNPROP_USERNAME        (SA_INT)6
  153. #define SA_CONNPROP_NAME            (SA_INT)7
  154. #define SA_CONNPROP_PASSWORD        (SA_INT)8
  155. #define SA_CONNPROP_IPADDR            (SA_INT)9
  156. #define SA_CONNPROP_DOCSDIR            (SA_INT)10
  157. #define SA_CONNPROP_DOCSPATH        (SA_INT)11
  158. #define SA_CONNPROP_ROOTDIR            (SA_INT)12
  159. #define SA_CONNPROP_REQUESTHOST        (SA_INT)13
  160. #define SA_CONNPROP_PRIVS            (SA_INT)14
  161.  
  162. /*
  163. ** Scheduler Time Arguments
  164. */
  165. #define SA_SCHEDULETIME_TIMEOUT        (SA_INT)1        /* Every 2 minutes    */
  166. #define SA_SCHEDULETIME_HOURLY        (SA_INT)2        /* Every hour         */
  167. #define SA_SCHEDULETIME_DAILY        (SA_INT)3        /* Every day         */
  168. #define SA_SCHEDULETIME_WEEKLY        (SA_INT)4        /* Every week         */
  169. #define SA_SCHEDULETIME_MONTHLY        (SA_INT)5        /* Every month         */
  170.  
  171. /*
  172. ** Next Page Argument
  173. */
  174. #define SA_PAGE_ARG                    TEXT("RCpage")
  175. #define SA_REDIRECT_ARG                TEXT("RCredirect")
  176.  
  177. /*
  178. ** System Administrator & User Folders
  179. */
  180. #define SA_ADMIN_FOLDER                TEXT("sysadmin")
  181. #define SA_USER_FOLDER                TEXT("sysuser")
  182.  
  183. /*
  184. ** Default group
  185. */
  186. #define SA_DEFAULT_GROUP            TEXT("other")
  187.  
  188. /*
  189. ** RPC authorization types
  190. */
  191. #define SA_AUTHORIZATION_ALL        (SA_INT)0        /* All clients */
  192. #define SA_AUTHORIZATION_USER        (SA_INT)1        /* Logged in users only */
  193. #define SA_AUTHORIZATION_ADMIN        (SA_INT)2        /* Admin only */
  194. #define SA_AUTHORIZATION_SCRIPT        (SA_INT)3        /* Only inside scripts */
  195.  
  196. /*
  197. ** RPC parameters
  198. */
  199. typedef struct sa__rpcparam
  200. {
  201.     SA_CHAR            *name;                /* Parameter name */
  202.     SA_BOOL            required;            /* Required or optional param */
  203.     SA_CHAR            *descr;                /* Parameter description */
  204. } SA_RPCPARAM;
  205.  
  206. typedef struct sa__arg
  207. {
  208.     SA_CHAR            *value;                /* Parameter value */
  209.     struct sa__arg    *next;
  210. } SA_ARG;
  211.  
  212. /*
  213. ** Scalar parameters
  214. */
  215. typedef struct sa__scalararg
  216. {
  217.     SA_CHAR            *name;                /* Argument name */
  218.     SA_CHAR            *descr;                /* Argument description */
  219. } SA_SCALARARG;
  220.  
  221. /*
  222. ** Request-handler modules
  223. */
  224. typedef struct sa__request
  225. {
  226.         SA_INT        method;                /* SA_METHOD_* */
  227.         SA_CHAR        *uri;                /* URI requested. */
  228.         SA_INT         urilen; 
  229.         SA_CHAR        *path;                /* path to requested URI. */
  230.         SA_INT         pathlen; 
  231.         SA_CHAR     *args;
  232.         SA_INT         argslen; 
  233.         SA_CHAR     *content;
  234.         SA_INT         contentlen;
  235.         SA_CHAR     *pathinfo;
  236.         SA_INT         pathinfolen;
  237. } SA_REQUEST;
  238.  
  239. #define SA_METHOD_GET                (SA_INT)1
  240. #define SA_METHOD_POST                (SA_INT)2
  241. #define SA_METHOD_PUT                (SA_INT)3
  242. #define SA_METHOD_HEAD                (SA_INT)4
  243. #define SA_METHOD_PATCH                (SA_INT)5
  244. #define SA_METHOD_PROPFIND            (SA_INT)6
  245. #define SA_METHOD_PROPPATCH            (SA_INT)7
  246. #define SA_METHOD_DELETE            (SA_INT)8
  247. #define SA_METHOD_CONNECT            (SA_INT)9
  248. #define SA_METHOD_COPY                (SA_INT)10
  249. #define SA_METHOD_MKCOL                (SA_INT)11
  250. #define SA_METHOD_MOVE                (SA_INT)12
  251. #define SA_METHOD_OPTIONS            (SA_INT)13
  252. #define SA_METHOD_TRACE                (SA_INT)14
  253. #define SA_METHOD_LOCK                (SA_INT)15
  254. #define SA_METHOD_UNLOCK            (SA_INT)16
  255. #define SA_METHOD_SEARCH            (SA_INT)17
  256. #define SA_METHOD_CHECKOUT            (SA_INT)18
  257. #define SA_METHOD_UNCHECKOUT        (SA_INT)19
  258. #define SA_METHOD_CHECKIN            (SA_INT)20
  259. #define SA_METHOD_MKRESOURCE        (SA_INT)21
  260. #define SA_METHOD_REPORT            (SA_INT)22
  261.  
  262. /*
  263. ** HTTP Log callback structure
  264. */
  265. typedef struct sa__httplog
  266. {
  267.         SA_INT         size; 
  268.         SA_INT         status; 
  269.         SA_CHAR        *method;
  270.         SA_CHAR     *timestamp;
  271.         SA_CHAR     *request;
  272.         SA_CHAR     *args;
  273.         SA_CHAR     *vhost;
  274.         SA_CHAR     *user;                /* User IP Address */
  275.         SA_CHAR        *username;
  276.         SA_CHAR        *referer;
  277.         SA_CHAR        *agent;
  278.  
  279.         /* Include system statistics.                                    */
  280.         SA_INT         allconns;             /* Total network connections    */
  281.         SA_INT         httpconns;             /* # of HTTP connections        */
  282.         SA_INT         threads;             /* Total threads                */
  283. } SA_HTTPLOG;
  284.  
  285. /*
  286. ** Password Management
  287. */
  288. #define SA_PASSWD_FILE                TEXT("passwd")
  289. #define SA_MAX_NAME                    (SA_INT)64
  290. #define SA_MAX_VALUE                (SA_INT)1000
  291.  
  292. typedef struct sa__ftp
  293. {
  294.     SA_INT        privs;                                    /* FTP access */
  295.     SA_INT        ftpmax;                                    /* Maximum FTP MB */
  296.     SA_INT        dirlen;
  297.     SA_CHAR        dir[SA_MAX_NAME + 1];                    /* FTP root dir */
  298. } SA_FTP;
  299.  
  300. typedef struct sa__sip
  301. {
  302.     SA_INT        unused;                                    /* SIP access */
  303. } SA_SIP;
  304.  
  305. typedef struct sa__passwd
  306. {
  307.     SA_INT        privs;                                    /* Upload privs */
  308.     SA_INT        ftpmax;                                    /* FTP max upload */
  309.     SA_INT        dirlen;
  310.     SA_INT        namelen;
  311.     SA_INT        grouplen;
  312.     SA_INT        passwordlen;
  313.     SA_CHAR        name[SA_MAX_NAME + 1];                    /* Symbolic name */
  314.     SA_CHAR        group[SA_MAX_NAME + 1];
  315.     SA_CHAR        password[SA_MAX_NAME + 1];
  316.     SA_CHAR        dir[SA_MAX_NAME + 1];                    /* FTP dir */
  317.  
  318. } SA_PASSWD;
  319.  
  320. typedef struct sa__user
  321. {
  322.     SA_INT        grouplen;
  323.     SA_INT        usernamelen;
  324.     SA_CHAR        group[SA_MAX_NAME + 1];
  325.     SA_CHAR        username[SA_MAX_NAME + 1];
  326. } SA_USER;
  327.  
  328. typedef struct sa__group
  329. {
  330.     SA_INT        namelen;
  331.     SA_CHAR        name[SA_MAX_NAME + 1];
  332. } SA_GROUP;
  333.  
  334. /*
  335. ** FTP/Document Manager/HTTP PUT Priviledges
  336. */
  337. #define SA_PRIV_NOACCESS            (SA_INT)0
  338. #define SA_PRIV_READONLY            (SA_INT)1
  339. #define SA_PRIV_READWRITE            (SA_INT)2
  340.  
  341. /*
  342. ** Server Types
  343. */
  344. #define SA_SERVERTYPE_HTTP            (SA_INT)100
  345. #define SA_SERVERTYPE_HTTPPROXY        (SA_INT)101
  346. #define SA_SERVERTYPE_FTP            (SA_INT)102
  347. #define SA_SERVERTYPE_SMTPPROXY        (SA_INT)103
  348. #define SA_SERVERTYPE_POP3PROXY        (SA_INT)104
  349. #define SA_SERVERTYPE_IMAP4PROXY    (SA_INT)105
  350. #define SA_SERVERTYPE_BRIDGEPROXY    (SA_INT)106
  351. #define SA_SERVERTYPE_NNTPPROXY        (SA_INT)107
  352. #define SA_SERVERTYPE_FTPPROXY        (SA_INT)108
  353. #define SA_SERVERTYPE_SOCKSPROXY    (SA_INT)109
  354. #define SA_SERVERTYPE_TELNETPROXY    (SA_INT)110
  355. #define SA_SERVERTYPE_REALPROXY        (SA_INT)111
  356. #define SA_SERVERTYPE_SMTP            (SA_INT)112
  357. #define SA_SERVERTYPE_POP3            (SA_INT)113
  358. #define SA_SERVERTYPE_IMAP4            (SA_INT)114
  359. #define SA_SERVERTYPE_TELNET        (SA_INT)115
  360. #define SA_SERVERTYPE_DNS            (SA_INT)116
  361. #define SA_SERVERTYPE_SIP            (SA_INT)117
  362. #define SA_SERVERTYPE_DHCP            (SA_INT)118
  363.  
  364. /*
  365. ** Record Flags
  366. */ 
  367. #define SA_REC_CREATE                (SA_INT)0x0001
  368. #define SA_REC_DELETE                (SA_INT)0x0002
  369.  
  370.  
  371. /*
  372. ** Sambar Server callbacks
  373. */
  374. typedef SA_RETCODE                (* SA_INITFUNC)(SA_CTX *ctx);
  375. typedef SA_RETCODE                (* SA_EXITFUNC)(SA_CTX *ctx);
  376. typedef SA_RETCODE                (* SA_LOGINFUNC)(SA_CTX *ctx, SA_CONN *conn, 
  377.                                     SA_CHAR *username, SA_INT usernamelen, 
  378.                                     SA_CHAR *password, SA_INT passwordlen, 
  379.                                     SA_INT *infop);
  380. typedef SA_RETCODE                (* SA_LOGOUTFUNC)(SA_CTX *ctx, SA_CONN *conn);
  381. typedef SA_RETCODE                (* SA_PROFILEFUNC)(SA_CTX *ctx, SA_CONN *conn,
  382.                                     SA_INT action, SA_CHAR *name, 
  383.                                     SA_INT namelen, SA_VOID *datap);
  384. typedef SA_RETCODE                (* SA_REQUESTFUNC)(SA_CTX *ctx, SA_CONN *conn,
  385.                                     SA_CHAR *uri, SA_INT urilen, 
  386.                                     SA_PARAMS *params, SA_INT *infop);
  387. typedef SA_RETCODE                (* SA_RPCFUNC)(SA_CTX *ctx, SA_CONN *conn,
  388.                                     SA_PARAMS *params, SA_INT *infop);
  389. typedef SA_RETCODE                (* SA_SCALARFUNC)(SA_CTX *ctx, SA_CONN *conn,
  390.                                     SA_ARG *args, SA_CHAR *value);
  391. typedef SA_RETCODE                (* SA_PROPFUNC)(SA_CTX *ctx, SA_VOID *argp, 
  392.                                     SA_CHAR *name, SA_CHAR *value);
  393. typedef SA_RETCODE                (* SA_FTPFUNC)(SA_CTX *ctx, SA_CHAR *name,
  394.                                     SA_INT namelen, SA_CHAR *password, 
  395.                                     SA_INT passwordlen, SA_FTP *ftpresp);
  396. typedef SA_RETCODE                (* SA_SIPFUNC)(SA_CTX *ctx, SA_CHAR *name,
  397.                                     SA_INT namelen, SA_CHAR *password, 
  398.                                     SA_INT passwordlen, SA_SIP *sipresp);
  399. typedef SA_RETCODE                (* SA_TELNETFUNC)(SA_CTX *ctx, SA_CHAR *name,
  400.                                     SA_INT namelen, SA_CHAR *password, 
  401.                                     SA_INT passwordlen);
  402. typedef SA_RETCODE                (* SA_MAILFUNC)(SA_CTX *ctx, SA_CHAR *name,
  403.                                     SA_INT namelen, SA_CHAR *password, 
  404.                                     SA_INT passwordlen);
  405. typedef SA_RETCODE                (* SA_NETCONNECTFUNC)(SA_CTX *ctx, 
  406.                                     SA_CHAR *ipaddr, SA_INT servertype);
  407. typedef SA_RETCODE                (* SA_HTTPPROXYFUNC)(SA_CTX *ctx, SA_CONN *conn,
  408.                                     SA_CHAR *host, SA_INT hostlen,
  409.                                     SA_CHAR *url, SA_INT urllen);
  410. typedef SA_RETCODE                (* SA_ENVTFUNC)(SA_CTX *ctx, SA_CONN *conn,
  411.                                     SA_CHAR *buffer, SA_INT buflen, 
  412.                                     SA_CHAR *data);
  413. typedef SA_RETCODE                (* SA_MODULEFUNC)(SA_CTX *ctx, SA_CONN *conn,
  414.                                     SA_REQUEST *request, SA_INT *infop);
  415. typedef SA_VOID                    (* SA_HTTPLOGFUNC)(SA_CTX *ctx, 
  416.                                     SA_HTTPLOG *httplog);
  417. typedef SA_RETCODE                (* SA_SCHEDULEFUNC)(SA_CTX *ctx, SA_CHAR *name,
  418.                                     SA_VOID *argp);
  419. typedef SA_VOID                    (* SA_RASFUNC)(SA_CTX *ctx, SA_CHAR *ip,
  420.                                     SA_CHAR *previp, SA_BOOL connected);
  421.  
  422.  
  423. /*
  424. ** Sambar Server Function Prototypes
  425. */
  426. #ifdef    WIN32
  427. #define SA_PUBLIC                __cdecl
  428. #define SA_EXPORT                __declspec(dllexport)
  429. #else    /* UNIX */
  430. #define SA_PUBLIC
  431. #define SA_EXPORT
  432. #endif
  433.  
  434. #if defined(__cplusplus)
  435. extern "C" {
  436. #endif    /* defined(__cplusplus) */
  437.  
  438. /*
  439. ** Sambar Server startup/shutdown
  440. */
  441. extern SA_RETCODE SA_EXPORT        sa_server(
  442.                                 SA_VOID            *hWnd
  443.                                 );
  444. extern SA_BOOL SA_EXPORT        sa_stopped(
  445.                                 void
  446.                                 );
  447. extern SA_RETCODE SA_EXPORT        sa_shutdown(
  448.                                 SA_BOOL            restart
  449.                                 );
  450. extern SA_RETCODE SA_EXPORT        sa_pause(
  451.                                 SA_BOOL            unpause
  452.                                 );
  453. /*
  454. ** General Functions
  455. */
  456.  
  457. extern SA_RETCODE SA_EXPORT        sa_cgi_exec(
  458.                                 SA_CTX            *ctx,
  459.                                 SA_CONN            *conn,
  460.                                 SA_REQUEST        *request
  461.                                 );
  462. extern SA_RETCODE SA_EXPORT        sa_wincgi_exec(
  463.                                 SA_CTX            *ctx,
  464.                                 SA_CONN            *conn,
  465.                                 SA_REQUEST        *request
  466.                                 );
  467. extern SA_RETCODE SA_EXPORT        sa_cmd_init(
  468.                                 SA_CTX            *ctx,
  469.                                 SA_CHAR            *name,
  470.                                 SA_RPCPARAM        *params,
  471.                                 SA_INT            numparams,
  472.                                 SA_INT            authorization,
  473.                                 SA_CHAR            *descr,
  474.                                 SA_RPCFUNC        funcp
  475.                                 );
  476. extern SA_RETCODE SA_EXPORT        sa_scalar_init(
  477.                                 SA_CTX            *ctx,
  478.                                 SA_CHAR            *name,
  479.                                 SA_SCALARARG    *args,
  480.                                 SA_INT            numargs,
  481.                                 SA_CHAR            *descr,
  482.                                 SA_SCALARFUNC    funcp
  483.                                 );
  484. extern SA_RETCODE SA_EXPORT        sa_props_load(
  485.                                 SA_CTX            *ctx,
  486.                                 SA_CHAR            *filename,
  487.                                 SA_CHAR            *section,
  488.                                 SA_VOID            *argp,
  489.                                 SA_PROPFUNC        funcp
  490.                                 );
  491. extern SA_RETCODE SA_EXPORT        sa_send_file(
  492.                                 SA_CONN            *conn,
  493.                                 SA_CHAR            *filename
  494.                                 );
  495. extern SA_RETCODE SA_EXPORT        sa_send_macro(
  496.                                 SA_CONN            *conn,
  497.                                 SA_CHAR            *macroname
  498.                                 );
  499. extern SA_RETCODE SA_EXPORT        sa_send_header(
  500.                                 SA_CONN            *conn,
  501.                                 SA_CHAR            *buffer,
  502.                                 SA_INT            buflen
  503.                                 );
  504. extern SA_RETCODE SA_EXPORT        sa_params(
  505.                                 SA_CTX            *ctx,
  506.                                 SA_CONN            *conn,
  507.                                 SA_PARAMS        **paramsp
  508.                                 );
  509. extern SA_RETCODE SA_EXPORT        sa_param(
  510.                                 SA_CTX            *ctx,
  511.                                 SA_PARAMS        *params,
  512.                                 SA_CHAR            *name,
  513.                                 SA_CHAR            **valuep,
  514.                                 SA_INT            *valuelenp
  515.                                 );
  516. extern SA_RETCODE SA_EXPORT        sa_param_set(
  517.                                 SA_CTX            *ctx,
  518.                                 SA_PARAMS        *params,
  519.                                 SA_CHAR            *name,
  520.                                 SA_CHAR            *value,
  521.                                 SA_INT            valuelen
  522.                                 );
  523. extern SA_RETCODE SA_EXPORT        sa_state_get(
  524.                                 SA_CTX            *ctx,
  525.                                 SA_CONN            *conn,
  526.                                 SA_CHAR            *name,
  527.                                 SA_CHAR            **valuep,
  528.                                 SA_INT            *valuelenp
  529.                                 );
  530. extern SA_RETCODE SA_EXPORT        sa_state_set(
  531.                                 SA_CTX            *ctx,
  532.                                 SA_CONN            *conn,
  533.                                 SA_CHAR            *name,
  534.                                 SA_CHAR            *value,
  535.                                 SA_INT            valuelen
  536.                                 );
  537. extern SA_VOID SA_EXPORT        sa_log(
  538.                                 SA_CTX            *ctx,
  539.                                 SA_CHAR            *buffer
  540.                                 );
  541. extern SA_VOID SA_EXPORT        sa_observe(
  542.                                 SA_CTX            *ctx,
  543.                                 SA_CHAR            *buffer
  544.                                 );
  545. extern SA_RETCODE SA_EXPORT        sa_get_macro(
  546.                                 SA_CTX            *ctx,
  547.                                 SA_CHAR            *macroname,
  548.                                 SA_CHAR            **macrop,
  549.                                 SA_INT            *macrolenp
  550.                                 );
  551. extern SA_RETCODE SA_EXPORT        sa_get_mime(
  552.                                 SA_CTX            *ctx,
  553.                                 SA_CHAR            *name,
  554.                                 SA_INT            namelen,
  555.                                 SA_CHAR            **mimetypep
  556.                                 );
  557. extern SA_RETCODE SA_EXPORT        sa_get_realpath(
  558.                                 SA_CTX            *ctx,
  559.                                 SA_CONN            *conn,
  560.                                 SA_CHAR            *name,
  561.                                 SA_INT            namelen,
  562.                                 SA_CHAR            *path,
  563.                                 SA_INT            maxpath
  564.                                 );
  565. extern SA_INT SA_EXPORT            sa_wildcmp(
  566.                                 SA_CTX            *ctx,
  567.                                 SA_CHAR            *wildstr,
  568.                                 SA_INT            wildstrlen,
  569.                                 SA_CHAR            *arg,
  570.                                 SA_INT            arglen
  571.                                 );
  572. extern SA_RETCODE SA_EXPORT        sa_schedule_task(
  573.                                 SA_CTX            *ctx,
  574.                                 SA_CHAR            *name,
  575.                                 SA_SCHEDULEFUNC    func,
  576.                                 SA_VOID            *argp,
  577.                                 SA_INT            when
  578.                                 );
  579.                                 
  580.  
  581. /*
  582. ** Mail Utility Functions
  583. */
  584. extern SA_RETCODE SA_EXPORT        sa_smtpmail(
  585.                                 SA_CTX            *ctx,
  586.                                 SA_CHAR            *from,
  587.                                 SA_CHAR            *tolist,
  588.                                 SA_CHAR            *cclist,
  589.                                 SA_CHAR            *bcclist,
  590.                                 SA_CHAR            *subject,
  591.                                 SA_CHAR            *message,
  592.                                 SA_CHAR            *attachment
  593.                                 );
  594. extern SA_RETCODE SA_EXPORT        sa_smtpmail2(
  595.                                 SA_CTX            *ctx,
  596.                                 SA_CHAR            *from,
  597.                                 SA_CHAR            *tolist,
  598.                                 SA_CHAR            *cclist,
  599.                                 SA_CHAR            *bcclist,
  600.                                 SA_CHAR            *subject,
  601.                                 SA_CHAR            *message,
  602.                                 SA_CHAR            *signature,
  603.                                 SA_CHAR            *attachname,
  604.                                 SA_BYTE            *attachdata,
  605.                                 SA_INT            attachdatalen
  606.                                 );
  607. extern SA_RETCODE SA_EXPORT        sa_smtpmail3(
  608.                                 SA_CTX            *ctx,
  609.                                 SA_CHAR            *from,
  610.                                 SA_CHAR            *tolist,
  611.                                 SA_CHAR            *spoolfile
  612.                                 );
  613.  
  614. extern SA_RETCODE SA_EXPORT        sa_mbox_create(
  615.                                 SA_CTX            *ctx,
  616.                                 SA_CHAR            *user
  617.                                 );
  618. extern SA_RETCODE SA_EXPORT        sa_mbox_delete(
  619.                                 SA_CTX            *ctx,
  620.                                 SA_CHAR            *user
  621.                                 );
  622. extern SA_BOOL SA_EXPORT        sa_mbox_exists(
  623.                                 SA_CTX            *ctx,
  624.                                 SA_CHAR            *user
  625.                                 );
  626.  
  627. /*
  628. ** Context Functions
  629. */
  630. extern SA_RETCODE SA_EXPORT        sa_ctx_global(
  631.                                 SA_CTX            **ctxp
  632.                                 );
  633. extern SA_RETCODE SA_EXPORT        sa_ctx_key(
  634.                                 SA_CTX            *ctx,
  635.                                 SA_INT            action,
  636.                                 SA_CHAR            *key,
  637.                                 SA_VOID            **valuep
  638.                                 );
  639. extern SA_RETCODE SA_EXPORT        sa_ctx_props(
  640.                                 SA_CTX            *ctx,
  641.                                 SA_INT            action,
  642.                                 SA_INT            property,
  643.                                 SA_BYTE            *buffer,
  644.                                 SA_INT            buflen,
  645.                                 SA_INT            *outlenp
  646.                                 );
  647. extern SA_RETCODE SA_EXPORT        sa_envt_prop(
  648.                                 SA_CTX            *ctx,
  649.                                 SA_CONN            *conn,
  650.                                 SA_BYTE            *prop,
  651.                                 SA_INT            proplen,
  652.                                 SA_CHAR            *buffer
  653.                                 );
  654.  
  655. /*
  656. ** Connection Functions
  657. */
  658. extern SA_RETCODE SA_EXPORT        sa_conn_key(
  659.                                 SA_CONN            *conn,
  660.                                 SA_INT            action,
  661.                                 SA_CHAR            *key,
  662.                                 SA_VOID            **valuep
  663.                                 );
  664. extern SA_RETCODE SA_EXPORT        sa_conn_props(
  665.                                 SA_CONN            *conn,
  666.                                 SA_INT            action,
  667.                                 SA_INT            property,
  668.                                 SA_BYTE            *buffer,
  669.                                 SA_INT            buflen,
  670.                                 SA_INT            *outlenp
  671.                                 );
  672. extern SA_RETCODE SA_EXPORT        sa_conn_send(
  673.                                 SA_CONN            *conn,
  674.                                 SA_CHAR            *buffer,
  675.                                 SA_INT            buflen
  676.                                 );
  677. extern SA_RETCODE SA_EXPORT        sa_conn_flush(
  678.                                 SA_CONN            *conn
  679.                                 );
  680. extern SA_RETCODE SA_EXPORT        sa_conn_redirect(
  681.                                 SA_CONN            *conn,
  682.                                 SA_CHAR            *location,
  683.                                 SA_CHAR            *buffer,
  684.                                 SA_INT            buflen
  685.                                 );
  686. extern SA_RETCODE SA_EXPORT        sa_conn_login(
  687.                                 SA_CONN            *conn,
  688.                                 SA_CHAR            *user,
  689.                                 SA_INT            userlen,
  690.                                 SA_CHAR            *password,
  691.                                 SA_INT            passwordlen,
  692.                                 SA_INT            *infop
  693.                                 );
  694. extern SA_RETCODE SA_EXPORT        sa_conn_maptourl(
  695.                                 SA_CONN            *conn,
  696.                                 SA_CHAR            *path,
  697.                                 SA_CHAR            *buffer
  698.                                 );
  699.  
  700. /*
  701. ** User/Password Management Routines
  702. */
  703. extern SA_RETCODE SA_EXPORT        sa_passwd_verify(
  704.                                 SA_CTX            *ctx,
  705.                                 SA_CHAR            *username,
  706.                                 SA_INT            usernamelen,
  707.                                 SA_CHAR            *password,
  708.                                 SA_INT            passwordlen,
  709.                                 SA_BOOL            *statusp
  710.                                 );
  711. extern SA_RETCODE SA_EXPORT        sa_passwd_lookup(
  712.                                 SA_CTX            *ctx,
  713.                                 SA_CHAR            *username,
  714.                                 SA_INT            usernamelen,
  715.                                 SA_PASSWD        *passwd
  716.                                 );
  717. extern SA_RETCODE SA_EXPORT        sa_passwd_add(
  718.                                 SA_CTX            *ctx,
  719.                                 SA_CHAR            *username,
  720.                                 SA_INT            usernamelen,
  721.                                 SA_PASSWD        *passwd
  722.                                 );
  723. extern SA_RETCODE SA_EXPORT        sa_passwd_update(
  724.                                 SA_CTX            *ctx,
  725.                                 SA_CHAR            *username,
  726.                                 SA_INT            usernamelen,
  727.                                 SA_PASSWD        *passwd
  728.                                 );
  729. extern SA_RETCODE SA_EXPORT        sa_passwd_delete(
  730.                                 SA_CTX            *ctx,
  731.                                 SA_CHAR            *username,
  732.                                 SA_INT            usernamelen
  733.                                 );
  734. extern SA_RETCODE SA_EXPORT        sa_passwd_list(
  735.                                 SA_CTX            *ctx,
  736.                                 SA_USER            *users,
  737.                                 SA_INT            numusers,
  738.                                 SA_INT            *countp
  739.                                 );
  740.  
  741. /*
  742. ** Group Management Routines
  743. */
  744. extern SA_RETCODE SA_EXPORT        sa_group_add(
  745.                                 SA_CTX            *ctx,
  746.                                 SA_CHAR            *name,
  747.                                 SA_INT            namelen
  748.                                 );
  749. extern SA_RETCODE SA_EXPORT        sa_group_delete(
  750.                                 SA_CTX            *ctx,
  751.                                 SA_CHAR            *name,
  752.                                 SA_INT            namelen
  753.                                 );
  754. extern SA_RETCODE SA_EXPORT        sa_group_list(
  755.                                 SA_CTX            *ctx,
  756.                                 SA_GROUP        *groups,
  757.                                 SA_INT            numgroups,
  758.                                 SA_INT            *countp
  759.                                 );
  760.  
  761. /*
  762. ** Profile Functions
  763. */
  764. extern SA_RETCODE SA_EXPORT        sa_profile_init(
  765.                                 SA_CTX            *ctx,
  766.                                 SA_CHAR            *username,
  767.                                 SA_INT            usernamelen,
  768.                                 SA_PROFILE        **profilep
  769.                                 );
  770. extern SA_RETCODE SA_EXPORT        sa_profile_exit(
  771.                                 SA_CTX            *ctx,
  772.                                 SA_PROFILE        *profile
  773.                                 );
  774. extern SA_RETCODE SA_EXPORT        sa_profile_save(
  775.                                 SA_CTX            *ctx,
  776.                                 SA_PROFILE        *profile
  777.                                 );
  778. extern SA_RETCODE SA_EXPORT        sa_profile_get(
  779.                                 SA_CTX            *ctx,
  780.                                 SA_PROFILE        *profile,
  781.                                 SA_CHAR            *name,
  782.                                 SA_INT            namelen,
  783.                                 SA_CHAR            **datap
  784.                                 );
  785. extern SA_RETCODE SA_EXPORT        sa_profile_set(
  786.                                 SA_CTX            *ctx,
  787.                                 SA_PROFILE        *profile,
  788.                                 SA_CHAR            *name,
  789.                                 SA_INT            namelen,
  790.                                 SA_CHAR            *value
  791.                                 );
  792.  
  793.  
  794. /*
  795. ** Search Functions
  796. */
  797. extern SA_RETCODE SA_EXPORT        sa_search_add(
  798.                                 SA_CTX            *ctx,
  799.                                 SA_CHAR            *indexname,
  800.                                 SA_CHAR            *title,
  801.                                 SA_CHAR            *url,
  802.                                 SA_CHAR            *data,
  803.                                 SA_INT            datalen
  804.                                 );
  805.  
  806. /*
  807. ** RAS Functions
  808. */
  809. extern SA_RETCODE SA_EXPORT        sa_ras_disconnect(
  810.                                 SA_CTX            *ctx,
  811.                                 SA_BOOL            *activep
  812.                                 );
  813.  
  814. /*
  815. ** Record Functions
  816. */
  817. extern SA_RETCODE SA_EXPORT        sa_rec_init(
  818.                                 SA_CTX            *ctx,
  819.                                 SA_CHAR            *filename,
  820.                                 SA_INT            flags,
  821.                                 SA_INT            reclen,
  822.                                 SA_REC            **recp
  823.                                 );
  824. extern SA_RETCODE SA_EXPORT        sa_rec_exit(
  825.                                 SA_REC            *rec,
  826.                                 SA_INT            flags
  827.                                 );
  828. extern SA_RETCODE SA_EXPORT        sa_rec_insert(
  829.                                 SA_REC            *rec,
  830.                                 SA_BYTE            *data,
  831.                                 SA_INT            *idp
  832.                                 );
  833. extern SA_RETCODE SA_EXPORT        sa_rec_update(
  834.                                 SA_REC            *rec,
  835.                                 SA_INT            id,
  836.                                 SA_BYTE            *data
  837.                                 );
  838. extern SA_RETCODE SA_EXPORT        sa_rec_delete(
  839.                                 SA_REC            *rec,
  840.                                 SA_INT            id
  841.                                 );
  842. extern SA_RETCODE SA_EXPORT        sa_rec_fetch(
  843.                                 SA_REC            *rec,
  844.                                 SA_INT            id,
  845.                                 SA_BYTE            *data
  846.                                 );
  847. extern SA_RETCODE SA_EXPORT        sa_rec_next(
  848.                                 SA_REC            *rec,
  849.                                 SA_INT            lastid,
  850.                                 SA_BYTE            *data,
  851.                                 SA_INT            *idp
  852.                                 );
  853.  
  854. /*
  855. ** General Utilities
  856. */
  857. extern SA_INT SA_EXPORT            sa_dirsize(
  858.                                 SA_CHAR            *dirpath
  859.                                 );
  860. extern SA_INT SA_EXPORT            sa_dirfiles(
  861.                                 SA_CHAR            *dirpath
  862.                                 );
  863. extern SA_RETCODE SA_EXPORT        sa_gzip(
  864.                                 SA_CHAR            *filename,
  865.                                 SA_CHAR            *ext
  866.                                 );
  867. extern SA_RETCODE SA_EXPORT        sa_gunzip(
  868.                                 SA_CHAR            *filename,
  869.                                 SA_CHAR            *ext
  870.                                 );
  871. extern SA_RETCODE SA_EXPORT        sa_compress(
  872.                                 SA_BYTE            *in,
  873.                                 SA_INT            inlen,
  874.                                 SA_BYTE            *out,
  875.                                 SA_INT            *outlenp
  876.                                 );
  877. extern SA_RETCODE SA_EXPORT        sa_uncompress(
  878.                                 SA_BYTE            *in,
  879.                                 SA_INT            inlen,
  880.                                 SA_BYTE            *out,
  881.                                 SA_INT            *outlenp
  882.                                 );
  883.  
  884. #if defined(__cplusplus)
  885. }
  886. #endif    /* defined(__cplusplus) */
  887.  
  888. #endif /* __SAMBAR_H__ */
  889.