Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jaak Ristioja
OpenLDAP
Commits
727fae81
Commit
727fae81
authored
26 years ago
by
Hallvard Furuseth
Browse files
Options
Downloads
Patches
Plain Diff
"const"ify some static arrays and related function parameters
parent
80b64148
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/saucer/main.c
+21
-15
21 additions, 15 deletions
contrib/saucer/main.c
with
21 additions
and
15 deletions
contrib/saucer/main.c
+
21
−
15
View file @
727fae81
...
...
@@ -40,9 +40,9 @@
#define DN_MAXLEN 4096
typedef
struct
{
char
*
cmd
;
int
(
*
func
)
(
char
**
,
int
);
char
*
help_msg
;
const
char
*
cmd
;
int
(
*
func
)
(
char
**
,
int
);
const
char
*
help_msg
;
}
CMDTABLE
;
typedef
enum
{
...
...
@@ -87,12 +87,14 @@ void show_syntax(int cmdnum);
char
*
skip_to_char
(
register
char
*
s
,
register
int
c
);
char
*
skip_to_whitespace
(
register
char
*
s
);
char
*
skip_whitespace
(
register
char
*
s
);
int
table_lookup
(
c
har
*
word
,
char
**
table
,
int
table_cou
nt
);
int
table_lookup
(
c
onst
char
*
,
const
char
*
const
*
,
i
nt
);
FILE
*
user_tailor
(
void
);
static
char
*
binary_attrs
[]
=
{
"audio"
,
"jpegPhoto"
,
"personalSignature"
,
"photo"
};
static
const
char
*
const
binary_attrs
[]
=
{
"audio"
,
"jpegPhoto"
,
"personalSignature"
,
"photo"
};
CMDTABLE
cmdtable
[]
=
{
const
CMDTABLE
cmdtable
[]
=
{
"help"
,
cmd_help
,
"[command]"
,
"list"
,
cmd_list
,
"[RDN-or-DN] [-absolute]"
,
"moveto"
,
cmd_moveto
,
"[RDN-or-DN] [-absolute]"
,
...
...
@@ -150,7 +152,7 @@ int cmd_list(char **cmdargv, int cmdargc)
char
*
dn
=
NULL
;
int
errflag
=
0
;
int
i
;
static
c
har
*
opts
[]
=
{
"absolute"
};
static
c
onst
char
*
const
opts
[]
=
{
"absolute"
};
int
relative
=
1
;
LDAPMessage
*
result
;
...
...
@@ -198,7 +200,7 @@ int cmd_moveto(char **cmdargv, int cmdargc)
int
errflag
=
0
;
char
**
exploded_dn
;
int
i
;
static
c
har
*
opts
[]
=
{
"absolute"
};
static
c
onst
char
*
const
opts
[]
=
{
"absolute"
};
int
relative
=
1
;
for
(
i
=
1
;
i
<
cmdargc
;
i
++
)
{
...
...
@@ -274,11 +276,11 @@ int cmd_search(char **cmdargv, int cmdargc)
int
errflag
=
0
;
char
*
filter
=
NULL
;
int
i
,
j
;
static
c
har
*
opts
[]
=
{
"absolute"
,
"object"
,
"scope"
};
static
c
onst
char
*
const
opts
[]
=
{
"absolute"
,
"object"
,
"scope"
};
int
relative
=
1
;
LDAPMessage
*
result
;
static
c
har
*
scope_opts
[]
=
{
"base"
,
"onelevel"
,
"subtree"
};
static
int
scope_vals
[]
=
{
LDAP_SCOPE_BASE
,
LDAP_SCOPE_ONELEVEL
,
LDAP_SCOPE_SUBTREE
};
static
c
onst
char
*
const
scope_opts
[]
=
{
"base"
,
"onelevel"
,
"subtree"
};
static
const
int
scope_vals
[]
=
{
LDAP_SCOPE_BASE
,
LDAP_SCOPE_ONELEVEL
,
LDAP_SCOPE_SUBTREE
};
static
int
search_scope
=
LDAP_SCOPE_ONELEVEL
;
for
(
i
=
1
;
i
<
cmdargc
;
i
++
)
{
...
...
@@ -333,10 +335,14 @@ int cmd_search(char **cmdargv, int cmdargc)
int
cmd_set
(
char
**
cmdargv
,
int
cmdargc
)
{
static
char
*
alias_opts
[]
=
{
"never"
,
"search"
,
"find"
,
"always"
};
static
const
char
*
const
alias_opts
[]
=
{
"never"
,
"search"
,
"find"
,
"always"
};
int
errflag
=
0
;
int
i
,
j
;
static
char
*
opts
[]
=
{
"aliasderef"
,
"sizelimit"
,
"timelimit"
};
static
const
char
*
const
opts
[]
=
{
"aliasderef"
,
"sizelimit"
,
"timelimit"
};
for
(
i
=
1
;
i
<
cmdargc
;
i
++
)
{
if
(
cmdargv
[
i
][
0
]
==
'-'
)
{
...
...
@@ -391,7 +397,7 @@ int cmd_show(char **cmdargv, int cmdargc)
LDAPMessage
*
entry
;
int
errflag
=
0
;
int
i
;
static
c
har
*
opts
[]
=
{
"absolute"
};
static
c
onst
char
*
const
opts
[]
=
{
"absolute"
};
int
relative
=
1
;
LDAPMessage
*
result
;
...
...
@@ -708,7 +714,7 @@ char *skip_whitespace(register char *s)
return
s
;
}
int
table_lookup
(
char
*
word
,
c
har
*
*
table
,
int
table_count
)
int
table_lookup
(
const
char
*
word
,
c
onst
char
*
const
*
table
,
int
table_count
)
{
register
int
i
;
int
wordlen
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment