Commit 5a16e9b0 authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Rename functions with blc_

parent 6aadef17
......@@ -106,16 +106,16 @@ char* blc_uint32_to_string(uint32_t *string, uint32_t x);
#define SCAN_CONV(size_max, format) "%" STRINGIFY_CONTENT(size_max)format
///Print a red error message with the file, line and position of the caller with the message in parameter with printf format. Then raise SIGABRT signal (usefull for debugging) and exit with code EXIT_FAILURE.
#define EXIT_ON_ERROR(...) fatal_error(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
#define EXIT_ON_ERROR(...) blc_fatal_error(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
///Print an orange warning message with the file, line and position of the caller with the message in parameter with printf format. Then return.
#define PRINT_WARNING(...) print_warning(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
#define PRINT_WARNING(...) blc_print_warning(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
///Like @ref EXIT_ON_ERROR butprints also the system error message corresponding to the last system error (errno).
#define EXIT_ON_SYSTEM_ERROR(...) fatal_system_error(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
#define EXIT_ON_SYSTEM_ERROR(...) blc_fatal_system_error(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
///Like @ref PRINT_WARNING but print also the system error message corresponding to the last system error (errno).
#define PRINT_SYSTEM_ERROR(...) print_system_error(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
#define PRINT_SYSTEM_ERROR(...) blc_print_system_error(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
/**
@code{.c}
......@@ -124,23 +124,23 @@ FILE* file;
SYSTEM_ERROR_CHECK(file=fopen(filename, "r"), NULL, "Problem opening the file '%s'", filename);
@endcode
if file is NULL this exit with a error message showing the position of the error, the executed command 'file=fopen(filename, "r")', the system error message and your personnal formated message*/
#define SYSTEM_ERROR_CHECK(command, bad_value, ...) do{if ((command) == bad_value) fatal_command_system_error(__FILE__, __FUNCTION__, __LINE__, STRINGIFY(command),__VA_ARGS__);}while(0)
#define SYSTEM_ERROR_CHECK(command, bad_value, ...) do{if ((command) == bad_value) blc_fatal_command_system_error(__FILE__, __FUNCTION__, __LINE__, STRINGIFY(command),__VA_ARGS__);}while(0)
///Same as SYSTEM_ERROR_CHECK but cheking success instead of error.
#define SYSTEM_SUCCESS_CHECK(command, good_value, ...) do{if ((command) != good_value) fatal_command_system_error(__FILE__, __FUNCTION__, __LINE__, STRINGIFY(command),__VA_ARGS__);}while(0)
#define SYSTEM_SUCCESS_CHECK(command, good_value, ...) do{if ((command) != good_value) blc_fatal_command_system_error(__FILE__, __FUNCTION__, __LINE__, STRINGIFY(command),__VA_ARGS__);}while(0)
/**Like SYSTEM_ERROR_CHECK but the command is reexecuted if the errno is errno_accepted (Usually in case of interruption EINTR).*/
#define SYSTEM_ERROR_RETRY_ON_SPECIFIC_ERRNO(command, bad_value, errno_accepted, ...) while((command) == bad_value) { if (errno!=(errno_accepted)) fatal_command_system_error(__FILE__, __FUNCTION__, __LINE__, STRINGIFY(command),__VA_ARGS__);}
#define SYSTEM_ERROR_RETRY_ON_SPECIFIC_ERRNO(command, bad_value, errno_accepted, ...) while((command) == bad_value) { if (errno!=(errno_accepted)) blc_fatal_command_system_error(__FILE__, __FUNCTION__, __LINE__, STRINGIFY(command),__VA_ARGS__);}
/**Do a malloc big enough to contain 'type', checks if it succeeds and return the memory casted as 'type*'.
@code{.c}
struct toto *toto_pointer;
toto_pointer=ALLOCATION(struct toto);
@endcode*/
#define ALLOCATION(type) (type*)secure_malloc(__FILE__, __FUNCTION__,__LINE__, sizeof(type))
#define ALLOCATION(type) (type*)blc_secure_malloc(__FILE__, __FUNCTION__,__LINE__, sizeof(type))
///Like @ref ALLOCATION but allocates 'numbers' elements of 'type'.
#define MANY_ALLOCATIONS(numbers, type) (type*)secure_malloc(__FILE__, __FUNCTION__, __LINE__, (numbers)*sizeof(type))
#define MANY_ALLOCATIONS(numbers, type) (type*)blc_secure_malloc(__FILE__, __FUNCTION__, __LINE__, (numbers)*sizeof(type))
/**Like @ref ALLOCATION but reallocates 'pointer' to contain 'numbers' element of 'type'. The content of pointer may be changed if needed. If pointer is NULL, this macro has the same effect than MANY_ALLOACTIONS. @return Nothing as the 'pointer' is directly modified.
@code{.c}
......@@ -150,7 +150,7 @@ values=MANY_ALLOCATIONS(5, int);
MANY_REALLOCATIONS(&values, 7);
//now values is an array of 7 int. The values address may change but the 5 first values are the same.
@endcode*/
#define MANY_REALLOCATIONS(array_pt, numbers) secure_realloc(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, (numbers)*sizeof(**(array_pt)))
#define MANY_REALLOCATIONS(array_pt, numbers) blc_secure_realloc(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, (numbers)*sizeof(**(array_pt)))
/// Free the content of the pointer and set it to NULL. Useful to be sure that a freed pointer will not be used again.
#define FREE(pointer) do{ free((void*)pointer); pointer=NULL; }while(0)
......@@ -165,10 +165,10 @@ MANY_REALLOCATIONS(&values, 7);
APPEND_ITEM(&items, &items_nb, &item0);
//Items is a pointer to a memory of sizeof(type_item), and items_nb=1
@endcode */
#define APPEND_ITEM(array_pt, numbers_pt, new_element_pt) append_item(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, sizeof(**(array_pt)), numbers_pt, sizeof(*(new_element_pt)), (void*)new_element_pt)
#define APPEND_ITEM(array_pt, numbers_pt, new_element_pt) blc_append_item(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, sizeof(**(array_pt)), numbers_pt, sizeof(*(new_element_pt)), (void*)new_element_pt)
/** Return the pointer toward a new allocation the end of the array*/
#define APPEND_ALLOCATION(array_pt, numbers_pt, type) (type*)append_allocation(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, sizeof(**(array_pt)), numbers_pt, sizeof(type))
#define APPEND_ALLOCATION(array_pt, numbers_pt, type) (type*)blc_append_allocation(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, sizeof(**(array_pt)), numbers_pt, sizeof(type))
/**Insert the content of the object pointed by new_element to the array pointed by pointer. The size of the array will increase and the pointer will be changed acordingly. To insert the data, a part of the array is copied, which may not be optimal. The number of elements is incremented. The size of the element is determined by the type of pointer.
@code{.c}
......@@ -176,7 +176,7 @@ MANY_REALLOCATIONS(&values, 7);
INSERT_ITEM(&items, &items_nb, &item1, 0);
//Items is a pointer to a memory of 2*sizeof(type_item), and items_nb=2, the first item is item1, the second item is item0.
@endcode */
#define INSERT_ITEM(array_pt, numbers_pt, new_element_pt, position) insert_item(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, sizeof(**(array_pt)), numbers_pt, sizeof(*(new_element_pt)), (void*)new_element_pt, position)
#define INSERT_ITEM(array_pt, numbers_pt, new_element_pt, position) blc_insert_item(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, sizeof(**(array_pt)), numbers_pt, sizeof(*(new_element_pt)), (void*)new_element_pt, position)
/**Process each item of an array
@code{.c}
......@@ -194,7 +194,7 @@ MANY_REALLOCATIONS(&values, 7);
//1 is returned as item0 is at the position 1
@endcode
*/
#define GET_ITEM_POSITION(array, numbers, searched_item_pt) get_item_position(__FILE__, __FUNCTION__, __LINE__, (void**)array, sizeof(*(array)), numbers, sizeof(*(searched_item_pt)), (void*)searched_item_pt)
#define GET_ITEM_POSITION(array, numbers, searched_item_pt) blc_get_item_position(__FILE__, __FUNCTION__, __LINE__, (void**)array, sizeof(*(array)), numbers, sizeof(*(searched_item_pt)), (void*)searched_item_pt)
/**Remove item by replacing the item at position by the last item and liberating the memory. This change the order of the element in the array. If you use a loop, do not forget to reiterate the current position as it as now a new item ( the one that was at teh end of the array ).
@code {.c}
......@@ -203,7 +203,14 @@ MANY_REALLOCATIONS(&values, 7);
We are now like before INSERT_ITEM, item0 is at the first place. And the memory of item1 as been removed.
The last item is now at the position of the current removed item !!! The order is not kept !!!
*/
#define REMOVE_ITEM(array_pt, numbers_pt, position) remove_item_position(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, sizeof(**(array_pt)), numbers_pt, position)
#define REMOVE_ITEM_POSITION(array_pt, numbers_pt, position) blc_remove_item_position(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, sizeof(**(array_pt)), numbers_pt, position)
/**
Search the item and remove it from the array.
*/
#define REMOVE_ITEM(array_pt, numbers_pt, searched_item_pt) blc_remove_item(__FILE__, __FUNCTION__, __LINE__, (void**)array_pt, sizeof(**(array_pt)), numbers_pt, sizeof(*(searched_item_pt)), (void*)searched_item_pt)
/* Not usually useful. Log the data in the file log_file. log_file has to be managed (open/close), by the caller. You can have many different log file depending on the caller. It can also be stdout or stderr. In this case declare log_file = stdout/stderr. It is not yet stabilized.*/
#define BLC_LOG(...) printf_log("blc",__FILE__, __FUNCTION__,__LINE__, __VA_ARGS__)
......@@ -265,20 +272,23 @@ void blc_close_pipe(int *pipe);
char const *blc_get_filename_extension(char const *filename);
//They have to be called by macros, you usually do not need them
void print_warning(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...);
void print_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...);
void fatal_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...);
void fatal_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...);
void fatal_command_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, char const *command, const char *message, ...);
void printf_log(const char *log_name, char const *file, char const *function, int line_id, ...);
void *secure_malloc(const char *file , const char *function, int line, size_t size);
void secure_realloc(char const *file , char const *function, int line, void** pointer, size_t size);
void *append_allocation(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size);
void *append_item(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size, void* new_item);
void *insert_item(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size, void* new_item, int position);
void remove_item_position(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, int position);
int get_item_position(const char *file, const char *function, int line, void const* const* array_pt, size_t pointer_content_size, int items_nb, size_t item_size, void* searched_item_pt);
void blc_print_warning(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...);
void blc_print_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...);
void blc_fatal_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...);
void blc_fatal_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...);
void blc_fatal_command_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, char const *command, const char *message, ...);
void blc_printf_log(const char *log_name, char const *file, char const *function, int line_id, ...);
void *blc_secure_malloc(const char *file , const char *function, int line, size_t size);
void blc_secure_realloc(char const *file , char const *function, int line, void** pointer, size_t size);
void *blc_append_allocation(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size);
void *blc_append_item(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size, void* new_item);
void *blc_insert_item(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size, void* new_item, int position);
void blc_remove_item_position(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, int position);
void blc_remove_item(const char *file, const char *function, int line, void const *const* array, size_t pointer_content_size, int *items_nb, size_t item_size, void* researched_item);
int blc_get_item_position(const char *file, const char *function, int line, void const* const* array_pt, size_t pointer_content_size, int items_nb, size_t item_size, void* searched_item_pt);
///Add an argument to the list argv of arguments. Add eventually a value as well.
......
......@@ -56,7 +56,7 @@ size_t blc_get_type_size(uint32_t type)
}
//Envoie un message de warning avec name_of_file, name_of_function, number_of_line et affiche le message formate avec les parametres variables. To be used with PRINT_WARNING.
void print_warning(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...)
void blc_print_warning(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...)
{
va_list arguments;
va_start(arguments, message);
......@@ -68,7 +68,7 @@ void print_warning(const char *name_of_file, const char* name_of_function, int n
}
//Envoie un message de warning avec name_of_file, name_of_function, number_of_line et affiche le message formate avec les parametres variables. To be used with PRINT_WARNING.
void print_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...)
void blc_print_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...)
{
va_list arguments;
va_start(arguments, message);
......@@ -80,7 +80,7 @@ void print_system_error(const char *name_of_file, const char* name_of_function,
}
// Envoie un message d'erreur avec name_of_file, name_of_function, number_of_line et affiche le message formate avec les parametres variables. Puis exit le programme avec le parametre EXIT_FAILURE. To be used with EXIT_ON_ERROR.
void fatal_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...)
void blc_fatal_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...)
{
va_list arguments;
va_start(arguments, message);
......@@ -94,7 +94,7 @@ void fatal_error(const char *name_of_file, const char* name_of_function, int num
}
//Envoie un message d'erreur avec name_of_file, name_of_function, number_of_line et affiche le message formate avec les parametres variables. Puis exit le programme avec le parametre EXIT_FAILURE. To be used with @ref EXIT_ON_SYSTEM_ERROR .
void fatal_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...)
void blc_fatal_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, const char *message, ...)
{
va_list arguments;
va_start(arguments, message);
......@@ -108,7 +108,7 @@ void fatal_system_error(const char *name_of_file, const char* name_of_function,
exit(EXIT_FAILURE);
}
void fatal_command_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, char const *command,const char *message, ...)
void blc_fatal_command_system_error(const char *name_of_file, const char* name_of_function, int numero_of_line, char const *command,const char *message, ...)
{
va_list arguments;
va_start(arguments, message);
......@@ -124,53 +124,53 @@ void fatal_command_system_error(const char *name_of_file, const char* name_of_fu
}
// Fait un malloc de taille 'size' verifie qu'il n'a pas renvoye NULL et renvoie ce pointeur. Si le malloc a renvoye NULL alors une erreur fatal est generee avec le filename, name_of_function, et line comme parametres.
void *secure_malloc(const char *file, const char *function, int line, size_t size)
void *blc_secure_malloc(const char *file, const char *function, int line, size_t size)
{
void *pointer;
if (size){
pointer = malloc(size);
if (pointer == NULL) fatal_error(file, function, line, "malloc of size %d has failed (return NULL)", size);
if (pointer == NULL) blc_fatal_error(file, function, line, "malloc of size %d has failed (return NULL)", size);
else return pointer;
}
return NULL;
}
//Fait un realloc de taille 'size' sur le pointeur verifie qu'il n'a pas renvoye NULL et renvoie la nouvelle addresse du pointeur. Si le pointeur d'origine est NULL alors la fonction a le meme effet que secure_malloc. Si le realloc a renvoiye NULL alors une erreur fatal est generee avec le filename, name_of_function, et line comme parametres.
void secure_realloc(const char *file, const char *function, int line, void** pointer, size_t size)
void blc_secure_realloc(const char *file, const char *function, int line, void** pointer, size_t size)
{
if (size==0) FREE(*pointer);
else SYSTEM_ERROR_CHECK(*pointer = realloc(*pointer, size), NULL, "size: '%lu'", size);
}
void *append_allocation(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size)
void *blc_append_allocation(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size)
{
void *new_address;
if (pointer_content_size != item_size) fatal_error(file, function, line, "The size '%ld' of the content of the array must be equal to the size '%ld' of the item to contain.\nYou may mix content and pointer.", pointer_content_size, item_size);
if (pointer_content_size != item_size) blc_fatal_error(file, function, line, "The size '%ld' of the content of the array must be equal to the size '%ld' of the item to contain.\nYou may mix content and pointer.", pointer_content_size, item_size);
secure_realloc(file, function, line, (void**) pointer, item_size * (*items_nb + 1));
blc_secure_realloc(file, function, line, (void**) pointer, item_size * (*items_nb + 1));
new_address=((char*)*pointer)+(*items_nb) * item_size;
*items_nb += 1;
return new_address;
}
void *append_item(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size, void* new_item)
void *blc_append_item(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size, void* new_item)
{
void *new_address;
new_address=append_allocation(file, function, line, pointer, pointer_content_size, items_nb, item_size);
new_address=blc_append_allocation(file, function, line, pointer, pointer_content_size, items_nb, item_size);
memcpy(new_address, new_item, item_size);
return new_address;
}
void *insert_item(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size, void* new_item, int position)
void *blc_insert_item(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, size_t item_size, void* new_item, int position)
{
char *tmp_pointer;
if (pointer_content_size != item_size) fatal_error(file, function, line, "The size '%ld' of the content of the array must be equal to the size '%ld' of the item to contain.", pointer_content_size, item_size);
if (pointer_content_size != item_size) blc_fatal_error(file, function, line, "The size '%ld' of the content of the array must be equal to the size '%ld' of the item to contain.", pointer_content_size, item_size);
secure_realloc(file, function, line, (void**) pointer, item_size * (*items_nb + 1));
blc_secure_realloc(file, function, line, (void**) pointer, item_size * (*items_nb + 1));
tmp_pointer = (char*)*pointer;
memmove(tmp_pointer + (position+1) * item_size, tmp_pointer+position*item_size, (*items_nb - position)*item_size);
memcpy(tmp_pointer+position * item_size, new_item, item_size);
......@@ -178,28 +178,37 @@ void *insert_item(const char *file, const char *function, int line, void** point
return tmp_pointer+position * item_size;
}
void remove_item_position(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, int position)
void blc_remove_item_position(const char *file, const char *function, int line, void** pointer, size_t pointer_content_size, int *items_nb, int position)
{
char *tmp_pointer;
if (position >= *items_nb) EXIT_ON_ERROR("You try to remove an elments at position '%d' outside the range of the array [0,%d[", position, items_nb);
(*items_nb)--;
tmp_pointer = (char*)*pointer;
memcpy(tmp_pointer+pointer_content_size*position, tmp_pointer + pointer_content_size*(*items_nb), pointer_content_size);
secure_realloc(file, function, line, (void**) pointer, pointer_content_size * (*items_nb));
memmove(tmp_pointer+pointer_content_size*position, tmp_pointer + pointer_content_size*(*items_nb), pointer_content_size);
blc_secure_realloc(file, function, line, (void**) pointer, pointer_content_size * (*items_nb));
}
int get_item_position(const char *file, const char *function, int line, void const *const* array, size_t pointer_content_size, int items_nb, size_t item_size, void* researched_item)
int blc_get_item_position(const char *file, const char *function, int line, void const *const* array, size_t pointer_content_size, int items_nb, size_t item_size, void* researched_item)
{
int i;
if (pointer_content_size != item_size) fatal_error(file, function, line, "The size '%d' of the content of array must be equal to the size of the researched item '%d'", pointer_content_size, item_size);
if (pointer_content_size != item_size) blc_fatal_error(file, function, line, "The size '%d' of the content of array must be equal to the size of the researched item '%d'", pointer_content_size, item_size);
FOR_INV(i, items_nb) if (memcmp(researched_item, &array[i], item_size) == 0) return i;
return -1;
}
void blc_remove_item(const char *file, const char *function, int line, void const *const* array_pt, size_t pointer_content_size, int *items_nb, size_t item_size, void* researched_item_pt){
int position;
position=blc_get_item_position(file, function, line, (void**)*array_pt, pointer_content_size, *items_nb, item_size, researched_item_pt);
if (position==-1) EXIT_ON_ERROR("Object of size '%d' not found", pointer_content_size);
blc_remove_item_position(file, function, line, (void**) array_pt, pointer_content_size, items_nb, position);
}
/* May be changed */
char rand_char()
{
......@@ -207,7 +216,7 @@ char rand_char()
}
/* We use an intermediate buffer line in order to avoid thread mix */
void printf_log(const char *log_name, char const *source_filename, char const *function, int line_id, ...)
void blc_printf_log(const char *log_name, char const *source_filename, char const *function, int line_id, ...)
{
const char*format;
va_list arguments;
......@@ -284,17 +293,20 @@ void blc_add_arg( int *argc, char ***argv, char const *arg, char const *value){
}
char *blc_create_command_line_from_argv(char const *const *argv){
int command_line_size, i;
char *command_line, *pos;
command_line_size=0;
for(i=0; argv[i] != NULL; i++) command_line_size+=strlen(argv[i])+1; // + 1 for the space
int i;
blc_mem command;
char text[NAME_MAX];
command_line=MANY_ALLOCATIONS(command_line_size+1, char);
pos=command_line;
for(i=0; argv[i] != NULL; i++)
pos+=sprintf(pos, "%s ", argv[i]);
return command_line;
for(i=0; argv[i] != NULL; i++) {
if (i) command.append_text(" "); //add space but not at the first word.
if ((strchr(argv[i], ' ')) && ((argv[i][0]!='"' || argv[i][strlen(argv[i])-1]!='"'))) SPRINTF(text, "\"%s\"", argv[i]); //Add quotes if needed ( space in the word and no quotes).
else SPRINTF(text, "%s", argv[i]);
command.append_text(text);
}
command.append("", 1);
command.size=0; //avoid free at the end of the function
return command.chars;;
}
char * const*blc_create_argv_from_command_line(char const *command_line)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment