diff options
Diffstat (limited to 'ctl.c')
-rw-r--r-- | ctl.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -20,17 +20,17 @@ printdate(int timestamp) } void -showattachment(id) +showatt(id) { - struct attachment *attachment; + struct att *att; - if(!(attachment = getattachment(byid("attachments", id), 1))){ - srverr("Could not retrieve attachment"); + if(!(att = getatt(byid("atts", id)))){ + srverr("Could not retrieve att"); return; } - printf("Content-Type: %s\n\n", attachment->mime); - printf("%.*s", attachment->bytes, attachment->data); + printf("Content-Type: %s\n\n", att->mime); + printf("%.*s", att->bytes, att->data); } void @@ -57,22 +57,22 @@ void showpost(int id) { char *title; - struct attachment *attachment; + struct att *att; struct post *post; struct user *user; sqlite3_stmt *stmt; - if(!(post = getpost(byid("posts", id), 1))){ + if(!(post = getpost(byid("posts", id)))){ srverr("Could not retrieve post"); return; } - if(!(user = getuser(byid("users", post->user), 1))){ + if(!(user = getuser(byid("users", post->user)))){ srverr("Could not retrieve post author"); return; } - stmt = byid("attachments", id); + stmt = byid("atts", id); title = site.name; printf("Content-Type: text/html\n\n"); @@ -85,7 +85,7 @@ showuser(int id) char *title; struct user *user; - if(!(user = getuser(byid("users", id), 1))){ + if(!(user = getuser(byid("users", id)))){ srverr("Could not retrieve user"); return; } |