-
Notifications
You must be signed in to change notification settings - Fork 0
/
Common.h
68 lines (60 loc) · 2.09 KB
/
Common.h
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
/*
* ChanKit - Imageboard parsing and interaction.
* Copyright 2009-2012 command-Q.org. All rights reserved.
* This framework is distributed under the terms of the Do What The Fuck You Want To Public License, Version 2.
*
* Common.h - Global includes/defines.
*/
#ifndef NSNewlineCharacter
#define NSNewlineCharacter 0x000a
#endif
#define CK_VERSION_MAJOR 0
#define CK_VERSION_MINOR 8
#define CK_VERSION_MICRO 6
#define CK_VERSION_TAG @""
#define CK_VERSION_OS @"OS X"
#ifdef _DEBUG
// HTML parsing is extremely messy, so this function is used to dump a ton of data
#define DLog(...) NSLog(__VA_ARGS__)
#else
// Silence our fountain of logs
#define DLog(...)
#endif
// Document fetching error codes
#define CK_ERR_UNDEFINED -1
#define CK_ERR_SUCCESS 0
#define CK_ERR_NETWORK 6
#define CK_ERR_CHECKSUM 7
#define CK_ERR_NOTFOUND 404
#define CK_ERR_PARSER 406
#define CK_ERR_UNSUPPORTED 415
#define CK_ERR_BANNED 403
#define CK_ERR_REDIRECT 302
// Common post rejection reasons, shared code range with above
#define CK_POSTERR_FLOOD 1
#define CK_POSTERR_VERIFICATION 2
#define CK_POSTERR_DUPLICATE 3
#define CK_POSTERR_NOTFOUND 4
#define CK_POSTERR_DISALLOWED 5
#define CK_POSTERR_REJECTED 8
#define CK_POSTERR_FILETYPE 9
#define CK_POSTERR_FAILEDUPLOAD 10
// Imageboard software detection codes (CKRecipe @detectBoardSoftware)
#define CK_DETECTION_COULDNOTPROCEED -1
#define CK_DETECTION_FAILED 0
#define CK_DETECTION_URL 1
#define CK_DETECTION_TITLE 2
#define CK_DETECTION_FUZZY 3
// Recipe status
#define CK_RECIPE_PRELIMINARY -1
#define CK_RECIPE_NOMATCH 0
#define CK_RECIPE_URLMATCH 1
#define CK_RECIPE_XMLMATCH 2
#define CK_RECIPE_MANUAL 3
// Resource type identifiers
#define CK_RESOURCE_UNDEFINED 0
#define CK_RESOURCE_IMAGE 1
#define CK_RESOURCE_POST 2
#define CK_RESOURCE_THREAD 3
#define CK_RESOURCE_BOARD 4
#define CK_PROXY_TIMEOUT 60