view power.cpp @ 463:35bb388d0eac api-inversion

audioDB::query_loop and audioDB::query_loop_points are no more. Be a little bit careful about deleting the exact_evaluation_queue in error conditions, but otherwise this was simple (If you ignore the work of the previous $N$ commits, that is). The inversion work in query.cpp is now complete, apart from physically teasing apart the API function from the body of audioDB::query and then moving the two remaining audioDB:: methods elsewhere. Unfortunately, we're still not quite done, because we have to deal with audioDB::index_query_loop too, which is still a little bit tangled. Still, we're nearly there...
author mas01cr
date Tue, 30 Dec 2008 15:38:59 +0000
parents 7038f31124d1
children
line wrap: on
line source
#include "audioDB.h"
extern "C" {
#include "audioDB_API.h"
#include "audioDB-internals.h"
}

int audiodb_power(adb_t *adb) {
  if(!(adb->flags & O_RDWR)) {
    return 1;
  }
  if(adb->header->length > 0) {
    return 1;
  }

  adb->header->flags |= O2_FLAG_POWER;
  return audiodb_sync_header(adb);
}