-/*
- * Bind a thread to a context. (It's inline merely to speed things up.)
- */
-INLINE void become_session(CitContext *which_con) {
-/*
- pid_t tid = syscall(SYS_gettid);
-*/
- citthread_setspecific(MyConKey, (void *)which_con );
-/*
- CtdlLogPrintf(CTDL_DEBUG, "[%d]: Now doing %s\n",
- (int) tid,
- ((which_con != NULL) && (which_con->ServiceName != NULL)) ?
- which_con->ServiceName:"");
-*/
-}
-
/*
* Set the "async waiting" flag for a session, if applicable
CitContext *CreateNewContext (void);
void context_cleanup(void);
void kill_session (int session_to_kill);
-INLINE void become_session(struct CitContext *which_con);
void InitializeMasterCC(void);
void dead_session_purge(int force);
void set_async_waiting(struct CitContext *ccptr);
#define TERM_ALLOWED 0x02
#define TERM_KILLED 0x03
#define TERM_NOTALLOWED -1
+
+/*
+ * Bind a thread to a context. (It's inline merely to speed things up.)
+ */
+static INLINE void become_session(CitContext *which_con) {
+/*
+ pid_t tid = syscall(SYS_gettid);
+*/
+ citthread_setspecific(MyConKey, (void *)which_con );
+/*
+ CtdlLogPrintf(CTDL_DEBUG, "[%d]: Now doing %s\n",
+ (int) tid,
+ ((which_con != NULL) && (which_con->ServiceName != NULL)) ?
+ which_con->ServiceName:"");
+*/
+}
+
+
#endif /* CONTEXT_H */
#include "config.h"
#include "file_ops.h"
#include "sysdep_decls.h"
-#include "user_ops.h"
#include "support.h"
#include "room_ops.h"
#include "msgbase.h"
#endif
#include "ctdl_module.h"
+#include "user_ops.h"
/*
* network_talking_to() -- concurrency checker
#include "citadel.h"
#include "server.h"
#include "database.h"
-#include "user_ops.h"
#include "sysdep_decls.h"
#include "support.h"
#include "room_ops.h"
#include "threads.h"
#include "citadel_ldap.h"
#include "ctdl_module.h"
+#include "user_ops.h"
#ifdef HAVE_LDAP
#define LDAP_DEPRECATED 1 /* Suppress libldap's warning that we are using deprecated API calls */
#include "room_ops.h"
#include "sysdep_decls.h"
#include "support.h"
-#include "user_ops.h"
#include "msgbase.h"
#include "citserver.h"
#include "ctdl_module.h"
+#include "user_ops.h"
/*
* Retrieve the applicable expire policy for a specific room
#include "room_ops.h"
#include "sysdep_decls.h"
#include "support.h"
-#include "user_ops.h"
#include "msgbase.h"
#include "citserver.h"
#include "control.h"
#include "threads.h"
#include "ctdl_module.h"
+#include "user_ops.h"
struct floor *floorcache[MAXFLOORS];
#include "citadel.h"
#include "server.h"
#include "database.h"
-#include "user_ops.h"
#include "sysdep_decls.h"
#include "support.h"
#include "room_ops.h"
#include "ctdl_module.h"
+////#define CTDL_INLINE_USR INLINE
+#include "user_ops.h"
+
/* These pipes are used to talk to the chkpwd daemon, which is forked during startup */
int chkpwd_write_pipe[2];
int chkpwd_read_pipe[2];
-INLINE long cutuserkey(char *username) {
- long len;
- len = strlen(username);
- if (len >= USERNAME_SIZE)
- {
- CtdlLogPrintf (CTDL_EMERG, "Username to long: %s", username);
- cit_backtrace ();
- len = USERNAME_SIZE - 1;
- ((char*)username)[USERNAME_SIZE - 1]='\0';
- }
- return len;
-}
-
-/*
- * makeuserkey() - convert a username into the format used as a database key
- * (it's just the username converted into lower case)
- */
-INLINE void makeuserkey(char *key, const char *username, long len) {
- int i;
-
- if (len >= USERNAME_SIZE)
- {
- CtdlLogPrintf (CTDL_EMERG, "Username to long: %s", username);
- cit_backtrace ();
- len = USERNAME_SIZE - 1;
- }
- for (i=0; i<=len; ++i) {
- key[i] = tolower(username[i]);
- }
-}
-
/*
* getuser() - retrieve named user into supplied buffer.
+#ifndef __USER_OPS_H__
+#define __USER_OPS_H__
+
+#include <ctype.h>
/* $Id$ */
int hash (char *str);
/* getuser is deprecated, use CtdlGetUser instead */
#define RENAMEUSER_ALREADY_EXISTS 3 /* An account with the desired new name already exists */
int rename_user(char *oldname, char *newname);
-INLINE void makeuserkey(char *key, const char *username, long len);
-INLINE long cutuserkey(char *username);
+
+///#ifndef CTDL_INLINE_USR
+////#define CTDL_INLINE_USR static INLINE
+///#endif
+
+///CTDL_INLINE_USR
+static INLINE long cutuserkey(char *username) {
+ long len;
+ len = strlen(username);
+ if (len >= USERNAME_SIZE)
+ {
+ CtdlLogPrintf (CTDL_EMERG, "Username to long: %s", username);
+ cit_backtrace ();
+ len = USERNAME_SIZE - 1;
+ ((char*)username)[USERNAME_SIZE - 1]='\0';
+ }
+ return len;
+}
+
+/*
+ * makeuserkey() - convert a username into the format used as a database key
+ * (it's just the username converted into lower case)
+ */
+///CTDL_INLINE_USR
+static INLINE void makeuserkey(char *key, const char *username, long len) {
+ int i;
+
+ if (len >= USERNAME_SIZE)
+ {
+ CtdlLogPrintf (CTDL_EMERG, "Username to long: %s", username);
+ cit_backtrace ();
+ len = USERNAME_SIZE - 1;
+ }
+ for (i=0; i<=len; ++i) {
+ key[i] = tolower(username[i]);
+ }
+}
+
int internal_create_user (const char *username, long len, struct ctdluser *usbuf, uid_t uid);
+
+#endif