r25547: Convert to standard bool type.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 6 Oct 2007 21:39:52 +0000 (21:39 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:07:52 +0000 (15:07 -0500)
(This used to be commit 97a241692c4b8dc45e086aa9b959f2cd30b8d6c9)

source4/param/generic.c
source4/param/params.c
source4/param/secrets.c
source4/param/share.c
source4/param/share.h
source4/param/share_classic.c
source4/param/share_ldb.c
source4/param/util.c

index 6e9a8e60e4fc7580bc331607a5746a68a232a297..d65502c02d22321d5ded892e604f683232c19b80 100644 (file)
@@ -202,7 +202,7 @@ static bool param_pfunc (const char *name, const char *value, void *_ctx)
        if (!p) {
                p = talloc_zero(ctx->sections, struct param_opt);
                if (p == NULL)
-                       return False;
+                       return false;
 
                p->key = talloc_strdup(p, name);
                p->value = talloc_strdup(p, value);
@@ -212,7 +212,7 @@ static bool param_pfunc (const char *name, const char *value, void *_ctx)
                p->value = talloc_strdup(p, value);
        }
 
-       return True;
+       return true;
 }
 
 struct param_context *param_init(TALLOC_CTX *mem_ctx)
index 5ee6dbea70018a296a865fbb7b6908382e00f812..3a9e2b95051123fd7315072999b9e234a5cfeb5c 100644 (file)
@@ -188,7 +188,7 @@ static int Continuation(char *line, int pos )
 }
 
 
-static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *, void *), void *userdata )
+static bool Section( myFILE *InFile, bool (*sfunc)(const char *, void *), void *userdata )
   /* ------------------------------------------------------------------------ **
    * Scan a section name, and pass the name to function sfunc().
    *
@@ -196,8 +196,8 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *, void *), void *
    *          sfunc   - Pointer to the function to be called if the section
    *                    name is successfully read.
    *
-   *  Output: True if the section name was read and True was returned from
-   *          <sfunc>.  False if <sfunc> failed or if a lexical error was
+   *  Output: true if the section name was read and true was returned from
+   *          <sfunc>.  false if <sfunc> failed or if a lexical error was
    *          encountered.
    *
    * ------------------------------------------------------------------------ **
@@ -229,7 +229,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *, void *), void *
       if( NULL == tb )
         {
         DEBUG(0, ("%s Memory re-allocation failure.", func) );
-        return( False );
+        return( false );
         }
       InFile->bufr = tb;
       InFile->bSize += BUFR_INC;
@@ -243,12 +243,12 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *, void *), void *
         if( 0 == end )                  /* Don't allow an empty name.       */
           {
           DEBUG(0, ("%s Empty section name in configuration file.\n", func ));
-          return( False );
+          return( false );
           }
         if( !sfunc(InFile->bufr,userdata) )            /* Got a valid name.  Deal with it. */
-          return( False );
+          return( false );
         (void)EatComment( InFile );     /* Finish off the line.             */
-        return( True );
+        return( true );
 
       case '\n':                      /* Got newline before closing ']'.    */
         i = Continuation( InFile->bufr, i );    /* Check for line continuation.     */
@@ -257,7 +257,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *, void *), void *
           InFile->bufr[end] = '\0';
           DEBUG(0, ("%s Badly formed line in configuration file: %s\n",
                    func, InFile->bufr ));
-          return( False );
+          return( false );
           }
         end = ( (i > 0) && (' ' == InFile->bufr[i - 1]) ) ? (i - 1) : (i);
         c = mygetc( InFile );             /* Continue with next line.         */
@@ -281,10 +281,10 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *, void *), void *
 
   /* We arrive here if we've met the EOF before the closing bracket. */
   DEBUG(0, ("%s Unexpected EOF in the configuration file\n", func));
-  return( False );
+  return( false );
   } /* Section */
 
