114 lines
2.9 KiB
C
114 lines
2.9 KiB
C
#ifndef EASYCSV_P_H
|
|
#define EASYCSV_P_H
|
|
|
|
#include "../include/easycsv.h"
|
|
|
|
/*** Accès ***/
|
|
|
|
/**
|
|
* Returns string of a specific row, including '\n' character
|
|
* This function does not check parameters!
|
|
* This function does not produce errors!
|
|
* @param[in] const pointer to easycsv structure
|
|
* @param[in] row number
|
|
* @return string of row (heap-allocated)
|
|
*/
|
|
char*
|
|
easycsv_get_row(const easycsv*,
|
|
unsigned int);
|
|
|
|
/* /\** */
|
|
/* * Returns column number of a named column *\/ */
|
|
/* int */
|
|
/* _easycsv_getcolumn(const _easycsv*, */
|
|
/* const char*); */
|
|
|
|
/* /\* Verifies the type of the value (eg: string or int) *\/ */
|
|
/* _EASYCSV_TYPE */
|
|
/* _easycsv_checktype(const _easycsv*, */
|
|
/* const int, */
|
|
/* const int); */
|
|
|
|
/* /\* Verifies if there is a value or not *\/ */
|
|
/* int */
|
|
/* _easycsv_checkifvalue(const _easycsv*, */
|
|
/* const int, */
|
|
/* const int); */
|
|
|
|
/* /\* Grab const char* in row *\/ */
|
|
/* char* */
|
|
/* _easycsv_getvalueinrow(const _easycsv*, */
|
|
/* const char*, */
|
|
/* const unsigned int); */
|
|
|
|
/**
|
|
* Returns char pointer towards the n-th occurence of ',' in a given string
|
|
* This function does not check parameters!
|
|
* This function does not produce errors!
|
|
* @param[in] string of row (string with multiple occurences of ',')
|
|
* @param[in] n-th occurence to place the char pointer
|
|
* @return char pointer towards the n-th occurence of ',' in a given string
|
|
*/
|
|
char*
|
|
easycsv_set_charp_to_value(const char*,
|
|
unsigned int);
|
|
|
|
/* /\* Insert value in row in specific column *\/ */
|
|
/* char* */
|
|
/* _easycsv_insertvalueinrow(const _easycsv*, */
|
|
/* const char*, */
|
|
/* const char*, */
|
|
/* const unsigned int); */
|
|
|
|
/**
|
|
* Calculate rows of easycsv
|
|
* @param[in] const pointer to easycsv structure
|
|
* @return number of rows in easycsv
|
|
*/
|
|
int
|
|
easycsv_rows(const easycsv*);
|
|
|
|
/**
|
|
* Calculate columns of easycsv
|
|
* @param[in] const pointer to easycsv structure
|
|
* @return number of columns in easycsv
|
|
*/
|
|
int
|
|
easycsv_columns(const easycsv*);
|
|
|
|
/**
|
|
* Rewind easycsv FILE pointer
|
|
* @param[in] const pointer to easycsv structure
|
|
* @return 0 if no error, -1 if fail
|
|
*/
|
|
int
|
|
easycsv_rewind(const easycsv*);
|
|
|
|
/* /\* Check if easycsv* and const char* are NULL *\/ */
|
|
/* int */
|
|
/* _easycsv_checkcsvandstring_one(const _easycsv*, */
|
|
/* const char*); */
|
|
|
|
/* /\* Check if easycsv* and two const char* are NULL*\/ */
|
|
/* int */
|
|
/* _easycsv_checkcsvandstring_two(const _easycsv*, */
|
|
/* const char*, */
|
|
/* const char*); */
|
|
|
|
/* Verifies if the string is not NULL or empty, returns 0 on success and -1 on failure */
|
|
// int _easycsv_checkstring(const char*);
|
|
|
|
/* Verifies if easycsv is not NULL or unallocated */
|
|
// int _easycsv_checkeasycsv(const struct easycsv*);
|
|
|
|
/* Verifies if int is */
|
|
// int _easycsv_checkunsigned(const int);
|
|
|
|
/*** Modifications ***/
|
|
|
|
/* Copies data from temp FILE to file FILE */
|
|
/* int */
|
|
/* _easycsv_update(_easycsv*); */
|
|
|
|
#endif
|