diff options
author | Jeremy Allison <jra@samba.org> | 2002-11-12 23:15:52 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-11-12 23:15:52 +0000 |
commit | 250c9801197ea1c949bd94c1c891f81ab118b130 (patch) | |
tree | 3a0ec79c71a010961d78726e223a70e1bc75c73f /source3/libsmb/nmblib.c | |
parent | 477025a6f628fd1a8d3bfacd30726e7a41819e50 (diff) | |
download | samba-250c9801197ea1c949bd94c1c891f81ab118b130.tar.gz samba-250c9801197ea1c949bd94c1c891f81ab118b130.tar.bz2 samba-250c9801197ea1c949bd94c1c891f81ab118b130.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 82b8f749a36b42e22186297482aad2abb04fab8a)
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 ba0d8cee5d..43e32aebbd 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; } } |