9511_project03

project 3 for algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README LICENSE
include/cla.h (725B)
   1 #ifndef CLA__H
   2 #define CLA__H
   3 
   4 #include <stdlib.h>
   5 #include <string.h>
   6 #include <stdbool.h>
   7 
   8 #include "status.h"
   9 
  10 #define NO_ARGS_ENTERED 1
  11 #define NORMAL_AMOUNT_ARGS 11
  12 #define FLAGS_MAX 5
  13 #define FORMATS_MAX 2
  14 
  15 typedef enum {
  16     FLAG_FMT,
  17     FLAG_OUT,
  18     FLAG_IN,
  19     FLAG_TI,
  20     FLAG_TF
  21 } flags_t;
  22 
  23 typedef struct {
  24     char *fmt;
  25     FILE *fi, *fo;
  26     unsigned long ti, tf;
  27 } cla_T, *cla_t;
  28 
  29 status_t validate_arguments(int, char **, cla_t);
  30 status_t check_flags_position(int, char **);
  31 status_t check_flags_repeated(int, char **);
  32 
  33 status_t cla_create(cla_t *);
  34 status_t cla_setup(int, char **, cla_t);
  35 status_t cla_destroy(cla_t);
  36 
  37 extern const char *available_flags[FLAGS_MAX];
  38 extern const char *available_formats[FORMATS_MAX];
  39 
  40 #endif