1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-22 16:23:49 +03:00

Additional revamped libsmbclient documentation

- Ensured that all public functions have documentation in libsmbclient.h
- Reformatted for "proper" indentation
- Re-added temporarily-disabled alternate authentication function capability

Derrell
This commit is contained in:
Derrell Lipman
2008-03-01 20:44:21 -05:00
parent 56429a3d60
commit 64b7150d92
14 changed files with 2617 additions and 2199 deletions

View File

@@ -55,11 +55,11 @@ static int
add_fd(SMBCFILE * file)
{
struct smbc_compat_fdlist * f = smbc_compat_fd_avail;
if (f) {
/* We found one that's available */
DLIST_REMOVE(smbc_compat_fd_avail, f);
} else {
/*
* None were available, so allocate one. Keep the number of
@@ -72,19 +72,19 @@ add_fd(SMBCFILE * file)
errno = EMFILE;
return -1;
}
f = SMB_MALLOC_P(struct smbc_compat_fdlist);
if (!f) {
errno = ENOMEM;
return -1;
}
f->fd = SMBC_BASE_FD + smbc_compat_nextfd++;
}
f->file = file;
DLIST_ADD(smbc_compat_fd_in_use, f);
return f->fd;
}
@@ -95,13 +95,13 @@ static int
del_fd(int fd)
{
struct smbc_compat_fdlist * f = smbc_compat_fd_in_use;
while (f) {
if (f->fd == fd)
break;
f = f->next;
}
if (f) {
/* found */
DLIST_REMOVE(smbc_compat_fd_in_use, f);
@@ -111,7 +111,7 @@ del_fd(int fd)
}
return 1;
}
int
@@ -122,17 +122,17 @@ smbc_init(smbc_get_auth_data_fn fn,
statcont = smbc_new_context();
if (!statcont)
return -1;
smbc_setDebug(statcont, debug);
smbc_setFunctionAuthData(statcont, fn);
if (!smbc_init_context(statcont)) {
smbc_free_context(statcont, False);
return -1;
}
smbc_compat_initialized = 1;
return 0;
}
return 0;
@@ -143,11 +143,11 @@ SMBCCTX *
smbc_set_context(SMBCCTX * context)
{
SMBCCTX *old_context = statcont;
if (context) {
/* Save provided context. It must have been initialized! */
statcont = context;
/* You'd better know what you're doing. We won't help you. */
smbc_compat_initialized = 1;
}
@@ -163,11 +163,11 @@ smbc_open(const char *furl,
{
SMBCFILE * file;
int fd;
file = smbc_getFunctionOpen(statcont)(statcont, furl, flags, mode);
if (!file)
return -1;
fd = add_fd(file);
if (fd == -1)
smbc_getFunctionClose(statcont)(statcont, file);
@@ -181,11 +181,11 @@ smbc_creat(const char *furl,
{
SMBCFILE * file;
int fd;
file = smbc_getFunctionCreat(statcont)(statcont, furl, mode);
if (!file)
return -1;
fd = add_fd(file);
if (fd == -1) {
/* Hmm... should we delete the file too ? I guess we could try */
@@ -250,15 +250,15 @@ smbc_opendir(const char *durl)
{
SMBCFILE * file;
int fd;
file = smbc_getFunctionOpendir(statcont)(statcont, durl);
if (!file)
return -1;
fd = add_fd(file);
if (fd == -1)
smbc_getFunctionClosedir(statcont)(statcont, file);
return fd;
}
@@ -357,14 +357,14 @@ smbc_utime(const char *fname,
struct utimbuf *utbuf)
{
struct timeval tv[2];
if (utbuf == NULL)
return smbc_getFunctionUtimes(statcont)(statcont, fname, NULL);
tv[0].tv_sec = utbuf->actime;
tv[1].tv_sec = utbuf->modtime;
tv[0].tv_usec = tv[1].tv_usec = 0;
return smbc_getFunctionUtimes(statcont)(statcont, fname, tv);
}
#endif
@@ -519,7 +519,7 @@ int
smbc_open_print_job(const char *fname)
{
SMBCFILE * file;
file = smbc_getFunctionOpenPrintJob(statcont)(statcont, fname);
if (!file) return -1;
return file->cli_fd;