-static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *, void *), int c, void *userdata )
+static bool Parameter( myFILE *InFile, bool (*pfunc)(const char *, const char *, void *), int c, void *userdata )
   /* ------------------------------------------------------------------------ **
    * Scan a parameter name and value, and pass these two fields to pfunc().
    *
@@ -296,8 +296,8 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *,
    *                    line or a section header, there is no lead-in
    *                    character that can be discarded.
    *
-   *  Output: True if the parameter name and value were scanned and processed
-   *          successfully, else False.
+   *  Output: true if the parameter name and value were scanned and processed
+   *          successfully, else false.
    *
    *  Notes:  This function is in two parts.  The first loop scans the
    *          parameter name.  Internal whitespace is compressed, and an
@@ -326,7 +326,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *,
       if( NULL == tb )
         {
         DEBUG(0, ("%s Memory re-allocation failure.", func) );
-        return( False );
+        return( false );
         }
       InFile->bufr = tb;
       InFile->bSize += BUFR_INC;
@@ -338,7 +338,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *,
         if( 0 == end )              /* Don't allow an empty name.      */
           {
           DEBUG(0, ("%s Invalid parameter name in config. file.\n", func ));
-          return( False );
+          return( false );
           }
         InFile->bufr[end++] = '\0';         /* Mark end of string & advance.   */
         i       = end;              /* New string starts here.         */
@@ -353,7 +353,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *,
           InFile->bufr[end] = '\0';
           DEBUG(1,("%s Ignoring badly formed line in configuration file: %s\n",
                    func, InFile->bufr ));
-          return( True );
+          return( true );
           }
         end = ( (i > 0) && (' ' == InFile->bufr[i - 1]) ) ? (i - 1) : (i);
         c = mygetc( InFile );       /* Read past eoln.                   */
@@ -363,7 +363,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *,
       case EOF:
         InFile->bufr[i] = '\0';
         DEBUG(1,("%s Unexpected end-of-file at: %s\n", func, InFile->bufr ));
-        return( True );
+        return( true );
 
       default:
         if( isspace( c ) )     /* One ' ' per whitespace region.       */
@@ -394,7 +394,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *,
       if( NULL == tb )
         {
         DEBUG(0, ("%s Memory re-allocation failure.", func) );
-        return( False );
+        return( false );
         }
       InFile->bufr = tb;
       InFile->bSize += BUFR_INC;
@@ -431,9 +431,9 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *,
   return( pfunc( InFile->bufr, &InFile->bufr[vstart], userdata ) );   /* Pass name & value to pfunc().  */
   } /* Parameter */
 
-static BOOL Parse( myFILE *InFile,
-                   BOOL (*sfunc)(const char *, void *),
-                   BOOL (*pfunc)(const char *, const char *, void *),
+static bool Parse( myFILE *InFile,
+                   bool (*sfunc)(const char *, void *),
+                   bool (*pfunc)(const char *, const char *, void *),
                                   void *userdata )
   /* ------------------------------------------------------------------------ **
    * Scan & parse the input.
@@ -444,7 +444,7 @@ static BOOL Parse( myFILE *InFile,
    *          pfunc   - Function to be called when a parameter is scanned.
    *                    See Parameter().
    *
-   *  Output: True if the file was successfully scanned, else False.
+   *  Output: true if the file was successfully scanned, else false.
    *
    *  Notes:  The input can be viewed in terms of 'lines'.  There are four
    *          types of lines:
@@ -475,7 +475,7 @@ static BOOL Parse( myFILE *InFile,
 
       case '[':                         /* Section Header. */
         if( !Section( InFile, sfunc, userdata ) )
-          return( False );
+          return( false );
         c = EatWhitespace( InFile );
         break;
 
@@ -485,12 +485,12 @@ static BOOL Parse( myFILE *InFile,
 
       default:                          /* Parameter line. */
         if( !Parameter( InFile, pfunc, c, userdata ) )
-          return( False );
+          return( false );
         c = EatWhitespace( InFile );
         break;
       }
     }
-  return( True );
+  return( true );
   } /* Parse */
 
 static myFILE *OpenConfFile( const char *FileName )
@@ -526,9 +526,9 @@ static myFILE *OpenConfFile( const char *FileName )
   return( ret );
   } /* OpenConfFile */
 
