]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/bfile.h
Apply Preben 'Peppe' Guldberg <peppe@wielders.org>
[bacula/bacula] / bacula / src / findlib / bfile.h
index 66123fd5d4b38a2fce50b1824348d96c31e41510..4d4c25b55525562b9819eb228a42f5f26d1ab7f6 100644 (file)
@@ -6,7 +6,7 @@
  *     Kern Sibbald May MMIII
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
 #ifndef __BFILE_H
 #define __BFILE_H
 
+/*  =======================================================
+ *
+ *   W I N D O W S
+ *
+ *  =======================================================
+ */
 #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
 
 #include <windows.h>
@@ -51,17 +57,31 @@ struct BFILE {
    POOLMEM *errmsg;                   /* error message buffer */
    DWORD rw_bytes;                    /* Bytes read or written */
    DWORD lerror;                      /* Last error code */
-};      
+   int berrno;                        /* errno */
+   char *prog;                        /* reader/writer program if any */
+   BPIPE *bpipe;                      /* pipe for reader */
+   JCR *jcr;                          /* jcr for editing job codes */
+};
 
 HANDLE bget_handle(BFILE *bfd);
 
 #else   /* Linux/Unix systems */
 
+/*  =======================================================
+ *
+ *   U N I X
+ *
+ *  =======================================================
+ */
+
 /* Basic low level I/O file packet */
 struct BFILE {
    int fid;                           /* file id on Unix */
    int berrno;
-};      
+   char *prog;                        /* reader/writer program if any */
+   BPIPE *bpipe;                      /* pipe for reader */
+   JCR *jcr;                          /* jcr for editing job codes */
+};
 
 #endif
 
@@ -69,12 +89,16 @@ void    binit(BFILE *bfd);
 int     is_bopen(BFILE *bfd);
 int     set_win32_backup(BFILE *bfd);
 int     set_portable_backup(BFILE *bfd);
+void    set_prog(BFILE *bfd, char *prog, JCR *jcr);
 int     have_win32_api();
 int     is_portable_backup(BFILE *bfd);
 int     is_stream_supported(int stream);
 int     is_win32_stream(int stream);
-char   *berror(BFILE *bfd);
+char   *xberror(BFILE *bfd);          /* DO NOT USE  -- use berrno class */
 int     bopen(BFILE *bfd, const char *fname, int flags, mode_t mode);
+#ifdef HAVE_DARWIN_OS
+int     bopen_rsrc(BFILE *bfd, const char *fname, int flags, mode_t mode);
+#endif
 int     bclose(BFILE *bfd);
 ssize_t bread(BFILE *bfd, void *buf, size_t count);
 ssize_t bwrite(BFILE *bfd, void *buf, size_t count);