mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-14 17:45:04 +00:00
Fixed a nasty macro expansion bug.
This commit is contained in:
parent
22b89875aa
commit
3acc70b270
3 changed files with 20 additions and 2 deletions
12
main.c
12
main.c
|
@ -54,6 +54,7 @@ char *get_argv(int *argi, int argc, char *argv[])
|
|||
|
||||
#define GET_ARGV() get_argv(&argi, argc, argv)
|
||||
|
||||
d_char *html_timeline(snac *snac, char *list, int local);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -131,6 +132,17 @@ int main(int argc, char *argv[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp(cmd, "timeline") == 0) {
|
||||
xs *list = local_list(&snac, 0xfffffff);
|
||||
xs *body = html_timeline(&snac, list, 1);
|
||||
|
||||
printf("%s\n", body);
|
||||
user_free(&snac);
|
||||
srv_free();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((url = GET_ARGV()) == NULL)
|
||||
return usage();
|
||||
|
||||
|
|
7
snac.c
7
snac.c
|
@ -30,6 +30,13 @@ int srv_running = 0;
|
|||
int dbglevel = 0;
|
||||
|
||||
|
||||
int valid_status(int status)
|
||||
/* is this HTTP status valid? */
|
||||
{
|
||||
return status >= 200 && status <= 299;
|
||||
}
|
||||
|
||||
|
||||
d_char *tid(int offset)
|
||||
/* returns a time-based Id */
|
||||
{
|
||||
|
|
3
snac.h
3
snac.h
|
@ -14,10 +14,9 @@ extern int dbglevel;
|
|||
|
||||
extern const char *susie;
|
||||
|
||||
#define valid_status(status) ((status) >= 200 && (status) <= 299)
|
||||
|
||||
#define L(s) (s)
|
||||
|
||||
int valid_status(int status);
|
||||
d_char *tid(int offset);
|
||||
double ftime(void);
|
||||
|
||||
|
|
Loading…
Reference in a new issue