svn commit: samba r25547 - in branches/SAMBA_4_0: . source/param

jelmer at samba.org jelmer at samba.org
Sat Oct 6 21:39:54 GMT 2007


Author: jelmer
Date: 2007-10-06 21:39:52 +0000 (Sat, 06 Oct 2007)
New Revision: 25547

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25547

Log:
Convert to standard bool type.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/param/generic.c
   branches/SAMBA_4_0/source/param/params.c
   branches/SAMBA_4_0/source/param/secrets.c
   branches/SAMBA_4_0/source/param/share.c
   branches/SAMBA_4_0/source/param/share.h
   branches/SAMBA_4_0/source/param/share_classic.c
   branches/SAMBA_4_0/source/param/share_ldb.c
   branches/SAMBA_4_0/source/param/util.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/param/generic.c
===================================================================
--- branches/SAMBA_4_0/source/param/generic.c	2007-10-06 21:33:16 UTC (rev 25546)
+++ branches/SAMBA_4_0/source/param/generic.c	2007-10-06 21:39:52 UTC (rev 25547)
@@ -202,7 +202,7 @@
 	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 @@
 		p->value = talloc_strdup(p, value);
 	}
 
-	return True;
+	return true;
 }
 
 struct param_context *param_init(TALLOC_CTX *mem_ctx)

Modified: branches/SAMBA_4_0/source/param/params.c
===================================================================
--- branches/SAMBA_4_0/source/param/params.c	2007-10-06 21:33:16 UTC (rev 25546)
+++ branches/SAMBA_4_0/source/param/params.c	2007-10-06 21:39:52 UTC (rev 25547)
@@ -188,7 +188,7 @@
 }
 
 
-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 @@
    *          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 @@
       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 @@
         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 @@
           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 @@
 
   /* 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 @@
    *                    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 @@
       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 @@
         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 @@
           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 @@
       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 @@
       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 @@
   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 @@
    *          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 @@
 
       case '[':                         /* Section Header. */
         if( !Section( InFile, sfunc, userdata ) )
-          return( False );
+          return( false );
         c = EatWhitespace( InFile );
         break;
 
@@ -485,12 +485,12 @@
 
       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 @@
   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 @@
 
   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 @@
       {
       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 @@
   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 */
 
 /* -------------------------------------------------------------------------- */

Modified: branches/SAMBA_4_0/source/param/secrets.c
===================================================================
--- branches/SAMBA_4_0/source/param/secrets.c	2007-10-06 21:33:16 UTC (rev 25546)
+++ branches/SAMBA_4_0/source/param/secrets.c	2007-10-06 21:39:52 UTC (rev 25547)
@@ -86,7 +86,7 @@
 	/* 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 @@
 	char *path;
 	const char *url;
 	struct ldb_context *ldb;
-	BOOL existed;
+	bool existed;
 	const char *init_ldif = 
 		"dn: @ATTRIBUTES\n" \
 		"computerName: CASE_INSENSITIVE\n" \

Modified: branches/SAMBA_4_0/source/param/share.c
===================================================================
--- branches/SAMBA_4_0/source/param/share.c	2007-10-06 21:33:16 UTC (rev 25546)
+++ branches/SAMBA_4_0/source/param/share.c	2007-10-06 21:39:52 UTC (rev 25547)
@@ -34,7 +34,7 @@
 	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);
 }

Modified: branches/SAMBA_4_0/source/param/share.h
===================================================================
--- branches/SAMBA_4_0/source/param/share.h	2007-10-06 21:33:16 UTC (rev 25546)
+++ branches/SAMBA_4_0/source/param/share.h	2007-10-06 21:39:52 UTC (rev 25547)
@@ -103,8 +103,8 @@
 #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 @@
 
 /* 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_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_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 */

Modified: branches/SAMBA_4_0/source/param/share_classic.c
===================================================================
--- branches/SAMBA_4_0/source/param/share_classic.c	2007-10-06 21:33:16 UTC (rev 25546)
+++ branches/SAMBA_4_0/source/param/share_classic.c	2007-10-06 21:39:52 UTC (rev 25547)
@@ -158,12 +158,12 @@
 	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';

Modified: branches/SAMBA_4_0/source/param/share_ldb.c
===================================================================
--- branches/SAMBA_4_0/source/param/share_ldb.c	2007-10-06 21:33:16 UTC (rev 25546)
+++ branches/SAMBA_4_0/source/param/share_ldb.c	2007-10-06 21:39:52 UTC (rev 25547)
@@ -99,16 +99,16 @@
 	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 @@
 
 	/* 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 @@
 	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 @@
 	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);
 			}

Modified: branches/SAMBA_4_0/source/param/util.c
===================================================================
--- branches/SAMBA_4_0/source/param/util.c	2007-10-06 21:33:16 UTC (rev 25546)
+++ branches/SAMBA_4_0/source/param/util.c	2007-10-06 21:39:52 UTC (rev 25547)
@@ -51,17 +51,17 @@
 	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;
 }
 
 



More information about the samba-cvs mailing list