summaryrefslogtreecommitdiff
path: root/share/shares.h
blob: ea079dad41a6ac0141fc5e70dd539d85a816facb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef SHARES_H
#define SHARES_H

#include <glib.h>

typedef struct {
	char *path;
	char *share_name;
	char *comment;
	gboolean is_writable;
	gboolean guest_ok;
} ShareInfo;

#define SHARES_ERROR (shares_error_quark ())

typedef enum {
	SHARES_ERROR_FAILED,
	SHARES_ERROR_NONEXISTENT
} SharesError;

GQuark shares_error_quark (void);

void shares_free_share_info (ShareInfo *info);

gboolean shares_get_path_is_shared (const char *path, gboolean *ret_is_shared, GError **error);

gboolean shares_get_share_info_for_path (const char *path, ShareInfo **ret_share_info, GError **error);

gboolean shares_get_share_name_exists (const char *share_name, gboolean *ret_exists, GError **error);

gboolean shares_get_share_info_for_share_name (const char *share_name, ShareInfo **ret_share_info, GError **error);

gboolean shares_modify_share (const char *old_path, ShareInfo *info, GError **error);

gboolean shares_get_share_info_list (GSList **ret_info_list, GError **error);

void shares_free_share_info_list (GSList *list);

gboolean shares_supports_guest_ok (gboolean *supports_guest_ok_ret,
				   GError **error);

void shares_set_debug (gboolean error_on_refresh,
		       gboolean error_on_add,
		       gboolean error_on_modify,
		       gboolean error_on_remove);

#endif