7 #include <libsmbclient.h>
9 #include "get_auth_data_fn.h"
11 static int notify_cb(const struct smbc_notify_callback_action
*actions
,
12 size_t num_actions
, void *private_data
)
14 int *count
= private_data
;
17 printf("%zu\n", num_actions
);
19 for (i
=0; i
<num_actions
; i
++) {
20 const struct smbc_notify_callback_action
*a
= &actions
[i
];
21 printf("%s: %"PRIu32
"\n", a
->filename
, a
->action
);
32 int main(int argc
, char * argv
[])
42 smbc_init(get_auth_data_fn
, debug
);
44 fprintf(stdout
, "Path: ");
46 p
= fgets(path
, sizeof(path
) - 1, stdin
);
48 fprintf(stderr
, "error reading from stdin\n");
51 if (strlen(path
) == 0) {
55 p
= path
+ strlen(path
) - 1;
60 fd
= smbc_opendir(path
);
66 ret
= smbc_notify(fd
, 1,
67 SMBC_NOTIFY_CHANGE_SECURITY
|
68 SMBC_NOTIFY_CHANGE_FILE_NAME
,
69 1000, notify_cb
, &count
);