gwenhywfar 5.12.0
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)
int _csvExport (GWEN_DBIO *dbio, GWEN_SYNCIO *sio, GWEN_DB_NODE *data, GWEN_DB_NODE *cfg, GWEN_UNUSED uint32_t flags)
static int _csvExport (GWEN_DBIO *dbio, GWEN_SYNCIO *sio, GWEN_DB_NODE *data, GWEN_DB_NODE *cfg, uint32_t flags)
static GWEN_DBIO_csvFactory (GWEN_PLUGIN *pl)
GWEN_DBIO_csvFactory (GWEN_UNUSED GWEN_PLUGIN *pl)
int _csvImport (GWEN_DBIO *dbio, GWEN_SYNCIO *sio, GWEN_DB_NODE *data, GWEN_DB_NODE *cfg, GWEN_UNUSED uint32_t flags)
static int _csvImport (GWEN_DBIO *dbio, GWEN_SYNCIO *sio, GWEN_DB_NODE *data, GWEN_DB_NODE *cfg, 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]

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]

◆ _csvExport() [1/2]

◆ _csvExport() [2/2]

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:

◆ _csvFactory() [1/2]

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(), GWEN_DBIO_SetImportFn(), and GWEN_UNUSED.

Here is the call graph for this function:

◆ _csvImport() [1/2]

◆ _csvImport() [2/2]

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:

◆ _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()

◆ _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()

◆ 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: