Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[goodguy/history.git] / cinelerra-5.1 / db / tst.C
diff --git a/cinelerra-5.1/db/tst.C b/cinelerra-5.1/db/tst.C
new file mode 100644 (file)
index 0000000..6def26b
--- /dev/null
@@ -0,0 +1,32 @@
+#include<stdio.h>
+#include<stdarg.h>
+#include<time.h>
+
+#include "tdb.h"
+#include "s.C"
+
+void write_pbm(uint8_t *tp, int w, int h, const char *fmt, ...)
+{
+  va_list ap;    va_start(ap, fmt);
+  char fn[256];  vsnprintf(fn, sizeof(fn), fmt, ap);
+  va_end(ap);
+  FILE *fp = !strcmp(fn,"-") ? stdout : fopen(fn,"w");
+  if( fp ) {
+    fprintf(fp,"P5\n%d %d\n255\n",w,h);
+    fwrite(tp,w,h,fp);
+    fclose(fp);
+  }
+}
+
+int main(int ac, char **av)
+{
+  int ret;  setbuf(stdout,0);
+  theDb db;
+  db.open(av[1]);
+  //db.access(av[1], 34543, 0);
+  if( !db.opened() || db.error() ) exit(1);
+
+  db.close();
+  return 0;
+}
+