gwenhywfar  5.10.1
Macros | Functions
csv.c File Reference
#include <gwenhywfar/text.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/stringlist.h>
#include <gwenhywfar/dbio_be.h>
#include <gwenhywfar/syncio_file.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
Include dependency graph for csv.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG
 

Functions

static GWEN_DBIO_CHECKFILE_RESULT _csvCheckFile (GWEN_DBIO *dbio, const char *fname)
 
GWEN_DBIO_CHECKFILE_RESULT _csvCheckFile (GWEN_UNUSED GWEN_DBIO *dbio, const char *fname)
 
static int _csvExport (GWEN_DBIO *dbio, GWEN_SYNCIO *sio, GWEN_DB_NODE *data, GWEN_DB_NODE *cfg, uint32_t flags)
 
int _csvExport (GWEN_DBIO *dbio, GWEN_SYNCIO *sio, GWEN_DB_NODE *data, GWEN_DB_NODE *cfg, GWEN_UNUSED uint32_t flags)
 
static GWEN_DBIO_csvFactory (GWEN_PLUGIN *pl)
 
GWEN_DBIO_csvFactory (GWEN_UNUSED GWEN_PLUGIN *pl)
 
static int _csvImport (GWEN_DBIO *dbio, GWEN_SYNCIO *sio, GWEN_DB_NODE *data, GWEN_DB_NODE *cfg, uint32_t flags)
 
int _csvImport (GWEN_DBIO *dbio, GWEN_SYNCIO *sio, GWEN_DB_NODE *data, GWEN_DB_NODE *cfg, GWEN_UNUSED uint32_t flags)
 
static int _getNameAndIndex (const char *name, char *buffer, unsigned int size)
 
static int _readCsvLine (GWEN_FAST_BUFFER *fb, GWEN_STRINGLIST *sl)
 
static GWEN_STRINGLIST_splitFixedWithStringIntoStringlist (const char *s, int condense, GWEN_DB_NODE *cfg)
 
static void _stringListToDb (GWEN_STRINGLIST *sl, GWEN_DB_NODE *colgr, GWEN_DB_NODE *dbData)
 
GWENHYWFAR_EXPORT GWEN_PLUGINdbio_csv_factory (GWEN_PLUGIN_MANAGER *pm, const char *modName, const char *fileName)
 

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 31 of file csv.c.

Function Documentation

◆ _csvCheckFile() [1/2]

static GWEN_DBIO_CHECKFILE_RESULT _csvCheckFile ( GWEN_DBIO dbio,
const char *  fname 
)
static

Referenced by _csvFactory().

Here is the caller graph for this function:

◆ _csvCheckFile() [2/2]

GWEN_DBIO_CHECKFILE_RESULT _csvCheckFile ( GWEN_UNUSED GWEN_DBIO dbio,
const char *  fname 
)

◆ _csvExport() [1/2]

static int _csvExport ( GWEN_DBIO dbio,
GWEN_SYNCIO sio,
GWEN_DB_NODE data,
GWEN_DB_NODE cfg,
uint32_t  flags 
)
static

Referenced by _csvFactory().

Here is the caller graph for this function:

◆ _csvExport() [2/2]

int _csvExport ( GWEN_DBIO dbio,
GWEN_SYNCIO sio,
GWEN_DB_NODE data,
GWEN_DB_NODE cfg,
GWEN_UNUSED uint32_t  flags 
)

◆ _csvFactory() [1/2]

static GWEN_DBIO* _csvFactory ( GWEN_PLUGIN pl)
static

Referenced by dbio_csv_factory().

Here is the caller graph for this function:

◆ _csvFactory() [2/2]

GWEN_DBIO* _csvFactory ( GWEN_UNUSED GWEN_PLUGIN pl)

Definition at line 76 of file csv.c.

References _csvCheckFile(), _csvExport(), _csvImport(), GWEN_DBIO_new(), GWEN_DBIO_SetCheckFileFn(), GWEN_DBIO_SetExportFn(), and GWEN_DBIO_SetImportFn().

Here is the call graph for this function:

◆ _csvImport() [1/2]

static int _csvImport ( GWEN_DBIO dbio,
GWEN_SYNCIO sio,
GWEN_DB_NODE data,
GWEN_DB_NODE cfg,
uint32_t  flags 
)
static

Referenced by _csvFactory().

Here is the caller graph for this function:

◆ _csvImport() [2/2]

int _csvImport ( GWEN_DBIO dbio,
GWEN_SYNCIO sio,
GWEN_DB_NODE data,
GWEN_DB_NODE cfg,
GWEN_UNUSED uint32_t  flags 
)

◆ _getNameAndIndex()

int _getNameAndIndex ( const char *  name,
char *  buffer,
unsigned int  size 
)
static

Definition at line 672 of file csv.c.

References DBG_INFO.

Referenced by _csvExport().

Here is the caller graph for this function:

◆ _readCsvLine()

int _readCsvLine ( GWEN_FAST_BUFFER fb,
GWEN_STRINGLIST sl 
)
static

◆ _splitFixedWithStringIntoStringlist()

GWEN_STRINGLIST * _splitFixedWithStringIntoStringlist ( const char *  s,
int  condense,
GWEN_DB_NODE cfg 
)
static

Definition at line 500 of file csv.c.

References GWEN_DB_GetIntValue(), GWEN_StringList_AppendString(), GWEN_StringList_Count(), GWEN_StringList_free(), GWEN_StringList_new(), and NULL.

Referenced by _csvImport().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _stringListToDb()

void _stringListToDb ( GWEN_STRINGLIST sl,
GWEN_DB_NODE colgr,
GWEN_DB_NODE dbData 
)
static

◆ dbio_csv_factory()

GWEN_PLUGIN * dbio_csv_factory ( GWEN_PLUGIN_MANAGER pm,
const char *  modName,
const char *  fileName 
)

Definition at line 88 of file csv.c.

References _csvFactory(), GWEN_DBIO_Plugin_new(), and GWEN_DBIO_Plugin_SetFactoryFn().

Here is the call graph for this function: