]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/findlib/namedpipe.h
Restore win32 dir from Branch-5.2 and update it
[bacula/bacula] / bacula / src / findlib / namedpipe.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2018 Kern Sibbald
5
6    The original author of Bacula is Kern Sibbald, with contributions
7    from many others, a complete list can be found in the file AUTHORS.
8
9    You may use this file and others of this release according to the
10    license defined in the LICENSE file, which includes the Affero General
11    Public License, v3.0 ("AGPLv3") and some additional permissions and
12    terms pursuant to its AGPLv3 Section 7.
13
14    This notice must be preserved when any source code is
15    conveyed and/or propagated.
16
17    Bacula(R) is a registered trademark of Kern Sibbald.
18 */
19 /*
20    Basic abstraction for named pipe between windows and linux
21  */
22
23 #ifndef NAMEDPIPE_H
24 #define NAMEDPIPE_H
25
26 #ifdef HAVE_WIN32
27 #include <windows.h>
28 #endif
29
30 #include <sys/types.h>
31
32 typedef struct {
33 #ifdef HAVE_WIN32
34    HANDLE    fd;
35 #else
36    char     *name;
37    int       fd;
38 #endif
39    int       ifd;
40 } NamedPipe;
41
42
43 void namedpipe_init(NamedPipe *self);
44 void namedpipe_free(NamedPipe *self);
45 int namedpipe_create(NamedPipe *self, const char *path, mode_t mode);
46 int namedpipe_open(NamedPipe *self, const char *path, mode_t mode);
47
48 #endif