osurs  0.0.1
Functions
reservation.c File Reference

Placing reservations for found connections. More...

#include <string.h>
#include "osurs/reserve.h"
#include "uuid.h"
Include dependency graph for reservation.c:

Functions

Reservationnew_reservation (Connection *connection, int seats, char *id)
 Create a new reservation. More...
 

Detailed Description

Placing reservations for found connections.

Date
: 2022-07-20
Author
: Merlin Unterfinger

Function Documentation

◆ new_reservation()

Reservation* new_reservation ( Connection connection,
int  seats,
char *  id 
)

Create a new reservation.

Books a connection on the network, if the desired seats are available. If enough seats are available the reservation counts of the corresponding trip on the stops of the routes are increased and a new reservation is allocated and connected to the network.

Parameters
connectionThe connection to reserve.
seatsThe number of seats to reserve.
idThe UUID of the reservation or NULL to generate a new one.
Returns
Returns a reservation or null if no seats are available.