s4-smb: Migrate named_pipe_server to tsocket.
[Samba/ekacnet.git] / source3 / libsmb / libsmb_setget.c
blob20835781ec06d6c0af9333d6e1151ce4fe9ecc78
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 c->debug = debug;
94 DEBUGLEVEL = debug;
97 /**
98 * Get the timeout used for waiting on connections and response data
99 * (in milliseconds)
102 smbc_getTimeout(SMBCCTX *c)
104 return c->timeout;
108 * Set the timeout used for waiting on connections and response data
109 * (in milliseconds)
111 void
112 smbc_setTimeout(SMBCCTX *c, int timeout)
114 c->timeout = timeout;
117 /** Get whether to log to standard error instead of standard output */
118 smbc_bool
119 smbc_getOptionDebugToStderr(SMBCCTX *c)
121 return c->internal->debug_stderr;
124 /** Set whether to log to standard error instead of standard output */
125 void
126 smbc_setOptionDebugToStderr(SMBCCTX *c, smbc_bool b)
128 c->internal->debug_stderr = b;
132 * Get whether to use new-style time attribute names, e.g. WRITE_TIME rather
133 * than the old-style names such as M_TIME. This allows also setting/getting
134 * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME
135 * was supposed to be CHANGE_TIME but was confused and sometimes referred to
136 * CREATE_TIME.)
138 smbc_bool
139 smbc_getOptionFullTimeNames(SMBCCTX *c)
141 return c->internal->full_time_names;
145 * Set whether to use new-style time attribute names, e.g. WRITE_TIME rather
146 * than the old-style names such as M_TIME. This allows also setting/getting
147 * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME
148 * was supposed to be CHANGE_TIME but was confused and sometimes referred to
149 * CREATE_TIME.)
151 void
152 smbc_setOptionFullTimeNames(SMBCCTX *c, smbc_bool b)
154 c->internal->full_time_names = b;
158 * Get the share mode to use for files opened with SMBC_open_ctx(). The
159 * default is SMBC_SHAREMODE_DENY_NONE.
161 smbc_share_mode
162 smbc_getOptionOpenShareMode(SMBCCTX *c)
164 return c->internal->share_mode;
168 * Set the share mode to use for files opened with SMBC_open_ctx(). The
169 * default is SMBC_SHAREMODE_DENY_NONE.
171 void
172 smbc_setOptionOpenShareMode(SMBCCTX *c, smbc_share_mode share_mode)
174 c->internal->share_mode = share_mode;
177 /** Retrieve a previously set user data handle */
178 void *
179 smbc_getOptionUserData(SMBCCTX *c)
181 return c->internal->user_data;
184 /** Save a user data handle */
185 void
186 smbc_setOptionUserData(SMBCCTX *c, void *user_data)
188 c->internal->user_data = user_data;
191 /** Get the encoded value for encryption level. */
192 smbc_smb_encrypt_level
193 smbc_getOptionSmbEncryptionLevel(SMBCCTX *c)
195 return c->internal->smb_encryption_level;
198 /** Set the encoded value for encryption level. */
199 void
200 smbc_setOptionSmbEncryptionLevel(SMBCCTX *c, smbc_smb_encrypt_level level)
202 c->internal->smb_encryption_level = level;
206 * Get whether to treat file names as case-sensitive if we can't determine
207 * when connecting to the remote share whether the file system is case
208 * sensitive. This defaults to FALSE since it's most likely that if we can't
209 * retrieve the file system attributes, it's a very old file system that does
210 * not support case sensitivity.
212 smbc_bool
213 smbc_getOptionCaseSensitive(SMBCCTX *c)
215 return c->internal->case_sensitive;
219 * Set whether to treat file names as case-sensitive if we can't determine
220 * when connecting to the remote share whether the file system is case
221 * sensitive. This defaults to FALSE since it's most likely that if we can't
222 * retrieve the file system attributes, it's a very old file system that does
223 * not support case sensitivity.
225 void
226 smbc_setOptionCaseSensitive(SMBCCTX *c, smbc_bool b)
228 c->internal->case_sensitive = b;
232 * Get from how many local master browsers should the list of workgroups be
233 * retrieved. It can take up to 12 minutes or longer after a server becomes a
234 * local master browser, for it to have the entire browse list (the list of
235 * workgroups/domains) from an entire network. Since a client never knows
236 * which local master browser will be found first, the one which is found
237 * first and used to retrieve a browse list may have an incomplete or empty
238 * browse list. By requesting the browse list from multiple local master
239 * browsers, a more complete list can be generated. For small networks (few
240 * workgroups), it is recommended that this value be set to 0, causing the
241 * browse lists from all found local master browsers to be retrieved and
242 * merged. For networks with many workgroups, a suitable value for this
243 * variable is probably somewhere around 3. (Default: 3).
246 smbc_getOptionBrowseMaxLmbCount(SMBCCTX *c)
248 return c->options.browse_max_lmb_count;
252 * Set from how many local master browsers should the list of workgroups be
253 * retrieved. It can take up to 12 minutes or longer after a server becomes a
254 * local master browser, for it to have the entire browse list (the list of
255 * workgroups/domains) from an entire network. Since a client never knows
256 * which local master browser will be found first, the one which is found
257 * first and used to retrieve a browse list may have an incomplete or empty
258 * browse list. By requesting the browse list from multiple local master
259 * browsers, a more complete list can be generated. For small networks (few
260 * workgroups), it is recommended that this value be set to 0, causing the
261 * browse lists from all found local master browsers to be retrieved and
262 * merged. For networks with many workgroups, a suitable value for this
263 * variable is probably somewhere around 3. (Default: 3).
265 void
266 smbc_setOptionBrowseMaxLmbCount(SMBCCTX *c, int count)
268 c->options.browse_max_lmb_count = count;
272 * Get whether to url-encode readdir entries.
274 * There is a difference in the desired return strings from
275 * smbc_readdir() depending upon whether the filenames are to
276 * be displayed to the user, or whether they are to be
277 * appended to the path name passed to smbc_opendir() to call
278 * a further smbc_ function (e.g. open the file with
279 * smbc_open()). In the former case, the filename should be
280 * in "human readable" form. In the latter case, the smbc_
281 * functions expect a URL which must be url-encoded. Those
282 * functions decode the URL. If, for example, smbc_readdir()
283 * returned a file name of "abc%20def.txt", passing a path
284 * with this file name attached to smbc_open() would cause
285 * smbc_open to attempt to open the file "abc def.txt" since
286 * the %20 is decoded into a space.
288 * Set this option to True if the names returned by
289 * smbc_readdir() should be url-encoded such that they can be
290 * passed back to another smbc_ call. Set it to False if the
291 * names returned by smbc_readdir() are to be presented to the
292 * user.
294 * For backwards compatibility, this option defaults to False.
296 smbc_bool
297 smbc_getOptionUrlEncodeReaddirEntries(SMBCCTX *c)
299 return c->options.urlencode_readdir_entries;
303 * Set whether to url-encode readdir entries.
305 * There is a difference in the desired return strings from
306 * smbc_readdir() depending upon whether the filenames are to
307 * be displayed to the user, or whether they are to be
308 * appended to the path name passed to smbc_opendir() to call
309 * a further smbc_ function (e.g. open the file with
310 * smbc_open()). In the former case, the filename should be
311 * in "human readable" form. In the latter case, the smbc_
312 * functions expect a URL which must be url-encoded. Those
313 * functions decode the URL. If, for example, smbc_readdir()
314 * returned a file name of "abc%20def.txt", passing a path
315 * with this file name attached to smbc_open() would cause
316 * smbc_open to attempt to open the file "abc def.txt" since
317 * the %20 is decoded into a space.
319 * Set this option to True if the names returned by
320 * smbc_readdir() should be url-encoded such that they can be
321 * passed back to another smbc_ call. Set it to False if the
322 * names returned by smbc_readdir() are to be presented to the
323 * user.
325 * For backwards compatibility, this option defaults to False.
327 void
328 smbc_setOptionUrlEncodeReaddirEntries(SMBCCTX *c, smbc_bool b)
330 c->options.urlencode_readdir_entries = b;
334 * Get whether to use the same connection for all shares on a server.
336 * Some Windows versions appear to have a limit to the number
337 * of concurrent SESSIONs and/or TREE CONNECTions. In
338 * one-shot programs (i.e. the program runs and then quickly
339 * ends, thereby shutting down all connections), it is
340 * probably reasonable to establish a new connection for each
341 * share. In long-running applications, the limitation can be
342 * avoided by using only a single connection to each server,
343 * and issuing a new TREE CONNECT when the share is accessed.
345 smbc_bool
346 smbc_getOptionOneSharePerServer(SMBCCTX *c)
348 return c->options.one_share_per_server;
352 * Set whether to use the same connection for all shares on a server.
354 * Some Windows versions appear to have a limit to the number
355 * of concurrent SESSIONs and/or TREE CONNECTions. In
356 * one-shot programs (i.e. the program runs and then quickly
357 * ends, thereby shutting down all connections), it is
358 * probably reasonable to establish a new connection for each
359 * share. In long-running applications, the limitation can be
360 * avoided by using only a single connection to each server,
361 * and issuing a new TREE CONNECT when the share is accessed.
363 void
364 smbc_setOptionOneSharePerServer(SMBCCTX *c, smbc_bool b)
366 c->options.one_share_per_server = b;
369 /** Get whether to enable use of kerberos */
370 smbc_bool
371 smbc_getOptionUseKerberos(SMBCCTX *c)
373 return c->flags & SMB_CTX_FLAG_USE_KERBEROS ? True : False;
376 /** Set whether to enable use of kerberos */
377 void
378 smbc_setOptionUseKerberos(SMBCCTX *c, smbc_bool b)
380 if (b) {
381 c->flags |= SMB_CTX_FLAG_USE_KERBEROS;
382 } else {
383 c->flags &= ~SMB_CTX_FLAG_USE_KERBEROS;
387 /** Get whether to fallback after kerberos */
388 smbc_bool
389 smbc_getOptionFallbackAfterKerberos(SMBCCTX *c)
391 return c->flags & SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS ? True : False;
394 /** Set whether to fallback after kerberos */
395 void
396 smbc_setOptionFallbackAfterKerberos(SMBCCTX *c, smbc_bool b)
398 if (b) {
399 c->flags |= SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS;
400 } else {
401 c->flags &= ~SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS;
405 /** Get whether to automatically select anonymous login */
406 smbc_bool
407 smbc_getOptionNoAutoAnonymousLogin(SMBCCTX *c)
409 return c->flags & SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON ? True : False;
412 /** Set whether to automatically select anonymous login */
413 void
414 smbc_setOptionNoAutoAnonymousLogin(SMBCCTX *c, smbc_bool b)
416 if (b) {
417 c->flags |= SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON;
418 } else {
419 c->flags &= ~SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON;
423 /** Get whether to enable use of kerberos */
424 smbc_bool
425 smbc_getOptionUseCCache(SMBCCTX *c)
427 return c->flags & SMB_CTX_FLAG_USE_CCACHE ? True : False;
430 /** Set whether to enable use of kerberos */
431 void
432 smbc_setOptionUseCCache(SMBCCTX *c, smbc_bool b)
434 if (b) {
435 c->flags |= SMB_CTX_FLAG_USE_CCACHE;
436 } else {
437 c->flags &= ~SMB_CTX_FLAG_USE_CCACHE;
441 /** Get the function for obtaining authentication data */
442 smbc_get_auth_data_fn
443 smbc_getFunctionAuthData(SMBCCTX *c)
445 return c->callbacks.auth_fn;
448 /** Set the function for obtaining authentication data */
449 void
450 smbc_setFunctionAuthData(SMBCCTX *c, smbc_get_auth_data_fn fn)
452 c->internal->auth_fn_with_context = NULL;
453 c->callbacks.auth_fn = fn;
456 /** Get the new-style authentication function which includes the context. */
457 smbc_get_auth_data_with_context_fn
458 smbc_getFunctionAuthDataWithContext(SMBCCTX *c)
460 return c->internal->auth_fn_with_context;
463 /** Set the new-style authentication function which includes the context. */
464 void
465 smbc_setFunctionAuthDataWithContext(SMBCCTX *c,
466 smbc_get_auth_data_with_context_fn fn)
468 c->callbacks.auth_fn = NULL;
469 c->internal->auth_fn_with_context = fn;
472 /** Get the function for checking if a server is still good */
473 smbc_check_server_fn
474 smbc_getFunctionCheckServer(SMBCCTX *c)
476 return c->callbacks.check_server_fn;
479 /** Set the function for checking if a server is still good */
480 void
481 smbc_setFunctionCheckServer(SMBCCTX *c, smbc_check_server_fn fn)
483 c->callbacks.check_server_fn = fn;
486 /** Get the function for removing a server if unused */
487 smbc_remove_unused_server_fn
488 smbc_getFunctionRemoveUnusedServer(SMBCCTX *c)
490 return c->callbacks.remove_unused_server_fn;
493 /** Set the function for removing a server if unused */
494 void
495 smbc_setFunctionRemoveUnusedServer(SMBCCTX *c,
496 smbc_remove_unused_server_fn fn)
498 c->callbacks.remove_unused_server_fn = fn;
501 /** Get the function for adding a cached server */
502 smbc_add_cached_srv_fn
503 smbc_getFunctionAddCachedServer(SMBCCTX *c)
505 return c->callbacks.add_cached_srv_fn;
508 /** Set the function for adding a cached server */
509 void
510 smbc_setFunctionAddCachedServer(SMBCCTX *c, smbc_add_cached_srv_fn fn)
512 c->callbacks.add_cached_srv_fn = fn;
515 /** Get the function for server cache lookup */
516 smbc_get_cached_srv_fn
517 smbc_getFunctionGetCachedServer(SMBCCTX *c)
519 return c->callbacks.get_cached_srv_fn;
522 /** Set the function for server cache lookup */
523 void
524 smbc_setFunctionGetCachedServer(SMBCCTX *c, smbc_get_cached_srv_fn fn)
526 c->callbacks.get_cached_srv_fn = fn;
529 /** Get the function for server cache removal */
530 smbc_remove_cached_srv_fn
531 smbc_getFunctionRemoveCachedServer(SMBCCTX *c)
533 return c->callbacks.remove_cached_srv_fn;
536 /** Set the function for server cache removal */
537 void
538 smbc_setFunctionRemoveCachedServer(SMBCCTX *c,
539 smbc_remove_cached_srv_fn fn)
541 c->callbacks.remove_cached_srv_fn = fn;
545 * Get the function for server cache purging. This function tries to
546 * remove all cached servers (e.g. on disconnect)
548 smbc_purge_cached_fn
549 smbc_getFunctionPurgeCachedServers(SMBCCTX *c)
551 return c->callbacks.purge_cached_fn;
554 /** Set the function to store private data of the server cache */
555 void smbc_setServerCacheData(SMBCCTX *c, struct smbc_server_cache * cache)
557 c->internal->server_cache = cache;
560 /** Get the function to store private data of the server cache */
561 struct smbc_server_cache * smbc_getServerCacheData(SMBCCTX *c)
563 return c->internal->server_cache;
568 * Set the function for server cache purging. This function tries to
569 * remove all cached servers (e.g. on disconnect)
571 void
572 smbc_setFunctionPurgeCachedServers(SMBCCTX *c, smbc_purge_cached_fn fn)
574 c->callbacks.purge_cached_fn = fn;
578 * Callable functions for files.
581 smbc_open_fn
582 smbc_getFunctionOpen(SMBCCTX *c)
584 return c->open;
587 void
588 smbc_setFunctionOpen(SMBCCTX *c, smbc_open_fn fn)
590 c->open = fn;
593 smbc_creat_fn
594 smbc_getFunctionCreat(SMBCCTX *c)
596 return c->creat;
599 void
600 smbc_setFunctionCreat(SMBCCTX *c, smbc_creat_fn fn)
602 c->creat = fn;
605 smbc_read_fn
606 smbc_getFunctionRead(SMBCCTX *c)
608 return c->read;
611 void
612 smbc_setFunctionRead(SMBCCTX *c, smbc_read_fn fn)
614 c->read = fn;
617 smbc_write_fn
618 smbc_getFunctionWrite(SMBCCTX *c)
620 return c->write;
623 void
624 smbc_setFunctionWrite(SMBCCTX *c, smbc_write_fn fn)
626 c->write = fn;
629 smbc_unlink_fn
630 smbc_getFunctionUnlink(SMBCCTX *c)
632 return c->unlink;
635 void
636 smbc_setFunctionUnlink(SMBCCTX *c, smbc_unlink_fn fn)
638 c->unlink = fn;
641 smbc_rename_fn
642 smbc_getFunctionRename(SMBCCTX *c)
644 return c->rename;
647 void
648 smbc_setFunctionRename(SMBCCTX *c, smbc_rename_fn fn)
650 c->rename = fn;
653 smbc_lseek_fn
654 smbc_getFunctionLseek(SMBCCTX *c)
656 return c->lseek;
659 void
660 smbc_setFunctionLseek(SMBCCTX *c, smbc_lseek_fn fn)
662 c->lseek = fn;
665 smbc_stat_fn
666 smbc_getFunctionStat(SMBCCTX *c)
668 return c->stat;
671 void
672 smbc_setFunctionStat(SMBCCTX *c, smbc_stat_fn fn)
674 c->stat = fn;
677 smbc_fstat_fn
678 smbc_getFunctionFstat(SMBCCTX *c)
680 return c->fstat;
683 void
684 smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn)
686 c->fstat = fn;
689 smbc_statvfs_fn
690 smbc_getFunctionStatVFS(SMBCCTX *c)
692 return c->internal->posix_emu.statvfs_fn;
695 void
696 smbc_setFunctionStatVFS(SMBCCTX *c, smbc_statvfs_fn fn)
698 c->internal->posix_emu.statvfs_fn = fn;
701 smbc_fstatvfs_fn
702 smbc_getFunctionFstatVFS(SMBCCTX *c)
704 return c->internal->posix_emu.fstatvfs_fn;
707 void
708 smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn)
710 c->internal->posix_emu.fstatvfs_fn = fn;
713 smbc_ftruncate_fn
714 smbc_getFunctionFtruncate(SMBCCTX *c)
716 return c->internal->posix_emu.ftruncate_fn;
719 void
720 smbc_setFunctionFtruncate(SMBCCTX *c, smbc_ftruncate_fn fn)
722 c->internal->posix_emu.ftruncate_fn = fn;
725 smbc_close_fn
726 smbc_getFunctionClose(SMBCCTX *c)
728 return c->close_fn;
731 void
732 smbc_setFunctionClose(SMBCCTX *c, smbc_close_fn fn)
734 c->close_fn = fn;
739 * Callable functions for directories.
742 smbc_opendir_fn
743 smbc_getFunctionOpendir(SMBCCTX *c)
745 return c->opendir;
748 void
749 smbc_setFunctionOpendir(SMBCCTX *c, smbc_opendir_fn fn)
751 c->opendir = fn;
754 smbc_closedir_fn
755 smbc_getFunctionClosedir(SMBCCTX *c)
757 return c->closedir;
760 void
761 smbc_setFunctionClosedir(SMBCCTX *c, smbc_closedir_fn fn)
763 c->closedir = fn;
766 smbc_readdir_fn
767 smbc_getFunctionReaddir(SMBCCTX *c)
769 return c->readdir;
772 void
773 smbc_setFunctionReaddir(SMBCCTX *c, smbc_readdir_fn fn)
775 c->readdir = fn;
778 smbc_getdents_fn
779 smbc_getFunctionGetdents(SMBCCTX *c)
781 return c->getdents;
784 void
785 smbc_setFunctionGetdents(SMBCCTX *c, smbc_getdents_fn fn)
787 c->getdents = fn;
790 smbc_mkdir_fn
791 smbc_getFunctionMkdir(SMBCCTX *c)
793 return c->mkdir;
796 void
797 smbc_setFunctionMkdir(SMBCCTX *c, smbc_mkdir_fn fn)
799 c->mkdir = fn;
802 smbc_rmdir_fn
803 smbc_getFunctionRmdir(SMBCCTX *c)
805 return c->rmdir;
808 void
809 smbc_setFunctionRmdir(SMBCCTX *c, smbc_rmdir_fn fn)
811 c->rmdir = fn;
814 smbc_telldir_fn
815 smbc_getFunctionTelldir(SMBCCTX *c)
817 return c->telldir;
820 void
821 smbc_setFunctionTelldir(SMBCCTX *c, smbc_telldir_fn fn)
823 c->telldir = fn;
826 smbc_lseekdir_fn
827 smbc_getFunctionLseekdir(SMBCCTX *c)
829 return c->lseekdir;
832 void
833 smbc_setFunctionLseekdir(SMBCCTX *c, smbc_lseekdir_fn fn)
835 c->lseekdir = fn;
838 smbc_fstatdir_fn
839 smbc_getFunctionFstatdir(SMBCCTX *c)
841 return c->fstatdir;
844 void
845 smbc_setFunctionFstatdir(SMBCCTX *c, smbc_fstatdir_fn fn)
847 c->fstatdir = fn;
852 * Callable functions applicable to both files and directories.
855 smbc_chmod_fn
856 smbc_getFunctionChmod(SMBCCTX *c)
858 return c->chmod;
861 void
862 smbc_setFunctionChmod(SMBCCTX *c, smbc_chmod_fn fn)
864 c->chmod = fn;
867 smbc_utimes_fn
868 smbc_getFunctionUtimes(SMBCCTX *c)
870 return c->utimes;
873 void
874 smbc_setFunctionUtimes(SMBCCTX *c, smbc_utimes_fn fn)
876 c->utimes = fn;
879 smbc_setxattr_fn
880 smbc_getFunctionSetxattr(SMBCCTX *c)
882 return c->setxattr;
885 void
886 smbc_setFunctionSetxattr(SMBCCTX *c, smbc_setxattr_fn fn)
888 c->setxattr = fn;
891 smbc_getxattr_fn
892 smbc_getFunctionGetxattr(SMBCCTX *c)
894 return c->getxattr;
897 void
898 smbc_setFunctionGetxattr(SMBCCTX *c, smbc_getxattr_fn fn)
900 c->getxattr = fn;
903 smbc_removexattr_fn
904 smbc_getFunctionRemovexattr(SMBCCTX *c)
906 return c->removexattr;
909 void
910 smbc_setFunctionRemovexattr(SMBCCTX *c, smbc_removexattr_fn fn)
912 c->removexattr = fn;
915 smbc_listxattr_fn
916 smbc_getFunctionListxattr(SMBCCTX *c)
918 return c->listxattr;
921 void
922 smbc_setFunctionListxattr(SMBCCTX *c, smbc_listxattr_fn fn)
924 c->listxattr = fn;
929 * Callable functions related to printing
932 smbc_print_file_fn
933 smbc_getFunctionPrintFile(SMBCCTX *c)
935 return c->print_file;
938 void
939 smbc_setFunctionPrintFile(SMBCCTX *c, smbc_print_file_fn fn)
941 c->print_file = fn;
944 smbc_open_print_job_fn
945 smbc_getFunctionOpenPrintJob(SMBCCTX *c)
947 return c->open_print_job;
950 void
951 smbc_setFunctionOpenPrintJob(SMBCCTX *c,
952 smbc_open_print_job_fn fn)
954 c->open_print_job = fn;
957 smbc_list_print_jobs_fn
958 smbc_getFunctionListPrintJobs(SMBCCTX *c)
960 return c->list_print_jobs;
963 void
964 smbc_setFunctionListPrintJobs(SMBCCTX *c,
965 smbc_list_print_jobs_fn fn)
967 c->list_print_jobs = fn;
970 smbc_unlink_print_job_fn
971 smbc_getFunctionUnlinkPrintJob(SMBCCTX *c)
973 return c->unlink_print_job;
976 void
977 smbc_setFunctionUnlinkPrintJob(SMBCCTX *c,
978 smbc_unlink_print_job_fn fn)
980 c->unlink_print_job = fn;