1 2 #ifndef CLIMM_UTIL_OPTS_H 3 #define CLIMM_UTIL_OPTS_H 1 4 5 #define OPT_TABLESIZE 4 6 7 struct Opt_s 8 { 9 Opt *next; 10 UBYTE tags[OPT_TABLESIZE]; 11 val_t vals[OPT_TABLESIZE]; 12 }; 13 14 Opt *OptC (void); 15 void OptD (Opt *opt); 16 17 BOOL OptGetVal (const Opt *opt, UDWORD flag, val_t *val DEBUGPARAM); 18 BOOL OptSetVal (Opt *opt, UDWORD flag, val_t val DEBUGPARAM); 19 Opt *OptSetVals (Opt *opt, UDWORD flag, ...); 20 val_t OptUndef (Opt *opt, UDWORD flag DEBUGPARAM); 21 22 BOOL OptGetStr (const Opt *opt, UDWORD flag, const char **res DEBUGPARAM); 23 BOOL OptSetStr (Opt *opt, UDWORD flag, const char *val DEBUGPARAM); 24 25 #define OptGetVal(o,f,v) OptGetVal(o,f,v DEBUGARGS) 26 #define OptSetVal(o,f,v) OptSetVal(o,f,v DEBUGARGS) 27 #define OptUndef(o,f) OptUndef(o,f DEBUGARGS) 28 #define OptGetStr(o,f,r) OptGetStr(o,f,r DEBUGARGS) 29 #define OptSetStr(o,f,r) OptSetStr(o,f,r DEBUGARGS) 30 31 const char *OptC2S (const char *color); 32 const char *OptS2C (const char *str); 33 34 int OptImport (Opt *opts, const char *args); 35 const char *OptString (const Opt *opts); 36 37 struct OptEntry_s 38 { 39 const char *name; 40 UDWORD flag; 41 }; 42 43 extern struct OptEntry_s OptList[]; 44 45 #define COF_BOOL 0x80000000UL 46 #define COF_NUMERIC 0x40000000UL 47 #define COF_COLOR 0x20000000UL 48 #define COF_STRING 0x10000000UL 49 50 #define CO_BOOLMASK 0x00ffff00UL 51 52 #define COF_GLOBAL 0x08000000UL 53 #define COF_SERVER 0x04000000UL 54 #define COF_GROUP 0x02000000UL 55 #define COF_CONTACT 0x01000000UL 56 57 #define CO_CONTACT (COF_GLOBAL | COF_GROUP | COF_SERVER | COF_CONTACT) 58 #define CO_SERVER (COF_GLOBAL | COF_GROUP | COF_SERVER) 59 #define CO_GROUP (COF_GLOBAL | COF_GROUP) 60 #define CO_GLOBAL COF_GLOBAL 61 62 #define CO_IGNORE (COF_BOOL | CO_CONTACT | 0x000101UL) /* ignore contact */ 63 #define CO_HIDEFROM (COF_BOOL | CO_CONTACT | 0x000401UL) /* always pretend to be offline */ 64 #define CO_INTIMATE (COF_BOOL | CO_CONTACT | 0x001001UL) /* can see even if invisible */ 65 #define CO_LOGONOFF (COF_BOOL | CO_CONTACT | 0x004001UL) /* log on/offline */ 66 #define CO_LOGCHANGE (COF_BOOL | CO_CONTACT | 0x010001UL) /* log status changes */ 67 #define CO_LOGMESS (COF_BOOL | CO_CONTACT | 0x040001UL) /* log messages */ 68 #define CO_SHOWONOFF (COF_BOOL | CO_CONTACT | 0x100001UL) /* show on/offline */ 69 #define CO_SHOWCHANGE (COF_BOOL | CO_CONTACT | 0x400001UL) /* show status changes */ 70 71 #define CO_ISSBL (COF_BOOL | CO_CONTACT | 0x000102UL) /* is on sbl */ 72 #define CO_WANTSBL (COF_BOOL | CO_CONTACT | 0x000402UL) /* want it to be on sbl */ 73 #define CO_SHADOW (COF_BOOL | CO_CONTACT | 0x001002UL) /* don't display in contact list */ 74 #define CO_HIDEACK (COF_BOOL | CO_CONTACT | 0x010002UL) /* hide when message acknowledge arrives */ 75 #define CO_TALKEDTO (COF_BOOL | CO_CONTACT | 0x040002UL) /* sent a msg to this contact yet */ 76 #define CO_AUTOAUTO (COF_BOOL | CO_CONTACT | 0x100002UL) /* autogetauto on status change */ 77 #define CO_PEEKME (COF_BOOL | CO_CONTACT | 0x400002UL) /* shall be peeked on peekall */ 78 79 #define CO_WEBAWARE (COF_BOOL | CO_SERVER | 0x000103UL) /* this connection is webaware */ 80 #define CO_HIDEIP (COF_BOOL | CO_SERVER | 0x000403UL) /* this connection hides its LAN ip */ 81 #define CO_DCAUTH (COF_BOOL | CO_SERVER | 0x001003UL) /* this connection requires auth for dc */ 82 #define CO_DCCONT (COF_BOOL | CO_SERVER | 0x004003UL) /* this connection: dc only for contacts */ 83 #define CO_OBEYSBL (COF_BOOL | CO_SERVER | 0x010003UL) /* this connection obeys the sbl */ 84 #define CO_AWAYCOUNT (COF_BOOL | CO_SERVER | 0x100003UL) /* this connection counts msgs even if _manual_ na/away/... */ 85 #define CO_LOGSTREAM (COF_BOOL | CO_SERVER | 0x400003UL) /* this connection's stream is completely logged */ 86 87 #define CO_SCRIPT (COF_BOOL | CO_GLOBAL | 0x000104UL) /* open a scripting connection */ 88 #define CO_S5USE (COF_BOOL | CO_SERVER | 0x000404UL) /* use Socks 5 proxy */ 89 #define CO_TAGRESSOURCE (COF_BOOL | CO_SERVER | 0x001004UL) /* append random string to ressource to make unique */ 90 #define CO_AUTOTAGRES (COF_BOOL | CO_SERVER | 0x004004UL) /* append random string to ressource to make unique (automatically set) */ 91 92 #define CO_LOCAL (COF_BOOL | CO_CONTACT | 0x000105UL) /* local contact (do not put on roster, don't get/send status) */ 93 #define CO_ASK_SBL (COF_BOOL | CO_CONTACT | 0x000105UL) /* authorization request was sent */ 94 #define CO_TO_SBL (COF_BOOL | CO_CONTACT | 0x001005UL) /* get presence from contact */ 95 #define CO_FROM_SBL (COF_BOOL | CO_CONTACT | 0x004005UL) /* send presence to contact */ 96 97 98 #define CO_ENCODING (COF_NUMERIC | CO_CONTACT | 0x06UL) /* the default encoding for this contact */ 99 #define CO_ENCODINGSTR (COF_STRING | CO_CONTACT | 0x07UL) /* the default encoding for this contact */ 100 #define CO_CSCHEME (COF_NUMERIC | CO_GLOBAL | 0x08UL) /* the color scheme to use */ 101 #define CO_TABSPOOL (COF_NUMERIC | CO_CONTACT | 0x09UL) /* spool contact into tab list */ 102 103 #define CO_TIMESEEN (COF_NUMERIC | COF_CONTACT| 0x0aUL) /* time contact was last seen */ 104 #define CO_TIMEONLINE (COF_NUMERIC | COF_CONTACT| 0x0bUL) /* time since contact is online */ 105 #define CO_TIMECLIMM (COF_NUMERIC | COF_CONTACT| 0x0cUL) /* time contact last used climm */ 106 #define CO_REVEALTIME (COF_NUMERIC | CO_CONTACT | 0x0dUL) /* time to reveal invisibility to contact*/ 107 108 #define CO_SCRIPT_PATH (COF_STRING | CO_GLOBAL | 0x0eUL) /* path for socket to scripting connection */ 109 110 #define CO_OSCAR_DC_MODE (COF_NUMERIC | CO_SERVER | 0x10UL) /* peer2peer connection mode for oscar */ 111 #define CO_OSCAR_DC_PORT (COF_NUMERIC | CO_SERVER | 0x11UL) /* peer2peer connection port */ 112 113 #define CO_AUTOAWAY (COF_STRING | CO_CONTACT | 0x20UL) /* the away auto reply message */ 114 #define CO_AUTONA (COF_STRING | CO_CONTACT | 0x21UL) /* the not available auto reply message */ 115 #define CO_AUTOOCC (COF_STRING | CO_CONTACT | 0x22UL) /* the occupied auto reply message */ 116 #define CO_AUTODND (COF_STRING | CO_CONTACT | 0x23UL) /* the do not disturb auto reply message */ 117 #define CO_AUTOFFC (COF_STRING | CO_CONTACT | 0x24UL) /* the free for chat auto reply message */ 118 #define CO_AUTOINV (COF_STRING | CO_CONTACT | 0x25UL) /* the invisible auto reply message */ 119 120 #define CO_TAUTOAWAY (COF_STRING | CO_CONTACT | 0x30UL) /* the temp away auto reply message */ 121 #define CO_TAUTONA (COF_STRING | CO_CONTACT | 0x31UL) /* the temp not available auto reply message */ 122 #define CO_TAUTOOCC (COF_STRING | CO_CONTACT | 0x32UL) /* the temp occupied auto reply message */ 123 #define CO_TAUTODND (COF_STRING | CO_CONTACT | 0x33UL) /* the temp do not disturb auto reply message */ 124 #define CO_TAUTOFFC (COF_STRING | CO_CONTACT | 0x34UL) /* the temp free for chat auto reply message */ 125 #define CO_TAUTOINV (COF_STRING | CO_CONTACT | 0x35UL) /* the temp invisible auto reply message */ 126 127 #define CO_OTRPOLICY (COF_STRING | CO_CONTACT | 0x40UL) /* OTR policy for a contact */ 128 129 #define CO_S5HOST (COF_STRING | CO_SERVER | 0x50UL) /* the Socks 5 host */ 130 #define CO_S5PORT (COF_NUMERIC | CO_SERVER | 0x51UL) /* the Socks 5 port */ 131 #define CO_S5NAME (COF_STRING | CO_SERVER | 0x52UL) /* the Socks 5 user name */ 132 #define CO_S5PASS (COF_STRING | CO_SERVER | 0x53UL) /* the Socks 5 user password */ 133 #define CO_XMPP_PRIV (COF_STRING | CO_SERVER | 0x54UL) /* XMPP privacy list to enable during login */ 134 135 #define CO_COLORNONE (COF_COLOR | CO_GLOBAL | 0x80UL) /* the escape sequence to print for no color */ 136 #define CO_COLORSERVER (COF_COLOR | CO_GLOBAL | 0x81UL) /* the escape sequence to print for server message */ 137 #define CO_COLORCLIENT (COF_COLOR | CO_GLOBAL | 0x82UL) /* the escape sequence to print for client stuff */ 138 #define CO_COLORINVCHAR (COF_COLOR | CO_GLOBAL | 0x83UL) /* the escape sequence to print for invalid characters */ 139 #define CO_COLORERROR (COF_COLOR | CO_GLOBAL | 0x84UL) /* the escape sequence to print for errors */ 140 #define CO_COLORDEBUG (COF_COLOR | CO_GLOBAL | 0x85UL) /* the escape sequence to print for debug messages */ 141 #define CO_COLORQUOTE (COF_COLOR | CO_GLOBAL | 0x86UL) /* the escape sequence to print for options/quotes */ 142 #define CO_COLORMESSAGE (COF_COLOR | CO_CONTACT | 0x87UL) /* the escape sequence to print for messages */ 143 #define CO_COLORSENT (COF_COLOR | CO_CONTACT | 0x88UL) /* the escape sequence to print for sent messages */ 144 #define CO_COLORACK (COF_COLOR | CO_CONTACT | 0x89UL) /* the escape sequence to print for acknowledged messages */ 145 #define CO_COLORINCOMING (COF_COLOR | CO_CONTACT | 0x8aUL) /* the escape sequence to print for incoming messages */ 146 #define CO_COLORCONTACT (COF_COLOR | CO_CONTACT | 0x8bUL) /* the escape sequence to print for contacts */ 147 148 #define CO_CLIMMCOMMAND (COF_STRING | 0x30UL) /* the climm command to execute */ 149 150 #define CO_MSGTEXT (COF_STRING | 0x20UL) /* the message text */ 151 #define CO_MSGTYPE (COF_NUMERIC | 0x21UL) /* the message type */ 152 #define CO_MSGTRANS (COF_NUMERIC | 0x22UL) /* message transportations to try */ 153 #define CO_ORIGIN (COF_NUMERIC | 0x23UL) /* the message's origin */ 154 #define CO_STATUS (COF_NUMERIC | 0x24UL) /* a status */ 155 #define CO_BYTES (COF_NUMERIC | 0x25UL) /* a file length */ 156 #define CO_REF (COF_NUMERIC | 0x27UL) /* a reference */ 157 #define CO_FORCE (COF_NUMERIC | 0x28UL) /* force action */ 158 #define CO_FILENAME (COF_STRING | 0x29UL) /* a filename */ 159 #define CO_FILEACCEPT (COF_NUMERIC | 0x2aUL) /* accept a file transfer */ 160 #define CO_REFUSE (COF_STRING | 0x2bUL) /* refuse message */ 161 #define CO_SUBJECT (COF_STRING | 0x2cUL) /* message with subject */ 162 #define CO_OTRINJECT (COF_NUMERIC | 0x2dUL) /* otr injected message */ 163 #define CO_SAMEHTML (COF_NUMERIC | 0x2eUL) /* message text identical as HTML */ 164 165 #define CV_ORIGIN_v5 8 166 #define CV_ORIGIN_v8 2 167 #define CV_ORIGIN_dc 1 168 #define CV_ORIGIN_ssl 16 169 170 #define CV_MSGTRANS_DC 1 171 #define CV_MSGTRANS_TYPE2 2 172 #define CV_MSGTRANS_ICQv8 4 173 #define CV_MSGTRANS_ICQv5 8 174 #define CV_MSGTRANS_XMPP 16 175 #define CV_MSGTRANS_ANY 31 176 177 #endif 178