/[LeafOK_CVS]/lbbs/include/user_list.h
ViewVC logotype

Diff of /lbbs/include/user_list.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 by sysadm, Tue Oct 21 12:35:03 2025 UTC Revision 1.5 by sysadm, Wed Oct 22 04:48:53 2025 UTC
# Line 21  Line 21 
21  #include <mysql/mysql.h>  #include <mysql/mysql.h>
22    
23  #define BBS_user_limit_per_page 20  #define BBS_user_limit_per_page 20
24    #define BBS_session_id_length 32
25    
26  struct user_info_t  struct user_info_t
27  {  {
# Line 44  struct user_list_t Line 45  struct user_list_t
45  };  };
46  typedef struct user_list_t USER_LIST;  typedef struct user_list_t USER_LIST;
47    
48  extern int user_list_load(MYSQL *db, USER_LIST *p_list);  struct user_online_info_t
49    {
50            char session_id[BBS_session_id_length + 1];
51            USER_INFO user_info;
52            char ip[IP_ADDR_LEN];
53            char current_action[BBS_current_action_max_len + 1];
54            const char *current_action_title;
55            time_t login_tm;
56            time_t last_tm;
57    };
58    typedef struct user_online_info_t USER_ONLINE_INFO;
59    
60    struct user_online_list_t
61    {
62            USER_ONLINE_INFO users[BBS_max_user_online_count];
63            int32_t user_count;
64    };
65    typedef struct user_online_list_t USER_ONLINE_LIST;
66    
67  extern int user_list_pool_init(void);  extern int user_list_pool_init(void);
68  extern void user_list_pool_cleanup(void);  extern void user_list_pool_cleanup(void);
69  extern int set_user_list_pool_shm_readonly(void);  extern int set_user_list_pool_shm_readonly(void);
70  extern int detach_user_list_pool_shm(void);  extern int detach_user_list_pool_shm(void);
71    
72  extern int user_list_pool_reload(void);  extern int user_list_pool_reload(int online_user);
   
 extern int user_list_try_rd_lock(int wait_sec);  
 extern int user_list_try_rw_lock(int wait_sec);  
 extern int user_list_rd_unlock(void);  
 extern int user_list_rw_unlock(void);  
 extern int user_list_rd_lock(void);  
 extern int user_list_rw_lock(void);  
73    
74  extern int query_user_list(int page_id, USER_INFO *p_users, int *p_user_count, int *p_page_count);  extern int query_user_list(int page_id, USER_INFO *p_users, int *p_user_count, int *p_page_count);
75    extern int query_user_online_list(int page_id, USER_ONLINE_INFO *p_online_users, int *p_user_count, int *p_page_count);
76    
77  extern int query_user_info(int32_t uid, USER_INFO *p_user);  extern int query_user_info(int32_t uid, USER_INFO *p_user);
78    


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1