Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- option *set_option(void)
- {
- option *flags = malloc(sizeof(option) * 2);
- if (flags == NULL) {
- write(2, "flags' malloc failed\n", 21);
- return (NULL);
- }
- flags[0] = &new_employee;
- flags[1] = NULL;
- return (flags);
- }
- int get_input(char *input)
- {
- char *action = strtok(input, " ");
- option *flags = set_option();
- employee_t *staff = NULL;
- meeting_t *meet = NULL;
- if (flags == NULL)
- return (84);
- for (int i = 0; flags[i](action, input, &staff, &meet) != 0; i++);
- free(flags);
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement