}
-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().
*
* 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.
*
* ------------------------------------------------------------------------ **
if( NULL == tb )
{
DEBUG(0, ("%s Memory re-allocation failure.", func) );
- return( False );
+ return( false );
}
InFile->bufr = tb;
InFile->bSize += BUFR_INC;
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. */
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. */
/* 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().
*
* 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
if( NULL == tb )
{
DEBUG(0, ("%s Memory re-allocation failure.", func) );
- return( False );
+ return( false );
}
InFile->bufr = tb;
InFile->bSize += BUFR_INC;
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. */
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. */
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. */
if( NULL == tb )
{
DEBUG(0, ("%s Memory re-allocation failure.", func) );
- return( False );
+ return( false );
}
InFile->bufr = tb;
InFile->bSize += BUFR_INC;
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.
* 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:
case '[': /* Section Header. */
if( !Section( InFile, sfunc, userdata ) )
- return( False );
+ return( false );
c = EatWhitespace( InFile );
break;
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 )
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.
InFile = OpenConfFile( FileName ); /* Open the config file. */
if( NULL == InFile )
- return( False );
+ return( false );
DEBUG( 3, ("%s Processing configuration file \"%s\"\n", func, 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;
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 */
/* -------------------------------------------------------------------------- */
#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
/* 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 */
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)
/* 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");
struct ldb_message *msg;
TALLOC_CTX *tmp_ctx;
NTSTATUS ret;
- bool do_rename = False;
+ bool do_rename = false;
char *newname;
int err, i;
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);
}