Room Manager 0.1
room reservation management system
roommandef.h
Go to the documentation of this file.
1
20#ifndef __ROOMMANDEF_H__
21#define __ROOMMANDEF_H__
22#include <stdio.h>
23#include <stdlib.h>
24#include <stdint.h>
25#include <string.h>
26#include <sys/types.h>
27#include <sys/stat.h>
28#include <fcntl.h>
29#include <sys/time.h>
30#include <unistd.h>
31#include <limits.h>
32#include <assert.h>
33
34#include "include/roomman.h"
35
36#define DATAFILE "roommanfile.dat"
37#define INTERMEDIATE_FILE "roommanfile.bak"
38
39/*
40 * Hash parameters according to Bernstein's function
41 * See http://www.strchr.com/hash_functions
42 */
43#define INITIAL_VALUE (5381)
44#define M (33)
45
46#define ROOMMAN_CAPACITY (10) /* Default room capacity */
47
61
66
75#define debug1(x) do{if(verbose >= 1){ printf x ;fflush(stdout);}}while(0)
76#define debug2(x) do{if(verbose >= 2){ printf x ;fflush(stdout);}}while(0)
77#define debug3(x) do{if(verbose >= 3){ printf x ;fflush(stdout);}}while(0)
78#define debug4(x) do{if(verbose >= 4){ printf x ;fflush(stdout);}}while(0)
79
80
81
82
83
84#endif /* __ROOMMANDEF_H__ */
#define ROOMMAN_MAX_NAME
Global definitions.
Definition roomman.h:44
uint32_t roomman_id_t
Definition roomman.h:82
struct roomman roomman_t
Structure of an entry in the database.
char roomman_current_user[ROOMMAN_MAX_NAME+1]
Structure of an entry in the database.
Definition roommandef.h:53
char name[ROOMMAN_MAX_NAME+1]
Definition roommandef.h:56
uint16_t capacity
Definition roommandef.h:58
char building[ROOMMAN_MAX_NAME+1]
Definition roommandef.h:55
uint16_t occupied
Definition roommandef.h:57
roomman_id_t rid
Definition roommandef.h:54
char reserved_by[ROOMMAN_MAX_NAME+1]
Definition roommandef.h:59