]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/client.h
- new file header format (in english).
[ngircd-alex.git] / src / ngircd / client.h
index e7178d74f00215e5feeb256a11f5053784fea363..edee38e4291dc6f1ff39641bcf1b3102b8fc1378 100644 (file)
@@ -2,16 +2,15 @@
  * ngIRCd -- The Next Generation IRC Daemon
  * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
  *
- * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
- * der GNU General Public License (GPL), wie von der Free Software Foundation
- * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
- * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
- * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
- * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * Please read the file COPYING, README and AUTHORS for more information.
  *
- * $Id: client.h,v 1.28 2002/05/27 13:09:26 alex Exp $
+ * $Id: client.h,v 1.32 2002/12/12 12:23:43 alex Exp $
  *
- * client.h: Konfiguration des ngircd (Header)
+ * Client management (header)
  */
 
 
 #define __client_h__
 
 
-typedef enum
-{
-       CLIENT_UNKNOWN,                 /* Verbindung mit (noch) unbekanntem Typ */
-       CLIENT_GOTPASS,                 /* Client hat PASS gesendet */
-       CLIENT_GOTNICK,                 /* Client hat NICK gesendet */
-       CLIENT_GOTUSER,                 /* Client hat USER gesendet */
-       CLIENT_USER,                    /* Client ist ein Benutzer (USER wurde gesendet) */
-       CLIENT_UNKNOWNSERVER,           /* unregistrierte Server-Verbindung */
-       CLIENT_GOTPASSSERVER,           /* Client hat PASS nach "Server-Art" gesendet */
-       CLIENT_SERVER,                  /* Client ist ein Server */
-       CLIENT_SERVICE                  /* Client ist ein Service */
-} CLIENT_TYPE;
+#define CLIENT_UNKNOWN 1               /* connection of unknown type */
+#define CLIENT_GOTPASS 2               /* client did send PASS */
+#define CLIENT_GOTNICK 4               /* client did send NICK */
+#define CLIENT_GOTUSER 8               /* client did send USER */
+#define CLIENT_USER 16                 /* client is an IRC user */
+#define CLIENT_UNKNOWNSERVER 32                /* unregistered server connection */
+#define CLIENT_GOTPASSSERVER 64                /* client did send PASS in "server style" */
+#define CLIENT_SERVER 128              /* client is a server */
+#define CLIENT_SERVICE 256             /* client is a service */
+
+#define CLIENT_TYPE INT
 
 
 #if defined(__client_c__) | defined(S_SPLINT_S)
@@ -39,21 +37,22 @@ typedef enum
 
 typedef struct _CLIENT
 {
-       CHAR id[CLIENT_ID_LEN];         /* Nick (User) bzw. ID (Server) */
-       UINT32 hash;                    /* Hash ueber die (kleingeschriebene) ID */
-       POINTER *next;                  /* Zeiger auf naechste Client-Struktur */
-       CLIENT_TYPE type;               /* Typ des Client, vgl. CLIENT_TYPE */
-       CONN_ID conn_id;                /* ID der Connection (wenn lokal) bzw. NONE (remote) */
-       struct _CLIENT *introducer;     /* ID des Servers, der die Verbindung hat */
-       struct _CLIENT *topserver;      /* Toplevel-Servers (nur gueltig, wenn Client ein Server ist) */
-       CHAR pwd[CLIENT_PASS_LEN];      /* Passwort, welches der Client angegeben hat */
-       CHAR host[CLIENT_HOST_LEN];     /* Hostname des Client */
-       CHAR user[CLIENT_USER_LEN];     /* Benutzername ("Login") */
-       CHAR info[CLIENT_INFO_LEN];     /* Langer Benutzername (User) bzw. Infotext (Server) */
-       CHAR modes[CLIENT_MODE_LEN];    /* Client Modes */
-       INT hops, token, mytoken;       /* "Hops" und "Token" (-> SERVER-Befehl) */
-       BOOLEAN oper_by_me;             /* IRC-Operator-Status durch diesen Server? */
-       CHAR away[CLIENT_AWAY_LEN];     /* AWAY-Text, wenn Mode 'a' gesetzt */
+       CHAR id[CLIENT_ID_LEN];         /* nick (user) / ID (server) */
+       UINT32 hash;                    /* hash of lower-case ID */
+       POINTER *next;                  /* pointer to next client structure */
+       CLIENT_TYPE type;               /* type of client, see CLIENT_xxx */
+       CONN_ID conn_id;                /* ID of the connection (if local) or NONE (remote) */
+       struct _CLIENT *introducer;     /* ID of the servers which the client is connected to */
+       struct _CLIENT *topserver;      /* toplevel servers (only valid if client is a server) */
+       CHAR pwd[CLIENT_PASS_LEN];      /* password received of the client */
+       CHAR host[CLIENT_HOST_LEN];     /* hostname of the client */
+       CHAR user[CLIENT_USER_LEN];     /* user name ("login") */
+       CHAR info[CLIENT_INFO_LEN];     /* long user name (user) / info text (server) */
+       CHAR modes[CLIENT_MODE_LEN];    /* client modes */
+       INT hops, token, mytoken;       /* "hops" and "Token" (see SERVER command) */
+       BOOLEAN oper_by_me;             /* client is local IRC operator on this server? */
+       CHAR away[CLIENT_AWAY_LEN];     /* AWAY text (valid if mode 'a' is set) */
+       CHAR flags[CLIENT_FLAGS_LEN];   /* flags of the client */
 } CLIENT;
 
 #else
