debug: move some definitions around
authorRalph Boehme <slow@samba.org>
Wed, 12 Dec 2018 07:57:28 +0000 (08:57 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 20 Dec 2018 02:19:25 +0000 (03:19 +0100)
They will be needed by some function in a subsequent commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/debug.c

index b5f120b..e409c54 100644 (file)
@@ -103,6 +103,58 @@ static struct {
        .fd = 2 /* stderr by default */
 };
 
+static const char *default_classname_table[] = {
+       [DBGC_ALL] =                    "all",
+       [DBGC_TDB] =                    "tdb",
+       [DBGC_PRINTDRIVERS] =           "printdrivers",
+       [DBGC_LANMAN] =                 "lanman",
+       [DBGC_SMB] =                    "smb",
+       [DBGC_RPC_PARSE] =              "rpc_parse",
+       [DBGC_RPC_SRV] =                "rpc_srv",
+       [DBGC_RPC_CLI] =                "rpc_cli",
+       [DBGC_PASSDB] =                 "passdb",
+       [DBGC_SAM] =                    "sam",
+       [DBGC_AUTH] =                   "auth",
+       [DBGC_WINBIND] =                "winbind",
+       [DBGC_VFS] =                    "vfs",
+       [DBGC_IDMAP] =                  "idmap",
+       [DBGC_QUOTA] =                  "quota",
+       [DBGC_ACLS] =                   "acls",
+       [DBGC_LOCKING] =                "locking",
+       [DBGC_MSDFS] =                  "msdfs",
+       [DBGC_DMAPI] =                  "dmapi",
+       [DBGC_REGISTRY] =               "registry",
+       [DBGC_SCAVENGER] =              "scavenger",
+       [DBGC_DNS] =                    "dns",
+       [DBGC_LDB] =                    "ldb",
+       [DBGC_TEVENT] =                 "tevent",
+       [DBGC_AUTH_AUDIT] =             "auth_audit",
+       [DBGC_AUTH_AUDIT_JSON] =        "auth_json_audit",
+       [DBGC_KERBEROS] =               "kerberos",
+       [DBGC_DRS_REPL] =               "drs_repl",
+       [DBGC_SMB2] =                   "smb2",
+       [DBGC_SMB2_CREDITS] =           "smb2_credits",
+       [DBGC_DSDB_AUDIT] =             "dsdb_audit",
+       [DBGC_DSDB_AUDIT_JSON] =        "dsdb_json_audit",
+       [DBGC_DSDB_PWD_AUDIT]  =        "dsdb_password_audit",
+       [DBGC_DSDB_PWD_AUDIT_JSON] =    "dsdb_password_json_audit",
+       [DBGC_DSDB_TXN_AUDIT]  =        "dsdb_transaction_audit",
+       [DBGC_DSDB_TXN_AUDIT_JSON] =    "dsdb_transaction_json_audit",
+       [DBGC_DSDB_GROUP_AUDIT] =       "dsdb_group_audit",
+       [DBGC_DSDB_GROUP_AUDIT_JSON] =  "dsdb_group_json_audit",
+};
+
+/*
+ * This is to allow reading of DEBUGLEVEL_CLASS before the debug
+ * system has been initialized.
+ */
+static int debug_class_list_initial[ARRAY_SIZE(default_classname_table)];
+
+static size_t debug_num_classes = 0;
+static int *DEBUGLEVEL_CLASS = debug_class_list_initial;
+
+static int current_msg_level = 0;
+
 #if defined(WITH_SYSLOG) || defined(HAVE_LIBSYSTEMD_JOURNAL) || defined(HAVE_LIBSYSTEMD)
 static int debug_level_to_priority(int level)
 {
@@ -512,56 +564,6 @@ static void debug_backends_log(const char *msg, int msg_level)
 */
 bool    override_logfile;
 
-static const char *default_classname_table[] = {
-       [DBGC_ALL] =            "all",
-       [DBGC_TDB] =            "tdb",
-       [DBGC_PRINTDRIVERS] =   "printdrivers",
-       [DBGC_LANMAN] =         "lanman",
-       [DBGC_SMB] =            "smb",
-       [DBGC_RPC_PARSE] =      "rpc_parse",
-       [DBGC_RPC_SRV] =        "rpc_srv",
-       [DBGC_RPC_CLI] =        "rpc_cli",
-       [DBGC_PASSDB] =         "passdb",
-       [DBGC_SAM] =            "sam",
-       [DBGC_AUTH] =           "auth",
-       [DBGC_WINBIND] =        "winbind",
-       [DBGC_VFS] =            "vfs",
-       [DBGC_IDMAP] =          "idmap",
-       [DBGC_QUOTA] =          "quota",
-       [DBGC_ACLS] =           "acls",
-       [DBGC_LOCKING] =        "locking",
-       [DBGC_MSDFS] =          "msdfs",
-       [DBGC_DMAPI] =          "dmapi",
-       [DBGC_REGISTRY] =       "registry",
-       [DBGC_SCAVENGER] =      "scavenger",
-       [DBGC_DNS] =            "dns",
-       [DBGC_LDB] =            "ldb",
-       [DBGC_TEVENT] =         "tevent",
-       [DBGC_AUTH_AUDIT] =     "auth_audit",
-       [DBGC_AUTH_AUDIT_JSON] = "auth_json_audit",
-       [DBGC_KERBEROS] =       "kerberos",
-       [DBGC_DRS_REPL] =       "drs_repl",
-       [DBGC_SMB2] =           "smb2",
-       [DBGC_SMB2_CREDITS] =   "smb2_credits",
-       [DBGC_DSDB_AUDIT]  =    "dsdb_audit",
-       [DBGC_DSDB_AUDIT_JSON] = "dsdb_json_audit",
-       [DBGC_DSDB_PWD_AUDIT]  =        "dsdb_password_audit",
-       [DBGC_DSDB_PWD_AUDIT_JSON] = "dsdb_password_json_audit",
-       [DBGC_DSDB_TXN_AUDIT]  =        "dsdb_transaction_audit",
-       [DBGC_DSDB_TXN_AUDIT_JSON] = "dsdb_transaction_json_audit",
-       [DBGC_DSDB_GROUP_AUDIT] =       "dsdb_group_audit",
-       [DBGC_DSDB_GROUP_AUDIT_JSON] = "dsdb_group_json_audit",
-};
-
-/*
- * This is to allow reading of DEBUGLEVEL_CLASS before the debug
- * system has been initialized.
- */
-static int debug_class_list_initial[ARRAY_SIZE(default_classname_table)];
-
-static size_t debug_num_classes = 0;
-static int    *DEBUGLEVEL_CLASS = debug_class_list_initial;
-
 int debuglevel_get_class(size_t idx)
 {
        return DEBUGLEVEL_CLASS[idx];
@@ -597,7 +599,6 @@ void debuglevel_set_class(size_t idx, int level)
  */
 
 static int     debug_count    = 0;
-static int     current_msg_level   = 0;
 static char format_bufr[FORMAT_BUFR_SIZE];
 static size_t     format_pos     = 0;
 static bool    log_overflow   = false;