summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-11-12 23:20:50 +0000
committerJeremy Allison <jra@samba.org>2002-11-12 23:20:50 +0000
commit2f194322d419350f35a48dff750066894d68eccf (patch)
treeb0501eaf874ca8e740a51a8e0f29d261e32e0093 /source3/client
parentf2b669b37fecda2687860eba4a15801dc89855dc (diff)
downloadsamba-2f194322d419350f35a48dff750066894d68eccf.tar.gz
samba-2f194322d419350f35a48dff750066894d68eccf.tar.bz2
samba-2f194322d419350f35a48dff750066894d68eccf.zip
Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit f755711df8f74f9b8e8c1a2b0d07d02a931eeb89)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c19
-rw-r--r--source3/client/smbspool.c14
2 files changed, 14 insertions, 19 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 96b9837fef..c8529b84f2 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -37,7 +37,6 @@ pstring cur_dir = "\\";
static pstring cd_path = "";
static pstring service;
static pstring desthost;
-extern pstring global_myname;
static pstring password;
static pstring username;
static pstring workgroup;
@@ -2177,7 +2176,7 @@ process a -c command string
static int process_command_string(char *cmd)
{
pstring line;
- char *ptr;
+ const char *ptr;
int rc = 0;
/* establish the connection if not already */
@@ -2297,7 +2296,7 @@ process commands on stdin
****************************************************************************/
static void process_stdin(void)
{
- char *ptr;
+ const char *ptr;
while (1) {
fstring tok;
@@ -2362,7 +2361,7 @@ static struct cli_state *do_connect(const char *server, const char *share)
zero_ip(&ip);
- make_nmb_name(&calling, global_myname, 0x0);
+ make_nmb_name(&calling, global_myname(), 0x0);
make_nmb_name(&called , server, name_type);
again:
@@ -2635,7 +2634,7 @@ static int do_message_op(void)
fstring server_name;
char name_type_hex[10];
- make_nmb_name(&calling, global_myname, 0x0);
+ make_nmb_name(&calling, global_myname(), 0x0);
make_nmb_name(&called , desthost, name_type);
safe_strcpy(server_name, desthost, sizeof(server_name));
@@ -2845,17 +2844,13 @@ static void remember_query_host(const char *arg,
message = True;
break;
case 'i':
- {
- extern pstring global_scope;
- pstrcpy(global_scope,optarg);
- strupper(global_scope);
- }
+ set_global_scope(optarg);
break;
case 'N':
got_pass = True;
break;
case 'n':
- pstrcpy(global_myname,optarg);
+ set_global_myname(optarg);
break;
case 'd':
if (*optarg == 'A')
@@ -3000,7 +2995,7 @@ static void remember_query_host(const char *arg,
}
}
- get_myname((*global_myname)?NULL:global_myname);
+ init_names();
if(*new_name_resolve_order)
lp_set_name_resolve_order(new_name_resolve_order);
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index ff10963533..4c90db4114 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -36,7 +36,7 @@ extern BOOL in_client; /* Boolean for client library */
*/
static void list_devices(void);
-static struct cli_state *smb_connect(char *, char *, char *, char *, char *);
+static struct cli_state *smb_connect(const char *, const char *, const char *, const char *, const char *);
static int smb_print(struct cli_state *, char *, FILE *);
@@ -54,9 +54,9 @@ static int smb_print(struct cli_state *, char *, FILE *);
*sep, /* Pointer to separator */
*username, /* Username */
*password, /* Password */
- *workgroup, /* Workgroup */
*server, /* Server name */
*printer; /* Printer name */
+ const char *workgroup; /* Workgroup */
FILE *fp; /* File to print */
int status=0; /* Status of LPD job */
struct cli_state *cli; /* SMB interface */
@@ -265,11 +265,11 @@ list_devices(void)
*/
static struct cli_state * /* O - SMB connection */
-smb_connect(char *workgroup, /* I - Workgroup */
- char *server, /* I - Server */
- char *share, /* I - Printer */
- char *username, /* I - Username */
- char *password) /* I - Password */
+smb_connect(const char *workgroup, /* I - Workgroup */
+ const char *server, /* I - Server */
+ const char *share, /* I - Printer */
+ const char *username, /* I - Username */
+ const char *password) /* I - Password */
{
struct cli_state *c; /* New connection */
pstring myname; /* Client name */