Zappy - Year end project 2
This is a project that Epitech asked us to create in order to allow us to reveiw the notions of the current year.
Loading...
Searching...
No Matches
Data Structures | Functions
command_parse.h File Reference
#include <stdint.h>
#include "constants.h"
Include dependency graph for command_parse.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  command_s
 Define structure of a command @command being the trigger string @opt Currently unused @arg_nb number of argument taken by command @command_fct Function pointer to command function. More...
 

Functions

char ** parse_command (char *str)
 Parse a command using COMMAND_DELIMITER as delimiter.
 
char *** parse_buffer (uint8_t *buffer, ssize_t buf_size)
 Get all command in buffer (a command is delimited by COMMAND_SEPARATOR)
 

Function Documentation

◆ parse_buffer()

char *** parse_buffer ( uint8_t * buffer,
ssize_t buf_size )

Get all command in buffer (a command is delimited by COMMAND_SEPARATOR)

Parameters
bufferRead buffer from server
buf_sizeSize of buffer
Returns
Parsed command splited with SPACE as delimiter or NULL on error

Definition at line 97 of file command_parse.c.

◆ parse_command()

char ** parse_command ( char * str)

Parse a command using COMMAND_DELIMITER as delimiter.

Parameters
strCommand string to parse
Returns
Parsed command or NULL on error

Definition at line 48 of file command_parse.c.