2013-10-20 12:39:31 +00:00
|
|
|
/*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
Copyright 2006-2012 Chung, Hyung-Hwan.
|
|
|
|
This file is part of QSE.
|
|
|
|
|
|
|
|
QSE is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as
|
|
|
|
published by the Free Software Foundation, either version 3 of
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
QSE is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _QSE_LIB_CMN_FMT_H_
|
|
|
|
#define _QSE_LIB_CMN_FMT_H_
|
|
|
|
|
|
|
|
#include <qse/cmn/fmt.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
2013-10-24 14:55:15 +00:00
|
|
|
typedef int (*qse_fmtout_mchar_t) (
|
2013-10-21 08:39:53 +00:00
|
|
|
qse_mchar_t c,
|
|
|
|
void* ctx
|
|
|
|
);
|
|
|
|
|
2013-10-24 14:55:15 +00:00
|
|
|
typedef int (*qse_fmtout_wchar_t) (
|
|
|
|
qse_wchar_t c,
|
2013-10-21 08:39:53 +00:00
|
|
|
void* ctx
|
|
|
|
);
|
|
|
|
|
2013-10-24 14:55:15 +00:00
|
|
|
struct qse_fmtout_t
|
|
|
|
{
|
|
|
|
qse_size_t count; /* out */
|
|
|
|
qse_size_t limit; /* in */
|
|
|
|
void* ctx; /* in */
|
|
|
|
qse_fmtout_mchar_t put_mchar; /* in */
|
|
|
|
qse_fmtout_wchar_t put_wchar; /* in */
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct qse_fmtout_t qse_fmtout_t;
|
|
|
|
|
2013-10-20 12:39:31 +00:00
|
|
|
#ifdef __cplusplus
|
2013-10-24 14:55:15 +00:00
|
|
|
extern "C" {
|
2013-10-20 12:39:31 +00:00
|
|
|
#endif
|
|
|
|
|
2013-10-24 14:55:15 +00:00
|
|
|
int qse_mfmtout (
|
2013-10-20 12:39:31 +00:00
|
|
|
const qse_mchar_t* fmt,
|
2013-10-24 14:55:15 +00:00
|
|
|
qse_fmtout_t* data,
|
2013-10-20 12:39:31 +00:00
|
|
|
va_list ap
|
|
|
|
);
|
|
|
|
|
2013-10-24 14:55:15 +00:00
|
|
|
int qse_wfmtout (
|
2013-10-20 12:39:31 +00:00
|
|
|
const qse_wchar_t* fmt,
|
2013-10-24 14:55:15 +00:00
|
|
|
qse_fmtout_t* data,
|
2013-10-20 12:39:31 +00:00
|
|
|
va_list ap
|
|
|
|
);
|
|
|
|
|
2013-10-24 14:55:15 +00:00
|
|
|
#if defined(QSE_CHAR_IS_MCHAR)
|
|
|
|
# define qse_fmtout(fmt,fo,ap) qse_mfmtout(fmt,fo,ap)
|
|
|
|
#else
|
|
|
|
# define qse_fmtout(fmt,fo,ap) qse_wfmtout(fmt,fo,ap)
|
|
|
|
#endif
|
|
|
|
|
2013-10-20 12:39:31 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|