Startpunkten
This commit is contained in:
38
Lab4/db.h
Normal file
38
Lab4/db.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user