2010-09-03 21:00:02 -06:00
|
|
|
#ifndef __COMMON_H__
|
|
|
|
#define __COMMON_H__
|
|
|
|
|
2010-09-11 23:22:28 -06:00
|
|
|
#include <stddef.h>
|
2010-09-18 21:56:57 -06:00
|
|
|
#include <stdint.h>
|
2010-09-11 23:22:28 -06:00
|
|
|
|
2010-09-12 22:00:58 -06:00
|
|
|
#define TEAM_MAX 40
|
|
|
|
#define CAT_MAX 40
|
2010-09-29 17:38:54 -06:00
|
|
|
#define TOKEN_MAX 80
|
2010-10-25 17:17:10 -06:00
|
|
|
#define itokenlen 5
|
2010-09-12 22:00:58 -06:00
|
|
|
|
2012-05-30 18:04:24 -06:00
|
|
|
#define ERR_GENERAL -1
|
|
|
|
#define ERR_NOTEAM -2
|
|
|
|
#define ERR_CLAIMED -3
|
|
|
|
|
2010-09-13 12:23:39 -06:00
|
|
|
int cgi_init(char *global_argv[]);
|
2010-09-11 23:22:28 -06:00
|
|
|
size_t cgi_item(char *str, size_t maxlen);
|
2010-09-12 22:00:58 -06:00
|
|
|
void cgi_head(char *title);
|
|
|
|
void cgi_foot();
|
2011-03-14 17:13:25 -06:00
|
|
|
void cgi_result(int code, char *desc, char *fmt, ...);
|
2012-05-30 18:04:24 -06:00
|
|
|
void cgi_fail(int err);
|
2010-09-11 23:22:28 -06:00
|
|
|
void cgi_page(char *title, char *fmt, ...);
|
2011-03-14 17:13:25 -06:00
|
|
|
void cgi_error(char *text);
|
2010-09-11 23:22:28 -06:00
|
|
|
|
|
|
|
|
2012-05-30 18:04:24 -06:00
|
|
|
int anchored_search(char const *filename, char const *needle, const char anchor);
|
2010-09-29 17:38:54 -06:00
|
|
|
void urandom(char *buf, size_t buflen);
|
2010-09-16 12:21:16 -06:00
|
|
|
int my_snprintf(char *buf, size_t buflen, char *fmt, ...);
|
2010-09-23 18:23:00 -06:00
|
|
|
char *state_path(char const *fmt, ...);
|
|
|
|
char *package_path(char const *fmt, ...);
|
2010-09-11 22:57:46 -06:00
|
|
|
int team_exists(char const *teamhash);
|
2012-05-30 18:04:24 -06:00
|
|
|
int award_points(char const *teamhash,
|
2010-09-11 22:57:46 -06:00
|
|
|
char const *category,
|
2012-05-30 18:04:24 -06:00
|
|
|
long point,
|
|
|
|
char const *uid);
|
2010-09-03 21:00:02 -06:00
|
|
|
|
|
|
|
#endif
|