summaryrefslogtreecommitdiffstats
path: root/source/lib/util.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-02-24 03:09:08 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-02-24 03:09:08 +0000
commit9ef0d40c3f8aef52ab321dc065264c42065bc876 (patch)
tree99f7c10f0d29f52b452c5178cf6f376976e82a02 /source/lib/util.c
parentb32f3ecaf65f5f433d3b95802b45216689d56d75 (diff)
downloadsamba-9ef0d40c3f8aef52ab321dc065264c42065bc876.tar.gz
samba-9ef0d40c3f8aef52ab321dc065264c42065bc876.tar.xz
samba-9ef0d40c3f8aef52ab321dc065264c42065bc876.zip
Merge doxygen, signed/unsigned, const and other small fixes from HEAD to 3.0.
Andrew Bartlett
Diffstat (limited to 'source/lib/util.c')
-rw-r--r--source/lib/util.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index b4d9e9f16fe..3958600cbde 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -249,13 +249,7 @@ BOOL init_names(void)
int n;
if (global_myname() == NULL || *global_myname() == '\0') {
- fstring name;
-
- fstrcpy( name, myhostname() );
- p = strchr( name, '.' );
- if (p)
- *p = 0;
- if (!set_global_myname(name)) {
+ if (!set_global_myname(myhostname())) {
DEBUG( 0, ( "init_structs: malloc fail.\n" ) );
return False;
}
@@ -315,9 +309,9 @@ BOOL in_group(gid_t group, gid_t current_gid, int ngroups, const gid_t *groups)
Like atoi but gets the value up to the separator character.
****************************************************************************/
-static char *Atoic(char *p, int *n, char *c)
+static const char *Atoic(const char *p, int *n, const char *c)
{
- if (!isdigit((int)*p)) {
+ if (!isdigit((const int)*p)) {
DEBUG(5, ("Atoic: malformed number\n"));
return NULL;
}
@@ -339,7 +333,7 @@ static char *Atoic(char *p, int *n, char *c)
Reads a list of numbers.
*************************************************************************/
-char *get_numlist(char *p, uint32 **num, int *count)
+const char *get_numlist(const char *p, uint32 **num, int *count)
{
int val;
@@ -1014,7 +1008,7 @@ BOOL get_myfullname(char *my_name)
Get my own domain name.
****************************************************************************/
-BOOL get_mydomname(char *my_domname)
+BOOL get_mydomname(fstring my_domname)
{
pstring hostname;
char *p;
@@ -1730,6 +1724,23 @@ BOOL is_myname_or_ipaddr(const char *s)
}
/*******************************************************************
+ Is the name specified our workgroup/domain.
+ Returns true if it is equal, false otherwise.
+********************************************************************/
+
+BOOL is_myworkgroup(const char *s)
+{
+ BOOL ret = False;
+
+ if (strequal(s, lp_workgroup())) {
+ ret=True;
+ }
+
+ DEBUG(8, ("is_myworkgroup(\"%s\") returns %d\n", s, ret));
+ return(ret);
+}
+
+/*******************************************************************
Set the horrid remote_arch string based on an enum.
********************************************************************/
@@ -2389,7 +2400,7 @@ static BOOL unix_do_match(char *regexp, char *str)
Simple case insensitive interface to a UNIX wildcard matcher.
*******************************************************************/
-BOOL unix_wild_match(char *pattern, char *string)
+BOOL unix_wild_match(const char *pattern, const char *string)
{
pstring p2, s2;
char *p;