Browse code

- Convenience macros for checking database capability vector

Jan Janak authored on 14/09/2004 10:45:53
Showing 1 changed files
... ...
@@ -39,6 +39,19 @@ typedef enum db_cap {
39 39
 	DB_CAP_DELETE =    1 << 3,  /* Database driver can delete data from database */
40 40
 	DB_CAP_UPDATE =    1 << 4   /* Database driver can update data in the database */
41 41
 } db_cap_t;
42
-	
42
+
43
+
44
+/*
45
+ * All database functions except raw_query
46
+ */
47
+#define DB_CAP_ALL (DB_CAP_QUERY | DB_CAP_INSERT | DB_CAP_DELETE | DB_CAP_UPDATE)	
48
+
49
+
50
+/*
51
+ * True if all the capabilities in cpv are supported by module
52
+ * represented by dbf, false otherwise
53
+ */
54
+#define DB_CAPABILITY(dbf, cpv) ((dbf)->cap & (cpv)) == (cpv))
55
+
43 56
 
44 57
 #endif /* DB_CAP_H */