-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathlimit_ioccc.h
More file actions
165 lines (143 loc) · 6.47 KB
/
limit_ioccc.h
File metadata and controls
165 lines (143 loc) · 6.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*
* limit_ioccc - IOCCC size and rule related limitations
*
* Copyright (c) 2021-2025 by Landon Curt Noll and Cody Boone Ferguson.
* All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright, this permission notice and text
* this comment, and the disclaimer below appear in all of the following:
*
* supporting documentation
* source copies
* source works derived from this source
* binaries derived from this source or from derived source
*
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* This tool was co-developed in 2021-2025 by Cody Boone Ferguson and Landon
* Curt Noll:
*
* @xexyl
* https://xexyl.net Cody Boone Ferguson
* https://ioccc.xexyl.net
* and:
* chongo (Landon Curt Noll, http://www.isthe.com/chongo/index.html) /\oo/\
*
* "Because sometimes even the IOCCC Judges need some help." :-)
*
* Share and enjoy! :-)
* -- Sirius Cybernetics Corporation Complaints Division, JSON spec department. :-)
*/
#if !defined(INCLUDE_LIMIT_IOCCC_H)
# define INCLUDE_LIMIT_IOCCC_H
#include <time.h>
/*
* version - official IOCCC toolkit versions
*/
#include "version.h"
#undef DIGRAPHS /* digraphs count a 2 for Rule 2b */
#undef TRIGRAPHS /* trigraphs count a 3 for Rule 2b */
#define RULE_2A_SIZE (4993) /* Rule 2a size of prog.c */
#define RULE_2B_SIZE (2503) /* Rule 2b size of prog.c */
/*
* IMPORTANT:
*
* The MAX_TARBALL_LEN value MUST match the MAX_TARBALL_LEN variable as defined
* in the IOCCC submit server code.
*/
#define MAX_TARBALL_LEN (3999971) /* compressed tarball size limit in bytes */
#define MAX_SUM_FILELEN (27651*1024) /* maximum sum of the byte lengths of all files in the entry */
#define MAX_EXTRA_FILE_COUNT (31) /* maximum number of files not including mandatory submission files */
#define MAX_EXTRA_DIR_COUNT (13) /* maximum number of EXTRA directories */
/*
* IMPORTANT:
*
* The MAX_SUBMIT_SLOT value MUST match the MAX_SUBMIT_SLOT variable as defined
* in the IOCCC submit server code.
*
* The MAX_SUBMIT_SLOT must be < 10 to the MAX_SUBMIT_SLOT_CHARS power!
*/
#define MAX_SUBMIT_SLOT (9) /* entry numbers from 0 to MAX_SUBMIT_SLOT */
#define MAX_SUBMIT_SLOT_CHARS (1) /* characters that represent the maximum entry number */
#define MAX_AUTHORS (5) /* maximum number of authors of an entry */
#define MAX_AUTHORS_CHARS (1) /* characters that represent the author number */
#define MAX_NAME_LEN (48) /* max author name length */
#define MAX_EMAIL_LEN (48) /* max Email address length */
#define MAX_URL_LEN (64) /* max home URL length, including http:// or https:// */
#define MAX_MASTODON_LEN (20+64) /* max mastodon handle length, including both '@'s */
#define MAX_GITHUB_LEN (16) /* max GitHub account length, including the leading '@' */
#define MAX_AFFILIATION_LEN (48) /* max affiliation name length */
#define MAX_TITLE_LEN (32) /* maximum length of a title */
#define MAX_ABSTRACT_LEN (64) /* maximum length of an abstract */
#define MAX_HANDLE (32) /* maximum length of IOCCC winner handle */
#define UUID_LEN (36) /* characters in a UUID string - as per RFC4122 */
#define UUID_VERSION (4) /* version 4 - random UUID */
#define UUID_VARIANT_0 (0x8) /* variant 0 - encoded as 0x8 */
#define UUID_VARIANT_1 (0x9) /* variant 1 - encoded as 0x9 */
#define UUID_VARIANT_2 (0xa) /* variant 2 - encoded as 0xa */
#define UUID_VARIANT_3 (0xb) /* variant 3 - encoded as 0xb */
#define TIMESTAMP_EPOCH "Thu Jan 01 00:00:00 1970 UTC" /* gettimeofday epoch */
#define MAX_TIMESTAMP_LEN (48) /* 28 + 20 more padding for locate */
/*
* submission tarballs may have subdirectories as long as they fit certain
* constraints
*/
#define MAX_FILENAME_LEN (38) /* max path component length */
#define MAX_PATH_DEPTH (4) /* max depth of a subdirectory tree */
/*
* The maximum path length is limited by the v7 tar format
*
* A submission tarball paths start with: UUID string + "-" (dash) + slot_num + "/" (slash).
* This the MAX_PATH_LEN under a submission topdir MUST be reduced by TAR_TOPDIR_SLASH_LEN
* from the v7 tar format limit.
*/
#define V7_TAR_LIMIT (99) /* V7 tar format limits to 99 chars */
#define TAR_TOPDIR_SLASH_LEN (UUID_LEN+1+MAX_SUBMIT_SLOT_CHARS+1) /* UUID "-" slot_num "/" */
#define MAX_PATH_LEN (V7_TAR_LIMIT - TAR_TOPDIR_SLASH_LEN) /* as of 2025: MAX_PATH_LEN == 60 */
/*
* timestamp constraints
*/
#define MIN_FORMED_TIMESTAMP_USEC (1) /* minimum formed_timestamp_usec value */
#define MAX_FORMED_TIMESTAMP_USEC (999999) /* maximum formed_timestamp_usec value */
/*
* Be careful not to change this value as it will invalidate all IOCCC timestamps < this value
*/
#define MIN_TIMESTAMP ((time_t)1762222634)
/*
* IOCCC contest name
*
* use format: IOCCC[0-9][0-9] or IOCCCMOCK
*/
#define IOCCC_CONTEST "IOCCC29"
/*
* The year that IOCCC_CONTEST closes
*
* NOTE: If the contest spans the new year, then the year
* that IOCCC_CONTEST opens may be different.
*/
#define IOCCC_YEAR (2025)
/*
* Did you know that the JSON author removed comments from the original
* JSON spec because the creators claimed they saw people using comments
* to hold parsing directives? See the following URL for details:
*
* https://stackoverflow.com/questions/244777/can-comments-be-used-in-json/10976934#10976934
*
* The IOCCC honors the above decision to remove comments from the JSON spec
* by mandating the following directive in all IOCCC related JSON files:
*
* JSON_PARSING_DIRECTIVE_NAME : JSON_PARSING_DIRECTIVE_VALUE
*/
#define JSON_PARSING_DIRECTIVE_NAME "no_comment"
#define JSON_PARSING_DIRECTIVE_VALUE "mandatory comment: because comments were removed from the original JSON spec"
#define IOCCC_STATUS_URL "https://www.ioccc.org/status.html" /* status of IOCCC URL */
#define IOCCC_ENTER_FAQ_URL "https://www.ioccc.org/faq.html#enter" /* how to enter FAQ */
#define IOCCC_FIND_AUTHOR_HANDLE "https://www.ioccc.org/faq.html#find_author_handle" /* how to find an author handle */
#endif /* ! INCLUDE_LIMIT_IOCCC_H */