Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edb

Dir     : e17/libs/edb/src


Modified Files:
        Edb.h e_db.c os_oflags.c 


Log Message:


tadpole's patch to open with mode flags

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edb/src/Edb.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- Edb.h       22 Feb 2002 12:57:47 -0000      1.12
+++ Edb.h       5 Apr 2004 03:00:02 -0000       1.13
@@ -22,6 +22,17 @@
 E_DB_File          *e_db_open(char *file);
 
 /**
+ * e_db_open_mode - Opens a db with a user-specified mode
+ * @file: name of the db file.
+ * @flags: bitmask in the format specified by open(2)
+ *
+ * This function opens an edb database file for access as specified by
+ * flags. It returns NULL if not possible, a pointer to an E_DB_File
+ * otherwise.
+ */
+E_DB_File          *e_db_open_mode(char *file, int flags);
+
+/**
  * e_db_property_set - Sets the value of a Property Field.
  * @edb: A database handle.
  * @property: The name of the Property Field to edit.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edb/src/e_db.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- e_db.c      15 Nov 2002 20:24:38 -0000      1.21
+++ e_db.c      5 Apr 2004 03:00:02 -0000       1.22
@@ -179,6 +179,13 @@
 E_DB_File          *
 e_db_open(char *file)
 {
+  return e_db_open_mode(file, O_RDWR | O_CREAT);
+}
+
+
+E_DB_File          *
+e_db_open_mode(char *file, int flags)
+{
    _E_DB_File         *edbf;
    DBM                *edb = NULL;
    int                 edbs_count = 0;
@@ -222,7 +229,7 @@
               (newfile[newfilelen - 1] == 'b'))
              newfile[newfilelen - 3] = 0;
           
-          edb = edbm_open(newfile, O_RDWR | O_CREAT, 0664);
+          edb = edbm_open(newfile, flags, 0664);
           FREE(newfile);
        }
    }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edb/src/os_oflags.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- os_oflags.c 9 Mar 2001 01:30:40 -0000       1.2
+++ os_oflags.c 5 Apr 2004 03:00:02 -0000       1.3
@@ -45,6 +45,11 @@
                edbflags |= DB_RDONLY;
        if (oflags & O_TRUNC)
                edbflags |= DB_TRUNCATE;
+       if (oflags & O_EXCL)
+               edbflags |= DB_EXCL;
+       if (oflags & O_TRUNC)
+               edbflags |= DB_TRUNCATE;
+
        return (edbflags);
 }
 




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to