tdb: Fix a typo
[Samba/gebeck_regimport.git] / source3 / libsmb / libsmb_setget.c
blob60bbc8bc5efdb36888be3cae595f1a73935cc636
1 /*
2 Unix SMB/Netbios implementation.
3 SMB client library implementation
4 Copyright (C) Andrew Tridgell 1998
5 Copyright (C) Richard Sharpe 2000, 2002
6 Copyright (C) John Terpstra 2000
7 Copyright (C) Tom Jansen (Ninja ISD) 2002
8 Copyright (C) Derrell Lipman 2003-2008
9 Copyright (C) Jeremy Allison 2007, 2008
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include "includes.h"
26 #define __LIBSMBCLIENT_INTERNAL__
27 #include "libsmbclient.h"
28 #include "libsmb_internal.h"
31 /** Get the netbios name used for making connections */
32 char *
33 smbc_getNetbiosName(SMBCCTX *c)
35 return c->netbios_name;
38 /** Set the netbios name used for making connections */
39 void
40 smbc_setNetbiosName(SMBCCTX *c, char * netbios_name)
42 SAFE_FREE(c->netbios_name);
43 if (netbios_name) {
44 c->netbios_name = SMB_STRDUP(netbios_name);
48 /** Get the workgroup used for making connections */
49 char *
50 smbc_getWorkgroup(SMBCCTX *c)
52 return c->workgroup;
55 /** Set the workgroup used for making connections */
56 void
57 smbc_setWorkgroup(SMBCCTX *c, char * workgroup)
59 SAFE_FREE(c->workgroup);
60 if (workgroup) {
61 c->workgroup = SMB_STRDUP(workgroup);
65 /** Get the username used for making connections */
66 char *
67 smbc_getUser(SMBCCTX *c)
69 return c->user;
72 /** Set the username used for making connections */
73 void
74 smbc_setUser(SMBCCTX *c, char * user)
76 SAFE_FREE(c->user);
77 if (user) {
78 c->user = SMB_STRDUP(user);
82 /** Get the debug level */
83 int
84 smbc_getDebug(SMBCCTX *c)
86 return c->debug;
89 /** Set the debug level */
90 void
91 smbc_setDebug(SMBCCTX *c, int debug)
93 char buf[32];
94 snprintf(buf, sizeof(buf), "%d", debug);
95 c->debug = debug;
96 lp_set_cmdline("log level", buf);
99 /**
100 * Get the timeout used for waiting on connections and response data
101 * (in milliseconds)
104 smbc_getTimeout(SMBCCTX *c)
106 return c->timeout;
110 * Set the timeout used for waiting on connections and response data
111 * (in milliseconds)
113 void
114 smbc_setTimeout(SMBCCTX *c, int timeout)
116 c->timeout = timeout;
119 /** Get whether to log to standard error instead of standard output */
120 smbc_bool
121 smbc_getOptionDebugToStderr(SMBCCTX *c)
123 /* Because this is a global concept, it is better to check
124 * what is really set, rather than what we wanted set
125 * (particularly as you cannot go back to stdout). */
126 return debug_get_output_is_stderr();
129 /** Set whether to log to standard error instead of standard output.
130 * This option is 'sticky' - once set to true, it cannot be set to
131 * false again, as it is global to the process, as once we have been
132 * told that it is not safe to safe to write to stdout, we shouldn't
133 * go back as we don't know it was this context that set it that way.
135 void
136 smbc_setOptionDebugToStderr(SMBCCTX *c, smbc_bool b)
138 if (b) {
140 * We do not have a unique per-thread debug state? For
141 * now, we'll just leave it up to the user. If any one
142 * context spefies debug to stderr then all will be (and
143 * will stay that way, as it is unsafe to flip back if
144 * stdout is in use for other things)
146 setup_logging("libsmbclient", DEBUG_STDERR);
151 * Get whether to use new-style time attribute names, e.g. WRITE_TIME rather
152 * than the old-style names such as M_TIME. This allows also setting/getting
153 * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME
154 * was supposed to be CHANGE_TIME but was confused and sometimes referred to
155 * CREATE_TIME.)
157 smbc_bool
158 smbc_getOptionFullTimeNames(SMBCCTX *c)
160 return c->internal->full_time_names;
164 * Set whether to use new-style time attribute names, e.g. WRITE_TIME rather
165 * than the old-style names such as M_TIME. This allows also setting/getting
166 * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME
167 * was supposed to be CHANGE_TIME but was confused and sometimes referred to
168 * CREATE_TIME.)
170 void
171 smbc_setOptionFullTimeNames(SMBCCTX *c, smbc_bool b)
173 c->internal->full_time_names = b;
177 * Get the share mode to use for files opened with SMBC_open_ctx(). The
178 * default is SMBC_SHAREMODE_DENY_NONE.
180 smbc_share_mode
181 smbc_getOptionOpenShareMode(SMBCCTX *c)
183 return c->internal->share_mode;
187 * Set the share mode to use for files opened with SMBC_open_ctx(). The
188 * default is SMBC_SHAREMODE_DENY_NONE.
190 void
191 smbc_setOptionOpenShareMode(SMBCCTX *c, smbc_share_mode share_mode)
193 c->internal->share_mode = share_mode;
196 /** Retrieve a previously set user data handle */
197 void *
198 smbc_getOptionUserData(SMBCCTX *c)
200 return c->internal->user_data;
203 /** Save a user data handle */
204 void
205 smbc_setOptionUserData(SMBCCTX *c, void *user_data)
207 c->internal->user_data = user_data;
210 /** Get the encoded value for encryption level. */
211 smbc_smb_encrypt_level
212 smbc_getOptionSmbEncryptionLevel(SMBCCTX *c)
214 return c->internal->smb_encryption_level;
217 /** Set the encoded value for encryption level. */
218 void
219 smbc_setOptionSmbEncryptionLevel(SMBCCTX *c, smbc_smb_encrypt_level level)
221 c->internal->smb_encryption_level = level;
225 * Get whether to treat file names as case-sensitive if we can't determine
226 * when connecting to the remote share whether the file system is case
227 * sensitive. This defaults to FALSE since it's most likely that if we can't
228 * retrieve the file system attributes, it's a very old file system that does
229 * not support case sensitivity.
231 smbc_bool
232 smbc_getOptionCaseSensitive(SMBCCTX *c)
234 return c->internal->case_sensitive;
238 * Set whether to treat file names as case-sensitive if we can't determine
239 * when connecting to the remote share whether the file system is case
240 * sensitive. This defaults to FALSE since it's most likely that if we can't
241 * retrieve the file system attributes, it's a very old file system that does
242 * not support case sensitivity.
244 void
245 smbc_setOptionCaseSensitive(SMBCCTX *c, smbc_bool b)
247 c->internal->case_sensitive = b;
251 * Get from how many local master browsers should the list of workgroups be
252 * retrieved. It can take up to 12 minutes or longer after a server becomes a
253 * local master browser, for it to have the entire browse list (the list of
254 * workgroups/domains) from an entire network. Since a client never knows
255 * which local master browser will be found first, the one which is found
256 * first and used to retrieve a browse list may have an incomplete or empty
257 * browse list. By requesting the browse list from multiple local master
258 * browsers, a more complete list can be generated. For small networks (few
259 * workgroups), it is recommended that this value be set to 0, causing the
260 * browse lists from all found local master browsers to be retrieved and
261 * merged. For networks with many workgroups, a suitable value for this
262 * variable is probably somewhere around 3. (Default: 3).
265 smbc_getOptionBrowseMaxLmbCount(SMBCCTX *c)
267 return c->options.browse_max_lmb_count;
271 * Set from how many local master browsers should the list of workgroups be
272 * retrieved. It can take up to 12 minutes or longer after a server becomes a
273 * local master browser, for it to have the entire browse list (the list of
274 * workgroups/domains) from an entire network. Since a client never knows
275 * which local master browser will be found first, the one which is found
276 * first and used to retrieve a browse list may have an incomplete or empty
277 * browse list. By requesting the browse list from multiple local master
278 * browsers, a more complete list can be generated. For small networks (few
279 * workgroups), it is recommended that this value be set to 0, causing the
280 * browse lists from all found local master browsers to be retrieved and
281 * merged. For networks with many workgroups, a suitable value for this
282 * variable is probably somewhere around 3. (Default: 3).
284 void
285 smbc_setOptionBrowseMaxLmbCount(SMBCCTX *c, int count)
287 c->options.browse_max_lmb_count = count;
291 * Get whether to url-encode readdir entries.
293 * There is a difference in the desired return strings from
294 * smbc_readdir() depending upon whether the filenames are to
295 * be displayed to the user, or whether they are to be
296 * appended to the path name passed to smbc_opendir() to call
297 * a further smbc_ function (e.g. open the file with
298 * smbc_open()). In the former case, the filename should be
299 * in "human readable" form. In the latter case, the smbc_
300 * functions expect a URL which must be url-encoded. Those
301 * functions decode the URL. If, for example, smbc_readdir()
302 * returned a file name of "abc%20def.txt", passing a path
303 * with this file name attached to smbc_open() would cause
304 * smbc_open to attempt to open the file "abc def.txt" since
305 * the %20 is decoded into a space.
307 * Set this option to True if the names returned by
308 * smbc_readdir() should be url-encoded such that they can be
309 * passed back to another smbc_ call. Set it to False if the
310 * names returned by smbc_readdir() are to be presented to the
311 * user.
313 * For backwards compatibility, this option defaults to False.
315 smbc_bool
316 smbc_getOptionUrlEncodeReaddirEntries(SMBCCTX *c)
318 return c->options.urlencode_readdir_entries;
322 * Set whether to url-encode readdir entries.
324 * There is a difference in the desired return strings from
325 * smbc_readdir() depending upon whether the filenames are to
326 * be displayed to the user, or whether they are to be
327 * appended to the path name passed to smbc_opendir() to call
328 * a further smbc_ function (e.g. open the file with
329 * smbc_open()). In the former case, the filename should be
330 * in "human readable" form. In the latter case, the smbc_
331 * functions expect a URL which must be url-encoded. Those
332 * functions decode the URL. If, for example, smbc_readdir()
333 * returned a file name of "abc%20def.txt", passing a path
334 * with this file name attached to smbc_open() would cause
335 * smbc_open to attempt to open the file "abc def.txt" since
336 * the %20 is decoded into a space.
338 * Set this option to True if the names returned by
339 * smbc_readdir() should be url-encoded such that they can be
340 * passed back to another smbc_ call. Set it to False if the
341 * names returned by smbc_readdir() are to be presented to the
342 * user.
344 * For backwards compatibility, this option defaults to False.
346 void
347 smbc_setOptionUrlEncodeReaddirEntries(SMBCCTX *c, smbc_bool b)
349 c->options.urlencode_readdir_entries = b;
353 * Get whether to use the same connection for all shares on a server.
355 * Some Windows versions appear to have a limit to the number
356 * of concurrent SESSIONs and/or TREE CONNECTions. In
357 * one-shot programs (i.e. the program runs and then quickly
358 * ends, thereby shutting down all connections), it is
359 * probably reasonable to establish a new connection for each
360 * share. In long-running applications, the limitation can be
361 * avoided by using only a single connection to each server,
362 * and issuing a new TREE CONNECT when the share is accessed.
364 smbc_bool
365 smbc_getOptionOneSharePerServer(SMBCCTX *c)
367 return c->options.one_share_per_server;
371 * Set whether to use the same connection for all shares on a server.
373 * Some Windows versions appear to have a limit to the number
374 * of concurrent SESSIONs and/or TREE CONNECTions. In
375 * one-shot programs (i.e. the program runs and then quickly
376 * ends, thereby shutting down all connections), it is
377 * probably reasonable to establish a new connection for each
378 * share. In long-running applications, the limitation can be
379 * avoided by using only a single connection to each server,
380 * and issuing a new TREE CONNECT when the share is accessed.
382 void
383 smbc_setOptionOneSharePerServer(SMBCCTX *c, smbc_bool b)
385 c->options.one_share_per_server = b;
388 /** Get whether to enable use of kerberos */
389 smbc_bool
390 smbc_getOptionUseKerberos(SMBCCTX *c)
392 return c->flags & SMB_CTX_FLAG_USE_KERBEROS ? True : False;
395 /** Set whether to enable use of kerberos */
396 void
397 smbc_setOptionUseKerberos(SMBCCTX *c, smbc_bool b)
399 if (b) {
400 c->flags |= SMB_CTX_FLAG_USE_KERBEROS;
401 } else {
402 c->flags &= ~SMB_CTX_FLAG_USE_KERBEROS;
406 /** Get whether to fallback after kerberos */
407 smbc_bool
408 smbc_getOptionFallbackAfterKerberos(SMBCCTX *c)
410 return c->flags & SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS ? True : False;
413 /** Set whether to fallback after kerberos */
414 void
415 smbc_setOptionFallbackAfterKerberos(SMBCCTX *c, smbc_bool b)
417 if (b) {
418 c->flags |= SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS;
419 } else {
420 c->flags &= ~SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS;
424 /** Get whether to automatically select anonymous login */
425 smbc_bool
426 smbc_getOptionNoAutoAnonymousLogin(SMBCCTX *c)
428 return c->flags & SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON ? True : False;
431 /** Set whether to automatically select anonymous login */
432 void
433 smbc_setOptionNoAutoAnonymousLogin(SMBCCTX *c, smbc_bool b)
435 if (b) {
436 c->flags |= SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON;
437 } else {
438 c->flags &= ~SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON;
442 /** Get whether to enable use of kerberos */
443 smbc_bool
444 smbc_getOptionUseCCache(SMBCCTX *c)
446 return c->flags & SMB_CTX_FLAG_USE_CCACHE ? True : False;
449 /** Set whether to enable use of kerberos */
450 void
451 smbc_setOptionUseCCache(SMBCCTX *c, smbc_bool b)
453 if (b) {
454 c->flags |= SMB_CTX_FLAG_USE_CCACHE;
455 } else {
456 c->flags &= ~SMB_CTX_FLAG_USE_CCACHE;
460 /** Get whether to enable use of the winbind ccache */
461 smbc_bool
462 smbc_getOptionUseNTHash(SMBCCTX *c)
464 return (c->flags & SMB_CTX_FLAG_USE_NT_HASH) != 0;
467 /** Set indication that the password supplied is the NT hash */
468 void
469 smbc_setOptionUseNTHash(SMBCCTX *c, smbc_bool b)
471 if (b) {
472 c->flags |= SMB_CTX_FLAG_USE_NT_HASH;
473 } else {
474 c->flags &= ~SMB_CTX_FLAG_USE_NT_HASH;
478 /** Get the function for obtaining authentication data */
479 smbc_get_auth_data_fn
480 smbc_getFunctionAuthData(SMBCCTX *c)
482 return c->callbacks.auth_fn;
485 /** Set the function for obtaining authentication data */
486 void
487 smbc_setFunctionAuthData(SMBCCTX *c, smbc_get_auth_data_fn fn)
489 c->internal->auth_fn_with_context = NULL;
490 c->callbacks.auth_fn = fn;
493 /** Get the new-style authentication function which includes the context. */
494 smbc_get_auth_data_with_context_fn
495 smbc_getFunctionAuthDataWithContext(SMBCCTX *c)
497 return c->internal->auth_fn_with_context;
500 /** Set the new-style authentication function which includes the context. */
501 void
502 smbc_setFunctionAuthDataWithContext(SMBCCTX *c,
503 smbc_get_auth_data_with_context_fn fn)
505 c->callbacks.auth_fn = NULL;
506 c->internal->auth_fn_with_context = fn;
509 /** Get the function for checking if a server is still good */
510 smbc_check_server_fn
511 smbc_getFunctionCheckServer(SMBCCTX *c)
513 return c->callbacks.check_server_fn;
516 /** Set the function for checking if a server is still good */
517 void
518 smbc_setFunctionCheckServer(SMBCCTX *c, smbc_check_server_fn fn)
520 c->callbacks.check_server_fn = fn;
523 /** Get the function for removing a server if unused */
524 smbc_remove_unused_server_fn
525 smbc_getFunctionRemoveUnusedServer(SMBCCTX *c)
527 return c->callbacks.remove_unused_server_fn;
530 /** Set the function for removing a server if unused */
531 void
532 smbc_setFunctionRemoveUnusedServer(SMBCCTX *c,
533 smbc_remove_unused_server_fn fn)
535 c->callbacks.remove_unused_server_fn = fn;
538 /** Get the function for adding a cached server */
539 smbc_add_cached_srv_fn
540 smbc_getFunctionAddCachedServer(SMBCCTX *c)
542 return c->callbacks.add_cached_srv_fn;
545 /** Set the function for adding a cached server */
546 void
547 smbc_setFunctionAddCachedServer(SMBCCTX *c, smbc_add_cached_srv_fn fn)
549 c->callbacks.add_cached_srv_fn = fn;
552 /** Get the function for server cache lookup */
553 smbc_get_cached_srv_fn
554 smbc_getFunctionGetCachedServer(SMBCCTX *c)
556 return c->callbacks.get_cached_srv_fn;
559 /** Set the function for server cache lookup */
560 void
561 smbc_setFunctionGetCachedServer(SMBCCTX *c, smbc_get_cached_srv_fn fn)
563 c->callbacks.get_cached_srv_fn = fn;
566 /** Get the function for server cache removal */
567 smbc_remove_cached_srv_fn
568 smbc_getFunctionRemoveCachedServer(SMBCCTX *c)
570 return c->callbacks.remove_cached_srv_fn;
573 /** Set the function for server cache removal */
574 void
575 smbc_setFunctionRemoveCachedServer(SMBCCTX *c,
576 smbc_remove_cached_srv_fn fn)
578 c->callbacks.remove_cached_srv_fn = fn;
582 * Get the function for server cache purging. This function tries to
583 * remove all cached servers (e.g. on disconnect)
585 smbc_purge_cached_fn
586 smbc_getFunctionPurgeCachedServers(SMBCCTX *c)
588 return c->callbacks.purge_cached_fn;
591 /** Set the function to store private data of the server cache */
592 void smbc_setServerCacheData(SMBCCTX *c, struct smbc_server_cache * cache)
594 c->internal->server_cache = cache;
597 /** Get the function to store private data of the server cache */
598 struct smbc_server_cache * smbc_getServerCacheData(SMBCCTX *c)
600 return c->internal->server_cache;
605 * Set the function for server cache purging. This function tries to
606 * remove all cached servers (e.g. on disconnect)
608 void
609 smbc_setFunctionPurgeCachedServers(SMBCCTX *c, smbc_purge_cached_fn fn)
611 c->callbacks.purge_cached_fn = fn;
615 * Callable functions for files.
618 smbc_open_fn
619 smbc_getFunctionOpen(SMBCCTX *c)
621 return c->open;
624 void
625 smbc_setFunctionOpen(SMBCCTX *c, smbc_open_fn fn)
627 c->open = fn;
630 smbc_creat_fn
631 smbc_getFunctionCreat(SMBCCTX *c)
633 return c->creat;
636 void
637 smbc_setFunctionCreat(SMBCCTX *c, smbc_creat_fn fn)
639 c->creat = fn;
642 smbc_read_fn
643 smbc_getFunctionRead(SMBCCTX *c)
645 return c->read;
648 void
649 smbc_setFunctionRead(SMBCCTX *c, smbc_read_fn fn)
651 c->read = fn;
654 smbc_write_fn
655 smbc_getFunctionWrite(SMBCCTX *c)
657 return c->write;
660 void
661 smbc_setFunctionWrite(SMBCCTX *c, smbc_write_fn fn)
663 c->write = fn;
666 smbc_unlink_fn
667 smbc_getFunctionUnlink(SMBCCTX *c)
669 return c->unlink;
672 void
673 smbc_setFunctionUnlink(SMBCCTX *c, smbc_unlink_fn fn)
675 c->unlink = fn;
678 smbc_rename_fn
679 smbc_getFunctionRename(SMBCCTX *c)
681 return c->rename;
684 void
685 smbc_setFunctionRename(SMBCCTX *c, smbc_rename_fn fn)
687 c->rename = fn;
690 smbc_lseek_fn
691 smbc_getFunctionLseek(SMBCCTX *c)
693 return c->lseek;
696 void
697 smbc_setFunctionLseek(SMBCCTX *c, smbc_lseek_fn fn)
699 c->lseek = fn;
702 smbc_stat_fn
703 smbc_getFunctionStat(SMBCCTX *c)
705 return c->stat;
708 void
709 smbc_setFunctionStat(SMBCCTX *c, smbc_stat_fn fn)
711 c->stat = fn;
714 smbc_fstat_fn
715 smbc_getFunctionFstat(SMBCCTX *c)
717 return c->fstat;
720 void
721 smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn)
723 c->fstat = fn;
726 smbc_statvfs_fn
727 smbc_getFunctionStatVFS(SMBCCTX *c)
729 return c->internal->posix_emu.statvfs_fn;
732 void
733 smbc_setFunctionStatVFS(SMBCCTX *c, smbc_statvfs_fn fn)
735 c->internal->posix_emu.statvfs_fn = fn;
738 smbc_fstatvfs_fn
739 smbc_getFunctionFstatVFS(SMBCCTX *c)
741 return c->internal->posix_emu.fstatvfs_fn;
744 void
745 smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn)
747 c->internal->posix_emu.fstatvfs_fn = fn;
750 smbc_ftruncate_fn
751 smbc_getFunctionFtruncate(SMBCCTX *c)
753 return c->internal->posix_emu.ftruncate_fn;
756 void
757 smbc_setFunctionFtruncate(SMBCCTX *c, smbc_ftruncate_fn fn)
759 c->internal->posix_emu.ftruncate_fn = fn;
762 smbc_close_fn
763 smbc_getFunctionClose(SMBCCTX *c)
765 return c->close_fn;
768 void
769 smbc_setFunctionClose(SMBCCTX *c, smbc_close_fn fn)
771 c->close_fn = fn;
776 * Callable functions for directories.
779 smbc_opendir_fn
780 smbc_getFunctionOpendir(SMBCCTX *c)
782 return c->opendir;
785 void
786 smbc_setFunctionOpendir(SMBCCTX *c, smbc_opendir_fn fn)
788 c->opendir = fn;
791 smbc_closedir_fn
792 smbc_getFunctionClosedir(SMBCCTX *c)
794 return c->closedir;
797 void
798 smbc_setFunctionClosedir(SMBCCTX *c, smbc_closedir_fn fn)
800 c->closedir = fn;
803 smbc_readdir_fn
804 smbc_getFunctionReaddir(SMBCCTX *c)
806 return c->readdir;
809 void
810 smbc_setFunctionReaddir(SMBCCTX *c, smbc_readdir_fn fn)
812 c->readdir = fn;
815 smbc_getdents_fn
816 smbc_getFunctionGetdents(SMBCCTX *c)
818 return c->getdents;
821 void
822 smbc_setFunctionGetdents(SMBCCTX *c, smbc_getdents_fn fn)
824 c->getdents = fn;
827 smbc_mkdir_fn
828 smbc_getFunctionMkdir(SMBCCTX *c)
830 return c->mkdir;
833 void
834 smbc_setFunctionMkdir(SMBCCTX *c, smbc_mkdir_fn fn)
836 c->mkdir = fn;
839 smbc_rmdir_fn
840 smbc_getFunctionRmdir(SMBCCTX *c)
842 return c->rmdir;
845 void
846 smbc_setFunctionRmdir(SMBCCTX *c, smbc_rmdir_fn fn)
848 c->rmdir = fn;
851 smbc_telldir_fn
852 smbc_getFunctionTelldir(SMBCCTX *c)
854 return c->telldir;
857 void
858 smbc_setFunctionTelldir(SMBCCTX *c, smbc_telldir_fn fn)
860 c->telldir = fn;
863 smbc_lseekdir_fn
864 smbc_getFunctionLseekdir(SMBCCTX *c)
866 return c->lseekdir;
869 void
870 smbc_setFunctionLseekdir(SMBCCTX *c, smbc_lseekdir_fn fn)
872 c->lseekdir = fn;
875 smbc_fstatdir_fn
876 smbc_getFunctionFstatdir(SMBCCTX *c)
878 return c->fstatdir;
881 void
882 smbc_setFunctionFstatdir(SMBCCTX *c, smbc_fstatdir_fn fn)
884 c->fstatdir = fn;
889 * Callable functions applicable to both files and directories.
892 smbc_chmod_fn
893 smbc_getFunctionChmod(SMBCCTX *c)
895 return c->chmod;
898 void
899 smbc_setFunctionChmod(SMBCCTX *c, smbc_chmod_fn fn)
901 c->chmod = fn;
904 smbc_utimes_fn
905 smbc_getFunctionUtimes(SMBCCTX *c)
907 return c->utimes;
910 void
911 smbc_setFunctionUtimes(SMBCCTX *c, smbc_utimes_fn fn)
913 c->utimes = fn;
916 smbc_setxattr_fn
917 smbc_getFunctionSetxattr(SMBCCTX *c)
919 return c->setxattr;
922 void
923 smbc_setFunctionSetxattr(SMBCCTX *c, smbc_setxattr_fn fn)
925 c->setxattr = fn;
928 smbc_getxattr_fn
929 smbc_getFunctionGetxattr(SMBCCTX *c)
931 return c->getxattr;
934 void
935 smbc_setFunctionGetxattr(SMBCCTX *c, smbc_getxattr_fn fn)
937 c->getxattr = fn;
940 smbc_removexattr_fn
941 smbc_getFunctionRemovexattr(SMBCCTX *c)
943 return c->removexattr;
946 void
947 smbc_setFunctionRemovexattr(SMBCCTX *c, smbc_removexattr_fn fn)
949 c->removexattr = fn;
952 smbc_listxattr_fn
953 smbc_getFunctionListxattr(SMBCCTX *c)
955 return c->listxattr;
958 void
959 smbc_setFunctionListxattr(SMBCCTX *c, smbc_listxattr_fn fn)
961 c->listxattr = fn;
966 * Callable functions related to printing
969 smbc_print_file_fn
970 smbc_getFunctionPrintFile(SMBCCTX *c)
972 return c->print_file;
975 void
976 smbc_setFunctionPrintFile(SMBCCTX *c, smbc_print_file_fn fn)
978 c->print_file = fn;
981 smbc_open_print_job_fn
982 smbc_getFunctionOpenPrintJob(SMBCCTX *c)
984 return c->open_print_job;
987 void
988 smbc_setFunctionOpenPrintJob(SMBCCTX *c,
989 smbc_open_print_job_fn fn)
991 c->open_print_job = fn;
994 smbc_list_print_jobs_fn
995 smbc_getFunctionListPrintJobs(SMBCCTX *c)
997 return c->list_print_jobs;
1000 void
1001 smbc_setFunctionListPrintJobs(SMBCCTX *c,
1002 smbc_list_print_jobs_fn fn)
1004 c->list_print_jobs = fn;
1007 smbc_unlink_print_job_fn
1008 smbc_getFunctionUnlinkPrintJob(SMBCCTX *c)
1010 return c->unlink_print_job;
1013 void
1014 smbc_setFunctionUnlinkPrintJob(SMBCCTX *c,
1015 smbc_unlink_print_job_fn fn)
1017 c->unlink_print_job = fn;