Program Listing for File server_args_parser.h

Return to documentation for file (server/server_args_parser.h)

#ifndef ARGS_H_
    #define ARGS_H_

    #include <limits.h>
    #include <stdbool.h>
    #include <stddef.h>
    #include <stdint.h>

    // Maximum number of teams allowed including GRAPHIC
    #define TEAM_COUNT_LIMIT 1 << (CHAR_BIT * sizeof (char))

typedef struct params_s {
    char **teams; // Team names, NULL-terminated
    uint8_t registered_team_count;
    uint16_t frequency; // Range between 1 and 10000
    uint8_t map_width; // Range between 10 and 42
    uint8_t map_height; // Range between 10 and 42
    uint16_t port; // Range between 1024 and 65535
    uint8_t team_capacity; // Range between 1 and 200
    bool help; // Display help message
} params_t;

extern const char SERVER_USAGE[];   // Usage message for the server

bool parse_args(params_t *params, int argc, char *argv[]);

#endif /* !ARGS_H_ */