added a few functions for qse_env_t

This commit is contained in:
2011-08-06 11:08:21 +00:00
parent 5b92edfe50
commit a5e86b984c
6 changed files with 223 additions and 39 deletions

View File

@ -34,14 +34,14 @@ struct qse_env_t
{
qse_size_t capa;
qse_size_t len;
void* ptr;
} buf;
qse_char_t* ptr;
} str;
struct
{
qse_size_t capa;
qse_size_t len;
void** ptr;
qse_size_t capa;
qse_size_t len;
qse_char_t** ptr;
} arr;
};
@ -70,15 +70,26 @@ void qse_env_fini (
qse_env_t* env
);
/*
void* qse_env_getstring ();
void* qse_env_getarray ();
*/
void qse_env_clear (
qse_env_t* env
);
int qse_env_add (
#define qse_env_getstr(env) ((env)->str.ptr)
#define qse_env_getarr(env) ((env)->arr.ptr)
int qse_env_addvar (
qse_env_t* env,
const void* name,
const void* value
const qse_char_t* name,
const qse_char_t* value
);
int qse_env_addraw (
qse_env_t* env, /**< env */
const qse_char_t* raw /**< name=value */
);
int qse_env_loadcurvars (
qse_env_t* env
);
#ifdef __cplusplus

View File

@ -1,5 +1,5 @@
/*
* $Id: str.h 533 2011-08-04 15:43:28Z hyunghwan.chung $
* $Id: str.h 535 2011-08-05 17:08:21Z hyunghwan.chung $
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
@ -104,7 +104,7 @@ struct qse_mbs_t
{
QSE_DEFINE_COMMON_FIELDS (mbs)
qse_mbs_sizer_t sizer; /**< buffer resizer function */
qse_mxstr_t val; /**< buffer/string pointer and lengh */
qse_mxstr_t val; /**< buffer/string pointer and lengh */
qse_size_t capa; /**< buffer capacity */
};
@ -2302,7 +2302,6 @@ void qse_mbs_setsizer (
qse_mbs_t* str,
qse_mbs_sizer_t sizer
);
/******/
/**
* The qse_mbs_getcapa() function returns the current capacity.
@ -2472,7 +2471,6 @@ void qse_wcs_setsizer (
qse_wcs_t* str,
qse_wcs_sizer_t sizer
);
/******/
/**
* The qse_wcs_getcapa() function returns the current capacity.