@@ -91,6 +90,7 @@ GLOBAL CHAR *Client_User PARAMS((CLIENT *Client ));
 GLOBAL CHAR *Client_Hostname PARAMS((CLIENT *Client ));
 GLOBAL CHAR *Client_Password PARAMS((CLIENT *Client ));
 GLOBAL CHAR *Client_Modes PARAMS((CLIENT *Client ));
+GLOBAL CHAR *Client_Flags PARAMS((CLIENT *Client ));
 GLOBAL CLIENT *Client_Introducer PARAMS((CLIENT *Client ));
 GLOBAL BOOLEAN Client_OperByMe PARAMS((CLIENT *Client ));
 GLOBAL INT Client_Hops PARAMS((CLIENT *Client ));
@@ -112,6 +112,7 @@ GLOBAL VOID Client_SetHops PARAMS((CLIENT *Client, INT Hops ));
 GLOBAL VOID Client_SetToken PARAMS((CLIENT *Client, INT Token ));
 GLOBAL VOID Client_SetOperByMe PARAMS((CLIENT *Client, BOOLEAN OperByMe ));
 GLOBAL VOID Client_SetModes PARAMS((CLIENT *Client, CHAR *Modes ));
+GLOBAL VOID Client_SetFlags PARAMS((CLIENT *Client, CHAR *Flags ));
 GLOBAL VOID Client_SetIntroducer PARAMS((CLIENT *Client, CLIENT *Introducer ));
 GLOBAL VOID Client_SetAway PARAMS((CLIENT *Client, CHAR *Txt ));
 
@@ -121,14 +122,14 @@ GLOBAL BOOLEAN Client_ModeDel PARAMS((CLIENT *Client, CHAR Mode ));
 GLOBAL BOOLEAN Client_CheckNick PARAMS((CLIENT *Client, CHAR *Nick ));
 GLOBAL BOOLEAN Client_CheckID PARAMS((CLIENT *Client, CHAR *ID ));
 
-GLOBAL INT Client_UserCount PARAMS((VOID ));
-GLOBAL INT Client_ServiceCount PARAMS((VOID ));
-GLOBAL INT Client_ServerCount PARAMS((VOID ));
-GLOBAL INT Client_OperCount PARAMS((VOID ));
-GLOBAL INT Client_UnknownCount PARAMS((VOID ));
-GLOBAL INT Client_MyUserCount PARAMS((VOID ));
-GLOBAL INT Client_MyServiceCount PARAMS((VOID ));
-GLOBAL INT Client_MyServerCount PARAMS((VOID ));
+GLOBAL LONG Client_UserCount PARAMS((VOID ));
+GLOBAL LONG Client_ServiceCount PARAMS((VOID ));
+GLOBAL LONG Client_ServerCount PARAMS((VOID ));
+GLOBAL LONG Client_OperCount PARAMS((VOID ));
+GLOBAL LONG Client_UnknownCount PARAMS((VOID ));
+GLOBAL LONG Client_MyUserCount PARAMS((VOID ));
+GLOBAL LONG Client_MyServiceCount PARAMS((VOID ));
+GLOBAL LONG Client_MyServerCount PARAMS((VOID ));
 
 GLOBAL BOOLEAN Client_IsValidNick PARAMS((CHAR *Nick ));