39 lines
665 B
C
39 lines
665 B
C
#ifndef __DB_H__
|
|
#define __DB_H__
|
|
|
|
#define NAMESIZE 30
|
|
#define NRSIZE 10
|
|
#define ACK 0
|
|
#define ADD 1
|
|
#define DEL 2
|
|
#define NR 3
|
|
#define NAME 4
|
|
#define EXIT 5
|
|
#define PRN 6
|
|
#define NACK 9
|
|
|
|
#define FILENAME "datafile"
|
|
#define TMPFILE "tmpfile"
|
|
#define READLOCK ".rlock"
|
|
#define WRITELOCK ".wlock"
|
|
#define PERMS 0666
|
|
|
|
#include <stdio.h>
|
|
#include <signal.h>
|
|
#include <fcntl.h>
|
|
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
#include <sys/stat.h>
|
|
#include <netinet/in.h>
|
|
#include <netdb.h>
|
|
|
|
typedef struct msg{
|
|
int op; /* The type of operation */
|
|
char nr[NRSIZE]; /* Telephone number */
|
|
char name[NAMESIZE]; /* The name */
|
|
}msg;
|
|
|
|
typedef msg *msgPtr;
|
|
|
|
#endif
|