Startpunkten

This commit is contained in:
2026-03-05 13:31:50 +01:00
commit 86a20ae0e1
16 changed files with 1305 additions and 0 deletions

38
Lab4/db.h Normal file
View 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