-BOOL pm_process( const char *FileName,
-                 BOOL (*sfunc)(const char *, void *),
-                 BOOL (*pfunc)(const char *, const char *, void *),
+bool pm_process( const char *FileName,
+                 bool (*sfunc)(const char *, void *),
+                 bool (*pfunc)(const char *, const char *, void *),
                                 void *userdata)
   /* ------------------------------------------------------------------------ **
    * Process the named parameter file.
@@ -550,7 +550,7 @@ BOOL pm_process( const char *FileName,
 
   InFile = OpenConfFile( FileName );          /* Open the config file. */
   if( NULL == InFile )
-    return( False );
+    return( false );
 
   DEBUG( 3, ("%s Processing configuration file \"%s\"\n", func, FileName) );
 
@@ -566,7 +566,7 @@ BOOL pm_process( const char *FileName,
       {
       DEBUG(0,("%s memory allocation failure.\n", func));
       myfile_close(InFile);
-      return( False );
+      return( false );
       }
     result = Parse( InFile, sfunc, pfunc, userdata );
     InFile->bufr  = NULL;
@@ -578,10 +578,10 @@ BOOL pm_process( const char *FileName,
   if( !result )                               /* Generic failure. */
     {
     DEBUG(0,("%s Failed.  Error returned from params.c:parse().\n", func));
-    return( False );
+    return( false );
     }
 
-  return( True );                             /* Generic success. */
+  return( true );                             /* Generic success. */
   } /* pm_process */
 
 /* -------------------------------------------------------------------------- */
index 829341a5f99a63da6e5c6b6e6c7b192c921ddda3..6640fd473d9156382aa9ca44413b81ceb7c2ed95 100644 (file)
@@ -86,7 +86,7 @@ bool secrets_init(void)
        /* Ensure that the reseed is done now, while we are root, etc */
        generate_random_buffer(&dummy, sizeof(dummy));
 
-       return True;
+       return true;
 }
 
 /*
@@ -97,7 +97,7 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx)
        char *path;
        const char *url;
        struct ldb_context *ldb;
-       BOOL existed;
+       bool existed;
        const char *init_ldif = 
                "dn: @ATTRIBUTES\n" \
                "computerName: CASE_INSENSITIVE\n" \
index d0a570eeca78f71a0589785fd5d9162ca5436e55..489049f39f7bffbcb51fda3959b0f65fa11f2129 100644 (file)
@@ -34,7 +34,7 @@ int share_int_option(struct share_config *scfg, const char *opt_name, int defval
        return scfg->ctx->ops->int_option(scfg, opt_name, defval);
 }
 
-BOOL share_bool_option(struct share_config *scfg, const char *opt_name, BOOL defval)
+bool share_bool_option(struct share_config *scfg, const char *opt_name, bool defval)
 {
        return scfg->ctx->ops->bool_option(scfg, opt_name, defval);
 }
index 4e16f03715757b84b3dfeba9ff08c8d0e92f25d0..c93d0d985722dab9bbb312b7d338b0339e5f81c0 100644 (file)
@@ -103,8 +103,8 @@ struct share_ops {
 #define SHARE_VOLUME_DEFAULT           NULL
 #define SHARE_TYPE_DEFAULT             "DISK"  
 #define SHARE_CSC_POLICY_DEFAULT       0
-#define SHARE_AVAILABLE_DEFAULT                True
-#define SHARE_BROWSEABLE_DEFAULT       True
+#define SHARE_AVAILABLE_DEFAULT                true
+#define SHARE_BROWSEABLE_DEFAULT       true
 #define SHARE_MAX_CONNECTIONS_DEFAULT  0
 
 #define SHARE_DIR_MASK_DEFAULT                   0755
@@ -116,14 +116,14 @@ struct share_ops {
 
 /* I'd like to see the following options go away
  * and always use EAs and SECDESCs */
-#define SHARE_READONLY_DEFAULT         True
-#define SHARE_MAP_SYSTEM_DEFAULT       False
-#define SHARE_MAP_HIDDEN_DEFAULT       False
-#define SHARE_MAP_ARCHIVE_DEFAULT      True
-
-#define SHARE_STRICT_LOCKING_DEFAULT   True
-#define SHARE_STRICT_SYNC_DEFAULT      False
-#define SHARE_MSDFS_ROOT_DEFAULT       False
-#define SHARE_CI_FILESYSTEM_DEFAULT    False
+#define SHARE_READONLY_DEFAULT         true
+#define SHARE_MAP_SYSTEM_DEFAULT       false
+#define SHARE_MAP_HIDDEN_DEFAULT       false
+#define SHARE_MAP_ARCHIVE_DEFAULT      true
+
+#define SHARE_STRICT_LOCKING_DEFAULT   true
+#define SHARE_STRICT_SYNC_DEFAULT      false
+#define SHARE_MSDFS_ROOT_DEFAULT       false
+#define SHARE_CI_FILESYSTEM_DEFAULT    false
 
 #endif /* _SHARE_H */
index 08d01af6e271b401b968adcec65a89a052ee5b6f..cf140f0d32b26aae7cd8d3bb73a63c237b141c1e 100644 (file)
@@ -158,12 +158,12 @@ static bool sclassic_bool_option(struct share_config *scfg, const char *opt_name
        struct loadparm_service *s = talloc_get_type(scfg->opaque, 
                                                     struct loadparm_service);
        char *parm, *val;
-       BOOL ret;
+       bool ret;
 
        if (strchr(opt_name, ':')) {
                parm = talloc_strdup(scfg, opt_name);
                if(!parm) {
-                       return False;
+                       return false;
                }
                val = strchr(parm, ':');
                *val = '\0';
index 5ddf0e3511f885c6588c418c2c071d9eb93b9664..019b1616391ae185861a36c3fd6069829797ed29 100644 (file)
@@ -99,16 +99,16 @@ static int sldb_int_option(struct share_config *scfg, const char *opt_name, int
        return ret;
 }
 
-static BOOL sldb_bool_option(struct share_config *scfg, const char *opt_name, BOOL defval)
+static bool sldb_bool_option(struct share_config *scfg, const char *opt_name, bool defval)
 {
        const char *val;
 
                val = sldb_string_option(scfg, opt_name, NULL);
        if (val == NULL) return defval;
 
-       if (strcasecmp(val, "true") == 0) return True;
+       if (strcasecmp(val, "true") == 0) return true;
 
-       return False;
+       return false;
 }
 
 static const char **sldb_string_list_option(TALLOC_CTX *mem_ctx, struct share_config *scfg, const char *opt_name)
@@ -355,9 +355,9 @@ NTSTATUS sldb_create(struct share_context *ctx, const char *name, struct share_i
 
        /* TODO: Security Descriptor */
 
-       SHARE_ADD_STRING(SHARE_AVAILABLE, "True");
-       SHARE_ADD_STRING(SHARE_BROWSEABLE, "True");
-       SHARE_ADD_STRING(SHARE_READONLY, "False");
+       SHARE_ADD_STRING(SHARE_AVAILABLE, "true");
+       SHARE_ADD_STRING(SHARE_BROWSEABLE, "true");
+       SHARE_ADD_STRING(SHARE_READONLY, "false");
        SHARE_ADD_STRING(SHARE_NTVFS_HANDLER, "unixuid");
        SHARE_ADD_STRING(SHARE_NTVFS_HANDLER, "posix");
 
@@ -429,7 +429,7 @@ NTSTATUS sldb_set(struct share_context *ctx, const char *name, struct share_info
        struct ldb_message *msg;
        TALLOC_CTX *tmp_ctx;
        NTSTATUS ret;
-       bool do_rename = False;
+       bool do_rename = false;
        char *newname;
        int err, i;
 
@@ -463,7 +463,7 @@ NTSTATUS sldb_set(struct share_context *ctx, const char *name, struct share_info
        for (i = 0; i < count; i++) {
                if (strcasecmp(info[i].name, SHARE_NAME) == 0) {
                        if (strcasecmp(name, (char *)info[i].value) != 0) {
-                               do_rename = True;
+                               do_rename = true;
                                newname = (char *)info[i].value;
                                SHARE_MOD_STRING("cn", (char *)info[i].value);
                        }
index 9c682a7791d17750f29b2dafc7cdb175f4a19d2a..8d59861f400bbfb0713f8a9ea214a78e41f83472 100644 (file)
@@ -51,17 +51,17 @@ _PUBLIC_ bool lp_is_myname(struct loadparm_context *lp_ctx, const char *name)
        int i;
 
        if (strcasecmp(name, lp_netbios_name(lp_ctx)) == 0) {
-               return True;
+               return true;
        }
 
        aliases = lp_netbios_aliases(lp_ctx);
        for (i=0; aliases && aliases[i]; i++) {
                if (strcasecmp(name, aliases[i]) == 0) {
-                       return True;
+                       return true;
                }
        }
 
-       return False;
+       return false;
 }