]> code.citadel.org Git - citadel.git/blobdiff - webcit/subst.h
* first work on doing ical elements in templates. does nothing usefull yet.
[citadel.git] / webcit / subst.h
index dcb4b556bc0623931666a698aaaf73681677334c..fec6d958925861a2f98d5a74f36798de4ece996f 100644 (file)
@@ -1,4 +1,4 @@
-
+\
 extern HashList *Conditionals;
 extern HashList *GlobalNS;
 extern HashList *Iterators;
@@ -50,8 +50,9 @@ enum {
 #define CTX_ROOMS 14
 #define CTX_FLOORS 15
 #define CTX_ITERATE 16
+#define CTX_ICAL 17
 
-#define CTX_UNKNOWN 17
+#define CTX_UNKNOWN 18
 
 
 /**
@@ -78,21 +79,6 @@ typedef void (*WCHandlerFunc)(StrBuf *Target, WCTemplputParams *TP);
 /* make a template token a lookup key: */
 #define TKEY(a) TP->Tokens->Params[a]->Start, TP->Tokens->Params[a]->len
 
-/* TODO: wcsubst should be private! */
-
-/*
- * \brief Dynamic content for variable substitution in templates
- */
-typedef struct _wcsubst {
-       ContextFilter Filter;
-       int wcs_type;                       /* which type of Substitution are we */
-       char wcs_key[32];                   /* copy of our hashkey for debugging */
-       StrBuf *wcs_value;                  /* if we're a string, keep it here */
-       long lvalue;                        /* type long? keep data here */
-       WCHandlerFunc wcs_function; /* funcion hook ???*/
-} wcsubst;
-
-
 /**
  * this is the signature of a conditional function 
  * Note: Target is just passed in for error messages; don't write onto it in regular cases.
@@ -192,6 +178,15 @@ void LogTemplateError (StrBuf *Target,
                       WCTemplputParams *TP, 
                       const char *Format, ...)__attribute__((__format__(__printf__,5,6)));
 
+
+/**
+ * \Brief log an error while in global context; print it to Wildfire / Target
+ * \param Target your Target Buffer to print the error message next to the log
+ * \param Type What sort of thing are we talking about? Tokens? Conditionals?
+ * \param Format for the custom error message
+ */ 
+void LogError (StrBuf *Target, const char *Type, const char *Format, ...);
+
 /**
  * \Brief get the actual value of a token parameter
  * in your tmplputs or conditionals use this function to access parameters that can also be