#include <errno.h>
#include <syslog.h>
#include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
+#include <time.h>
#include <sys/wait.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
int CtdlGetRoom(struct ctdlroom *qrbuf, const char *room_name);
int CtdlGetRoomLock(struct ctdlroom *qrbuf, char *room_name);
int CtdlDoIHavePermissionToDeleteThisRoom(struct ctdlroom *qr);
-void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
- int *result, int *view);
+void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf, int *result, int *view);
void CtdlPutRoomLock(struct ctdlroom *qrbuf);
typedef void (*ForEachRoomCallBack)(struct ctdlroom *EachRoom, void *out_data);
void CtdlForEachRoom(ForEachRoomCallBack CB, void *in_data);
typedef void (*ForEachRoomNetCfgCallBack)(struct ctdlroom *EachRoom, void *out_data, OneRoomNetCfg *OneRNCFG);
-void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB,
- void *in_data,
- RoomNetCfg filter);
+void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB, void *in_data, RoomNetCfg filter);
void SaveChangedConfigs(void);
-
void CtdlDeleteRoom(struct ctdlroom *qrbuf);
int CtdlRenameRoom(char *old_name, char *new_name, int new_floor);
-void CtdlUserGoto (char *where, int display_result, int transiently,
- int *msgs, int *new);
+void CtdlUserGoto (char *where, int display_result, int transiently, int *msgs, int *new, long *oldest, long *newest);
struct floor *CtdlGetCachedFloor(int floor_num);
void CtdlScheduleRoomForDeletion(struct ctdlroom *qrbuf);
void CtdlGetFloor (struct floor *flbuf, int floor_num);
time_t c_pop3_fastest;
int c_spam_flag_only;
int c_guest_logins;
+ int c_nntp_port;
+ int c_nntps_port;
};
+#define SET_CFGSTRBUF(which, buffer) safestrncpy(config.which, ChrPtr(buffer), sizeof(config.which))
+#define SET_CFGSTR(which, buffer) safestrncpy(config.which, buffer, sizeof(config.which))
+
extern struct config config;
+#define NODENAME config.c_nodename
+#define FQDN config.c_fqdn
+#define CTDLUID config.c_ctdluid
+#define CREATAIDE config.c_creataide
+#define REGISCALL config.c_regiscall
+#define TWITDETECT config.c_twitdetect
+#define TWITROOM config.c_twitroom
+#define RESTRICT_INTERNET config.c_restrict
+
+#define CFG_KEY(which) config.which, strlen(config.which)
+
typedef void (*CfgLineParser)(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos, OneRoomNetCfg *rncfg);
typedef void (*CfgLineSerializer)(const CfgLineType *ThisOne, StrBuf *OuptputBuffer, OneRoomNetCfg *rncfg, RoomNetCfgLine *data);
typedef void (*CfgLineDeAllocator)(const CfgLineType *ThisOne, RoomNetCfgLine **data);
int CtdlGetUserLock(struct ctdluser *usbuf, char *name);
void CtdlPutUser(struct ctdluser *usbuf);
void CtdlPutUserLock(struct ctdluser *usbuf);
+
+int CtdlLockGetCurrentUser(void);
+void CtdlPutCurrentUserLock(void);
+
int CtdlGetUserByNumber(struct ctdluser *usbuf, long number);
void CtdlGetRelationship(visit *vbuf,
struct ctdluser *rel_user,