/* General include file for declaring AolServer emulation funcs...
 * Part of the mod_aolserver software package, Copyright 2000 Robert S. Thau
 */

/* Header files for major functional modules... */

#include <tcl.h>
#include "mod_aolserver.h"

#include "ns_basics.h"
#include "ns_set.h"
#include "dstring.h"
#include "str.h"
#include "tls.h"

#include "conn.h"
#include "modlog.h"
#include "adp.h"

#include "config.h"
#include "db.h"

/* Other stuff that doesn't really deserve its own header */

/* crypt */

#define NS_ENCRYPT_BUFSIZE 16
char *Ns_Encrypt (char *pw, char *salt, char *buf);

/* base64 support */

int Ns_HtuuEncode(unsigned char *bufin, unsigned int nbytes, char * bufcoded);
int Ns_HtuuDecode(char * bufcoded, unsigned char * bufplain, int outbufsize);

/* tclmisc commands */

ns_tcl_command NsTclStripHtmlCmd;
ns_tcl_command NsTclCryptCmd;
ns_tcl_command NsTclHrefsCmd;
ns_tcl_command NsTclLocalTimeCmd;
ns_tcl_command NsTclGmTimeCmd;
ns_tcl_command NsTclSleepCmd;
ns_tcl_command NsTclHTUUEncodeCmd;
ns_tcl_command NsTclHTUUDecodeCmd;
ns_tcl_command NsTclTimeCmd;
ns_tcl_command NsTclStrftimeCmd;
ns_tcl_command NsTclGifSizeCmd;
ns_tcl_command NsTclJpegSizeCmd;

/* tclfile commands --- untested except where marked */

ns_tcl_command NsTclCpFpCmd;
ns_tcl_command NsTclCpCmd;
ns_tcl_command NsTclMkdirCmd;
ns_tcl_command NsTclRmdirCmd; 
ns_tcl_command NsTclUnlinkCmd;
ns_tcl_command NsTclMkTempCmd; /**/
ns_tcl_command NsTclTmpNamCmd; /**/
ns_tcl_command NsTclNormalizePathCmd; /**/
ns_tcl_command NsTclUrl2FileCmd; /**/
ns_tcl_command NsTclKillCmd;
ns_tcl_command NsTclLinkCmd;
ns_tcl_command NsTclSymlinkCmd;
ns_tcl_command NsTclRenameCmd;
ns_tcl_command NsTclTruncateCmd;
ns_tcl_command NsTclChmodCmd;
ns_tcl_command NsTclGetByCmd;

/* Networking */

ns_tcl_command NsTclSockSetBlockingCmd;
ns_tcl_command NsTclSockSetNonBlockingCmd;
ns_tcl_command NsTclSockNReadCmd;
ns_tcl_command NsTclSockCheckCmd;
ns_tcl_command NsTclSockOpenCmd;
ns_tcl_command NsTclSockSelectCmd;
ns_tcl_command NsTclSelectCmd;

/* Misc. URL fiddling */

ns_tcl_command NsTclUrlEncodeCmd;
ns_tcl_command NsTclUrlDecodeCmd;
ns_tcl_command NsTclGuessTypeCmd;

/* Logging */

ns_tcl_command NsTclLogCmd;
ns_tcl_command NsTclModLogCmd;

/* quotehtml */

ns_tcl_command NsTclQuoteHtmlCmd;

/* db stuff */

ns_tcl_command NsTclDbCmd;
ns_tcl_command NsTclPoolDescriptionCmd;
ns_tcl_command NsTclDbErrorCodeCmd;
ns_tcl_command NsTclDbErrorMsgCmd;
ns_tcl_command NsTclQuoteListToListCmd;
ns_tcl_command NsTclGetCsvCmd;

/* Random stuff */

ns_tcl_command NsTclRandCmd;

/* Dealing with pathnames --- still here for now */

#define Ns_PathIsAbsolute(p) (*(p) == '/')
void Ns_MakePath (Ns_DString *ds, ...);
char *Ns_NormalizePath (Ns_DString *s, char *name);

/* DNS stuff --- can't be in ns_basics.h because of the dstrings */

int Ns_GetAddrByHost(Ns_DString *dsPtr, char *host);
int Ns_GetHostByAddr(Ns_DString *dsPtr, char *addr);