summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-09-21 07:22:48 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-09-21 07:22:48 +0800
commit24d848bc545c35e9420f30c4fac7ded75072cfaa (patch)
treee67915b3817858f51487e7deab726185f76baedb /include
parent0f1c03fda85c111bbd551c10774b84af1ef08aff (diff)
downloadpttbbs-24d848bc545c35e9420f30c4fac7ded75072cfaa.tar
pttbbs-24d848bc545c35e9420f30c4fac7ded75072cfaa.tar.gz
pttbbs-24d848bc545c35e9420f30c4fac7ded75072cfaa.tar.bz2
pttbbs-24d848bc545c35e9420f30c4fac7ded75072cfaa.tar.lz
pttbbs-24d848bc545c35e9420f30c4fac7ded75072cfaa.tar.xz
pttbbs-24d848bc545c35e9420f30c4fac7ded75072cfaa.tar.zst
pttbbs-24d848bc545c35e9420f30c4fac7ded75072cfaa.zip
* merge uflag2 and uflag, and refine flag bitmask names
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4871 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r--include/proto.h2
-rw-r--r--include/pttstruct.h2
-rw-r--r--include/uflags.h109
3 files changed, 44 insertions, 69 deletions
diff --git a/include/proto.h b/include/proto.h
index 76507556..793fc8b9 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -624,7 +624,7 @@ int u_list(void);
#ifdef DBCSAWARE
int u_detectDBCSAwareEvilClient();
#endif
-#define ISDBCSAWARE() (cuser.uflag & DBCSAWARE_FLAG)
+#define ISDBCSAWARE() (cuser.uflag & UF_DBCSAWARE)
/* vote */
void b_suckinfile(FILE *fp, const char *fname);
diff --git a/include/pttstruct.h b/include/pttstruct.h
index fb6fb78e..1e50a795 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -61,7 +61,7 @@ typedef struct userec_t {
char pad_1;
uint32_t uflag; /* 策篋1 , see uflags.h */
- uint32_t uflag2; /* 策篋2 , see uflags.h */
+ uint32_t deprecated_uflag2; /* deprecated: 策篋2 , see uflags.h */
uint32_t userlevel; /* 舦 */
uint32_t numlogindays; /* 絬戈菌 (–ら程+1祅Ω计) */
uint32_t numposts; /* ゅ彻絞计 */
diff --git a/include/uflags.h b/include/uflags.h
index 5192fcce..6bac95ea 100644
--- a/include/uflags.h
+++ b/include/uflags.h
@@ -4,79 +4,54 @@
#ifndef INCLUDE_UFLAGS_H
#define INCLUDE_UFLAGS_H
-// TODO in order to prevent masking with wrong variables
-// (since we have 2 flags), it is better to rename the
-// masks with their flag index, eg:
-// UF_PAGER,
-// UF2_WATER_ORIG,
-
/* -------------------- userec_t.uflag (unsigned int) */
-/* UNKNOWN */
-
-/* TRADITIONAL BBS UFLAG */
-//#define UNKNOWN_FLAG 0x00000001 // deprecated ?
-//#define UNKNOWN_FLAG2 0x00000002 // deprecated ?
-//#define PAGER_FLAG 0x00000004 /* deprecated by cuser.pager: true if pager was OFF last session */
-//#define CLOAK_FLAG 0x00000008 /* deprecated by cuser.invisible: true if cloak was ON last session */
-#define FRIEND_FLAG 0x00000010 /* true if show friends only */
-#define BRDSORT_FLAG 0x00000020 /* true if the boards sorted alphabetical */
-#define ADBANNER_FLAG 0x00000040 /* (was: MOVIE_FLAG, true if show advertisement banner */
-#define ADBANNER_USONG_FLAG 0x00000080 /* true if show user songs in banner */
-/* deprecated flag */
-//#define MIND_FLAG 0x00000100 /* true if mind search mode open <-Heat*/
-
-/* DBCS CONFIG */
-/* please keep these even if you don't have DBCSAWARE features turned on */
-#define DBCSAWARE_FLAG 0x00000200 /* true if DBCS-aware enabled. */
-#define DBCS_NOINTRESC 0x00000400 /* no Escapes interupting DBCS characters */
-// #define DBCS__??? 0x00000800
-
-/* Modification Mark (~) */
-#define NO_MODMARK_FLAG 0x00001000 /* true if modified files are NOT marked */
-#define COLORED_MODMARK 0x00002000 /* true if mod-mark is coloured. */
-
-/* Backup Preference */
-#define DEFBACKUP_FLAG 0x00010000 /* true if user defaults to backup */
-
-#define TOBACKUP(x) ((cuser.uflag & DEFBACKUP_FLAG) ? \
+#define UF_FAV_NOHILIGHT 0x00000001 // false if hilight favorite
+#define UF_FAV_ADDNEW 0x00000002 // true to add new board into one's fav
+// #define UF_PAGER 0x00000004 // deprecated by cuser.pager: true if pager was OFF last session
+// #define UF_CLOAK 0x00000008 // deprecated by cuser.invisible: true if cloak was ON last session
+#define UF_FRIEND 0x00000010 // true if show friends only
+#define UF_BRDSORT 0x00000020 // true if the boards sorted alphabetical
+#define UF_ADBANNER 0x00000040 // (was: MOVIE_FLAG, true if show advertisement banner
+#define UF_ADBANNER_USONG 0x00000080 // true if show user songs in banner
+// #define UF_MIND 0x00000100 // deprecated: true if mind search mode open <-Heat
+#define UF_DBCSAWARE 0x00000200 // true if DBCS-aware enabled.
+#define UF_DBCS_NOINTRESC 0x00000400 // no Escapes interupting DBCS characters
+// #define UF_DBCS_??? 0x00000800 // reserved
+#define UF_NO_MODMARK 0x00001000 // true if modified files are NOT marked
+#define UF_COLORED_MODMARK 0x00002000 // true if mod-mark is coloured.
+// #define UF_MODMARK_??? 0x00004000 // reserved
+// #define UF_MODMARK_??? 0x00008000 // reserved
+#define UF_DEFBACKUP 0x00010000 // true if user defaults to backup
+// #define UF_??? 0x00020000 // reserved
+#define UF_REJ_OUTTAMAIL 0x00040000 // true if don't accept outside mails
+// #define UF_??? 0x00080000 // reserved
+#define UF_FOREIGN 0x00100000 // true if a foreign
+#define UF_LIVERIGHT 0x00200000 // true if get "liveright" already
+// #define UF_COUNTRY_??? 0x00400000 // reserved
+// #define UF_COUNTRY_??? 0x00800000 // reserved
+// #define UF_??? 0x01000000 // reserved
+// #define UF_??? 0x02000000 // reserved
+// #define UF_??? 0x04000000 // reserved
+// #define UF_??? 0x08000000 // reserved
+// #define UF_??? 0x10000000 // reserved
+// #define UF_??? 0x20000000 // reserved
+// #define UF_??? 0x40000000 // reserved
+// #define UF_??? 0x80000000 // reserved
+
+// Helper Macros
+#define HasUserFlag(x) (cuser.uflag & (x))
+#define TOBACKUP(x) ((cuser.uflag & UF_DEFBACKUP) ? \
(x != 'n') : \
(x == 'y') )
-
-/* NEW ENTRY HERE */
-// #define ??__??? 0x00100000
+#define REJECT_OUTTAMAIL(x) (x.uflag & UF_REJ_OUTTAMAIL)
/* -------------------- userec_t.uflag2 (unsigned int) */
-// WATER_* is moved to PAGER_UI_* in modes.h
-// #define WATER_ORIG 0x00000000
-// #define WATER_NEW 0x00000001
-// #define WATER_OFO 0x00000002
-// #define WATERMODE(mode) ((cuser.uflag2 & WATER_MASK) == mode)
-// #define WATER_MASK 0x00000003 /* water mask */
-// #define WATER_??? 0x00000004
-// #define WATER_??? 0x00000008
-
-/* MYFAV */
-#define FAVNOHILIGHT 0x00000010 /* false if hilight favorite */
-#define FAVNEW_FLAG 0x00000020 /* true if add new board into one's fav */
-// #define FAV_??? 0x00000040
-// #define FAV_??? 0x00000080
-
-/* MISC */
-#define FOREIGN 0x00000100 /* true if a foreign */
-#define LIVERIGHT 0x00000200 /* true if get "liveright" already */
-#define REJ_OUTTAMAIL 0x00000400 /* true if don't accept outside mails */
-#define REJECT_OUTTAMAIL (cuser.uflag2 & REJ_OUTTAMAIL)
-
-/* ANGEL [deprecated] */
-// #define ANGEL_??? 0x00000800 /* deprecated: true if don't want to be angel for a while */
-// #define ANGEL_??? 0x00001000 // deprecated: ???
-// #define ANGEL_??? 0x00002000 // deprecated: ???
-// #define ANGEL_??? 0x00004000 // reserved then deprecated
-// #define ANGEL_??? 0x00008000 // reserved then deprecated
-
-/* NEW ENTRY HERE */
-// #define ???_??? 0x00010000
+#define OUF2_FAVNOHILIGHT 0x00000010 /* false if hilight favorite */
+#define OUF2_FAVNEW_FLAG 0x00000020 /* true if add new board into one's fav */
+#define OUF2_FOREIGN 0x00000100 /* true if a foreign */
+#define OUF2_LIVERIGHT 0x00000200 /* true if get "liveright" already */
+#define OUF2_REJ_OUTTAMAIL 0x00000400 /* true if don't accept outside mails */
#endif // INCLUDE_UFLAGS_H