source: vendor/3.6.0/source3/libsmb/libsmb_setget.c

Last change on this file was 740, checked in by Silvan Scherrer, 13 years ago

Samba Server: update vendor to 3.6.0

File size: 24.4 KB
Line 
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
10
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.
15
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.
20
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/>.
23*/
24
25#include "includes.h"
26#define __LIBSMBCLIENT_INTERNAL__
27#include "libsmbclient.h"
28#include "libsmb_internal.h"
29
30
31/** Get the netbios name used for making connections */
32char *
33smbc_getNetbiosName(SMBCCTX *c)
34{
35 return c->netbios_name;
36}
37
38/** Set the netbios name used for making connections */
39void
40smbc_setNetbiosName(SMBCCTX *c, char * netbios_name)
41{
42 SAFE_FREE(c->netbios_name);
43 if (netbios_name) {
44 c->netbios_name = SMB_STRDUP(netbios_name);
45 }
46}
47
48/** Get the workgroup used for making connections */
49char *
50smbc_getWorkgroup(SMBCCTX *c)
51{
52 return c->workgroup;
53}
54
55/** Set the workgroup used for making connections */
56void
57smbc_setWorkgroup(SMBCCTX *c, char * workgroup)
58{
59 SAFE_FREE(c->workgroup);
60 if (workgroup) {
61 c->workgroup = SMB_STRDUP(workgroup);
62 }
63}
64
65/** Get the username used for making connections */
66char *
67smbc_getUser(SMBCCTX *c)
68{
69 return c->user;
70}
71
72/** Set the username used for making connections */
73void
74smbc_setUser(SMBCCTX *c, char * user)
75{
76 SAFE_FREE(c->user);
77 if (user) {
78 c->user = SMB_STRDUP(user);
79 }
80}
81
82/** Get the debug level */
83int
84smbc_getDebug(SMBCCTX *c)
85{
86 return c->debug;
87}
88
89/** Set the debug level */
90void
91smbc_setDebug(SMBCCTX *c, int debug)
92{
93 char buf[32];
94 snprintf(buf, sizeof(buf), "%d", debug);
95 c->debug = debug;
96 lp_set_cmdline("log level", buf);
97}
98
99/**
100 * Get the timeout used for waiting on connections and response data
101 * (in milliseconds)
102 */
103int
104smbc_getTimeout(SMBCCTX *c)
105{
106 return c->timeout;
107}
108
109/**
110 * Set the timeout used for waiting on connections and response data
111 * (in milliseconds)
112 */
113void
114smbc_setTimeout(SMBCCTX *c, int timeout)
115{
116 c->timeout = timeout;
117}
118
119/** Get whether to log to standard error instead of standard output */
120smbc_bool
121smbc_getOptionDebugToStderr(SMBCCTX *c)
122{
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();
127}
128
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.
134 */
135void
136smbc_setOptionDebugToStderr(SMBCCTX *c, smbc_bool b)
137{
138 if (b) {
139 /*
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)
145 */
146 setup_logging("libsmbclient", DEBUG_STDERR);
147 }
148}
149
150/**
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.)
156 */
157smbc_bool
158smbc_getOptionFullTimeNames(SMBCCTX *c)
159{
160 return c->internal->full_time_names;
161}
162
163/**
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.)
169 */
170void
171smbc_setOptionFullTimeNames(SMBCCTX *c, smbc_bool b)
172{
173 c->internal->full_time_names = b;
174}
175
176/**
177 * Get the share mode to use for files opened with SMBC_open_ctx(). The
178 * default is SMBC_SHAREMODE_DENY_NONE.
179 */
180smbc_share_mode
181smbc_getOptionOpenShareMode(SMBCCTX *c)
182{
183 return c->internal->share_mode;
184}
185
186/**
187 * Set the share mode to use for files opened with SMBC_open_ctx(). The
188 * default is SMBC_SHAREMODE_DENY_NONE.
189 */
190void
191smbc_setOptionOpenShareMode(SMBCCTX *c, smbc_share_mode share_mode)
192{
193 c->internal->share_mode = share_mode;
194}
195
196/** Retrieve a previously set user data handle */
197void *
198smbc_getOptionUserData(SMBCCTX *c)
199{
200 return c->internal->user_data;
201}
202
203/** Save a user data handle */
204void
205smbc_setOptionUserData(SMBCCTX *c, void *user_data)
206{
207 c->internal->user_data = user_data;
208}
209
210/** Get the encoded value for encryption level. */
211smbc_smb_encrypt_level
212smbc_getOptionSmbEncryptionLevel(SMBCCTX *c)
213{
214 return c->internal->smb_encryption_level;
215}
216
217/** Set the encoded value for encryption level. */
218void
219smbc_setOptionSmbEncryptionLevel(SMBCCTX *c, smbc_smb_encrypt_level level)
220{
221 c->internal->smb_encryption_level = level;
222}
223
224/**
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.
230 */
231smbc_bool
232smbc_getOptionCaseSensitive(SMBCCTX *c)
233{
234 return c->internal->case_sensitive;
235}
236
237/**
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.
243 */
244void
245smbc_setOptionCaseSensitive(SMBCCTX *c, smbc_bool b)
246{
247 c->internal->case_sensitive = b;
248}
249
250/**
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).
263 */
264int
265smbc_getOptionBrowseMaxLmbCount(SMBCCTX *c)
266{
267 return c->options.browse_max_lmb_count;
268}
269
270/**
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).
283 */
284void
285smbc_setOptionBrowseMaxLmbCount(SMBCCTX *c, int count)
286{
287 c->options.browse_max_lmb_count = count;
288}
289
290/**
291 * Get whether to url-encode readdir entries.
292 *
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.
306 *
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.
312 *
313 * For backwards compatibility, this option defaults to False.
314 */
315smbc_bool
316smbc_getOptionUrlEncodeReaddirEntries(SMBCCTX *c)
317{
318 return c->options.urlencode_readdir_entries;
319}
320
321/**
322 * Set whether to url-encode readdir entries.
323 *
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.
337 *
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.
343 *
344 * For backwards compatibility, this option defaults to False.
345 */
346void
347smbc_setOptionUrlEncodeReaddirEntries(SMBCCTX *c, smbc_bool b)
348{
349 c->options.urlencode_readdir_entries = b;
350}
351
352/**
353 * Get whether to use the same connection for all shares on a server.
354 *
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.
363 */
364smbc_bool
365smbc_getOptionOneSharePerServer(SMBCCTX *c)
366{
367 return c->options.one_share_per_server;
368}
369
370/**
371 * Set whether to use the same connection for all shares on a server.
372 *
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.
381 */
382void
383smbc_setOptionOneSharePerServer(SMBCCTX *c, smbc_bool b)
384{
385 c->options.one_share_per_server = b;
386}
387
388/** Get whether to enable use of kerberos */
389smbc_bool
390smbc_getOptionUseKerberos(SMBCCTX *c)
391{
392 return c->flags & SMB_CTX_FLAG_USE_KERBEROS ? True : False;
393}
394
395/** Set whether to enable use of kerberos */
396void
397smbc_setOptionUseKerberos(SMBCCTX *c, smbc_bool b)
398{
399 if (b) {
400 c->flags |= SMB_CTX_FLAG_USE_KERBEROS;
401 } else {
402 c->flags &= ~SMB_CTX_FLAG_USE_KERBEROS;
403 }
404}
405
406/** Get whether to fallback after kerberos */
407smbc_bool
408smbc_getOptionFallbackAfterKerberos(SMBCCTX *c)
409{
410 return c->flags & SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS ? True : False;
411}
412
413/** Set whether to fallback after kerberos */
414void
415smbc_setOptionFallbackAfterKerberos(SMBCCTX *c, smbc_bool b)
416{
417 if (b) {
418 c->flags |= SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS;
419 } else {
420 c->flags &= ~SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS;
421 }
422}
423
424/** Get whether to automatically select anonymous login */
425smbc_bool
426smbc_getOptionNoAutoAnonymousLogin(SMBCCTX *c)
427{
428 return c->flags & SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON ? True : False;
429}
430
431/** Set whether to automatically select anonymous login */
432void
433smbc_setOptionNoAutoAnonymousLogin(SMBCCTX *c, smbc_bool b)
434{
435 if (b) {
436 c->flags |= SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON;
437 } else {
438 c->flags &= ~SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON;
439 }
440}
441
442/** Get whether to enable use of kerberos */
443smbc_bool
444smbc_getOptionUseCCache(SMBCCTX *c)
445{
446 return c->flags & SMB_CTX_FLAG_USE_CCACHE ? True : False;
447}
448
449/** Set whether to enable use of kerberos */
450void
451smbc_setOptionUseCCache(SMBCCTX *c, smbc_bool b)
452{
453 if (b) {
454 c->flags |= SMB_CTX_FLAG_USE_CCACHE;
455 } else {
456 c->flags &= ~SMB_CTX_FLAG_USE_CCACHE;
457 }
458}
459
460/** Get the function for obtaining authentication data */
461smbc_get_auth_data_fn
462smbc_getFunctionAuthData(SMBCCTX *c)
463{
464 return c->callbacks.auth_fn;
465}
466
467/** Set the function for obtaining authentication data */
468void
469smbc_setFunctionAuthData(SMBCCTX *c, smbc_get_auth_data_fn fn)
470{
471 c->internal->auth_fn_with_context = NULL;
472 c->callbacks.auth_fn = fn;
473}
474
475/** Get the new-style authentication function which includes the context. */
476smbc_get_auth_data_with_context_fn
477smbc_getFunctionAuthDataWithContext(SMBCCTX *c)
478{
479 return c->internal->auth_fn_with_context;
480}
481
482/** Set the new-style authentication function which includes the context. */
483void
484smbc_setFunctionAuthDataWithContext(SMBCCTX *c,
485 smbc_get_auth_data_with_context_fn fn)
486{
487 c->callbacks.auth_fn = NULL;
488 c->internal->auth_fn_with_context = fn;
489}
490
491/** Get the function for checking if a server is still good */
492smbc_check_server_fn
493smbc_getFunctionCheckServer(SMBCCTX *c)
494{
495 return c->callbacks.check_server_fn;
496}
497
498/** Set the function for checking if a server is still good */
499void
500smbc_setFunctionCheckServer(SMBCCTX *c, smbc_check_server_fn fn)
501{
502 c->callbacks.check_server_fn = fn;
503}
504
505/** Get the function for removing a server if unused */
506smbc_remove_unused_server_fn
507smbc_getFunctionRemoveUnusedServer(SMBCCTX *c)
508{
509 return c->callbacks.remove_unused_server_fn;
510}
511
512/** Set the function for removing a server if unused */
513void
514smbc_setFunctionRemoveUnusedServer(SMBCCTX *c,
515 smbc_remove_unused_server_fn fn)
516{
517 c->callbacks.remove_unused_server_fn = fn;
518}
519
520/** Get the function for adding a cached server */
521smbc_add_cached_srv_fn
522smbc_getFunctionAddCachedServer(SMBCCTX *c)
523{
524 return c->callbacks.add_cached_srv_fn;
525}
526
527/** Set the function for adding a cached server */
528void
529smbc_setFunctionAddCachedServer(SMBCCTX *c, smbc_add_cached_srv_fn fn)
530{
531 c->callbacks.add_cached_srv_fn = fn;
532}
533
534/** Get the function for server cache lookup */
535smbc_get_cached_srv_fn
536smbc_getFunctionGetCachedServer(SMBCCTX *c)
537{
538 return c->callbacks.get_cached_srv_fn;
539}
540
541/** Set the function for server cache lookup */
542void
543smbc_setFunctionGetCachedServer(SMBCCTX *c, smbc_get_cached_srv_fn fn)
544{
545 c->callbacks.get_cached_srv_fn = fn;
546}
547
548/** Get the function for server cache removal */
549smbc_remove_cached_srv_fn
550smbc_getFunctionRemoveCachedServer(SMBCCTX *c)
551{
552 return c->callbacks.remove_cached_srv_fn;
553}
554
555/** Set the function for server cache removal */
556void
557smbc_setFunctionRemoveCachedServer(SMBCCTX *c,
558 smbc_remove_cached_srv_fn fn)
559{
560 c->callbacks.remove_cached_srv_fn = fn;
561}
562
563/**
564 * Get the function for server cache purging. This function tries to
565 * remove all cached servers (e.g. on disconnect)
566 */
567smbc_purge_cached_fn
568smbc_getFunctionPurgeCachedServers(SMBCCTX *c)
569{
570 return c->callbacks.purge_cached_fn;
571}
572
573/** Set the function to store private data of the server cache */
574void smbc_setServerCacheData(SMBCCTX *c, struct smbc_server_cache * cache)
575{
576 c->internal->server_cache = cache;
577}
578
579/** Get the function to store private data of the server cache */
580struct smbc_server_cache * smbc_getServerCacheData(SMBCCTX *c)
581{
582 return c->internal->server_cache;
583}
584
585
586/**
587 * Set the function for server cache purging. This function tries to
588 * remove all cached servers (e.g. on disconnect)
589 */
590void
591smbc_setFunctionPurgeCachedServers(SMBCCTX *c, smbc_purge_cached_fn fn)
592{
593 c->callbacks.purge_cached_fn = fn;
594}
595
596/**
597 * Callable functions for files.
598 */
599
600smbc_open_fn
601smbc_getFunctionOpen(SMBCCTX *c)
602{
603 return c->open;
604}
605
606void
607smbc_setFunctionOpen(SMBCCTX *c, smbc_open_fn fn)
608{
609 c->open = fn;
610}
611
612smbc_creat_fn
613smbc_getFunctionCreat(SMBCCTX *c)
614{
615 return c->creat;
616}
617
618void
619smbc_setFunctionCreat(SMBCCTX *c, smbc_creat_fn fn)
620{
621 c->creat = fn;
622}
623
624smbc_read_fn
625smbc_getFunctionRead(SMBCCTX *c)
626{
627 return c->read;
628}
629
630void
631smbc_setFunctionRead(SMBCCTX *c, smbc_read_fn fn)
632{
633 c->read = fn;
634}
635
636smbc_write_fn
637smbc_getFunctionWrite(SMBCCTX *c)
638{
639 return c->write;
640}
641
642void
643smbc_setFunctionWrite(SMBCCTX *c, smbc_write_fn fn)
644{
645 c->write = fn;
646}
647
648smbc_unlink_fn
649smbc_getFunctionUnlink(SMBCCTX *c)
650{
651 return c->unlink;
652}
653
654void
655smbc_setFunctionUnlink(SMBCCTX *c, smbc_unlink_fn fn)
656{
657 c->unlink = fn;
658}
659
660smbc_rename_fn
661smbc_getFunctionRename(SMBCCTX *c)
662{
663 return c->rename;
664}
665
666void
667smbc_setFunctionRename(SMBCCTX *c, smbc_rename_fn fn)
668{
669 c->rename = fn;
670}
671
672smbc_lseek_fn
673smbc_getFunctionLseek(SMBCCTX *c)
674{
675 return c->lseek;
676}
677
678void
679smbc_setFunctionLseek(SMBCCTX *c, smbc_lseek_fn fn)
680{
681 c->lseek = fn;
682}
683
684smbc_stat_fn
685smbc_getFunctionStat(SMBCCTX *c)
686{
687 return c->stat;
688}
689
690void
691smbc_setFunctionStat(SMBCCTX *c, smbc_stat_fn fn)
692{
693 c->stat = fn;
694}
695
696smbc_fstat_fn
697smbc_getFunctionFstat(SMBCCTX *c)
698{
699 return c->fstat;
700}
701
702void
703smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn)
704{
705 c->fstat = fn;
706}
707
708smbc_statvfs_fn
709smbc_getFunctionStatVFS(SMBCCTX *c)
710{
711 return c->internal->posix_emu.statvfs_fn;
712}
713
714void
715smbc_setFunctionStatVFS(SMBCCTX *c, smbc_statvfs_fn fn)
716{
717 c->internal->posix_emu.statvfs_fn = fn;
718}
719
720smbc_fstatvfs_fn
721smbc_getFunctionFstatVFS(SMBCCTX *c)
722{
723 return c->internal->posix_emu.fstatvfs_fn;
724}
725
726void
727smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn)
728{
729 c->internal->posix_emu.fstatvfs_fn = fn;
730}
731
732smbc_ftruncate_fn
733smbc_getFunctionFtruncate(SMBCCTX *c)
734{
735 return c->internal->posix_emu.ftruncate_fn;
736}
737
738void
739smbc_setFunctionFtruncate(SMBCCTX *c, smbc_ftruncate_fn fn)
740{
741 c->internal->posix_emu.ftruncate_fn = fn;
742}
743
744smbc_close_fn
745smbc_getFunctionClose(SMBCCTX *c)
746{
747 return c->close_fn;
748}
749
750void
751smbc_setFunctionClose(SMBCCTX *c, smbc_close_fn fn)
752{
753 c->close_fn = fn;
754}
755
756
757/**
758 * Callable functions for directories.
759 */
760
761smbc_opendir_fn
762smbc_getFunctionOpendir(SMBCCTX *c)
763{
764 return c->opendir;
765}
766
767void
768smbc_setFunctionOpendir(SMBCCTX *c, smbc_opendir_fn fn)
769{
770 c->opendir = fn;
771}
772
773smbc_closedir_fn
774smbc_getFunctionClosedir(SMBCCTX *c)
775{
776 return c->closedir;
777}
778
779void
780smbc_setFunctionClosedir(SMBCCTX *c, smbc_closedir_fn fn)
781{
782 c->closedir = fn;
783}
784
785smbc_readdir_fn
786smbc_getFunctionReaddir(SMBCCTX *c)
787{
788 return c->readdir;
789}
790
791void
792smbc_setFunctionReaddir(SMBCCTX *c, smbc_readdir_fn fn)
793{
794 c->readdir = fn;
795}
796
797smbc_getdents_fn
798smbc_getFunctionGetdents(SMBCCTX *c)
799{
800 return c->getdents;
801}
802
803void
804smbc_setFunctionGetdents(SMBCCTX *c, smbc_getdents_fn fn)
805{
806 c->getdents = fn;
807}
808
809smbc_mkdir_fn
810smbc_getFunctionMkdir(SMBCCTX *c)
811{
812 return c->mkdir;
813}
814
815void
816smbc_setFunctionMkdir(SMBCCTX *c, smbc_mkdir_fn fn)
817{
818 c->mkdir = fn;
819}
820
821smbc_rmdir_fn
822smbc_getFunctionRmdir(SMBCCTX *c)
823{
824 return c->rmdir;
825}
826
827void
828smbc_setFunctionRmdir(SMBCCTX *c, smbc_rmdir_fn fn)
829{
830 c->rmdir = fn;
831}
832
833smbc_telldir_fn
834smbc_getFunctionTelldir(SMBCCTX *c)
835{
836 return c->telldir;
837}
838
839void
840smbc_setFunctionTelldir(SMBCCTX *c, smbc_telldir_fn fn)
841{
842 c->telldir = fn;
843}
844
845smbc_lseekdir_fn
846smbc_getFunctionLseekdir(SMBCCTX *c)
847{
848 return c->lseekdir;
849}
850
851void
852smbc_setFunctionLseekdir(SMBCCTX *c, smbc_lseekdir_fn fn)
853{
854 c->lseekdir = fn;
855}
856
857smbc_fstatdir_fn
858smbc_getFunctionFstatdir(SMBCCTX *c)
859{
860 return c->fstatdir;
861}
862
863void
864smbc_setFunctionFstatdir(SMBCCTX *c, smbc_fstatdir_fn fn)
865{
866 c->fstatdir = fn;
867}
868
869
870/**
871 * Callable functions applicable to both files and directories.
872 */
873
874smbc_chmod_fn
875smbc_getFunctionChmod(SMBCCTX *c)
876{
877 return c->chmod;
878}
879
880void
881smbc_setFunctionChmod(SMBCCTX *c, smbc_chmod_fn fn)
882{
883 c->chmod = fn;
884}
885
886smbc_utimes_fn
887smbc_getFunctionUtimes(SMBCCTX *c)
888{
889 return c->utimes;
890}
891
892void
893smbc_setFunctionUtimes(SMBCCTX *c, smbc_utimes_fn fn)
894{
895 c->utimes = fn;
896}
897
898smbc_setxattr_fn
899smbc_getFunctionSetxattr(SMBCCTX *c)
900{
901 return c->setxattr;
902}
903
904void
905smbc_setFunctionSetxattr(SMBCCTX *c, smbc_setxattr_fn fn)
906{
907 c->setxattr = fn;
908}
909
910smbc_getxattr_fn
911smbc_getFunctionGetxattr(SMBCCTX *c)
912{
913 return c->getxattr;
914}
915
916void
917smbc_setFunctionGetxattr(SMBCCTX *c, smbc_getxattr_fn fn)
918{
919 c->getxattr = fn;
920}
921
922smbc_removexattr_fn
923smbc_getFunctionRemovexattr(SMBCCTX *c)
924{
925 return c->removexattr;
926}
927
928void
929smbc_setFunctionRemovexattr(SMBCCTX *c, smbc_removexattr_fn fn)
930{
931 c->removexattr = fn;
932}
933
934smbc_listxattr_fn
935smbc_getFunctionListxattr(SMBCCTX *c)
936{
937 return c->listxattr;
938}
939
940void
941smbc_setFunctionListxattr(SMBCCTX *c, smbc_listxattr_fn fn)
942{
943 c->listxattr = fn;
944}
945
946
947/**
948 * Callable functions related to printing
949 */
950
951smbc_print_file_fn
952smbc_getFunctionPrintFile(SMBCCTX *c)
953{
954 return c->print_file;
955}
956
957void
958smbc_setFunctionPrintFile(SMBCCTX *c, smbc_print_file_fn fn)
959{
960 c->print_file = fn;
961}
962
963smbc_open_print_job_fn
964smbc_getFunctionOpenPrintJob(SMBCCTX *c)
965{
966 return c->open_print_job;
967}
968
969void
970smbc_setFunctionOpenPrintJob(SMBCCTX *c,
971 smbc_open_print_job_fn fn)
972{
973 c->open_print_job = fn;
974}
975
976smbc_list_print_jobs_fn
977smbc_getFunctionListPrintJobs(SMBCCTX *c)
978{
979 return c->list_print_jobs;
980}
981
982void
983smbc_setFunctionListPrintJobs(SMBCCTX *c,
984 smbc_list_print_jobs_fn fn)
985{
986 c->list_print_jobs = fn;
987}
988
989smbc_unlink_print_job_fn
990smbc_getFunctionUnlinkPrintJob(SMBCCTX *c)
991{
992 return c->unlink_print_job;
993}
994
995void
996smbc_setFunctionUnlinkPrintJob(SMBCCTX *c,
997 smbc_unlink_print_job_fn fn)
998{
999 c->unlink_print_job = fn;
1000}
1001
Note: See TracBrowser for help on using the repository browser.