home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 September
/
PCWorld_2000-09_cd.bin
/
Komunik
/
sambar
/
_setup.1
/
sambar.h
< prev
next >
Wrap
C/C++ Source or Header
|
2000-03-22
|
23KB
|
862 lines
/*
** SAMBAR.H
**
** This is the public WIN32 header file for the Sambar
** Server application.
**
** Confidential Property of Tod Sambar
** (c) Copyright Tod Sambar 1996-1997
** All rights reserved.
**
**
** History:
** Chg# Date Description Resp
** ---- ------- ------------------------------------------------------- ----
** 10AUG96 Created sambar
** 11APR97 Added server start/stop APIs sambar
*/
#if !defined(__SAMBAR_H__)
#define __SAMBAR_H__
/*
** Types
*/
typedef int SA_RETCODE;
typedef long SA_INT;
typedef int SA_BOOL;
typedef void SA_VOID;
typedef unsigned char SA_BYTE;
typedef unsigned char SA_CHAR;
#ifndef TEXT
#define TEXT(x) (x)
#endif
#ifndef MAX
#define MAX(a,b) ((SA_INT)(a) > (SA_INT)(b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((SA_INT)(a) < (SA_INT)(b) ? (a) : (b))
#endif
/*
** Public Structures
*/
#define SA_CTX SA_VOID
#define SA_CONN SA_VOID
#define SA_PARAMS SA_VOID
#define SA_REC SA_VOID
#define SA_PROFILE SA_VOID
/*
** Return Codes
*/
#define SA_SUCCEED 1
#define SA_FAIL 0
/*
** Error Codes
*/
#define SA_E_DOCFOLLOWS (SA_INT)-1
#define SA_E_INTERNALSYSTEM (SA_INT)0
#define SA_E_ALREADYLOGGEDIN (SA_INT)1
#define SA_E_BADCOOKIE (SA_INT)2
#define SA_E_INVALIDLOGIN (SA_INT)3
#define SA_E_MAXLOGINS (SA_INT)4
#define SA_E_ALREADYDEFINED (SA_INT)5
#define SA_E_INVALIDDATA (SA_INT)6
#define SA_E_NOTIMPLEMENTED (SA_INT)7
#define SA_E_FORBIDDEN (SA_INT)8
#define SA_E_NOTFOUND (SA_INT)9
#define SA_E_DUPLICATE (SA_INT)10
#define SA_E_DBOPFAILED (SA_INT)11
#define SA_E_BADGATEWAY (SA_INT)12
#define SA_E_REDIRECT (SA_INT)13
#define SA_E_USRDEF1 (SA_INT)14
#define SA_E_USRDEF2 (SA_INT)15
#define SA_E_USRDEF3 (SA_INT)16
#define SA_E_USRDEF4 (SA_INT)17
#define SA_E_USRDEF5 (SA_INT)18
#define SA_E_USRDEF6 (SA_INT)19
#define SA_E_USRDEF7 (SA_INT)20
#define SA_E_USRDEF8 (SA_INT)21
#define SA_E_USRDEF9 (SA_INT)22
#define SA_E_USRDEF10 (SA_INT)23
#define SA_E_USRDEF11 (SA_INT)24
#define SA_E_USRDEF12 (SA_INT)25
#define SA_E_USRDEF13 (SA_INT)26
#define SA_E_USRDEF14 (SA_INT)27
#define SA_E_USRDEF15 (SA_INT)28
#define SA_E_USRDEF16 (SA_INT)29
#define SA_E_USRDEF17 (SA_INT)30
#define SA_E_USRDEF18 (SA_INT)31
#define SA_E_USRDEF19 (SA_INT)32
#define SA_E_USRDEF20 (SA_INT)33
#define SA_E_TIMEOUT (SA_INT)34
#define SA_E_SHUTDOWN (SA_INT)35
#define SA_E_SERVERDOWN (SA_INT)36
#define SA_E_PAUSED (SA_INT)37
#define SA_E_MAXCGIS (SA_INT)38
#define SA_E_INUSE (SA_INT)39
#define SA_E_RESTART (SA_INT)40
#define SA_E_INTERRUPTED (SA_INT)41
#define SA_E_SSLONLY (SA_INT)42
/*
** Actions
*/
#define SA_GET (SA_INT)1
#define SA_SET (SA_INT)2
#define SA_CLEAR (SA_INT)3
/*
** Misc Defines
*/
#define SA_NULLTERM (SA_INT)-3
/*
** Context Properties
*/
#define SA_CTXPROP_SYSADMIN (SA_INT)1
#define SA_CTXPROP_HOMEDIR (SA_INT)2
#define SA_CTXPROP_LOGDIR (SA_INT)3
#define SA_CTXPROP_DBCACHE (SA_INT)4
#define SA_CTXPROP_APPLICDIR (SA_INT)5
#define SA_CTXPROP_SERVERSW (SA_INT)7
#define SA_CTXPROP_SERVERPORT (SA_INT)8
#define SA_CTXPROP_SERVERNAME (SA_INT)9
#define SA_CTXPROP_SERVERIP (SA_INT)10
#define SA_CTXPROP_BUILDID (SA_INT)11
#define SA_CTXPROP_HTTPLOGFUNC (SA_INT)12
#define SA_CTXPROP_SECURITYMODEL (SA_INT)13
#define SA_CTXPROP_LICENSETYPE (SA_INT)14
#define SA_CTXPROP_AUTHLOGINS (SA_INT)15
/*
** Connection Properties
*/
#define SA_CONNPROP_HOST (SA_INT)1
#define SA_CONNPROP_AGENT (SA_INT)2
#define SA_CONNPROP_REFERER (SA_INT)3
#define SA_CONNPROP_REQUEST (SA_INT)4
#define SA_CONNPROP_REQUESTMETHOD (SA_INT)5
#define SA_CONNPROP_USERNAME (SA_INT)6
#define SA_CONNPROP_NAME (SA_INT)7
#define SA_CONNPROP_PASSWORD (SA_INT)8
#define SA_CONNPROP_IPADDR (SA_INT)9
#define SA_CONNPROP_DOCSDIR (SA_INT)10
#define SA_CONNPROP_DOCSPATH (SA_INT)11
/*
** Scheduler Time Arguments
*/
#define SA_SCHEDULETIME_TIMEOUT (SA_INT)1 /* Every 2 minutes */
#define SA_SCHEDULETIME_HOURLY (SA_INT)2 /* Every hour */
#define SA_SCHEDULETIME_DAILY (SA_INT)3 /* Every day */
#define SA_SCHEDULETIME_WEEKLY (SA_INT)4 /* Every week */
#define SA_SCHEDULETIME_MONTHLY (SA_INT)5 /* Every month */
/*
** Next Page Argument
*/
#define SA_PAGE_ARG TEXT("RCpage")
#define SA_REDIRECT_ARG TEXT("RCredirect")
/*
** System Administrator Folder
*/
#define SA_ADMIN_FOLDER TEXT("sysadmin")
/*
** Default group
*/
#define SA_DEFAULT_GROUP TEXT("other")
/*
** RPC authorization types
*/
#define SA_AUTHORIZATION_ALL (SA_INT)0 /* All clients */
#define SA_AUTHORIZATION_USER (SA_INT)1 /* Logged in users only */
#define SA_AUTHORIZATION_ADMIN (SA_INT)2 /* Admin only */
#define SA_AUTHORIZATION_SCRIPT (SA_INT)3 /* Only inside scripts */
/*
** RPC parameters
*/
typedef struct sa__rpcparam
{
SA_CHAR *name; /* Parameter name */
SA_BOOL required; /* Required or optional param */
SA_CHAR *descr; /* Parameter description */
} SA_RPCPARAM;
typedef struct sa__arg
{
SA_CHAR *value; /* Parameter value */
struct sa__arg *next;
} SA_ARG;
/*
** Scalar parameters
*/
typedef struct sa__scalararg
{
SA_CHAR *name; /* Argument name */
SA_CHAR *descr; /* Argument description */
} SA_SCALARARG;
/*
** Request-handler modules
*/
typedef struct sa__request
{
SA_INT method; /* SA_METHOD_* */
SA_CHAR *uri; /* URI requested. */
SA_INT urilen;
SA_CHAR *path; /* path to requested URI. */
SA_INT pathlen;
SA_CHAR *args;
SA_INT argslen;
SA_CHAR *content;
SA_INT contentlen;
SA_CHAR *pathinfo;
SA_INT pathinfolen;
} SA_REQUEST;
#define SA_METHOD_GET (SA_INT)1
#define SA_METHOD_POST (SA_INT)2
#define SA_METHOD_PUT (SA_INT)3
#define SA_METHOD_HEAD (SA_INT)4
#define SA_METHOD_PATCH (SA_INT)5
#define SA_METHOD_PROPFIND (SA_INT)6
#define SA_METHOD_PROPPATCH (SA_INT)7
#define SA_METHOD_DELETE (SA_INT)8
#define SA_METHOD_CONNECT (SA_INT)9
#define SA_METHOD_COPY (SA_INT)10
#define SA_METHOD_MKCOL (SA_INT)11
#define SA_METHOD_MOVE (SA_INT)12
#define SA_METHOD_OPTIONS (SA_INT)13
#define SA_METHOD_TRACE (SA_INT)14
#define SA_METHOD_LOCK (SA_INT)15
#define SA_METHOD_UNLOCK (SA_INT)16
#define SA_METHOD_SEARCH (SA_INT)17
#define SA_METHOD_CHECKOUT (SA_INT)18
#define SA_METHOD_UNCHECKOUT (SA_INT)19
#define SA_METHOD_CHECKIN (SA_INT)20
#define SA_METHOD_MKRESOURCE (SA_INT)21
#define SA_METHOD_REPORT (SA_INT)22
/*
** HTTP Log callback structure
*/
typedef struct sa__httplog
{
SA_INT size;
SA_INT status;
SA_CHAR *method;
SA_CHAR *timestamp;
SA_CHAR *request;
SA_CHAR *args;
SA_CHAR *vhost;
SA_CHAR *user; /* User IP Address */
SA_CHAR *username;
SA_CHAR *referer;
SA_CHAR *agent;
/* Include system statistics. */
SA_INT allconns; /* Total network connections */
SA_INT httpconns; /* # of HTTP connections */
SA_INT threads; /* Total threads */
} SA_HTTPLOG;
/*
** Password Management
*/
#define SA_PASSWD_FILE TEXT("passwd")
#define SA_MAX_NAME (SA_INT)64
#define SA_MAX_VALUE (SA_INT)1000
typedef struct sa__ftp
{
SA_INT privs; /* FTP access */
SA_INT ftpmax; /* Maximum FTP MB */
SA_INT dirlen;
SA_CHAR dir[SA_MAX_NAME + 1]; /* FTP root dir */
} SA_FTP;
typedef struct sa__sip
{
SA_INT unused; /* SIP access */
} SA_SIP;
typedef struct sa__passwd
{
SA_INT ftpprivs; /* FTP priviledges */
SA_INT ftpmax; /* FTP max upload */
SA_INT dirlen;
SA_INT namelen;
SA_INT grouplen;
SA_INT passwordlen;
SA_CHAR name[SA_MAX_NAME + 1]; /* Symbolic name */
SA_CHAR group[SA_MAX_NAME + 1];
SA_CHAR password[SA_MAX_NAME + 1];
SA_CHAR dir[SA_MAX_NAME + 1]; /* FTP dir */
} SA_PASSWD;
typedef struct sa__user
{
SA_INT grouplen;
SA_INT usernamelen;
SA_CHAR group[SA_MAX_NAME + 1];
SA_CHAR username[SA_MAX_NAME + 1];
} SA_USER;
typedef struct sa__group
{
SA_INT namelen;
SA_CHAR name[SA_MAX_NAME + 1];
} SA_GROUP;
/*
** FTP Priviledges
*/
#define SA_PRIV_NOACCESS (SA_INT)0
#define SA_PRIV_READONLY (SA_INT)1
#define SA_PRIV_READWRITE (SA_INT)2
/*
** Server Types
*/
#define SA_SERVERTYPE_HTTP (SA_INT)100
#define SA_SERVERTYPE_HTTPPROXY (SA_INT)101
#define SA_SERVERTYPE_FTP (SA_INT)102
#define SA_SERVERTYPE_SMTPPROXY (SA_INT)103
#define SA_SERVERTYPE_POP3PROXY (SA_INT)104
#define SA_SERVERTYPE_IMAP4PROXY (SA_INT)105
#define SA_SERVERTYPE_BRIDGEPROXY (SA_INT)106
#define SA_SERVERTYPE_NNTPPROXY (SA_INT)107
#define SA_SERVERTYPE_FTPPROXY (SA_INT)108
#define SA_SERVERTYPE_SOCKSPROXY (SA_INT)109
#define SA_SERVERTYPE_TELNETPROXY (SA_INT)110
#define SA_SERVERTYPE_REALPROXY (SA_INT)111
#define SA_SERVERTYPE_SMTP (SA_INT)112
#define SA_SERVERTYPE_POP3 (SA_INT)113
#define SA_SERVERTYPE_IMAP4 (SA_INT)114
#define SA_SERVERTYPE_TELNET (SA_INT)115
#define SA_SERVERTYPE_DNS (SA_INT)116
#define SA_SERVERTYPE_SIP (SA_INT)117
#define SA_SERVERTYPE_DHCP (SA_INT)118
/*
** Record Flags
*/
#define SA_REC_CREATE (SA_INT)0x0001
#define SA_REC_DELETE (SA_INT)0x0002
/*
** Sambar Server callbacks
*/
typedef SA_RETCODE (* SA_INITFUNC)(SA_CTX *ctx);
typedef SA_RETCODE (* SA_EXITFUNC)(SA_CTX *ctx);
typedef SA_RETCODE (* SA_LOGINFUNC)(SA_CTX *ctx, SA_CONN *conn,
SA_CHAR *username, SA_INT usernamelen,
SA_CHAR *password, SA_INT passwordlen,
SA_INT *infop);
typedef SA_RETCODE (* SA_LOGOUTFUNC)(SA_CTX *ctx, SA_CONN *conn);
typedef SA_RETCODE (* SA_PROFILEFUNC)(SA_CTX *ctx, SA_CONN *conn,
SA_INT action, SA_CHAR *name,
SA_INT namelen, SA_VOID *datap);
typedef SA_RETCODE (* SA_REQUESTFUNC)(SA_CTX *ctx, SA_CONN *conn,
SA_CHAR *uri, SA_INT urilen,
SA_PARAMS *params, SA_INT *infop);
typedef SA_RETCODE (* SA_RPCFUNC)(SA_CTX *ctx, SA_CONN *conn,
SA_PARAMS *params, SA_INT *infop);
typedef SA_RETCODE (* SA_SCALARFUNC)(SA_CTX *ctx, SA_CONN *conn,
SA_ARG *args, SA_CHAR *value);
typedef SA_RETCODE (* SA_PROPFUNC)(SA_CTX *ctx, SA_VOID *argp,
SA_CHAR *name, SA_CHAR *value);
typedef SA_RETCODE (* SA_FTPFUNC)(SA_CTX *ctx, SA_CHAR *name,
SA_INT namelen, SA_CHAR *password,
SA_INT passwordlen, SA_FTP *ftpresp);
typedef SA_RETCODE (* SA_SIPFUNC)(SA_CTX *ctx, SA_CHAR *name,
SA_INT namelen, SA_CHAR *password,
SA_INT passwordlen, SA_SIP *sipresp);
typedef SA_RETCODE (* SA_TELNETFUNC)(SA_CTX *ctx, SA_CHAR *name,
SA_INT namelen, SA_CHAR *password,
SA_INT passwordlen);
typedef SA_RETCODE (* SA_MAILFUNC)(SA_CTX *ctx, SA_CHAR *name,
SA_INT namelen, SA_CHAR *password,
SA_INT passwordlen);
typedef SA_RETCODE (* SA_NETCONNECTFUNC)(SA_CTX *ctx,
SA_CHAR *ipaddr, SA_INT servertype);
typedef SA_RETCODE (* SA_HTTPPROXYFUNC)(SA_CTX *ctx, SA_CONN *conn,
SA_CHAR *host, SA_INT hostlen,
SA_CHAR *url, SA_INT urllen);
typedef SA_RETCODE (* SA_ENVTFUNC)(SA_CTX *ctx, SA_CONN *conn,
SA_CHAR *buffer, SA_INT buflen,
SA_CHAR *data);
typedef SA_RETCODE (* SA_MODULEFUNC)(SA_CTX *ctx, SA_CONN *conn,
SA_REQUEST *request, SA_INT *infop);
typedef SA_VOID (* SA_HTTPLOGFUNC)(SA_CTX *ctx,
SA_HTTPLOG *httplog);
typedef SA_RETCODE (* SA_SCHEDULEFUNC)(SA_CTX *ctx, SA_CHAR *name,
SA_VOID *argp);
typedef SA_VOID (* SA_RASFUNC)(SA_CTX *ctx, SA_CHAR *ip,
SA_CHAR *previp, SA_BOOL connected);
/*
** Sambar Server Function Prototypes
*/
#ifdef WIN32
#define SA_PUBLIC __cdecl
#define SA_EXPORT __declspec(dllexport)
#else /* UNIX */
#define SA_PUBLIC
#define SA_EXPORT
#endif
#if defined(__cplusplus)
extern "C" {
#endif /* defined(__cplusplus) */
/*
** Sambar Server startup/shutdown
*/
extern SA_RETCODE SA_EXPORT sa_server(
SA_VOID *hWnd
);
extern SA_BOOL SA_EXPORT sa_stopped(
void
);
extern SA_RETCODE SA_EXPORT sa_shutdown(
SA_BOOL restart
);
extern SA_RETCODE SA_EXPORT sa_pause(
SA_BOOL unpause
);
/*
** General Functions
*/
extern SA_RETCODE SA_EXPORT sa_cgi_exec(
SA_CTX *ctx,
SA_CONN *conn,
SA_REQUEST *request
);
extern SA_RETCODE SA_EXPORT sa_wincgi_exec(
SA_CTX *ctx,
SA_CONN *conn,
SA_REQUEST *request
);
extern SA_RETCODE SA_EXPORT sa_cmd_init(
SA_CTX *ctx,
SA_CHAR *name,
SA_RPCPARAM *params,
SA_INT numparams,
SA_INT authorization,
SA_CHAR *descr,
SA_RPCFUNC funcp
);
extern SA_RETCODE SA_EXPORT sa_scalar_init(
SA_CTX *ctx,
SA_CHAR *name,
SA_SCALARARG *args,
SA_INT numargs,
SA_CHAR *descr,
SA_SCALARFUNC funcp
);
extern SA_RETCODE SA_EXPORT sa_props_load(
SA_CTX *ctx,
SA_CHAR *filename,
SA_CHAR *section,
SA_VOID *argp,
SA_PROPFUNC funcp
);
extern SA_RETCODE SA_EXPORT sa_send_file(
SA_CONN *conn,
SA_CHAR *filename
);
extern SA_RETCODE SA_EXPORT sa_send_macro(
SA_CONN *conn,
SA_CHAR *macroname
);
extern SA_RETCODE SA_EXPORT sa_send_header(
SA_CONN *conn,
SA_CHAR *buffer,
SA_INT buflen
);
extern SA_RETCODE SA_EXPORT sa_params(
SA_CTX *ctx,
SA_CONN *conn,
SA_PARAMS **paramsp
);
extern SA_RETCODE SA_EXPORT sa_param(
SA_CTX *ctx,
SA_PARAMS *params,
SA_CHAR *name,
SA_CHAR **valuep,
SA_INT *valuelenp
);
extern SA_RETCODE SA_EXPORT sa_param_set(
SA_CTX *ctx,
SA_PARAMS *params,
SA_CHAR *name,
SA_CHAR *value,
SA_INT valuelen
);
extern SA_RETCODE SA_EXPORT sa_state_get(
SA_CTX *ctx,
SA_CONN *conn,
SA_CHAR *name,
SA_CHAR **valuep,
SA_INT *valuelenp
);
extern SA_RETCODE SA_EXPORT sa_state_set(
SA_CTX *ctx,
SA_CONN *conn,
SA_CHAR *name,
SA_CHAR *value,
SA_INT valuelen
);
extern SA_VOID SA_EXPORT sa_log(
SA_CTX *ctx,
SA_CHAR *buffer
);
extern SA_VOID SA_EXPORT sa_observe(
SA_CTX *ctx,
SA_CHAR *buffer
);
extern SA_RETCODE SA_EXPORT sa_get_macro(
SA_CTX *ctx,
SA_CHAR *macroname,
SA_CHAR **macrop,
SA_INT *macrolenp
);
extern SA_RETCODE SA_EXPORT sa_get_mime(
SA_CTX *ctx,
SA_CHAR *name,
SA_INT namelen,
SA_CHAR **mimetypep
);
extern SA_RETCODE SA_EXPORT sa_get_realpath(
SA_CTX *ctx,
SA_CONN *conn,
SA_CHAR *name,
SA_INT namelen,
SA_CHAR *path,
SA_INT maxpath
);
extern SA_INT SA_EXPORT sa_wildcmp(
SA_CTX *ctx,
SA_CHAR *wildstr,
SA_INT wildstrlen,
SA_CHAR *arg,
SA_INT arglen
);
extern SA_RETCODE SA_EXPORT sa_schedule_task(
SA_CTX *ctx,
SA_CHAR *name,
SA_SCHEDULEFUNC func,
SA_VOID *argp,
SA_INT when
);
/*
** Mail Utility Functions
*/
extern SA_RETCODE SA_EXPORT sa_smtpmail(
SA_CTX *ctx,
SA_CHAR *from,
SA_CHAR *tolist,
SA_CHAR *cclist,
SA_CHAR *bcclist,
SA_CHAR *subject,
SA_CHAR *message,
SA_CHAR *attachment
);
extern SA_RETCODE SA_EXPORT sa_smtpmail2(
SA_CTX *ctx,
SA_CHAR *from,
SA_CHAR *tolist,
SA_CHAR *cclist,
SA_CHAR *bcclist,
SA_CHAR *subject,
SA_CHAR *message,
SA_CHAR *signature,
SA_CHAR *attachname,
SA_BYTE *attachdata,
SA_INT attachdatalen
);
extern SA_RETCODE SA_EXPORT sa_mbox_create(
SA_CTX *ctx,
SA_CHAR *user
);
extern SA_RETCODE SA_EXPORT sa_mbox_delete(
SA_CTX *ctx,
SA_CHAR *user
);
extern SA_BOOL SA_EXPORT sa_mbox_exists(
SA_CTX *ctx,
SA_CHAR *user
);
/*
** Context Functions
*/
extern SA_RETCODE SA_EXPORT sa_ctx_global(
SA_CTX **ctxp
);
extern SA_RETCODE SA_EXPORT sa_ctx_key(
SA_CTX *ctx,
SA_INT action,
SA_CHAR *key,
SA_VOID **valuep
);
extern SA_RETCODE SA_EXPORT sa_ctx_props(
SA_CTX *ctx,
SA_INT action,
SA_INT property,
SA_BYTE *buffer,
SA_INT buflen,
SA_INT *outlenp
);
extern SA_RETCODE SA_EXPORT sa_envt_prop(
SA_CTX *ctx,
SA_CONN *conn,
SA_BYTE *prop,
SA_INT proplen,
SA_CHAR *buffer
);
/*
** Connection Functions
*/
extern SA_RETCODE SA_EXPORT sa_conn_key(
SA_CONN *conn,
SA_INT action,
SA_CHAR *key,
SA_VOID **valuep
);
extern SA_RETCODE SA_EXPORT sa_conn_props(
SA_CONN *conn,
SA_INT action,
SA_INT property,
SA_BYTE *buffer,
SA_INT buflen,
SA_INT *outlenp
);
extern SA_RETCODE SA_EXPORT sa_conn_send(
SA_CONN *conn,
SA_CHAR *buffer,
SA_INT buflen
);
extern SA_RETCODE SA_EXPORT sa_conn_flush(
SA_CONN *conn
);
extern SA_RETCODE SA_EXPORT sa_conn_redirect(
SA_CONN *conn,
SA_CHAR *location,
SA_CHAR *buffer,
SA_INT buflen
);
extern SA_RETCODE SA_EXPORT sa_conn_login(
SA_CONN *conn,
SA_CHAR *user,
SA_INT userlen,
SA_CHAR *password,
SA_INT passwordlen,
SA_INT *infop
);
/*
** User/Password Management Routines
*/
extern SA_RETCODE SA_EXPORT sa_passwd_lookup(
SA_CTX *ctx,
SA_CHAR *username,
SA_INT usernamelen,
SA_PASSWD *passwd
);
extern SA_RETCODE SA_EXPORT sa_passwd_add(
SA_CTX *ctx,
SA_CHAR *username,
SA_INT usernamelen,
SA_PASSWD *passwd
);
extern SA_RETCODE SA_EXPORT sa_passwd_update(
SA_CTX *ctx,
SA_CHAR *username,
SA_INT usernamelen,
SA_PASSWD *passwd
);
extern SA_RETCODE SA_EXPORT sa_passwd_delete(
SA_CTX *ctx,
SA_CHAR *username,
SA_INT usernamelen
);
extern SA_RETCODE SA_EXPORT sa_passwd_list(
SA_CTX *ctx,
SA_USER *users,
SA_INT numusers,
SA_INT *countp
);
/*
** Group Management Routines
*/
extern SA_RETCODE SA_EXPORT sa_group_add(
SA_CTX *ctx,
SA_CHAR *name,
SA_INT namelen
);
extern SA_RETCODE SA_EXPORT sa_group_delete(
SA_CTX *ctx,
SA_CHAR *name,
SA_INT namelen
);
extern SA_RETCODE SA_EXPORT sa_group_list(
SA_CTX *ctx,
SA_GROUP *groups,
SA_INT numgroups,
SA_INT *countp
);
/*
** Profile Functions
*/
extern SA_RETCODE SA_EXPORT sa_profile_init(
SA_CTX *ctx,
SA_CHAR *username,
SA_INT usernamelen,
SA_PROFILE **profilep
);
extern SA_RETCODE SA_EXPORT sa_profile_exit(
SA_CTX *ctx,
SA_PROFILE *profile
);
extern SA_RETCODE SA_EXPORT sa_profile_save(
SA_CTX *ctx,
SA_PROFILE *profile
);
extern SA_RETCODE SA_EXPORT sa_profile_get(
SA_CTX *ctx,
SA_PROFILE *profile,
SA_CHAR *name,
SA_INT namelen,
SA_CHAR **datap
);
extern SA_RETCODE SA_EXPORT sa_profile_set(
SA_CTX *ctx,
SA_PROFILE *profile,
SA_CHAR *name,
SA_INT namelen,
SA_CHAR *value
);
/*
** Search Functions
*/
extern SA_RETCODE SA_EXPORT sa_search_add(
SA_CTX *ctx,
SA_CHAR *indexname,
SA_CHAR *title,
SA_CHAR *url,
SA_CHAR *data,
SA_INT datalen
);
/*
** RAS Functions
*/
extern SA_RETCODE SA_EXPORT sa_ras_disconnect(
SA_CTX *ctx,
SA_BOOL *activep
);
/*
** Record Functions
*/
extern SA_RETCODE SA_EXPORT sa_rec_init(
SA_CTX *ctx,
SA_CHAR *filename,
SA_INT flags,
SA_INT reclen,
SA_REC **recp
);
extern SA_RETCODE SA_EXPORT sa_rec_exit(
SA_REC *rec,
SA_INT flags
);
extern SA_RETCODE SA_EXPORT sa_rec_insert(
SA_REC *rec,
SA_BYTE *data,
SA_INT *idp
);
extern SA_RETCODE SA_EXPORT sa_rec_update(
SA_REC *rec,
SA_INT id,
SA_BYTE *data
);
extern SA_RETCODE SA_EXPORT sa_rec_delete(
SA_REC *rec,
SA_INT id
);
extern SA_RETCODE SA_EXPORT sa_rec_fetch(
SA_REC *rec,
SA_INT id,
SA_BYTE *data
);
extern SA_RETCODE SA_EXPORT sa_rec_next(
SA_REC *rec,
SA_INT lastid,
SA_BYTE *data,
SA_INT *idp
);
/*
** General Utilities
*/
extern SA_INT SA_EXPORT sa_dirsize(
SA_CHAR *dirpath
);
extern SA_INT SA_EXPORT sa_dirfiles(
SA_CHAR *dirpath
);
extern SA_RETCODE SA_EXPORT sa_gzip(
SA_CHAR *filename,
SA_CHAR *ext
);
extern SA_RETCODE SA_EXPORT sa_gunzip(
SA_CHAR *filename,
SA_CHAR *ext
);
extern SA_RETCODE SA_EXPORT sa_compress(
SA_BYTE *in,
SA_INT inlen,
SA_BYTE *out,
SA_INT *outlenp
);
extern SA_RETCODE SA_EXPORT sa_uncompress(
SA_BYTE *in,
SA_INT inlen,
SA_BYTE *out,
SA_INT *outlenp
);
#if defined(__cplusplus)
}
#endif /* defined(__cplusplus) */
#endif /* __SAMBAR_H__ */