view power.cpp @ 425:d65410f4bb85 api-inversion

Begin pushing information through. Create and initialize an adb_query_refine_t struct in audioDB::query, and pass it through to various callees, which can then use it instead of the automagic class member variables. This allows conversion of some routines into ordinary static C functions. Begin doing so.
author mas01cr
date Wed, 24 Dec 2008 10:55:16 +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);
}