summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-18 17:40:25 -0700
committerJeremy Allison <jra@samba.org>2007-10-18 17:40:25 -0700
commit30191d1a5704ad2b158386b511558972d539ce47 (patch)
tree4f46e5c4f28f672ab661aa18f45745860970a88c /source3/client
parent789856f63ff73fec66298e95c91c60db7bdaf14e (diff)
downloadsamba-30191d1a5704ad2b158386b511558972d539ce47.tar.gz
samba-30191d1a5704ad2b158386b511558972d539ce47.tar.bz2
samba-30191d1a5704ad2b158386b511558972d539ce47.zip
RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c68
-rw-r--r--source3/client/clitar.c38
-rw-r--r--[-rwxr-xr-x]source3/client/mount.cifs.c0
-rw-r--r--source3/client/smbctool.c64
-rw-r--r--source3/client/smbmount.c18
-rw-r--r--source3/client/smbspool.c2
6 files changed, 95 insertions, 95 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 4e916f6372..f3d454ec4b 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -27,10 +27,10 @@
#define REGISTER 0
#endif
-extern BOOL AllowDebugChange;
-extern BOOL override_logfile;
+extern bool AllowDebugChange;
+extern bool override_logfile;
extern char tar_type;
-extern BOOL in_client;
+extern bool in_client;
static int port = 0;
pstring cur_dir = "\\";
static pstring cd_path = "";
@@ -38,7 +38,7 @@ static pstring service;
static pstring desthost;
static pstring username;
static pstring calling_name;
-static BOOL grepable=False;
+static bool grepable=False;
static char *cmdstr = NULL;
static int io_bufsize = 64512;
@@ -63,27 +63,27 @@ static pstring cwd;
time_t newer_than = 0;
static int archive_level = 0;
-static BOOL translation = False;
-static BOOL have_ip;
+static bool translation = False;
+static bool have_ip;
/* clitar bits insert */
extern int blocksize;
-extern BOOL tar_inc;
-extern BOOL tar_reset;
+extern bool tar_inc;
+extern bool tar_reset;
/* clitar bits end */
-static BOOL prompt = True;
+static bool prompt = True;
-static BOOL recurse = False;
-static BOOL showacls = False;
-BOOL lowercase = False;
+static bool recurse = False;
+static bool showacls = False;
+bool lowercase = False;
static struct in_addr dest_ip;
#define SEPARATORS " \t\n\r"
-static BOOL abort_mget = True;
+static bool abort_mget = True;
static pstring fileselection = "";
@@ -364,7 +364,7 @@ static int cmd_cd_oneup(void)
Decide if a file should be operated on.
********************************************************************/
-static BOOL do_this_one(file_info *finfo)
+static bool do_this_one(file_info *finfo)
{
if (finfo->mode & aDIR)
return(True);
@@ -450,8 +450,8 @@ static void do_du(file_info *finfo)
}
}
-static BOOL do_list_recurse;
-static BOOL do_list_dirs;
+static bool do_list_recurse;
+static bool do_list_dirs;
static char *do_list_queue = 0;
static long do_list_queue_size = 0;
static long do_list_queue_start = 0;
@@ -621,7 +621,7 @@ static void do_list_helper(const char *mntpoint, file_info *f, const char *mask,
A wrapper around cli_list that adds recursion.
****************************************************************************/
-void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),BOOL rec, BOOL dirs)
+void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),bool rec, bool dirs)
{
static int in_do_list = 0;
struct cli_state *targetcli;
@@ -803,10 +803,10 @@ static int cmd_echo(void)
Get a file from rname to lname
****************************************************************************/
-static int do_get(char *rname, char *lname, BOOL reget)
+static int do_get(char *rname, char *lname, bool reget)
{
int handle = 0, fnum;
- BOOL newhandle = False;
+ bool newhandle = False;
char *data;
struct timeval tp_start;
int read_size = io_bufsize;
@@ -1113,7 +1113,7 @@ static int cmd_mget(void)
Make a directory of name "name".
****************************************************************************/
-static BOOL do_mkdir(char *name)
+static bool do_mkdir(char *name)
{
struct cli_state *targetcli;
pstring targetname;
@@ -1136,7 +1136,7 @@ static BOOL do_mkdir(char *name)
Show 8.3 name of a file.
****************************************************************************/
-static BOOL do_altname(char *name)
+static bool do_altname(char *name)
{
pstring altname;
if (!NT_STATUS_IS_OK(cli_qpathinfo_alt_name(cli, name, altname))) {
@@ -1237,7 +1237,7 @@ static int cmd_altname(void)
Put a single file.
****************************************************************************/
-static int do_put(char *rname, char *lname, BOOL reput)
+static int do_put(char *rname, char *lname, bool reput)
{
int fnum;
XFILE *f;
@@ -1416,7 +1416,7 @@ static int cmd_put(void)
static struct file_list {
struct file_list *prev, *next;
char *file_path;
- BOOL isdir;
+ bool isdir;
} *file_list;
/****************************************************************************
@@ -1440,7 +1440,7 @@ static void free_file_list (struct file_list *list_head)
the specified name.
****************************************************************************/
-static BOOL seek_list(struct file_list *list, char *name)
+static bool seek_list(struct file_list *list, char *name)
{
while (list) {
trim_string(list->file_path,"./","\n");
@@ -1471,14 +1471,14 @@ static int cmd_select(void)
****************************************************************************/
static int file_find(struct file_list **list, const char *directory,
- const char *expression, BOOL match)
+ const char *expression, bool match)
{
SMB_STRUCT_DIR *dir;
struct file_list *entry;
struct stat statbuf;
int ret;
char *path;
- BOOL isdir;
+ bool isdir;
const char *dname;
dir = sys_opendir(directory);
@@ -2800,7 +2800,7 @@ static int cmd_prompt(void)
static int cmd_newer(void)
{
pstring buf;
- BOOL ok;
+ bool ok;
SMB_STRUCT_STAT sbuf;
ok = next_token_nr(NULL,buf,NULL,sizeof(buf));
@@ -2854,7 +2854,7 @@ static int cmd_lowercase(void)
static int cmd_setcase(void)
{
- BOOL orig_case_sensitive = cli_set_case_sensitive(cli, False);
+ bool orig_case_sensitive = cli_set_case_sensitive(cli, False);
cli_set_case_sensitive(cli, !orig_case_sensitive);
DEBUG(2,("filename case sensitivity is now %s\n",!orig_case_sensitive ?
@@ -3019,7 +3019,7 @@ static void browse_fn(const char *name, uint32 m,
}
}
-static BOOL browse_host_rpc(BOOL sort)
+static bool browse_host_rpc(bool sort)
{
NTSTATUS status;
struct rpc_pipe_client *pipe_hnd;
@@ -3074,7 +3074,7 @@ static BOOL browse_host_rpc(BOOL sort)
Try and browse available connections on a host.
****************************************************************************/
-static BOOL browse_host(BOOL sort)
+static bool browse_host(bool sort)
{
int ret;
if (!grepable) {
@@ -3111,7 +3111,7 @@ static void server_fn(const char *name, uint32 m,
Try and browse available connections on a host.
****************************************************************************/
-static BOOL list_servers(const char *wk_grp)
+static bool list_servers(const char *wk_grp)
{
fstring state;
@@ -3894,15 +3894,15 @@ static int do_message_op(void)
pstring base_directory;
int opt;
pstring query_host;
- BOOL message = False;
+ bool message = False;
pstring term_code;
static const char *new_name_resolve_order = NULL;
poptContext pc;
char *p;
int rc = 0;
fstring new_workgroup;
- BOOL tar_opt = False;
- BOOL service_opt = False;
+ bool tar_opt = False;
+ bool service_opt = False;
struct poptOption long_options[] = {
POPT_AUTOHELP
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index b82a59953d..0c820177b0 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -80,32 +80,32 @@ static char *tarbuf, *buffer_p;
static int tp, ntarf, tbufsiz;
static double ttarf;
/* Incremental mode */
-static BOOL tar_inc=False;
+static bool tar_inc=False;
/* Reset archive bit */
-static BOOL tar_reset=False;
+static bool tar_reset=False;
/* Include / exclude mode (true=include, false=exclude) */
-static BOOL tar_excl=True;
+static bool tar_excl=True;
/* use regular expressions for search on file names */
-static BOOL tar_re_search=False;
+static bool tar_re_search=False;
/* Do not dump anything, just calculate sizes */
-static BOOL dry_run=False;
+static bool dry_run=False;
/* Dump files with System attribute */
-static BOOL tar_system=True;
+static bool tar_system=True;
/* Dump files with Hidden attribute */
-static BOOL tar_hidden=True;
+static bool tar_hidden=True;
/* Be noisy - make a catalogue */
-static BOOL tar_noisy=True;
-static BOOL tar_real_noisy=False; /* Don't want to be really noisy by default */
+static bool tar_noisy=True;
+static bool tar_real_noisy=False; /* Don't want to be really noisy by default */
char tar_type='\0';
static char **cliplist=NULL;
static int clipn=0;
-static BOOL must_free_cliplist = False;
+static bool must_free_cliplist = False;
extern file_info def_finfo;
-extern BOOL lowercase;
+extern bool lowercase;
extern uint16 cnum;
-extern BOOL readbraw_supported;
+extern bool readbraw_supported;
extern int max_xmit;
extern pstring cur_dir;
extern int get_total_time_ms;
@@ -129,7 +129,7 @@ static void initarbuf(void);
static long readtarheader(union hblock *hb, file_info2 *finfo, char *prefix);
static long unoct(char *p, int ndgs);
static void do_tarput(void);
-static void unfixtarname(char *tptr, char *fp, int l, BOOL first);
+static void unfixtarname(char *tptr, char *fp, int l, bool first);
/*
* tar specific utitlities
@@ -512,7 +512,7 @@ static int strslashcmp(char *s1, char *s2)
Ensure a remote path exists (make if necessary)
***************************************************************************/
-static BOOL ensurepath(char *fname)
+static bool ensurepath(char *fname)
{
/* *must* be called with buffer ready malloc'ed */
/* ensures path exists */
@@ -608,8 +608,8 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
SMB_BIG_UINT nread=0;
char ftype;
file_info2 finfo;
- BOOL close_done = False;
- BOOL shallitime=True;
+ bool close_done = False;
+ bool shallitime=True;
char data[65520];
int read_size = 65520;
int datalen=0;
@@ -689,7 +689,7 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
DEBUG(4, ("skipping %s - hidden bit is set\n", finfo.name));
shallitime=0;
} else {
- BOOL wrote_tar_header = False;
+ bool wrote_tar_header = False;
DEBUG(3,("getting file %s of size %.0f bytes as a tar file %s",
finfo.name, (double)finfo.size, lname));
@@ -861,7 +861,7 @@ strlen(finfo->name)=%d\nname=%s,cur_dir=%s\n",
Convert from UNIX to DOS file names
***************************************************************************/
-static void unfixtarname(char *tptr, char *fp, int l, BOOL first)
+static void unfixtarname(char *tptr, char *fp, int l, bool first)
{
/* remove '.' from start of file name, convert from unix /'s to
* dos \'s in path. Kill any absolute path names. But only if first!
@@ -1076,7 +1076,7 @@ static char *get_longfilename(file_info2 finfo)
int namesize = finfo.size + strlen(cur_dir) + 2;
char *longname = (char *)SMB_MALLOC(namesize);
int offset = 0, left = finfo.size;
- BOOL first = True;
+ bool first = True;
DEBUG(5, ("Restoring a long file name: %s\n", finfo.name));
DEBUG(5, ("Len = %.0f\n", (double)finfo.size));
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c
index eb45ae5b4a..eb45ae5b4a 100755..100644
--- a/source3/client/mount.cifs.c
+++ b/source3/client/mount.cifs.c
diff --git a/source3/client/smbctool.c b/source3/client/smbctool.c
index 4390ee3fc5..57fd1d6cf7 100644
--- a/source3/client/smbctool.c
+++ b/source3/client/smbctool.c
@@ -28,10 +28,10 @@
#define REGISTER 0
#endif
-extern BOOL AllowDebugChange;
-extern BOOL override_logfile;
+extern bool AllowDebugChange;
+extern bool override_logfile;
extern char tar_type;
-extern BOOL in_client;
+extern bool in_client;
static int port = 0;
pstring cur_dir = "/";
static pstring service;
@@ -39,7 +39,7 @@ static pstring desthost;
static pstring username;
static pstring workgroup;
static pstring calling_name;
-static BOOL grepable=False;
+static bool grepable=False;
static char *cmdstr = NULL;
static int io_bufsize = 64512;
@@ -60,26 +60,26 @@ static int cmd_help(void);
time_t newer_than = 0;
static int archive_level = 0;
-static BOOL translation = False;
-static BOOL have_ip;
+static bool translation = False;
+static bool have_ip;
/* clitar bits insert */
extern int blocksize;
-extern BOOL tar_inc;
-extern BOOL tar_reset;
+extern bool tar_inc;
+extern bool tar_reset;
/* clitar bits end */
-static BOOL prompt = True;
+static bool prompt = True;
-static BOOL recurse = False;
-BOOL lowercase = False;
+static bool recurse = False;
+bool lowercase = False;
static struct in_addr dest_ip;
#define SEPARATORS " \t\n\r"
-static BOOL abort_mget = True;
+static bool abort_mget = True;
static pstring fileselection = "";
@@ -408,7 +408,7 @@ static int cmd_cd(void)
Decide if a file should be operated on.
********************************************************************/
-static BOOL do_this_one(file_info *finfo)
+static bool do_this_one(file_info *finfo)
{
if (finfo->mode & aDIR)
return(True);
@@ -474,8 +474,8 @@ static void do_du(file_info *finfo)
}
}
-static BOOL do_list_recurse;
-static BOOL do_list_dirs;
+static bool do_list_recurse;
+static bool do_list_dirs;
static char *do_list_queue = 0;
static long do_list_queue_size = 0;
static long do_list_queue_start = 0;
@@ -628,8 +628,8 @@ static void tool_list_helper(const char *mntpoint, struct stat *f, const char *m
int tool_list( char *mask,
mode_t mode,
void (*fn)(char *, struct stat *),
- BOOL rec,
- BOOL dirs)
+ bool rec,
+ bool dirs)
{
int dh;
pstring dentname;
@@ -727,7 +727,7 @@ static void do_list_helper(const char *mntpoint, file_info *f, const char *mask,
A wrapper around cli_list that adds recursion.
****************************************************************************/
-void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),BOOL rec, BOOL dirs)
+void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),bool rec, bool dirs)
{
static int in_do_list = 0;
struct cli_state *targetcli;
@@ -865,10 +865,10 @@ static int cmd_du(void)
Get a file from rname to lname
****************************************************************************/
-static int do_get(char *rname, char *lname, BOOL reget)
+static int do_get(char *rname, char *lname, bool reget)
{
int handle = 0, fnum;
- BOOL newhandle = False;
+ bool newhandle = False;
char *data;
struct timeval tp_start;
int read_size = io_bufsize;
@@ -1193,7 +1193,7 @@ static int cmd_mget(void)
Make a directory of name "name".
****************************************************************************/
-static BOOL do_mkdir(char *name)
+static bool do_mkdir(char *name)
{
if (smbc_mkdir(name, 755) < 0)
{
@@ -1208,7 +1208,7 @@ static BOOL do_mkdir(char *name)
Show 8.3 name of a file.
****************************************************************************/
-static BOOL do_altname(char *name)
+static bool do_altname(char *name)
{
pstring altname;
if (!NT_STATUS_IS_OK(cli_qpathinfo_alt_name(cli, name, altname))) {
@@ -1320,7 +1320,7 @@ static int cmd_altname(void)
Put a single file.
****************************************************************************/
-static int do_put(char *rname, char *lname, BOOL reput)
+static int do_put(char *rname, char *lname, bool reput)
{
int fnum;
XFILE *f;
@@ -1514,7 +1514,7 @@ static int cmd_put(void)
static struct file_list {
struct file_list *prev, *next;
char *file_path;
- BOOL isdir;
+ bool isdir;
} *file_list;
/****************************************************************************
@@ -1538,7 +1538,7 @@ static void free_file_list (struct file_list * list)
the specified name.
****************************************************************************/
-static BOOL seek_list(struct file_list *list, char *name)
+static bool seek_list(struct file_list *list, char *name)
{
while (list) {
trim_string(list->file_path,"./","\n");
@@ -1569,14 +1569,14 @@ static int cmd_select(void)
****************************************************************************/
static int file_find(struct file_list **list, const char *directory,
- const char *expression, BOOL match)
+ const char *expression, bool match)
{
DIR *dir;
struct file_list *entry;
struct stat statbuf;
int ret;
char *path;
- BOOL isdir;
+ bool isdir;
const char *dname;
dir = opendir(directory);
@@ -2553,7 +2553,7 @@ static int cmd_prompt(void)
static int cmd_newer(void)
{
pstring buf;
- BOOL ok;
+ bool ok;
SMB_STRUCT_STAT sbuf;
ok = next_token_nr(NULL,buf,NULL,sizeof(buf));
@@ -2607,7 +2607,7 @@ static int cmd_lowercase(void)
static int cmd_setcase(void)
{
- BOOL orig_case_sensitive = cli_set_case_sensitive(cli, False);
+ bool orig_case_sensitive = cli_set_case_sensitive(cli, False);
cli_set_case_sensitive(cli, !orig_case_sensitive);
DEBUG(2,("filename case sensitivity is now %s\n",!orig_case_sensitive ?
@@ -2757,7 +2757,7 @@ static void browse_fn(const char *name, uint32 m,
Try and browse available connections on a host.
****************************************************************************/
-static BOOL browse_host(BOOL sort)
+static bool browse_host(bool sort)
{
int ret;
if (!grepable) {
@@ -2790,7 +2790,7 @@ static void server_fn(const char *name, uint32 m,
Try and browse available connections on a host.
****************************************************************************/
-static BOOL list_servers(const char *wk_grp)
+static bool list_servers(const char *wk_grp)
{
fstring state;
@@ -3521,7 +3521,7 @@ static int do_message_op(void)
pstring base_directory;
int opt;
pstring query_host;
- BOOL message = False;
+ bool message = False;
pstring term_code;
static const char *new_name_resolve_order = NULL;
poptContext pc;
diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c
index d2a4b9a909..95adc9a8f2 100644
--- a/source3/client/smbmount.c
+++ b/source3/client/smbmount.c
@@ -23,7 +23,7 @@
#include <asm/types.h>
#include <linux/smb_fs.h>
-extern BOOL in_client;
+extern bool in_client;
extern pstring user_socket_options;
extern char *optarg;
extern int optind;
@@ -38,20 +38,20 @@ static pstring service;
static pstring options;
static struct in_addr dest_ip;
-static BOOL have_ip;
+static bool have_ip;
static int smb_port = 0;
-static BOOL got_user;
-static BOOL got_pass;
+static bool got_user;
+static bool got_pass;
static uid_t mount_uid;
static gid_t mount_gid;
static int mount_ro;
static unsigned mount_fmask;
static unsigned mount_dmask;
-static BOOL use_kerberos;
+static bool use_kerberos;
/* TODO: Add code to detect smbfs version in kernel */
-static BOOL status32_smbfs = False;
-static BOOL smbfs_has_unicode = False;
-static BOOL smbfs_has_lfs = False;
+static bool status32_smbfs = False;
+static bool smbfs_has_unicode = False;
+static bool smbfs_has_lfs = False;
static void usage(void);
@@ -549,7 +549,7 @@ static void get_password_file(void)
{
int fd = -1;
char *p;
- BOOL close_it = False;
+ bool close_it = False;
pstring spec;
char pass[128];
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index f0c31c5500..5a1556bd70 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -35,7 +35,7 @@
* Globals...
*/
-extern BOOL in_client; /* Boolean for client library */
+extern bool in_client; /* Boolean for client library */
/*