src/t_csv_l.c
static inline void
t_csv_pushfield( lua_State *L, struct t_csv_row *row, enum t_csv_ste ste )
{
	if (0==row->len && T_CSV_FLDBEG==row->ste)
		lua_pushnil( L );
	else
	{
		while ('\r' == row->beg[row->len-1] && row->len > 0) (row->len)--;
		// push a \0 terminated string on stack that can be safely gsub()-ed
		if (row->hdb)
		{
			lua_pushlstring( L, row->beg, row->len );
			luaL_gsub( L, lua_tostring( L, -1 ), row->sdq, row->ssq ); // pushes rinsed result onto stack
			lua_replace( L, -2 );                                      // overwrite original with rinsed result
		}
		else
			lua_pushlstring( L, row->beg, row->len );
	}
#if PRINT_DEBUGS == 3
	printf(" (P:%s:%zu:%d]  ", lua_tostring(L,-1), row->len, row->cnt+1);
#endif
	lua_rawseti( L, -2, ++(row->cnt) );  // push field to row
	row->ste = ste;
}
/**--------------------------------------------------------------------------
 * Push the current partse value as a field into the rusult table
 * \param   L       Lua state.
 * \param   row     t_csv_row struct partsing atete for current row.
 * \param   ste     t_csv_ste enum to be set in row struct after pushing value
 * --------------------------------------------------------------------------*/
Push the current partse value as a field into the rusult table
\param   L       Lua state.
\param   row     t_csv_row struct partsing atete for current row.
\param   ste     t_csv_ste enum to be set in row struct after pushing value
Push the current partse value as a field into the rusult table \ param L Lua state . \ param row t_csv_row struct partsing atete for current row . \ param ste t_csv_ste enum to be set in row struct after pushing value
static inline void
t_csv_pushfield( lua_State *L, struct t_csv_row *row, enum t_csv_ste ste )
{
	if (0==row->len && T_CSV_FLDBEG==row->ste)
		lua_pushnil( L );
	else
	{
		while ('\r' == row->beg[row->len-1] && row->len > 0) (row->len)--;
		if (row->hdb)
		{
			lua_pushlstring( L, row->beg, row->len );
			luaL_gsub( L, lua_tostring( L, -1 ), row->sdq, row->ssq ); 
			lua_replace( L, -2 );                                      
		}
		else
			lua_pushlstring( L, row->beg, row->len );
	}
#if PRINT_DEBUGS == 3
	printf(" (P:%s:%zu:%d]  ", lua_tostring(L,-1), row->len, row->cnt+1);
#endif
	lua_rawseti( L, -2, ++(row->cnt) );  
	row->ste = ste;
}
static inline void t_csv_pushfield ( lua_State * L , struct t_csv_row * row , enum t_csv_ste ste ) { if ( 0 == row -> len && T_CSV_FLDBEG == row -> ste ) lua_pushnil ( L ) ; else { while ( ' \r ' == row -> beg [ row -> len - 1 ] && row -> len > 0 ) ( row -> len ) -- ; if ( row -> hdb ) { lua_pushlstring ( L , row -> beg , row -> len ) ; luaL_gsub ( L , lua_tostring ( L , -1 ) , row -> sdq , row -> ssq ) ; lua_replace ( L , -2 ) ; } else lua_pushlstring ( L , row -> beg , row -> len ) ; } #if PRINT_DEBUGS == 3 printf ( " " , lua_tostring ( L , -1 ) , row -> len , row -> cnt + 1 ) ; #endif lua_rawseti ( L , -2 , ++ ( row -> cnt ) ) ; row -> ste = ste ; }
Push the current partse value as a field into the rusult table
 \param   L       Lua state.
Push the current partse value as a field into the rusult table \ param L Lua state .
// push a \0 terminated string on stack that can be safely gsub()-ed // pushes rinsed result onto stack // overwrite original with rinsed result // push field to row