diff options
author | Jeremy Allison <jra@samba.org> | 2002-11-12 23:20:50 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-11-12 23:20:50 +0000 |
commit | 2f194322d419350f35a48dff750066894d68eccf (patch) | |
tree | b0501eaf874ca8e740a51a8e0f29d261e32e0093 /source3/libsmb/nmblib.c | |
parent | f2b669b37fecda2687860eba4a15801dc89855dc (diff) | |
download | samba-2f194322d419350f35a48dff750066894d68eccf.tar.gz |
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/libsmb/nmblib.c')
-rw-r--r-- | source3/libsmb/nmblib.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c index ba0d8cee5de..43e32aebbdb 100644 --- a/source3/libsmb/nmblib.c +++ b/source3/libsmb/nmblib.c @@ -28,14 +28,14 @@ static const struct opcode_names { char *nmb_opcode_name; int opcode; } nmb_header_opcode_names[] = { - {"Query", 0 }, - {"Registration", 5 }, - {"Release", 6 }, - {"WACK", 7 }, - {"Refresh", 8 }, - {"Refresh(altcode)", 9 }, - {"Multi-homed Registration", 15 }, - {0, -1 } + {"Query", 0 }, + {"Registration", 5 }, + {"Release", 6 }, + {"WACK", 7 }, + {"Refresh", 8 }, + {"Refresh(altcode)", 9 }, + {"Multi-homed Registration", 15 }, + {0, -1 } }; /**************************************************************************** @@ -814,15 +814,15 @@ static int build_dgram(char *buf,struct packet_struct *p) } /******************************************************************* - build a nmb name - *******************************************************************/ + Build a nmb name +*******************************************************************/ + void make_nmb_name( struct nmb_name *n, const char *name, int type) { - extern pstring global_scope; memset( (char *)n, '\0', sizeof(struct nmb_name) ); push_ascii(n->name, name, 16, STR_TERMINATE|STR_UPPER); n->name_type = (unsigned int)type & 0xFF; - StrnCpy( n->scope, global_scope, 63 ); + StrnCpy( n->scope, global_scope(), 63 ); strupper( n->scope ); } @@ -1180,7 +1180,6 @@ int name_mangle( char *In, char *Out, char name_type ) int len; char buf[20]; char *p = Out; - extern pstring global_scope; /* Safely copy the input string, In, into buf[]. */ (void)memset( buf, 0, 20 ); @@ -1204,9 +1203,9 @@ int name_mangle( char *In, char *Out, char name_type ) p[0] = '\0'; /* Add the scope string. */ - for( i = 0, len = 0; NULL != global_scope; i++, len++ ) + for( i = 0, len = 0; NULL != global_scope(); i++, len++ ) { - switch( global_scope[i] ) + switch( (global_scope())[i] ) { case '\0': p[0] = len; @@ -1219,7 +1218,7 @@ int name_mangle( char *In, char *Out, char name_type ) len = -1; break; default: - p[len+1] = global_scope[i]; + p[len+1] = (global_scope())[i]; break; } } |