moth/packages/00common/src/common.h

38 lines
962 B
C
Raw Normal View History

2010-09-03 21:00:02 -06:00
#ifndef __COMMON_H__
#define __COMMON_H__
#include <stddef.h>
#include <stdint.h>
2010-09-12 22:00:58 -06:00
#define TEAM_MAX 40
#define CAT_MAX 40
#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
int cgi_init(char *global_argv[]);
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);
void cgi_page(char *title, char *fmt, ...);
2011-03-14 17:13:25 -06:00
void cgi_error(char *text);
2012-05-30 18:04:24 -06:00
int anchored_search(char const *filename, char const *needle, const char anchor);
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, ...);
int team_exists(char const *teamhash);
2012-05-30 18:04:24 -06:00
int award_points(char const *teamhash,
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