annotate power.cpp @ 507:e7fd50483311

Free bits of the datum constructed in audioDB::query. We're not quite safe: error calls between allocation of some of these bits and pieces and their use will cause failure... but not freeing things here is definitely wrong.
author mas01cr
date Tue, 13 Jan 2009 21:37:10 +0000
parents 342822c2d49a
children cc2b97d020b1
rev   line source
mas01cr@498 1 #include "audioDB.h"
mas01cr@498 2 extern "C" {
mas01cr@498 3 #include "audioDB_API.h"
mas01cr@498 4 #include "audioDB-internals.h"
mas01cr@498 5 }
mas01cr@498 6
mas01cr@498 7 int audiodb_power(adb_t *adb) {
mas01cr@498 8 if(!(adb->flags & O_RDWR)) {
mas01cr@498 9 return 1;
mas01cr@498 10 }
mas01cr@498 11 if(adb->header->length > 0) {
mas01cr@498 12 return 1;
mas01cr@498 13 }
mas01cr@498 14
mas01cr@498 15 adb->header->flags |= O2_FLAG_POWER;
mas01cr@498 16 return audiodb_sync_header(adb);
mas01cr@498 17 }