moth/packages/mcp/src/common.h

37 lines
1.0 KiB
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
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, ...);
void cgi_page(char *title, char *fmt, ...);
2011-03-14 17:13:25 -06:00
void cgi_error(char *text);
int fgrepx(char const *needle, char const *filename);
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);
int award_points(char const *teamhacsh,
char const *category,
2010-09-12 22:00:58 -06:00
long point);
void award_and_log_uniquely(char const *team,
char const *category,
2010-09-12 22:00:58 -06:00
long points,
char const *logfile,
2010-09-14 18:04:33 -06:00
char const *line);
2010-09-03 21:00:02 -06:00
#endif