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
|
|
|
|
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, ...);
|
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
|
|
|
|
|
|
|
|
2010-09-10 23:07:40 -06:00
|
|
|
int fgrepx(char const *needle, char const *filename);
|
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);
|
2010-09-13 12:23:39 -06:00
|
|
|
int award_points(char const *teamhacsh,
|
2010-09-11 22:57:46 -06:00
|
|
|
char const *category,
|
2010-09-12 22:00:58 -06:00
|
|
|
long point);
|
2010-09-11 22:57:46 -06:00
|
|
|
void award_and_log_uniquely(char const *team,
|
|
|
|
char const *category,
|
2010-09-12 22:00:58 -06:00
|
|
|
long points,
|
2010-09-11 22:57:46 -06:00
|
|
|
char const *logfile,
|
2010-09-14 18:04:33 -06:00
|
|
|
char const *line);
|
2010-09-03 21:00:02 -06:00
|
|
|
|
|
|
|
#endif
|