s3-debug Remove last direct assignements to DEBUGLEVEL
[Samba/gebeck_regimport.git] / source3 / libsmb / libsmb_setget.c
blobf2f5aec6c46ff59052a45d4ed5d6cb361efbdb4d
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 return c->internal->debug_stderr;
126 /** Set whether to log to standard error instead of standard output */
127 void
128 smbc_setOptionDebugToStderr(SMBCCTX *c, smbc_bool b)
130 c->internal->debug_stderr = b;
134 * Get whether to use new-style time attribute names, e.g. WRITE_TIME rather
135 * than the old-style names such as M_TIME. This allows also setting/getting
136 * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME
137 * was supposed to be CHANGE_TIME but was confused and sometimes referred to
138 * CREATE_TIME.)
140 smbc_bool
141 smbc_getOptionFullTimeNames(SMBCCTX *c)
143 return c->internal->full_time_names;
147 * Set whether to use new-style time attribute names, e.g. WRITE_TIME rather
148 * than the old-style names such as M_TIME. This allows also setting/getting
149 * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME
150 * was supposed to be CHANGE_TIME but was confused and sometimes referred to
151 * CREATE_TIME.)
153 void
154 smbc_setOptionFullTimeNames(SMBCCTX *c, smbc_bool b)
156 c->internal->full_time_names = b;
160 * Get the share mode to use for files opened with SMBC_open_ctx(). The
161 * default is SMBC_SHAREMODE_DENY_NONE.
163 smbc_share_mode
164 smbc_getOptionOpenShareMode(SMBCCTX *c)
166 return c->internal->share_mode;
170 * Set the share mode to use for files opened with SMBC_open_ctx(). The
171 * default is SMBC_SHAREMODE_DENY_NONE.
173 void
174 smbc_setOptionOpenShareMode(SMBCCTX *c, smbc_share_mode share_mode)
176 c->internal->share_mode = share_mode;
179 /** Retrieve a previously set user data handle */
180 void *
181 smbc_getOptionUserData(SMBCCTX *c)
183 return c->internal->user_data;
186 /** Save a user data handle */
187 void
188 smbc_setOptionUserData(SMBCCTX *c, void *user_data)
190 c->internal->user_data = user_data;
193 /** Get the encoded value for encryption level. */
194 smbc_smb_encrypt_level
195 smbc_getOptionSmbEncryptionLevel(SMBCCTX *c)
197 return c->internal->smb_encryption_level;
200 /** Set the encoded value for encryption level. */
201 void
202 smbc_setOptionSmbEncryptionLevel(SMBCCTX *c, smbc_smb_encrypt_level level)
204 c->internal->smb_encryption_level = level;
208 * Get whether to treat file names as case-sensitive if we can't determine
209 * when connecting to the remote share whether the file system is case
210 * sensitive. This defaults to FALSE since it's most likely that if we can't
211 * retrieve the file system attributes, it's a very old file system that does
212 * not support case sensitivity.
214 smbc_bool
215 smbc_getOptionCaseSensitive(SMBCCTX *c)
217 return c->internal->case_sensitive;
221 * Set whether to treat file names as case-sensitive if we can't determine
222 * when connecting to the remote share whether the file system is case
223 * sensitive. This defaults to FALSE since it's most likely that if we can't
224 * retrieve the file system attributes, it's a very old file system that does
225 * not support case sensitivity.
227 void
228 smbc_setOptionCaseSensitive(SMBCCTX *c, smbc_bool b)
230 c->internal->case_sensitive = b;
234 * Get from how many local master browsers should the list of workgroups be
235 * retrieved. It can take up to 12 minutes or longer after a server becomes a
236 * local master browser, for it to have the entire browse list (the list of
237 * workgroups/domains) from an entire network. Since a client never knows
238 * which local master browser will be found first, the one which is found
239 * first and used to retrieve a browse list may have an incomplete or empty
240 * browse list. By requesting the browse list from multiple local master
241 * browsers, a more complete list can be generated. For small networks (few
242 * workgroups), it is recommended that this value be set to 0, causing the
243 * browse lists from all found local master browsers to be retrieved and
244 * merged. For networks with many workgroups, a suitable value for this
245 * variable is probably somewhere around 3. (Default: 3).
248 smbc_getOptionBrowseMaxLmbCount(SMBCCTX *c)
250 return c->options.browse_max_lmb_count;
254 * Set from how many local master browsers should the list of workgroups be
255 * retrieved. It can take up to 12 minutes or longer after a server becomes a
256 * local master browser, for it to have the entire browse list (the list of
257 * workgroups/domains) from an entire network. Since a client never knows
258 * which local master browser will be found first, the one which is found
259 * first and used to retrieve a browse list may have an incomplete or empty
260 * browse list. By requesting the browse list from multiple local master
261 * browsers, a more complete list can be generated. For small networks (few
262 * workgroups), it is recommended that this value be set to 0, causing the
263 * browse lists from all found local master browsers to be retrieved and
264 * merged. For networks with many workgroups, a suitable value for this
265 * variable is probably somewhere around 3. (Default: 3).
267 void
268 smbc_setOptionBrowseMaxLmbCount(SMBCCTX *c, int count)
270 c->options.browse_max_lmb_count = count;
274 * Get whether to url-encode readdir entries.
276 * There is a difference in the desired return strings from
277 * smbc_readdir() depending upon whether the filenames are to
278 * be displayed to the user, or whether they are to be
279 * appended to the path name passed to smbc_opendir() to call
280 * a further smbc_ function (e.g. open the file with
281 * smbc_open()). In the former case, the filename should be
282 * in "human readable" form. In the latter case, the smbc_
283 * functions expect a URL which must be url-encoded. Those
284 * functions decode the URL. If, for example, smbc_readdir()
285 * returned a file name of "abc%20def.txt", passing a path
286 * with this file name attached to smbc_open() would cause
287 * smbc_open to attempt to open the file "abc def.txt" since
288 * the %20 is decoded into a space.
290 * Set this option to True if the names returned by
291 * smbc_readdir() should be url-encoded such that they can be
292 * passed back to another smbc_ call. Set it to False if the
293 * names returned by smbc_readdir() are to be presented to the
294 * user.
296 * For backwards compatibility, this option defaults to False.
298 smbc_bool
299 smbc_getOptionUrlEncodeReaddirEntries(SMBCCTX *c)
301 return c->options.urlencode_readdir_entries;
305 * Set whether to url-encode readdir entries.
307 * There is a difference in the desired return strings from
308 * smbc_readdir() depending upon whether the filenames are to
309 * be displayed to the user, or whether they are to be
310 * appended to the path name passed to smbc_opendir() to call
311 * a further smbc_ function (e.g. open the file with
312 * smbc_open()). In the former case, the filename should be
313 * in "human readable" form. In the latter case, the smbc_
314 * functions expect a URL which must be url-encoded. Those
315 * functions decode the URL. If, for example, smbc_readdir()
316 * returned a file name of "abc%20def.txt", passing a path
317 * with this file name attached to smbc_open() would cause
318 * smbc_open to attempt to open the file "abc def.txt" since
319 * the %20 is decoded into a space.
321 * Set this option to True if the names returned by
322 * smbc_readdir() should be url-encoded such that they can be
323 * passed back to another smbc_ call. Set it to False if the
324 * names returned by smbc_readdir() are to be presented to the
325 * user.
327 * For backwards compatibility, this option defaults to False.
329 void
330 smbc_setOptionUrlEncodeReaddirEntries(SMBCCTX *c, smbc_bool b)
332 c->options.urlencode_readdir_entries = b;
336 * Get whether to use the same connection for all shares on a server.
338 * Some Windows versions appear to have a limit to the number
339 * of concurrent SESSIONs and/or TREE CONNECTions. In
340 * one-shot programs (i.e. the program runs and then quickly
341 * ends, thereby shutting down all connections), it is
342 * probably reasonable to establish a new connection for each
343 * share. In long-running applications, the limitation can be
344 * avoided by using only a single connection to each server,
345 * and issuing a new TREE CONNECT when the share is accessed.
347 smbc_bool
348 smbc_getOptionOneSharePerServer(SMBCCTX *c)
350 return c->options.one_share_per_server;
354 * Set whether to use the same connection for all shares on a server.
356 * Some Windows versions appear to have a limit to the number
357 * of concurrent SESSIONs and/or TREE CONNECTions. In
358 * one-shot programs (i.e. the program runs and then quickly
359 * ends, thereby shutting down all connections), it is
360 * probably reasonable to establish a new connection for each
361 * share. In long-running applications, the limitation can be
362 * avoided by using only a single connection to each server,
363 * and issuing a new TREE CONNECT when the share is accessed.
365 void
366 smbc_setOptionOneSharePerServer(SMBCCTX *c, smbc_bool b)
368 c->options.one_share_per_server = b;
371 /** Get whether to enable use of kerberos */
372 smbc_bool
373 smbc_getOptionUseKerberos(SMBCCTX *c)
375 return c->flags & SMB_CTX_FLAG_USE_KERBEROS ? True : False;
378 /** Set whether to enable use of kerberos */
379 void
380 smbc_setOptionUseKerberos(SMBCCTX *c, smbc_bool b)
382 if (b) {
383 c->flags |= SMB_CTX_FLAG_USE_KERBEROS;
384 } else {
385 c->flags &= ~SMB_CTX_FLAG_USE_KERBEROS;
389 /** Get whether to fallback after kerberos */
390 smbc_bool
391 smbc_getOptionFallbackAfterKerberos(SMBCCTX *c)
393 return c->flags & SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS ? True : False;
396 /** Set whether to fallback after kerberos */
397 void
398 smbc_setOptionFallbackAfterKerberos(SMBCCTX *c, smbc_bool b)
400 if (b) {
401 c->flags |= SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS;
402 } else {
403 c->flags &= ~SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS;
407 /** Get whether to automatically select anonymous login */
408 smbc_bool
409 smbc_getOptionNoAutoAnonymousLogin(SMBCCTX *c)
411 return c->flags & SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON ? True : False;
414 /** Set whether to automatically select anonymous login */
415 void
416 smbc_setOptionNoAutoAnonymousLogin(SMBCCTX *c, smbc_bool b)
418 if (b) {
419 c->flags |= SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON;
420 } else {
421 c->flags &= ~SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON;
425 /** Get whether to enable use of kerberos */
426 smbc_bool
427 smbc_getOptionUseCCache(SMBCCTX *c)
429 return c->flags & SMB_CTX_FLAG_USE_CCACHE ? True : False;
432 /** Set whether to enable use of kerberos */
433 void
434 smbc_setOptionUseCCache(SMBCCTX *c, smbc_bool b)
436 if (b) {
437 c->flags |= SMB_CTX_FLAG_USE_CCACHE;
438 } else {
439 c->flags &= ~SMB_CTX_FLAG_USE_CCACHE;
443 /** Get the function for obtaining authentication data */
444 smbc_get_auth_data_fn
445 smbc_getFunctionAuthData(SMBCCTX *c)
447 return c->callbacks.auth_fn;
450 /** Set the function for obtaining authentication data */
451 void
452 smbc_setFunctionAuthData(SMBCCTX *c, smbc_get_auth_data_fn fn)
454 c->internal->auth_fn_with_context = NULL;
455 c->callbacks.auth_fn = fn;
458 /** Get the new-style authentication function which includes the context. */
459 smbc_get_auth_data_with_context_fn
460 smbc_getFunctionAuthDataWithContext(SMBCCTX *c)
462 return c->internal->auth_fn_with_context;
465 /** Set the new-style authentication function which includes the context. */
466 void
467 smbc_setFunctionAuthDataWithContext(SMBCCTX *c,
468 smbc_get_auth_data_with_context_fn fn)
470 c->callbacks.auth_fn = NULL;
471 c->internal->auth_fn_with_context = fn;
474 /** Get the function for checking if a server is still good */
475 smbc_check_server_fn
476 smbc_getFunctionCheckServer(SMBCCTX *c)
478 return c->callbacks.check_server_fn;
481 /** Set the function for checking if a server is still good */
482 void
483 smbc_setFunctionCheckServer(SMBCCTX *c, smbc_check_server_fn fn)
485 c->callbacks.check_server_fn = fn;
488 /** Get the function for removing a server if unused */
489 smbc_remove_unused_server_fn
490 smbc_getFunctionRemoveUnusedServer(SMBCCTX *c)
492 return c->callbacks.remove_unused_server_fn;
495 /** Set the function for removing a server if unused */
496 void
497 smbc_setFunctionRemoveUnusedServer(SMBCCTX *c,
498 smbc_remove_unused_server_fn fn)
500 c->callbacks.remove_unused_server_fn = fn;
503 /** Get the function for adding a cached server */
504 smbc_add_cached_srv_fn
505 smbc_getFunctionAddCachedServer(SMBCCTX *c)
507 return c->callbacks.add_cached_srv_fn;
510 /** Set the function for adding a cached server */
511 void
512 smbc_setFunctionAddCachedServer(SMBCCTX *c, smbc_add_cached_srv_fn fn)
514 c->callbacks.add_cached_srv_fn = fn;
517 /** Get the function for server cache lookup */
518 smbc_get_cached_srv_fn
519 smbc_getFunctionGetCachedServer(SMBCCTX *c)
521 return c->callbacks.get_cached_srv_fn;
524 /** Set the function for server cache lookup */
525 void
526 smbc_setFunctionGetCachedServer(SMBCCTX *c, smbc_get_cached_srv_fn fn)
528 c->callbacks.get_cached_srv_fn = fn;
531 /** Get the function for server cache removal */
532 smbc_remove_cached_srv_fn
533 smbc_getFunctionRemoveCachedServer(SMBCCTX *c)
535 return c->callbacks.remove_cached_srv_fn;
538 /** Set the function for server cache removal */
539 void
540 smbc_setFunctionRemoveCachedServer(SMBCCTX *c,
541 smbc_remove_cached_srv_fn fn)
543 c->callbacks.remove_cached_srv_fn = fn;
547 * Get the function for server cache purging. This function tries to
548 * remove all cached servers (e.g. on disconnect)
550 smbc_purge_cached_fn
551 smbc_getFunctionPurgeCachedServers(SMBCCTX *c)
553 return c->callbacks.purge_cached_fn;
556 /** Set the function to store private data of the server cache */
557 void smbc_setServerCacheData(SMBCCTX *c, struct smbc_server_cache * cache)
559 c->internal->server_cache = cache;
562 /** Get the function to store private data of the server cache */
563 struct smbc_server_cache * smbc_getServerCacheData(SMBCCTX *c)
565 return c->internal->server_cache;
570 * Set the function for server cache purging. This function tries to
571 * remove all cached servers (e.g. on disconnect)
573 void
574 smbc_setFunctionPurgeCachedServers(SMBCCTX *c, smbc_purge_cached_fn fn)
576 c->callbacks.purge_cached_fn = fn;
580 * Callable functions for files.
583 smbc_open_fn
584 smbc_getFunctionOpen(SMBCCTX *c)
586 return c->open;
589 void
590 smbc_setFunctionOpen(SMBCCTX *c, smbc_open_fn fn)
592 c->open = fn;
595 smbc_creat_fn
596 smbc_getFunctionCreat(SMBCCTX *c)
598 return c->creat;
601 void
602 smbc_setFunctionCreat(SMBCCTX *c, smbc_creat_fn fn)
604 c->creat = fn;
607 smbc_read_fn
608 smbc_getFunctionRead(SMBCCTX *c)
610 return c->read;
613 void
614 smbc_setFunctionRead(SMBCCTX *c, smbc_read_fn fn)
616 c->read = fn;
619 smbc_write_fn
620 smbc_getFunctionWrite(SMBCCTX *c)
622 return c->write;
625 void
626 smbc_setFunctionWrite(SMBCCTX *c, smbc_write_fn fn)
628 c->write = fn;
631 smbc_unlink_fn
632 smbc_getFunctionUnlink(SMBCCTX *c)
634 return c->unlink;
637 void
638 smbc_setFunctionUnlink(SMBCCTX *c, smbc_unlink_fn fn)
640 c->unlink = fn;
643 smbc_rename_fn
644 smbc_getFunctionRename(SMBCCTX *c)
646 return c->rename;
649 void
650 smbc_setFunctionRename(SMBCCTX *c, smbc_rename_fn fn)
652 c->rename = fn;
655 smbc_lseek_fn
656 smbc_getFunctionLseek(SMBCCTX *c)
658 return c->lseek;
661 void
662 smbc_setFunctionLseek(SMBCCTX *c, smbc_lseek_fn fn)
664 c->lseek = fn;
667 smbc_stat_fn
668 smbc_getFunctionStat(SMBCCTX *c)
670 return c->stat;
673 void
674 smbc_setFunctionStat(SMBCCTX *c, smbc_stat_fn fn)
676 c->stat = fn;
679 smbc_fstat_fn
680 smbc_getFunctionFstat(SMBCCTX *c)
682 return c->fstat;
685 void
686 smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn)
688 c->fstat = fn;
691 smbc_statvfs_fn
692 smbc_getFunctionStatVFS(SMBCCTX *c)
694 return c->internal->posix_emu.statvfs_fn;
697 void
698 smbc_setFunctionStatVFS(SMBCCTX *c, smbc_statvfs_fn fn)
700 c->internal->posix_emu.statvfs_fn = fn;
703 smbc_fstatvfs_fn
704 smbc_getFunctionFstatVFS(SMBCCTX *c)
706 return c->internal->posix_emu.fstatvfs_fn;
709 void
710 smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn)
712 c->internal->posix_emu.fstatvfs_fn = fn;
715 smbc_ftruncate_fn
716 smbc_getFunctionFtruncate(SMBCCTX *c)
718 return c->internal->posix_emu.ftruncate_fn;
721 void
722 smbc_setFunctionFtruncate(SMBCCTX *c, smbc_ftruncate_fn fn)
724 c->internal->posix_emu.ftruncate_fn = fn;
727 smbc_close_fn
728 smbc_getFunctionClose(SMBCCTX *c)
730 return c->close_fn;
733 void
734 smbc_setFunctionClose(SMBCCTX *c, smbc_close_fn fn)
736 c->close_fn = fn;
741 * Callable functions for directories.
744 smbc_opendir_fn
745 smbc_getFunctionOpendir(SMBCCTX *c)
747 return c->opendir;
750 void
751 smbc_setFunctionOpendir(SMBCCTX *c, smbc_opendir_fn fn)
753 c->opendir = fn;
756 smbc_closedir_fn
757 smbc_getFunctionClosedir(SMBCCTX *c)
759 return c->closedir;
762 void
763 smbc_setFunctionClosedir(SMBCCTX *c, smbc_closedir_fn fn)
765 c->closedir = fn;
768 smbc_readdir_fn
769 smbc_getFunctionReaddir(SMBCCTX *c)
771 return c->readdir;
774 void
775 smbc_setFunctionReaddir(SMBCCTX *c, smbc_readdir_fn fn)
777 c->readdir = fn;
780 smbc_getdents_fn
781 smbc_getFunctionGetdents(SMBCCTX *c)
783 return c->getdents;
786 void
787 smbc_setFunctionGetdents(SMBCCTX *c, smbc_getdents_fn fn)
789 c->getdents = fn;
792 smbc_mkdir_fn
793 smbc_getFunctionMkdir(SMBCCTX *c)
795 return c->mkdir;
798 void
799 smbc_setFunctionMkdir(SMBCCTX *c, smbc_mkdir_fn fn)
801 c->mkdir = fn;
804 smbc_rmdir_fn
805 smbc_getFunctionRmdir(SMBCCTX *c)
807 return c->rmdir;
810 void
811 smbc_setFunctionRmdir(SMBCCTX *c, smbc_rmdir_fn fn)
813 c->rmdir = fn;
816 smbc_telldir_fn
817 smbc_getFunctionTelldir(SMBCCTX *c)
819 return c->telldir;
822 void
823 smbc_setFunctionTelldir(SMBCCTX *c, smbc_telldir_fn fn)
825 c->telldir = fn;
828 smbc_lseekdir_fn
829 smbc_getFunctionLseekdir(SMBCCTX *c)
831 return c->lseekdir;
834 void
835 smbc_setFunctionLseekdir(SMBCCTX *c, smbc_lseekdir_fn fn)
837 c->lseekdir = fn;
840 smbc_fstatdir_fn
841 smbc_getFunctionFstatdir(SMBCCTX *c)
843 return c->fstatdir;
846 void
847 smbc_setFunctionFstatdir(SMBCCTX *c, smbc_fstatdir_fn fn)
849 c->fstatdir = fn;
854 * Callable functions applicable to both files and directories.
857 smbc_chmod_fn
858 smbc_getFunctionChmod(SMBCCTX *c)
860 return c->chmod;
863 void
864 smbc_setFunctionChmod(SMBCCTX *c, smbc_chmod_fn fn)
866 c->chmod = fn;
869 smbc_utimes_fn
870 smbc_getFunctionUtimes(SMBCCTX *c)
872 return c->utimes;
875 void
876 smbc_setFunctionUtimes(SMBCCTX *c, smbc_utimes_fn fn)
878 c->utimes = fn;
881 smbc_setxattr_fn
882 smbc_getFunctionSetxattr(SMBCCTX *c)
884 return c->setxattr;
887 void
888 smbc_setFunctionSetxattr(SMBCCTX *c, smbc_setxattr_fn fn)
890 c->setxattr = fn;
893 smbc_getxattr_fn
894 smbc_getFunctionGetxattr(SMBCCTX *c)
896 return c->getxattr;
899 void
900 smbc_setFunctionGetxattr(SMBCCTX *c, smbc_getxattr_fn fn)
902 c->getxattr = fn;
905 smbc_removexattr_fn
906 smbc_getFunctionRemovexattr(SMBCCTX *c)
908 return c->removexattr;
911 void
912 smbc_setFunctionRemovexattr(SMBCCTX *c, smbc_removexattr_fn fn)
914 c->removexattr = fn;
917 smbc_listxattr_fn
918 smbc_getFunctionListxattr(SMBCCTX *c)
920 return c->listxattr;
923 void
924 smbc_setFunctionListxattr(SMBCCTX *c, smbc_listxattr_fn fn)
926 c->listxattr = fn;
931 * Callable functions related to printing
934 smbc_print_file_fn
935 smbc_getFunctionPrintFile(SMBCCTX *c)
937 return c->print_file;
940 void
941 smbc_setFunctionPrintFile(SMBCCTX *c, smbc_print_file_fn fn)
943 c->print_file = fn;
946 smbc_open_print_job_fn
947 smbc_getFunctionOpenPrintJob(SMBCCTX *c)
949 return c->open_print_job;
952 void
953 smbc_setFunctionOpenPrintJob(SMBCCTX *c,
954 smbc_open_print_job_fn fn)
956 c->open_print_job = fn;
959 smbc_list_print_jobs_fn
960 smbc_getFunctionListPrintJobs(SMBCCTX *c)
962 return c->list_print_jobs;
965 void
966 smbc_setFunctionListPrintJobs(SMBCCTX *c,
967 smbc_list_print_jobs_fn fn)
969 c->list_print_jobs = fn;
972 smbc_unlink_print_job_fn
973 smbc_getFunctionUnlinkPrintJob(SMBCCTX *c)
975 return c->unlink_print_job;
978 void
979 smbc_setFunctionUnlinkPrintJob(SMBCCTX *c,
980 smbc_unlink_print_job_fn fn)
982 c->unlink_print_job = fn;