<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,10 +14,9 @@
     &lt;entry&gt;
         &lt;id&gt;{=id=}&lt;/id&gt;
         &lt;title&gt;{=title=}&lt;/title&gt;
-        &lt;link href=&quot;http://timothyilve.net/clog/{=id=}.atom&quot; /&gt;
-        &lt;link rel=&quot;alternate&quot; href=&quot;http://timothylive.net/clog/{=id=}&quot; /&gt;
+        &lt;link href=&quot;http://timothylive.net/clog/{=id=}&quot; /&gt;
         &lt;link rel=&quot;edit&quot; href=&quot;http://timothylive.net/clog/edit/{=id=}.atom&quot; /&gt;
-        &lt;updated&gt;{=c_time=}&lt;/updated&gt;
+        &lt;updated&gt;{=c_time %Y-%m-%dT%H:%M:%SZ=}&lt;/updated&gt;
 		&lt;content type=&quot;html&quot;&gt;&lt;![CDATA[{=content=}]]&gt;&lt;/content&gt;
     &lt;/entry&gt;
 {=loop_end=}</diff>
      <filename>atom.ct</filename>
    </modified>
    <modified>
      <diff>@@ -95,6 +95,7 @@ int print_template(const char *template_file, hash_table h[], int count) {
     char *open;
     char *close;
     char *loop_str;
+    char *param;
     loop_str = (char *)malloc(sizeof(char) * 1);
     loop_str[0] = 0;
 
@@ -131,7 +132,18 @@ int print_template(const char *template_file, hash_table h[], int count) {
                         key = (char *)malloc(sizeof(char) * (key_size + 1));
                         strncpy(key, open, key_size);
                         key[key_size] = 0;
-                        hash_print(h[i], key);
+                        //if key contains a space that means we have a parameter!
+                        param = key;
+                        while (*param) {
+                            param++;
+                            if (*param == ' ') {
+                                *param = 0;
+                                param++;
+                                break;
+                            }
+                        }
+
+                        hash_print(h[i], key, param);
                         free(key);
                     }
                     printf(&quot;%c&quot;, *pt);
@@ -246,11 +258,6 @@ int generate_entries(int window, int id, const char *template_file) {
     return 0;
 }
 
-void print_comment_count(char *count) {
-    if(strcmp(count, &quot;0&quot;) != 0) {
-        printf(&quot; (%s)&quot;, count);
-    }
-}
 
 int free_entries(entry_t entries[], int count) {
     int i;
@@ -318,7 +325,7 @@ int generate_comments(int entry_id, const char *template_file) {
     return 0;
 }
 
-void htmlize_print(char *str) {
+void htmlize_print(char *str, const char *param) {
     char *sep = &quot;\n\r&quot;;
     char *paragraph;
 
@@ -370,12 +377,22 @@ int error_log(const char *fmt, ...) {
     return (ret);
 }
 
-void print_date(char *time) {
+void print_comment_count(char *count, const char *param) {
+    if(strcmp(count, &quot;0&quot;) != 0) {
+        printf(&quot; (%s)&quot;, count);
+    }
+}
+
+void print_date(char *time, const char *format) {
     if (time != NULL) {
         char date[50];
 		//const char *format = &quot;%a, %d %b %Y %H:%M:%S %z&quot;;
-		const char *format = &quot;%Y-%m-%dT%H:%M:%SZ&quot;;
-        format_date(date, strtol(time, NULL, 10), format);
+		//const char *format = &quot;%Y-%m-%dT%H:%M:%SZ&quot;;
+        if (strlen(format) == 0) {
+            format_date(date, strtol(time, NULL, 10), &quot;%a, %d %b %Y %H:%M:%S %z&quot;);
+        } else {
+            format_date(date, strtol(time, NULL, 10), format);
+        }
         printf(&quot;%s&quot;, date);
     }
 }</diff>
      <filename>clog.c</filename>
    </modified>
    <modified>
      <diff>@@ -71,9 +71,9 @@ int remove_entry(int);
 /*
  * prints str where two or more \n are converted to &lt;p&gt; 
  */
-void htmlize_print(char *str);
-void print_comment_count(char *count);
-void print_date(char *time);
+void htmlize_print(char *str, const char *format);
+void print_comment_count(char *count, const char *format);
+void print_date(char *time, const char *format);
 
 int error_log(const char *fmt, ...);
 </diff>
      <filename>clog.h</filename>
    </modified>
    <modified>
      <diff>@@ -57,7 +57,7 @@ void hash_add(hash_table h, char *key, char *val, printer *f) {
 }
 
 
-void hash_print(hash_table table, char *key) {
+void hash_print(hash_table table, char *key, const char *param) {
     hash_t *h = hash_find(table, key);
     if (h == NULL) {
         return;
@@ -66,7 +66,7 @@ void hash_print(hash_table table, char *key) {
             printf(&quot;%s&quot;, h-&gt;val);
         }
     } else {
-        h-&gt;print_f(h-&gt;val);
+        h-&gt;print_f(h-&gt;val, param);
     }
 }
 
@@ -79,7 +79,7 @@ void hash_print_all(hash_table table) {
         while (curr != NULL) {
             printf(&quot; %s\t\t| %s\t\t| &quot;, curr-&gt;key, curr-&gt;val);
             if (curr-&gt;print_f != NULL) {
-                curr-&gt;print_f(curr-&gt;val);
+                curr-&gt;print_f(curr-&gt;val, NULL);
             }
             printf(&quot;\n&quot;);
             curr = curr-&gt;next;</diff>
      <filename>hash.c</filename>
    </modified>
    <modified>
      <diff>@@ -22,13 +22,13 @@
 #define BUCKET_SIZE 10
 
 //if you need to parse the value before printing
-typedef void printer(char *);
+typedef void printer(char *, const char *);
 
 typedef struct hash {
     char *key;
     char *val;
     printer *print_f;
-    struct hash *next; //for collision...
+    struct hash *next; //for collision
 } hash_t;
 
 typedef hash_t *hash_table[BUCKET_SIZE];
@@ -48,7 +48,7 @@ void hash_free(hash_table h);
  *  you can just use sqlite3_free_table */
 void hash_add(hash_table h, char *key, char *val, printer *f);
 
-void hash_print(hash_table table, char *key);
+void hash_print(hash_table table, char *key, const char *param);
 
 void hash_print_all(hash_table table);
 </diff>
      <filename>hash.h</filename>
    </modified>
    <modified>
      <diff>@@ -8,11 +8,17 @@ void get_param(char *q_str, char *search, char *ret, size_t n);
 
 int main() {
     while (FCGI_Accept() &gt;= 0) {
-        char type[80] = &quot;html&quot;;
+        char type[80] = &quot;atom&quot;;
         char entry[10] = &quot;0&quot;;
         char comments[6] = &quot;false&quot;;
+        char *postdata;
 
-        if(getenv(&quot;QUERY_STRING&quot;) != NULL) {
+        postdata = getenv(&quot;CONTENT_LENGTH&quot;);
+        if (postdata != NULL) {
+        }
+        
+
+        if (getenv(&quot;QUERY_STRING&quot;) != NULL) {
             char gets[1000];
 
             strcpy(gets, getenv(&quot;QUERY_STRING&quot;));</diff>
      <filename>main.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5128acc3c8fcbf9c2ddf37bd4acd87f5d5b8564a</id>
    </parent>
  </parents>
  <author>
    <name>Timothy Kim</name>
    <email>highwind@terra.local</email>
  </author>
  <url>http://github.com/highwind/clog/commit/62ff97785979ba7df61aed2b86ddde7132776b5a</url>
  <id>62ff97785979ba7df61aed2b86ddde7132776b5a</id>
  <committed-date>2009-11-05T17:57:05-08:00</committed-date>
  <authored-date>2009-11-05T17:57:05-08:00</authored-date>
  <message>printf modifiers now can have parameters, see date_print for example</message>
  <tree>3410ace296d46ac616fa5648cda97f0307070e7b</tree>
  <committer>
    <name>Timothy Kim</name>
    <email>highwind@terra.local</email>
  </committer>
</commit>
