Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Christopher Ng
OpenLDAP
Commits
8dae0432
Commit
8dae0432
authored
26 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
API test for checking draft API issues.
parent
ba47ae1c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/libldap/apitest.c
+98
-0
98 additions, 0 deletions
libraries/libldap/apitest.c
with
98 additions
and
0 deletions
libraries/libldap/apitest.c
0 → 100644
+
98
−
0
View file @
8dae0432
#include
"portable.h"
#include
<stdio.h>
#include
<ac/time.h>
#include
"lber.h"
#include
"ldap.h"
void
main
(
int
argc
,
char
**
argv
)
{
LDAPAPIInfo
api
;
int
ival
;
int
sval
;
#ifdef LDAP_API_INFO_VERSION
api
.
ldapai_info_version
=
LDAP_API_INFO_VERSION
;
#else
api
.
ldapai_info_version
=
1
;
#endif
printf
(
"Compile time API Information
\n
"
);
printf
(
" API Info version: %d
\n
"
,
api
.
ldapai_info_version
);
printf
(
" API version: %d
\n
"
,
LDAP_API_VERSION
);
#ifdef LDAP_VERSION
printf
(
" Protocol Version: %d
\n
"
,
LDAP_VERSION
);
#else
printf
(
" Protocol Version: unknown
\n
"
);
#endif
#ifdef LDAP_VERSION_MIN
printf
(
" Protocol Min: %d
\n
"
,
LDAP_VERSION_MIN
);
#else
printf
(
" Protocol Min: unknown
\n
"
);
#endif
#ifdef LDAP_VERSION_MAX
printf
(
" Protocol Max: %d
\n
"
,
LDAP_VERSION_MAX
);
#else
printf
(
" Protocol Max: unknown
\n
"
);
#endif
#ifdef LDAP_VENDOR_NAME
printf
(
" Vendor Name: %s
\n
"
,
LDAP_VENDOR_NAME
);
#else
printf
(
" Vendor Name: unknown
\n
"
);
#endif
#ifdef LDAP_VENDOR_VERSION
printf
(
" Vendor Version: %d
\n
"
,
LDAP_VENDOR_VERSION
);
#else
printf
(
" Vendor Version: unknown
\n
"
);
#endif
if
(
ldap_get_option
(
NULL
,
LDAP_OPT_API_INFO
,
&
api
)
!=
LDAP_SUCCESS
)
{
fprintf
(
stderr
,
"%s: ldap_get_option(api) failed"
,
argv
[
0
]);
exit
(
-
1
);
}
printf
(
"
\n
Execution time API Information
\n
"
);
printf
(
" API Info version: %d
\n
"
,
api
.
ldapai_info_version
);
if
(
api
.
ldapai_info_version
!=
LDAP_API_INFO_VERSION
)
{
printf
(
" API INFO version mismatch!"
);
exit
(
-
1
);
}
printf
(
" API Version: %d
\n
"
,
api
.
ldapai_api_version
);
printf
(
" Protocol Max: %d
\n
"
,
api
.
ldapai_protocol_version
);
if
(
api
.
ldapai_extensions
==
NULL
)
{
printf
(
" Extensions: none
\n
"
);
}
else
{
int
i
;
for
(
i
=
0
;
api
.
ldapai_extensions
[
i
]
!=
NULL
;
i
++
)
{
printf
(
" %s
\n
"
,
api
.
ldapai_extensions
[
i
]);
}
printf
(
" #Extensions: %d
\n
"
,
i
);
}
printf
(
" Vendor Name: %s
\n
"
,
api
.
ldapai_vendor_name
);
printf
(
" Vendor Version: %d
\n
"
,
api
.
ldapai_vendor_version
);
printf
(
"
\n
Execution time Default Options
\n
"
);
if
(
ldap_get_option
(
NULL
,
LDAP_OPT_DEREF
,
&
ival
)
!=
LDAP_SUCCESS
)
{
fprintf
(
stderr
,
"%s: ldap_get_option(api) failed"
,
argv
[
0
]);
exit
(
-
1
);
}
printf
(
" DEREF: %d
\n
"
,
ival
);
if
(
ldap_get_option
(
NULL
,
LDAP_OPT_SIZELIMIT
,
&
ival
)
!=
LDAP_SUCCESS
)
{
fprintf
(
stderr
,
"%s: ldap_get_option(sizelimit) failed"
,
argv
[
0
]);
exit
(
-
1
);
}
printf
(
" SIZELIMIT: %d
\n
"
,
ival
);
if
(
ldap_get_option
(
NULL
,
LDAP_OPT_TIMELIMIT
,
&
ival
)
!=
LDAP_SUCCESS
)
{
fprintf
(
stderr
,
"%s: ldap_get_option(timelimit) failed"
,
argv
[
0
]);
exit
(
-
1
);
}
printf
(
" TIMELIMIT: %d
\n
"
,
ival
);
}
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