|
|
1.1 root 1: /* userdat.h */
2:
3: /* Synchronet user data access routines (exported) */
4:
5: /* $Id: userdat.h,v 1.29 2006/01/31 03:40:02 rswindell Exp $ */
6:
7: /****************************************************************************
8: * @format.tab-size 4 (Plain Text/Source Code File Header) *
9: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
10: * *
11: * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
12: * *
13: * This program is free software; you can redistribute it and/or *
14: * modify it under the terms of the GNU General Public License *
15: * as published by the Free Software Foundation; either version 2 *
16: * of the License, or (at your option) any later version. *
17: * See the GNU General Public License for more details: gpl.txt or *
18: * http://www.fsf.org/copyleft/gpl.html *
19: * *
20: * Anonymous FTP access to the most recent released source is available at *
21: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
22: * *
23: * Anonymous CVS access to the development source and modification history *
24: * is available at cvs.synchro.net:/cvsroot/sbbs, example: *
25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login *
26: * (just hit return, no password is necessary) *
27: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src *
28: * *
29: * For Synchronet coding style and modification guidelines, see *
30: * http://www.synchro.net/source.html *
31: * *
32: * You are encouraged to submit any modifications (preferably in Unix diff *
33: * format) via e-mail to [email protected] *
34: * *
35: * Note: If this box doesn't appear square, then you need to fix your tabs. *
36: ****************************************************************************/
37:
38: #ifndef _USERDAT_H
39: #define _USERDAT_H
40:
41: #include "scfgdefs.h" /* scfg_t */
42: #include "dat_rec.h" /* getrec/putrec prototypes */
43:
44: #ifdef DLLEXPORT
45: #undef DLLEXPORT
46: #endif
47: #ifdef DLLCALL
48: #undef DLLCALL
49: #endif
50:
51: #ifdef _WIN32
52: #ifdef SBBS_EXPORTS
53: #define DLLEXPORT __declspec(dllexport)
54: #else
55: #define DLLEXPORT __declspec(dllimport)
56: #endif
57: #ifdef __BORLANDC__
58: #define DLLCALL __stdcall
59: #else
60: #define DLLCALL
61: #endif
62: #else
63: #define DLLEXPORT
64: #define DLLCALL
65: #endif
66:
67: #ifdef __cplusplus
68: extern "C" {
69: #endif
70:
71: extern char* crlf;
72: extern char* nulstr;
73:
74: DLLEXPORT int DLLCALL getuserdat(scfg_t* cfg, user_t* user); /* Fill userdat struct with user data */
75: DLLEXPORT int DLLCALL putuserdat(scfg_t* cfg, user_t* user); /* Put userdat struct into user file */
76: DLLEXPORT int DLLCALL newuserdat(scfg_t* cfg, user_t* user); /* Create new userdat in user file */
77: DLLEXPORT uint DLLCALL matchuser(scfg_t* cfg, char *str, BOOL sysop_alias); /* Checks for a username match */
78: DLLEXPORT char* DLLCALL alias(scfg_t* cfg, char* name, char* buf);
79: DLLEXPORT int DLLCALL putusername(scfg_t* cfg, int number, char * name);
80: DLLEXPORT uint DLLCALL total_users(scfg_t* cfg);
81: DLLEXPORT uint DLLCALL lastuser(scfg_t* cfg);
82: DLLEXPORT BOOL DLLCALL del_lastuser(scfg_t* cfg);
83: DLLEXPORT char DLLCALL getage(scfg_t* cfg, char *birthdate);
84: DLLEXPORT char* DLLCALL username(scfg_t* cfg, int usernumber, char * str);
85: DLLEXPORT char* DLLCALL usermailaddr(scfg_t* cfg, char* addr, char* name);
86: DLLEXPORT int DLLCALL getnodedat(scfg_t* cfg, uint number, node_t *node, int* file);
87: DLLEXPORT int DLLCALL putnodedat(scfg_t* cfg, uint number, node_t *node, int file);
88: DLLEXPORT char* DLLCALL nodestatus(scfg_t* cfg, node_t* node, char* buf, size_t buflen);
89: DLLEXPORT void DLLCALL printnodedat(scfg_t* cfg, uint number, node_t* node);
90: DLLEXPORT void DLLCALL packchatpass(char *pass, node_t* node);
91: DLLEXPORT char* DLLCALL unpackchatpass(char *pass, node_t* node);
92: DLLEXPORT char* DLLCALL getsmsg(scfg_t* cfg, int usernumber);
93: DLLEXPORT int DLLCALL putsmsg(scfg_t* cfg, int usernumber, char *strin);
94: DLLEXPORT char* DLLCALL getnmsg(scfg_t* cfg, int node_num);
95: DLLEXPORT int DLLCALL putnmsg(scfg_t* cfg, int num, char *strin);
96:
97: DLLEXPORT uint DLLCALL userdatdupe(scfg_t* cfg, uint usernumber, uint offset, uint datlen, char *dat
98: ,BOOL del);
99:
100: DLLEXPORT BOOL DLLCALL chk_ar(scfg_t* cfg, uchar* str, user_t* user); /* checks access requirements */
101:
102: DLLEXPORT int DLLCALL getuserrec(scfg_t*, int usernumber, int start, int length, char *str);
103: DLLEXPORT int DLLCALL putuserrec(scfg_t*, int usernumber, int start, uint length, char *str);
104: DLLEXPORT ulong DLLCALL adjustuserrec(scfg_t*, int usernumber, int start, int length, long adj);
105: DLLEXPORT BOOL DLLCALL logoutuserdat(scfg_t*, user_t*, time_t now, time_t logontime);
106: DLLEXPORT void DLLCALL resetdailyuserdat(scfg_t*, user_t*);
107: DLLEXPORT void DLLCALL subtract_cdt(scfg_t*, user_t*, long amt);
108: DLLEXPORT int DLLCALL user_rec_len(int offset);
109: DLLEXPORT BOOL DLLCALL is_download_free(scfg_t* cfg, uint dirnum, user_t* user);
110: DLLEXPORT BOOL DLLCALL filter_ip(scfg_t* cfg, char* prot, char* reason, char* host, char* ip_addr, char* username, char* fname);
111:
112: /* New atomic numeric user field adjustment functions: */
113: DLLEXPORT BOOL DLLCALL user_posted_msg(scfg_t* cfg, user_t* user, int count);
114: DLLEXPORT BOOL DLLCALL user_sent_email(scfg_t* cfg, user_t* user, int count, BOOL feedback);
115: DLLEXPORT BOOL DLLCALL user_downloaded(scfg_t* cfg, user_t* user, int files, long bytes);
116: DLLEXPORT BOOL DLLCALL user_uploaded(scfg_t* cfg, user_t* user, int files, long bytes);
117: DLLEXPORT BOOL DLLCALL user_adjust_credits(scfg_t* cfg, user_t* user, long amount);
118: DLLEXPORT BOOL DLLCALL user_adjust_minutes(scfg_t* cfg, user_t* user, long amount);
119:
120: #ifdef __cplusplus
121: }
122: #endif
123:
124: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.