#define LIBCITADEL_MIN 738 /* min required libcitadel ver */
#define DEFAULT_HOST "localhost" /* Default Citadel server */
#define DEFAULT_PORT "504"
-#define LB (1) /* Internal escape chars */
-#define RB (2)
-#define QU (3)
#define TARGET "webcit01" /* Target for inline URL's */
#define HOUSEKEEPING 15 /* Housekeeping frequency */
#define MIN_WORKER_THREADS 5
TemplateParam *Params[MAXPARAM];
} WCTemplateToken;
-typedef void (*WCHandlerFunc)(StrBuf *Target, int nArgs, WCTemplateToken **Tokens);
+typedef void (*WCHandlerFunc)(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context);
+void RegisterNS(const char *NSName, long len,
+ int nMinArgs,
+ int nMaxArgs,
+ WCHandlerFunc HandlerFunc);
+#define RegisterNamespace(a, b, c, d) RegisterNS(a, sizeof(a)-1, b, c, d)
+
+
+typedef void (*SubTemplFunc)(StrBuf *TemplBuffer, void *Context);
+typedef HashList *(*RetrieveHashlistFunc)(void);
+typedef void (*HashDestructorFunc) (HashList *KillMe);
+void RegisterITERATOR(const char *Name, long len,
+ HashList *StaticList,
+ RetrieveHashlistFunc GetHash,
+ SubTemplFunc DoSubTempl,
+ HashDestructorFunc Destructor);
+#define RegisterIterator(a, b, c, d, e) RegisterITERATOR(a, sizeof(a)-1, b, c, d, e)
+
/**
* \brief Values for wcs_type
*/
enum {
- WCS_STRING, /**< its a string */
- WCS_FUNCTION, /**< its a function callback */
- WCS_SERVCMD /**< its a command to send to the citadel server */
+ WCS_STRING, /**< its a string */
+ WCS_FUNCTION, /**< its a function callback */
+ WCS_SERVCMD, /**< its a command to send to the citadel server */
+ WCS_STRBUF, /**< its a strbuf we own */
+ WCS_STRBUF_REF /**< its a strbuf we mustn't free */
};
/**
extern HashList *TemplateCache;
extern HashList *LocalTemplateCache;
extern HashList *GlobalNS;
+extern HashList *Iterators;
+extern HashList *ZoneHash;
+
+
void InitialiseSemaphores(void);
void begin_critical_section(int which_one);
void who_inner_div(void);
void ajax_mini_calendar(void);
void fmout(char *align);
+void _fmout(StrBuf *Targt, char *align);
void pullquote_fmout(void);
void wDumpContent(int);
const char *BSTR(char *key);
const char *Bstr(char *key, size_t keylen);
-void urlescputs(char *);
-void hurlescputs(char *);
+
+
+void UrlescPutStrBuf(const StrBuf *strbuf);
+void StrEscPuts(const StrBuf *strbuf);
+void StrEscputs1(const StrBuf *strbuf, int nbsp, int nolinebreaks);
+
+void urlescputs(const char *);
+void hurlescputs(const char *);
void jsesc(char *, size_t, char *);
void jsescputs(char *);
void output_headers( int do_httpheaders,
void SVCallback(char *keyname, size_t keylen, var_callback_fptr fcn_ptr);
#define svcallback(a, b) SVCallback(a, sizeof(a) - 1, b)
-void DoTemplate(const char *templatename, long len);
-#define do_template(a) DoTemplate(a, sizeof(a) -1);
+void SVPUTBuf(const char *keyname, int keylen, StrBuf *Buf, int ref);
+#define SVPutBuf(a, b, c); SVPUTBuf(a, sizeof(a) - 1, b, c)
+
+void DoTemplate(const char *templatename, long len, void *Context, StrBuf *Target);
+#define do_template(a, b) DoTemplate(a, sizeof(a) -1, b, NULL);
int lingering_close(int fd);
int starttls(int sock);
extern SSL_CTX *ssl_ctx;
int client_read_ssl(char *buf, int bytes, int timeout);
-void client_write_ssl(const char *buf, int nbytes);
+void client_write_ssl(const StrBuf *Buf);
#endif
#ifdef HAVE_ZLIB