view power.cpp @ 413:9de6d0676907 api-inversion

Add a partial libtests/ implementation of tests/0037. Partial because still no "nsequence", though I have a plan for that. The audiodb_batchinsert is a little bit weird; I think I'd have used an adb_insert_t*[] (array of pointers) rather than an array of structures directly. I might think about that some more later.
author mas01cr
date Fri, 12 Dec 2008 15:37:17 +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);
}