Room Manager 0.1
room reservation management system
roomman.h
Go to the documentation of this file.
1
10#ifndef LIBROOMAN_H
11#define LIBROOMAN_H
12
13#include <stdlib.h>
14#include <stdint.h>
15
44#define ROOMMAN_MAX_NAME (31U)
45
47#define ROOMMAN_SUCCESS (0)
49#define ROOMMAN_ERR_INVALID_ROOM (-1)
51#define ROOMMAN_ERR_DUPLICATE_ROOM (-2)
53#define ROOMMAN_ERR_NAMETOOLONG (-3)
55#define ROOMMAN_ERR_EXCEED (-4)
57#define ROOMMAN_ERR_NOUSER (-5)
59#define ROOMMAN_ERR_NOT_EMPTY (-6)
61#define ROOMMAN_ERR_RESERVED (-7)
62
63
68#define ROOMMAN_ERR_FATAL (-100)
70#define ROOMMAN_ERR_STORE (-101)
72#define ROOMMAN_ERR_CORRUPT (-102)
82typedef uint32_t roomman_id_t;
83
87typedef int16_t roomman_result_t;
88
99
114roomman_result_t roomman_create_room(char *building_name, char *room_name, uint16_t max_pers, roomman_id_t *rid);
115
126
138
153
167
179
191
203 roomman_id_t rid,
204 char* building,
205 char* name,
206 uint16_t* occupied,
207 uint16_t* capacity,
208 char *reserved_by
209 );
210
211
224 const char* building,
225 const char* room_name,
226 roomman_id_t *rid
228 );
229
256 int32_t* fdptr,
257 const char* building,
258 const char* room_name,
260 roomman_id_t *rid
262 );
263
264#endif /* LIBROOMAN_H */
roomman_result_t roomman_create_room(char *building_name, char *room_name, uint16_t max_pers, roomman_id_t *rid)
Create a new room.
roomman_result_t roomman_directory(int32_t *fdptr, const char *building, const char *room_name, roomman_id_t *rid)
Get a directory of entries in the database.
roomman_result_t roomman_set_username(char *username)
Set the name of the current user (required for room reservations).
roomman_result_t roomman_update_capacity(roomman_id_t rid, uint16_t new_capacity)
Update the capacity of a room.
roomman_result_t roomman_clear_reservation(roomman_id_t rid)
Reserve a room.
roomman_result_t roomman_remove_persons(roomman_id_t rid, uint16_t persons)
Decrease the number of persons currently using the room.
roomman_result_t roomman_add_persons(roomman_id_t rid, uint16_t persons)
Increase the number of persons currently using the room.
roomman_result_t roomman_lookup(const char *building, const char *room_name, roomman_id_t *rid)
Find room in the database.
roomman_result_t roomman_delete_room(roomman_id_t rid)
Delete a room.
roomman_result_t roomman_readentry(roomman_id_t rid, char *building, char *name, uint16_t *occupied, uint16_t *capacity, char *reserved_by)
Get contents of an entry in the database.
roomman_result_t roomman_reserve_room(roomman_id_t rid)
Reserve a room.
int16_t roomman_result_t
Definition roomman.h:87
uint32_t roomman_id_t
Definition roomman.h:82