Mercurial > hg > audiodb
comparison audioDB_API.h @ 441:1a1ea05a94ce api-inversion
clarify audiodb_insert()
write audiodb_insert() (essentially to support the command-line client
audioDB::insert operation) in terms of audiodb_insert_datum() and a new
audiodb_insert_reference() function. These two functions each do
exactly one thing and return failure if they're working on the wrong
kind of database.
author | mas01cr |
---|---|
date | Wed, 24 Dec 2008 10:56:25 +0000 |
parents | 53c487885b2c |
children | 16a903968d18 |
comparison
equal
deleted
inserted
replaced
440:91addb6ce4c4 | 441:1a1ea05a94ce |
---|---|
40 const char *features; | 40 const char *features; |
41 const char *power; | 41 const char *power; |
42 const char *key; | 42 const char *key; |
43 const char *times; | 43 const char *times; |
44 }; | 44 }; |
45 typedef struct adbinsert adb_insert_t, *adb_insert_ptr; | 45 typedef struct adbinsert adb_insert_t, adb_reference_t, *adb_insert_ptr; |
46 | 46 |
47 /* struct for returning status results */ | 47 /* struct for returning status results */ |
48 struct adbstatus { | 48 struct adbstatus { |
49 unsigned int numFiles; | 49 unsigned int numFiles; |
50 unsigned int dim; | 50 unsigned int dim; |
173 int audiodb_l2norm(adb_ptr mydb); | 173 int audiodb_l2norm(adb_ptr mydb); |
174 int audiodb_power(adb_ptr mydb); | 174 int audiodb_power(adb_ptr mydb); |
175 | 175 |
176 /* insert functions */ | 176 /* insert functions */ |
177 int audiodb_insert_datum(adb_t *, adb_datum_t *); | 177 int audiodb_insert_datum(adb_t *, adb_datum_t *); |
178 int audiodb_insert_reference(adb_t *, adb_reference_t *); | |
178 int audiodb_insert(adb_ptr mydb, adb_insert_ptr ins); | 179 int audiodb_insert(adb_ptr mydb, adb_insert_ptr ins); |
179 int audiodb_batchinsert(adb_ptr mydb, adb_insert_ptr ins, unsigned int size); | 180 int audiodb_batchinsert(adb_ptr mydb, adb_insert_ptr ins, unsigned int size); |
180 | 181 |
181 /* query function */ | 182 /* query function */ |
182 int audiodb_query(adb_ptr mydb, adb_query_ptr adbq, adb_queryresult_ptr adbqres); | 183 int audiodb_query(adb_ptr mydb, adb_query_ptr adbq, adb_queryresult_ptr adbqres); |