mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 03:49:20 +03:00
src: Add function csync_vio_local_getfd().
This commit is contained in:
parent
123472e286
commit
527da08d3b
2 changed files with 16 additions and 1 deletions
|
@ -30,13 +30,26 @@
|
|||
#include "c_private.h"
|
||||
#include "c_lib.h"
|
||||
#include "c_string.h"
|
||||
|
||||
#include "vio/csync_vio_handle.h"
|
||||
#include "vio/csync_vio_local.h"
|
||||
#include "vio/csync_vio_handle_private.h"
|
||||
|
||||
typedef struct fhandle_s {
|
||||
int fd;
|
||||
} fhandle_t;
|
||||
|
||||
int csync_vio_local_getfd(csync_vio_handle_t *hnd)
|
||||
{
|
||||
fhandle_t *fh;
|
||||
|
||||
if (hnd == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
fh = (struct fhandle_s*)(hnd->method_handle);
|
||||
|
||||
return fh->fd;
|
||||
}
|
||||
|
||||
/* the url comes in as utf-8 and in windows, it needs to be multibyte. */
|
||||
csync_vio_method_handle_t *csync_vio_local_open(const char *durl, int flags, mode_t mode) {
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include "vio/csync_vio_method.h"
|
||||
#include <sys/time.h>
|
||||
|
||||
int csync_vio_local_getfd(csync_vio_handle_t *hnd);
|
||||
|
||||
csync_vio_method_handle_t *csync_vio_local_open(const char *durl, int flags, mode_t mode);
|
||||
csync_vio_method_handle_t *csync_vio_local_creat(const char *durl, mode_t mode);
|
||||
int csync_vio_local_close(csync_vio_method_handle_t *fhandle);
|
||||
|
|
Loading…
Reference in a new issue