File: dbfpack.c

package info (click to toggle)
php3-dbase 1%3A3.0.5-1
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 264 kB
  • ctags: 596
  • sloc: ansic: 1,826; makefile: 140; sh: 33
file content (36 lines) | stat: -rw-r--r-- 591 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright (c) 1993 Brad Eacker,
 *              (Music, Intuition, Software, and Computers)
 * All Rights Reserved
 */

#define	USAGE	"usage: dbfpack <file>\n"

/*
 * display the database in question to the stdout
 */
#include "dbf.h"

#include <stdio.h>
#include <fcntl.h>

int main(int argc, char *argv[])
{
	dbhead_t 	*dbh;

	if (argc < 2) {
		printf(USAGE);
		exit(1);
	}
	argv++;	argc--;
	if ((dbh = dbf_open(*argv, O_RDWR)) == NULL) {
		fprintf(stderr, "unable to open database file %s\n", *argv);
		exit(1);
	}
	argv++;	argc--;

	pack_dbf(dbh);

	put_dbf_info(dbh);
	exit(0);
}