removed redundant code

This commit is contained in:
2011-12-28 14:26:02 +00:00
parent 29107a71be
commit bd7fd49a72
46 changed files with 156 additions and 424 deletions

View File

@ -1,4 +1,5 @@
#include <qse/cmn/env.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/str.h>
#include <qse/cmn/stdio.h>
@ -53,7 +54,7 @@ static int test1 (void)
{
qse_env_t* env;
env = qse_env_open (QSE_NULL, 0, 0);
env = qse_env_open (QSE_MMGR_GETDFL(), 0, 0);
qse_env_clear (env);
qse_env_insert (env, QSE_T("alice"), QSE_T("wonderland"));
@ -82,7 +83,7 @@ static int test2 (void)
{
qse_env_t* env;
env = qse_env_open (QSE_NULL, 0, 1);
env = qse_env_open (QSE_MMGR_GETDFL(), 0, 1);
qse_printf (QSE_T("DELETING HOME => %s\n"),
(qse_env_delete (env, QSE_T("HOME")) == 0?
@ -103,7 +104,7 @@ static int test3 (void)
{
qse_env_t* env;
env = qse_env_open (QSE_NULL, 0, 0);
env = qse_env_open (QSE_MMGR_GETDFL(), 0, 0);
qse_printf (QSE_T("inserting PATH => %d\n"), qse_env_insertsys (env, QSE_T("PATH")));
qse_printf (QSE_T("inserting HOME => %d\n"), qse_env_insertsysm (env, QSE_MT("HOME")));

View File

@ -1,4 +1,5 @@
#include <qse/cmn/fio.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/stdio.h>
#include <locale.h>
@ -19,7 +20,7 @@ static int test1 (void)
char buf[1000];
fio = qse_fio_open (
QSE_NULL,
QSE_MMGR_GETDFL(),
0,
QSE_T("fio1.txt"),
QSE_FIO_READ|QSE_FIO_WRITE|QSE_FIO_CREATE|QSE_FIO_TRUNCATE,
@ -104,7 +105,7 @@ static int test2 (void)
int i;
fio = qse_fio_open (
QSE_NULL,
QSE_MMGR_GETDFL(),
0,
QSE_T("fio2.txt"),
QSE_FIO_CREATE | QSE_FIO_TRUNCATE | QSE_FIO_APPEND,
@ -220,7 +221,7 @@ static int test3 (void)
qse_char_t buf[1000];
fio = qse_fio_open (
QSE_NULL,
QSE_MMGR_GETDFL(),
0,
QSE_T("fio3.txt"),

View File

@ -1,4 +1,5 @@
#include <qse/cmn/fio.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/stdio.h>
#define R(f) \
@ -18,7 +19,7 @@ static int test1 (void)
qse_char_t file[] = QSE_T("fio02-XXXX");
fio = qse_fio_open (
QSE_NULL,
QSE_MMGR_GETDFL(),
0,
file,
QSE_FIO_CREATE | QSE_FIO_EXCLUSIVE | QSE_FIO_TEMPORARY | QSE_FIO_READ | QSE_FIO_WRITE,

View File

@ -1,5 +1,5 @@
#include <qse/cmn/fs.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/stdio.h>
#include <qse/cmn/main.h>
@ -52,7 +52,7 @@ int fs_main (int argc, qse_char_t* argv[])
return -1;
}
fs = qse_fs_open (QSE_NULL, 0);
fs = qse_fs_open (QSE_MMGR_GETDFL(), 0);
if (fs == QSE_NULL)
{
qse_fprintf (QSE_STDERR, QSE_T("Error: Cannot open directory\n"), argv[1]);

View File

@ -47,7 +47,7 @@ static int test1 ()
long x;
qse_oht_t* oht;
oht = qse_oht_open (QSE_NULL, 0, QSE_SIZEOF(x), 10, 5);
oht = qse_oht_open (QSE_MMGR_GETDFL(), 0, QSE_SIZEOF(x), 10, 5);
if (oht == QSE_NULL)
{
qse_printf (QSE_T("failed to open a table\n"));
@ -84,7 +84,7 @@ static int test2 ()
item_t x;
qse_oht_t* oht;
oht = qse_oht_open (QSE_NULL, 0, QSE_SIZEOF(x), 10, 10);
oht = qse_oht_open (QSE_MMGR_GETDFL(), 0, QSE_SIZEOF(x), 10, 10);
if (oht == QSE_NULL)
{
qse_printf (QSE_T("failed to open a table\n"));

View File

@ -1,4 +1,5 @@
#include <qse/cmn/pio.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/env.h>
#include <qse/cmn/stdio.h>
@ -28,7 +29,7 @@ static int pio1 (const qse_char_t* cmd, qse_env_t* env, int oflags, qse_pio_hid_
int x;
pio = qse_pio_open (
QSE_NULL,
QSE_MMGR_GETDFL(),
0,
cmd,
env,
@ -88,7 +89,7 @@ static int pio2 (const qse_char_t* cmd, qse_env_t* env, int oflags, qse_pio_hid_
int x;
pio = qse_pio_open (
QSE_NULL,
QSE_MMGR_GETDFL(),
0,
cmd,
env,
@ -285,7 +286,7 @@ static int test11 (void)
qse_env_t* env;
int n;
env = qse_env_open (QSE_NULL, 0, 0);
env = qse_env_open (QSE_MMGR_GETDFL(), 0, 0);
if (env == QSE_NULL) return -1;
qse_env_insertsys (env, QSE_T("PATH"));
@ -312,7 +313,7 @@ static int test12 (void)
int x;
pio = qse_pio_open (
QSE_NULL,
QSE_MMGR_GETDFL(),
0,
#if defined(_WIN32) || defined(__OS2__) || defined(__DOS__)
QSE_T("tree.com"),

View File

@ -1,4 +1,5 @@
#include <qse/cmn/rex.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/str.h>
#include <qse/cmn/main.h>
#include <qse/cmn/path.h>
@ -19,7 +20,7 @@ static int rex_main (int argc, qse_char_t* argv[])
return -1;
}
rex = qse_rex_open (QSE_NULL, 0, QSE_NULL);
rex = qse_rex_open (QSE_MMGR_GETDFL(), 0, QSE_NULL);
if (rex == QSE_NULL)
{
qse_printf (QSE_T("ERROR: cannot open rex\n"));

View File

@ -1,4 +1,5 @@
#include <qse/cmn/rex.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/str.h>
#include <qse/cmn/stdio.h>
@ -197,7 +198,7 @@ void MyFrame::OnComp(wxCommandEvent& WXUNUSED(event))
{
if (rex == NULL)
{
rex = qse_rex_open (QSE_NULL, 0, QSE_NULL);
rex = qse_rex_open (QSE_MMGR_GETDFL(), 0, QSE_NULL);
if (rex == NULL)
{
wxMessageBox(_T("Cannot open rex"),

View File

@ -1,4 +1,5 @@
#include <qse/cmn/sio.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/fmt.h>
#include <qse/cmn/stdio.h>
#include <locale.h>
@ -51,7 +52,7 @@ static int test1 (void)
x[0] = unistr;
x[2] = unistr;
x[5] = unistr;
sio = qse_sio_open (QSE_NULL, 0, QSE_T("sio.txt"),
sio = qse_sio_open (QSE_MMGR_GETDFL(), 0, QSE_T("sio.txt"),
QSE_SIO_WRITE | QSE_SIO_CREATE | QSE_SIO_TRUNCATE);
if (sio == QSE_NULL)
@ -81,8 +82,8 @@ static int test2 (void)
qse_wchar_t buf[20];
qse_sio_t* in, * out;
in = qse_sio_openstd (QSE_NULL, 0, QSE_SIO_STDIN, QSE_SIO_READ | QSE_SIO_IGNOREMBWCERR);
out = qse_sio_openstd (QSE_NULL, 0, QSE_SIO_STDOUT, QSE_SIO_WRITE | QSE_SIO_IGNOREMBWCERR);
in = qse_sio_openstd (QSE_MMGR_GETDFL(), 0, QSE_SIO_STDIN, QSE_SIO_READ | QSE_SIO_IGNOREMBWCERR);
out = qse_sio_openstd (QSE_MMGR_GETDFL(), 0, QSE_SIO_STDOUT, QSE_SIO_WRITE | QSE_SIO_IGNOREMBWCERR);
qse_sio_putstr (out, QSE_T("Type something here:\n"));
while (1)
@ -113,8 +114,8 @@ static int test3 (void)
qse_mchar_t buf[20];
qse_sio_t* in, * out;
in = qse_sio_openstd (QSE_NULL, 0, QSE_SIO_STDIN, QSE_SIO_READ | QSE_SIO_IGNOREMBWCERR);
out = qse_sio_openstd (QSE_NULL, 0, QSE_SIO_STDOUT, QSE_SIO_WRITE | QSE_SIO_IGNOREMBWCERR);
in = qse_sio_openstd (QSE_MMGR_GETDFL(), 0, QSE_SIO_STDIN, QSE_SIO_READ | QSE_SIO_IGNOREMBWCERR);
out = qse_sio_openstd (QSE_MMGR_GETDFL(), 0, QSE_SIO_STDOUT, QSE_SIO_WRITE | QSE_SIO_IGNOREMBWCERR);
qse_sio_putstr (out, QSE_T("Type something here:\n"));
while (1)
@ -151,7 +152,7 @@ int main ()
setlocale (LC_ALL, "");
g_out = qse_sio_openstd (QSE_NULL, 0, QSE_SIO_STDOUT, QSE_SIO_WRITE | QSE_SIO_IGNOREMBWCERR);
g_out = qse_sio_openstd (QSE_MMGR_GETDFL(), 0, QSE_SIO_STDOUT, QSE_SIO_WRITE | QSE_SIO_IGNOREMBWCERR);
R (test1);
R (test2);

View File

@ -1,5 +1,6 @@
#include <qse/cmn/stdio.h>
#include <qse/cmn/sio.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/stdio.h>
#include <locale.h>
@ -55,7 +56,7 @@ static int test1 (void)
x[1] = unistr;
x[2] = unistr2;
sio = qse_sio_openstd (QSE_NULL, 0, QSE_SIO_STDOUT, QSE_SIO_READ | QSE_SIO_IGNOREMBWCERR | QSE_SIO_NOAUTOFLUSH);
sio = qse_sio_openstd (QSE_MMGR_GETDFL(), 0, QSE_SIO_STDOUT, QSE_SIO_READ | QSE_SIO_IGNOREMBWCERR | QSE_SIO_NOAUTOFLUSH);
if (sio == QSE_NULL) return -1;
for (i = 0; i < QSE_COUNTOF(x); i++)
@ -83,7 +84,7 @@ static int test2 (void)
int i;
qse_sio_t* sio;
sio = qse_sio_openstd (QSE_NULL, 0, QSE_SIO_STDOUT, QSE_SIO_READ | QSE_SIO_IGNOREMBWCERR | QSE_SIO_NOAUTOFLUSH);
sio = qse_sio_openstd (QSE_MMGR_GETDFL(), 0, QSE_SIO_STDOUT, QSE_SIO_READ | QSE_SIO_IGNOREMBWCERR | QSE_SIO_NOAUTOFLUSH);
if (sio == QSE_NULL) return -1;
for (i = 0; i < QSE_COUNTOF(x); i++)
@ -111,7 +112,7 @@ static int test3 (void)
int i;
qse_sio_t* sio;
sio = qse_sio_openstd (QSE_NULL, 0, QSE_SIO_STDOUT, QSE_SIO_READ | QSE_SIO_IGNOREMBWCERR | QSE_SIO_NOAUTOFLUSH);
sio = qse_sio_openstd (QSE_MMGR_GETDFL(), 0, QSE_SIO_STDOUT, QSE_SIO_READ | QSE_SIO_IGNOREMBWCERR | QSE_SIO_NOAUTOFLUSH);
if (sio == QSE_NULL) return -1;
for (i = 0; i < QSE_COUNTOF(x); i++)

View File

@ -18,7 +18,7 @@ static int test_main (int argc, qse_char_t* argv[], qse_char_t* envp[])
return -1;
}
qse_tre_init (&tre, QSE_NULL);
qse_tre_init (&tre, QSE_MMGR_GETDFL());
if (qse_tre_comp (&tre, argv[1], &nsubmat, 0 /*QSE_TRE_EXTENDED*/) <= -1)
{

View File

@ -1,4 +1,5 @@
#include <qse/cmn/xma.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/stdio.h>
#define R(f) \
@ -11,7 +12,7 @@ static int test1 ()
{
void* ptr[100];
qse_xma_t* xma = qse_xma_open (QSE_NULL, 0, 100000L);
qse_xma_t* xma = qse_xma_open (QSE_MMGR_GETDFL(), 0, 100000L);
if (xma == QSE_NULL)
{
qse_printf (QSE_T("cannot open xma\n"));
@ -40,7 +41,7 @@ static int test2 ()
{
void* ptr[100];
qse_xma_t* xma = qse_xma_open (QSE_NULL, 0, 100000L);
qse_xma_t* xma = qse_xma_open (QSE_MMGR_GETDFL(), 0, 100000L);
if (xma == QSE_NULL)
{
qse_printf (QSE_T("cannot open xma\n"));
@ -67,7 +68,7 @@ static int test3 ()
{
void* ptr[100];
qse_xma_t* xma = qse_xma_open (QSE_NULL, 0, 100000L);
qse_xma_t* xma = qse_xma_open (QSE_MMGR_GETDFL(), 0, 100000L);
if (xma == QSE_NULL)
{
qse_printf (QSE_T("cannot open xma\n"));
@ -97,7 +98,7 @@ static int test4 ()
int i;
void* ptr[100];
qse_xma_t* xma = qse_xma_open (QSE_NULL, 0, 2000000L);
qse_xma_t* xma = qse_xma_open (QSE_MMGR_GETDFL(), 0, 2000000L);
if (xma == QSE_NULL)
{
qse_printf (QSE_T("cannot open xma\n"));
@ -158,7 +159,7 @@ static int test5 ()
qse_xma_t* xma1, * xma2, * xma3;
xma1 = qse_xma_open (QSE_NULL, 0, 2000000L);
xma1 = qse_xma_open (QSE_MMGR_GETDFL(), 0, 2000000L);
if (xma1 == QSE_NULL)
{
qse_printf (QSE_T("cannot open outer xma\n"));

View File

@ -52,7 +52,7 @@ int dir_main (int argc, qse_char_t* argv[])
return -1;
}
dir = qse_dir_open (QSE_NULL, 0);
dir = qse_dir_open (QSE_MMGR_GETDFL(), 0);
if (dir == QSE_NULL)
{
qse_fprintf (QSE_STDERR, QSE_T("Error: Cannot open directory\n"), argv[1]);

View File

@ -3,6 +3,7 @@
#include <qse/cmn/stdio.h>
#include <qse/cmn/main.h>
#include <qse/cmn/str.h>
#include <qse/cmn/mem.h>
#include <signal.h>
#define MAX_SENDFILE_SIZE 4096
@ -168,7 +169,7 @@ int httpd_main (int argc, qse_char_t* argv[])
}
httpd = qse_httpd_open (QSE_NULL, QSE_SIZEOF(httpd_xtn_t));
httpd = qse_httpd_open (QSE_MMGR_GETDFL(), QSE_SIZEOF(httpd_xtn_t));
if (httpd == QSE_NULL)
{
qse_fprintf (QSE_STDERR, QSE_T("Cannot open httpd\n"));