comparison libpurple/protocols/myspace/persist.h @ 18895:f732d072b118

Change all code to better match the style of libpurple - use 8-space tabs for indentation everywhere. Spaces are still used for alignment when needed, as described on http://derkarl.org/why_to_tabs.html (ack for [^\t]\t to ensure tabs are only being used for indentation). Lots of vim regexes made this transformation possible. Also cuddled a few braces that I missed before. This is a big commit, but there are no actual code changes.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Sat, 11 Aug 2007 05:53:11 +0000
parents c9acdf96e74e
children 9d921dde9d9f
comparison
equal deleted inserted replaced
18894:daedc9647341 18895:f732d072b118
19 19
20 #ifndef _MYSPACE_PERSIST_H 20 #ifndef _MYSPACE_PERSIST_H
21 #define _MYSPACE_PERSIST_H 21 #define _MYSPACE_PERSIST_H
22 22
23 /** Command codes */ 23 /** Command codes */
24 #define MSIM_CMD_GET 1 24 #define MSIM_CMD_GET 1
25 #define MSIM_CMD_PUT 2 25 #define MSIM_CMD_PUT 2
26 #define MSIM_CMD_DELETE 3 26 #define MSIM_CMD_DELETE 3
27 27
28 /** Command bit fields */ 28 /** Command bit fields */
29 #define MSIM_CMD_BIT_CODE 255 /*< Bits specifying command code */ 29 #define MSIM_CMD_BIT_CODE 255 /*< Bits specifying command code */
30 #define MSIM_CMD_BIT_REPLY 256 /**< 1=reply, 0=request */ 30 #define MSIM_CMD_BIT_REPLY 256 /**< 1=reply, 0=request */
31 #define MSIM_CMD_BIT_ACTION 512 /**< 1=action, 0=information */ 31 #define MSIM_CMD_BIT_ACTION 512 /**< 1=action, 0=information */
32 #define MSIM_CMD_BIT_ERROR 1024 /**< 1=error, 0=normal */ 32 #define MSIM_CMD_BIT_ERROR 1024 /**< 1=error, 0=normal */
33 33
34 /** Macros to read cmd bitfield. */ 34 /** Macros to read cmd bitfield. */
35 #define MSIM_CMD_GET_CODE(x) (x & MSIM_CMD_BIT_CODE) 35 #define MSIM_CMD_GET_CODE(x) (x & MSIM_CMD_BIT_CODE)
36 #define MSIM_CMD_IS_REPLY(x) (x & MSIM_CMD_BIT_REPLY) 36 #define MSIM_CMD_IS_REPLY(x) (x & MSIM_CMD_BIT_REPLY)
37 #define MSIM_CMD_IS_REQUEST(x) !(x & MSIM_CMD_BIT_REPLY) 37 #define MSIM_CMD_IS_REQUEST(x) !(x & MSIM_CMD_BIT_REPLY)
38 #define MSIM_CMD_IS_ACTION(x) (x & MSIM_CMD_BIT_ACTION) 38 #define MSIM_CMD_IS_ACTION(x) (x & MSIM_CMD_BIT_ACTION)
39 #define MSIM_CMD_IS_INFO(x) !(x & MSIM_CMD_BIT_ACTION) 39 #define MSIM_CMD_IS_INFO(x) !(x & MSIM_CMD_BIT_ACTION)
40 #define MSIM_CMD_IS_ERROR(x) (x & MSIM_CMD_BIT_ERROR) 40 #define MSIM_CMD_IS_ERROR(x) (x & MSIM_CMD_BIT_ERROR)
41 #define MSIM_CMD_IS_NORMAL(x) !(x & MSIM_CMD_BIT_ERROR) 41 #define MSIM_CMD_IS_NORMAL(x) !(x & MSIM_CMD_BIT_ERROR)
42 42
43 /** Define a set of _DSN and _LID constants for a persistance request. */ 43 /** Define a set of _DSN and _LID constants for a persistance request. */
44 #define MSIM_PERSIST_DSN_LID(name,dsn,lid) \ 44 #define MSIM_PERSIST_DSN_LID(name,dsn,lid) \
45 const int name##_DSN = dsn; \ 45 const int name##_DSN = dsn; \
46 const int name##_LID = lid; 46 const int name##_LID = lid;
47 47
48 /* Can't do this, errors: 48 /* Can't do this, errors:
49 * persist.h:51:3: error: '#' is not followed by a macro parameter 49 * persist.h:51:3: error: '#' is not followed by a macro parameter
50 * In file included from myspace.c:37: 50 * In file included from myspace.c:37:
51 * persist.h:56: error: expected ')' before numeric constant 51 * persist.h:56: error: expected ')' before numeric constant
52 * So instead, I define const ints above. 52 * So instead, I define const ints above.
53 #define MSIM_PERSIST_DSN_LID(name,dsn,lid) \ 53 #define MSIM_PERSIST_DSN_LID(name,dsn,lid) \
54 #define name##_DSN dsn \ 54 #define name##_DSN dsn \
55 #define name##_LID lid 55 #define name##_LID lid
56 #endif 56 #endif
57 */ 57 */
58 58
59 /** Messages to Get information dsn lid */ 59 /** Messages to Get information dsn lid */
60 MSIM_PERSIST_DSN_LID(MG_LIST_ALL_CONTACTS, 0, 1) 60 MSIM_PERSIST_DSN_LID(MG_LIST_ALL_CONTACTS, 0, 1)
61 MSIM_PERSIST_DSN_LID(MG_USER_INFO_BY_ID, 0, 2) 61 MSIM_PERSIST_DSN_LID(MG_USER_INFO_BY_ID, 0, 2)
62 MSIM_PERSIST_DSN_LID(MG_OWN_IM_INFO, 1, 4) 62 MSIM_PERSIST_DSN_LID(MG_OWN_IM_INFO, 1, 4)
63 MSIM_PERSIST_DSN_LID(MG_IM_INFO_BY_ID, 1, 17) 63 MSIM_PERSIST_DSN_LID(MG_IM_INFO_BY_ID, 1, 17)
64 MSIM_PERSIST_DSN_LID(MG_LIST_ALL_GROUPS, 2, 6) 64 MSIM_PERSIST_DSN_LID(MG_LIST_ALL_GROUPS, 2, 6)
65 MSIM_PERSIST_DSN_LID(MG_MYSPACE_INFO_BY_ID, 4, 3) 65 MSIM_PERSIST_DSN_LID(MG_MYSPACE_INFO_BY_ID, 4, 3)
66 MSIM_PERSIST_DSN_LID(MG_OWN_MYSPACE_INFO, 4, 5) 66 MSIM_PERSIST_DSN_LID(MG_OWN_MYSPACE_INFO, 4, 5)
67 MSIM_PERSIST_DSN_LID(MG_MYSPACE_INFO_BY_STRING, 5, 7) 67 MSIM_PERSIST_DSN_LID(MG_MYSPACE_INFO_BY_STRING, 5, 7)
68 MSIM_PERSIST_DSN_LID(MG_CHECK_MAIL, 7, 18) 68 MSIM_PERSIST_DSN_LID(MG_CHECK_MAIL, 7, 18)
69 MSIM_PERSIST_DSN_LID(MG_WEB_CHALLENGE, 17, 26) 69 MSIM_PERSIST_DSN_LID(MG_WEB_CHALLENGE, 17, 26)
70 MSIM_PERSIST_DSN_LID(MG_USER_SONG, 21, 28) 70 MSIM_PERSIST_DSN_LID(MG_USER_SONG, 21, 28)
71 MSIM_PERSIST_DSN_LID(MG_SERVER_INFO, 101, 20) 71 MSIM_PERSIST_DSN_LID(MG_SERVER_INFO, 101, 20)
72 72
73 /** Messages to Change/send information */ 73 /** Messages to Change/send information */
74 MSIM_PERSIST_DSN_LID(MC_USER_PREFERENCES, 1, 10) 74 MSIM_PERSIST_DSN_LID(MC_USER_PREFERENCES, 1, 10)
75 MSIM_PERSIST_DSN_LID(MC_CONTACT_INFO, 0, 9) 75 MSIM_PERSIST_DSN_LID(MC_CONTACT_INFO, 0, 9)
76 MSIM_PERSIST_DSN_LID(MC_INVITE, 16, 25) 76 MSIM_PERSIST_DSN_LID(MC_INVITE, 16, 25)
77 77
78 /** Messages to Delete information */ 78 /** Messages to Delete information */
79 MSIM_PERSIST_DSN_LID(MD_DELETE_BUDDY, 0, 8) 79 MSIM_PERSIST_DSN_LID(MD_DELETE_BUDDY, 0, 8)
80 80
81 /** Error codes */ 81 /** Error codes */
82 #define MERR_PARSE 1 82 #define MERR_PARSE 1
83 #define MERR_NOT_LOGGED_IN 2 83 #define MERR_NOT_LOGGED_IN 2
84 #define MERR_ANOTHER_LOGIN 6 84 #define MERR_ANOTHER_LOGIN 6
85 #define MERR_BAD_EMAIL 259 85 #define MERR_BAD_EMAIL 259
86 #define MERR_BAD_PASSWORD 260 86 #define MERR_BAD_PASSWORD 260
87 #define MERR_BAD_UID_IN_PERSISTR 4352 87 #define MERR_BAD_UID_IN_PERSISTR 4352
88 88
89 #endif /* !_MYSPACE_PERSIST_H */ 89 #endif /* !_MYSPACE_PERSIST_H */