fixed wrong eol style for some files
This commit is contained in:
parent
680c45e9ed
commit
287d67101a
@ -32,9 +32,9 @@
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
#elif defined(__OS2__)
|
||||
# define INCL_DOSPROCESS
|
||||
# include <windows.h>
|
||||
#elif defined(__OS2__)
|
||||
# define INCL_DOSPROCESS
|
||||
# include <os2.h>
|
||||
#else
|
||||
# include "syscall.h"
|
||||
@ -151,8 +151,8 @@ void qse_assert_failed (
|
||||
qse_sio_flush (QSE_SIO_ERR);
|
||||
|
||||
#if defined(_WIN32)
|
||||
ExitProcess (1);
|
||||
#elif defined(__OS2__)
|
||||
ExitProcess (1);
|
||||
#elif defined(__OS2__)
|
||||
DosExit (EXIT_PROCESS, 1);
|
||||
#else
|
||||
QSE_KILL (QSE_GETPID(), SIGABRT);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: chr_cnv.c 396 2011-03-14 15:40:35Z hyunghwan.chung $
|
||||
* $Id: chr_cnv.c 400 2011-03-16 08:37:06Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -20,16 +20,16 @@
|
||||
|
||||
#include <qse/cmn/chr.h>
|
||||
#include "mem.h"
|
||||
|
||||
#if !defined(QSE_HAVE_CONFIG_H)
|
||||
# if defined(_WIN32) || defined(__OS2__)
|
||||
# define HAVE_WCHAR_H
|
||||
# define HAVE_STDLIB_H
|
||||
# define HAVE_MBRLEN
|
||||
# define HAVE_MBRTOWC
|
||||
# define HAVE_WCRTOMB
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(QSE_HAVE_CONFIG_H)
|
||||
# if defined(_WIN32) || defined(__OS2__)
|
||||
# define HAVE_WCHAR_H
|
||||
# define HAVE_STDLIB_H
|
||||
# define HAVE_MBRLEN
|
||||
# define HAVE_MBRTOWC
|
||||
# define HAVE_WCRTOMB
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WCHAR_H
|
||||
# include <wchar.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dll.c 396 2011-03-14 15:40:35Z hyunghwan.chung $
|
||||
* $Id: dll.c 400 2011-03-16 08:37:06Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -107,7 +107,7 @@ int qse_dll_getscale (qse_dll_t* dll)
|
||||
void qse_dll_setscale (qse_dll_t* dll, int scale)
|
||||
{
|
||||
QSE_ASSERTX (scale > 0 && scale <= QSE_TYPE_MAX(qse_byte_t),
|
||||
"The scale should be larger than 0 and less than or equal to the maximum value that the qse_byte_t type can hold"
|
||||
"The scale should be larger than 0 and less than or equal to the maximum value that the qse_byte_t type can hold"
|
||||
);
|
||||
|
||||
if (scale <= 0) scale = 1;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fio.c 397 2011-03-15 03:40:39Z hyunghwan.chung $
|
||||
* $Id: fio.c 400 2011-03-16 08:37:06Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -25,10 +25,10 @@
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
# include <psapi.h>
|
||||
# include <tchar.h>
|
||||
#elif defined(__OS2__)
|
||||
# define INCL_DOSFILEMGR
|
||||
# define INCL_DOSERRORS
|
||||
# include <tchar.h>
|
||||
#elif defined(__OS2__)
|
||||
# define INCL_DOSFILEMGR
|
||||
# define INCL_DOSERRORS
|
||||
# include <os2.h>
|
||||
#else
|
||||
# include "syscall.h"
|
||||
@ -160,66 +160,66 @@ qse_fio_t* qse_fio_init (
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: support more features on WIN32 - TEMPORARY, DELETE_ON_CLOSE */
|
||||
|
||||
#elif defined(__OS2__)
|
||||
|
||||
if (flags & QSE_FIO_HANDLE)
|
||||
{
|
||||
handle = *(qse_fio_hnd_t*)path;
|
||||
}
|
||||
else
|
||||
{
|
||||
APIRET ret;
|
||||
ULONG action_taken = 0;
|
||||
ULONG open_action, open_mode;
|
||||
LONGLONG zero;
|
||||
|
||||
zero.ulLo = 0;
|
||||
zero.ulHi = 0;
|
||||
|
||||
if (flags & QSE_FIO_CREATE)
|
||||
{
|
||||
if (flags & QSE_FIO_EXCLUSIVE)
|
||||
{
|
||||
open_action = OPEN_ACTION_FAIL_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
|
||||
}
|
||||
else if (flags & QSE_FIO_TRUNCATE)
|
||||
{
|
||||
open_action = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
|
||||
}
|
||||
else
|
||||
{
|
||||
open_action = OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS;
|
||||
}
|
||||
}
|
||||
else if (flags & QSE_FIO_TRUNCATE)
|
||||
{
|
||||
open_action = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW;
|
||||
}
|
||||
else
|
||||
{
|
||||
open_action = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW;
|
||||
}
|
||||
|
||||
open_mode = OPEN_FLAGS_NOINHERIT | OPEN_SHARE_DENYNONE;
|
||||
if ((flags & QSE_FIO_READ) &&
|
||||
(flags & QSE_FIO_WRITE)) open_mode |= OPEN_ACCESS_READWRITE;
|
||||
else if (flags & QSE_FIO_READ) open_mode |= OPEN_ACCESS_READONLY;
|
||||
else if (flags & QSE_FIO_WRITE) open_mode |= OPEN_ACCESS_WRITEONLY;
|
||||
|
||||
ret = DosOpenL (
|
||||
path, /* file name */
|
||||
&handle, /* file handle */
|
||||
&action_taken, /* store action taken */
|
||||
zero, /* size */
|
||||
FILE_NORMAL, /* attribute */
|
||||
open_action, /* action if it exists */
|
||||
open_mode, /* open mode */
|
||||
0L
|
||||
);
|
||||
|
||||
if (ret != NO_ERROR) return QSE_NULL;
|
||||
/* TODO: support more features on WIN32 - TEMPORARY, DELETE_ON_CLOSE */
|
||||
|
||||
#elif defined(__OS2__)
|
||||
|
||||
if (flags & QSE_FIO_HANDLE)
|
||||
{
|
||||
handle = *(qse_fio_hnd_t*)path;
|
||||
}
|
||||
else
|
||||
{
|
||||
APIRET ret;
|
||||
ULONG action_taken = 0;
|
||||
ULONG open_action, open_mode;
|
||||
LONGLONG zero;
|
||||
|
||||
zero.ulLo = 0;
|
||||
zero.ulHi = 0;
|
||||
|
||||
if (flags & QSE_FIO_CREATE)
|
||||
{
|
||||
if (flags & QSE_FIO_EXCLUSIVE)
|
||||
{
|
||||
open_action = OPEN_ACTION_FAIL_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
|
||||
}
|
||||
else if (flags & QSE_FIO_TRUNCATE)
|
||||
{
|
||||
open_action = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
|
||||
}
|
||||
else
|
||||
{
|
||||
open_action = OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS;
|
||||
}
|
||||
}
|
||||
else if (flags & QSE_FIO_TRUNCATE)
|
||||
{
|
||||
open_action = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW;
|
||||
}
|
||||
else
|
||||
{
|
||||
open_action = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW;
|
||||
}
|
||||
|
||||
open_mode = OPEN_FLAGS_NOINHERIT | OPEN_SHARE_DENYNONE;
|
||||
if ((flags & QSE_FIO_READ) &&
|
||||
(flags & QSE_FIO_WRITE)) open_mode |= OPEN_ACCESS_READWRITE;
|
||||
else if (flags & QSE_FIO_READ) open_mode |= OPEN_ACCESS_READONLY;
|
||||
else if (flags & QSE_FIO_WRITE) open_mode |= OPEN_ACCESS_WRITEONLY;
|
||||
|
||||
ret = DosOpenL (
|
||||
path, /* file name */
|
||||
&handle, /* file handle */
|
||||
&action_taken, /* store action taken */
|
||||
zero, /* size */
|
||||
FILE_NORMAL, /* attribute */
|
||||
open_action, /* action if it exists */
|
||||
open_mode, /* open mode */
|
||||
0L
|
||||
);
|
||||
|
||||
if (ret != NO_ERROR) return QSE_NULL;
|
||||
}
|
||||
#else
|
||||
|
||||
@ -291,8 +291,8 @@ qse_fio_t* qse_fio_init (
|
||||
QSE_CATCH_ERR (tio)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
CloseHandle (handle);
|
||||
#elif defined(__OS2__)
|
||||
CloseHandle (handle);
|
||||
#elif defined(__OS2__)
|
||||
DosClose (handle);
|
||||
#else
|
||||
QSE_CLOSE (handle);
|
||||
@ -312,8 +312,8 @@ void qse_fio_fini (qse_fio_t* fio)
|
||||
{
|
||||
if (fio->tio != QSE_NULL) qse_tio_close (fio->tio);
|
||||
#if defined(_WIN32)
|
||||
CloseHandle (fio->handle);
|
||||
#elif defined(__OS2__)
|
||||
CloseHandle (fio->handle);
|
||||
#elif defined(__OS2__)
|
||||
DosClose (fio->handle);
|
||||
#else
|
||||
QSE_CLOSE (fio->handle);
|
||||
@ -362,26 +362,26 @@ qse_fio_off_t qse_fio_seek (
|
||||
}
|
||||
|
||||
return (qse_fio_off_t)x.QuadPart;
|
||||
*/
|
||||
#elif defined(__OS2__)
|
||||
static int seek_map[] =
|
||||
{
|
||||
FILE_BEGIN,
|
||||
FILE_CURRENT,
|
||||
FILE_END
|
||||
};
|
||||
|
||||
LONGLONG pos, newpos;
|
||||
APIRET ret;
|
||||
|
||||
QSE_ASSERT (QSE_SIZEOF(offset) >= QSE_SIZEOF(pos));
|
||||
|
||||
pos.ulLo = (ULONG)(offset&0xFFFFFFFFlu);
|
||||
pos.ulHi = (ULONG)(offset>>32);
|
||||
*/
|
||||
#elif defined(__OS2__)
|
||||
static int seek_map[] =
|
||||
{
|
||||
FILE_BEGIN,
|
||||
FILE_CURRENT,
|
||||
FILE_END
|
||||
};
|
||||
|
||||
LONGLONG pos, newpos;
|
||||
APIRET ret;
|
||||
|
||||
QSE_ASSERT (QSE_SIZEOF(offset) >= QSE_SIZEOF(pos));
|
||||
|
||||
pos.ulLo = (ULONG)(offset&0xFFFFFFFFlu);
|
||||
pos.ulHi = (ULONG)(offset>>32);
|
||||
|
||||
ret = DosSetFilePtrL (fio->handle, pos, seek_map[origin], &newpos);
|
||||
if (ret != NO_ERROR) return (qse_fio_off_t)-1;
|
||||
|
||||
ret = DosSetFilePtrL (fio->handle, pos, seek_map[origin], &newpos);
|
||||
if (ret != NO_ERROR) return (qse_fio_off_t)-1;
|
||||
|
||||
return ((qse_fio_off_t)pos.ulHi << 32) | pos.ulLo;
|
||||
#else
|
||||
static int seek_map[] =
|
||||
@ -423,16 +423,16 @@ int qse_fio_truncate (qse_fio_t* fio, qse_fio_off_t size)
|
||||
if (SetFilePointerEx(fio->handle,x,NULL,FILE_BEGIN) == FALSE ||
|
||||
SetEndOfFile(fio->handle) == FALSE) return -1;
|
||||
|
||||
return 0;
|
||||
#elif defined(__OS2__)
|
||||
APIRET ret;
|
||||
LONGLONG sz;
|
||||
/* the file must have the write access for it to succeed */
|
||||
|
||||
sz.ulLo = (ULONG)(size&0xFFFFFFFFlu);
|
||||
sz.ulHi = (ULONG)(size>>32);
|
||||
|
||||
ret = DosSetFileSizeL (fio->handle, sz);
|
||||
return 0;
|
||||
#elif defined(__OS2__)
|
||||
APIRET ret;
|
||||
LONGLONG sz;
|
||||
/* the file must have the write access for it to succeed */
|
||||
|
||||
sz.ulLo = (ULONG)(size&0xFFFFFFFFlu);
|
||||
sz.ulHi = (ULONG)(size>>32);
|
||||
|
||||
ret = DosSetFileSizeL (fio->handle, sz);
|
||||
return (ret == NO_ERROR)? 0: -1;
|
||||
#else
|
||||
return QSE_FTRUNCATE (fio->handle, size);
|
||||
@ -445,11 +445,11 @@ static qse_ssize_t fio_read (qse_fio_t* fio, void* buf, qse_size_t size)
|
||||
DWORD count;
|
||||
if (size > QSE_TYPE_MAX(DWORD)) size = QSE_TYPE_MAX(DWORD);
|
||||
if (ReadFile(fio->handle, buf, (DWORD)size, &count, QSE_NULL) == FALSE) return -1;
|
||||
return (qse_ssize_t)count;
|
||||
#elif defined(__OS2__)
|
||||
ULONG count;
|
||||
if (size > QSE_TYPE_MAX(ULONG)) size = QSE_TYPE_MAX(ULONG);
|
||||
if (DosRead (fio->handle, buf, (ULONG)size, &count) != NO_ERROR) return -1;
|
||||
return (qse_ssize_t)count;
|
||||
#elif defined(__OS2__)
|
||||
ULONG count;
|
||||
if (size > QSE_TYPE_MAX(ULONG)) size = QSE_TYPE_MAX(ULONG);
|
||||
if (DosRead (fio->handle, buf, (ULONG)size, &count) != NO_ERROR) return -1;
|
||||
return (qse_ssize_t)count;
|
||||
#else
|
||||
if (size > QSE_TYPE_MAX(size_t)) size = QSE_TYPE_MAX(size_t);
|
||||
@ -471,11 +471,11 @@ static qse_ssize_t fio_write (qse_fio_t* fio, const void* data, qse_size_t size)
|
||||
DWORD count;
|
||||
if (size > QSE_TYPE_MAX(DWORD)) size = QSE_TYPE_MAX(DWORD);
|
||||
if (WriteFile(fio->handle, data, (DWORD)size, &count, QSE_NULL) == FALSE) return -1;
|
||||
return (qse_ssize_t)count;
|
||||
#elif defined(__OS2__)
|
||||
ULONG count;
|
||||
if (size > QSE_TYPE_MAX(ULONG)) size = QSE_TYPE_MAX(ULONG);
|
||||
if (DosWrite(fio->handle, (PVOID)data, (ULONG)size, &count) != NO_ERROR) return -1;
|
||||
return (qse_ssize_t)count;
|
||||
#elif defined(__OS2__)
|
||||
ULONG count;
|
||||
if (size > QSE_TYPE_MAX(ULONG)) size = QSE_TYPE_MAX(ULONG);
|
||||
if (DosWrite(fio->handle, (PVOID)data, (ULONG)size, &count) != NO_ERROR) return -1;
|
||||
return (qse_ssize_t)count;
|
||||
#else
|
||||
if (size > QSE_TYPE_MAX(size_t)) size = QSE_TYPE_MAX(size_t);
|
||||
@ -599,24 +599,24 @@ int qse_fio_chmod (qse_fio_t* fio, int mode)
|
||||
qse_char_t name[MAX_PATH];
|
||||
|
||||
/* it is a best effort implementation. if the file size is 0,
|
||||
* it can't even get the file name from the handle and thus fails.
|
||||
* it can't even get the file name from the handle and thus fails.
|
||||
*/
|
||||
if (get_volname_from_handle (
|
||||
fio->handle, name, QSE_COUNTOF(name)) == -1) return -1;
|
||||
|
||||
if (!(mode & QSE_FIO_WUSR)) flags = FILE_ATTRIBUTE_READONLY;
|
||||
return (SetFileAttributes (name, flags) == FALSE)? -1: 0;
|
||||
#elif defined(__OS2__)
|
||||
int flags = FILE_NORMAL;
|
||||
FILESTATUS3L stat;
|
||||
ULONG size = QSE_SIZEOF(stat);
|
||||
|
||||
if (DosQueryFileInfo (fio->handle, FIL_STANDARDL, &stat, size) != NO_ERROR) return -1;
|
||||
|
||||
if (!(mode & QSE_FIO_WUSR)) flags = FILE_READONLY;
|
||||
|
||||
stat.attrFile = flags;
|
||||
return (DosSetFileInfo (fio->handle, FIL_STANDARDL, &stat, size) != NO_ERROR)? -1: 0;
|
||||
return (SetFileAttributes (name, flags) == FALSE)? -1: 0;
|
||||
#elif defined(__OS2__)
|
||||
int flags = FILE_NORMAL;
|
||||
FILESTATUS3L stat;
|
||||
ULONG size = QSE_SIZEOF(stat);
|
||||
|
||||
if (DosQueryFileInfo (fio->handle, FIL_STANDARDL, &stat, size) != NO_ERROR) return -1;
|
||||
|
||||
if (!(mode & QSE_FIO_WUSR)) flags = FILE_READONLY;
|
||||
|
||||
stat.attrFile = flags;
|
||||
return (DosSetFileInfo (fio->handle, FIL_STANDARDL, &stat, size) != NO_ERROR)? -1: 0;
|
||||
#else
|
||||
return QSE_FCHMOD (fio->handle, mode);
|
||||
#endif
|
||||
@ -625,8 +625,8 @@ int qse_fio_chmod (qse_fio_t* fio, int mode)
|
||||
int qse_fio_sync (qse_fio_t* fio)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return (FlushFileBuffers (fio->handle) == FALSE)? -1: 0;
|
||||
#elif defined(__OS2__)
|
||||
return (FlushFileBuffers (fio->handle) == FALSE)? -1: 0;
|
||||
#elif defined(__OS2__)
|
||||
return (DosResetBuffer (fio->handle) == NO_ERROR)? 0: -1;
|
||||
#else
|
||||
return QSE_FSYNC (fio->handle);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: pio.c 398 2011-03-15 15:20:03Z hyunghwan.chung $
|
||||
* $Id: pio.c 400 2011-03-16 08:37:06Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -24,10 +24,10 @@
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
# include <tchar.h>
|
||||
#elif defined(__OS2__)
|
||||
# define INCL_DOSPROCESS
|
||||
# define INCL_DOSERRORS
|
||||
# include <tchar.h>
|
||||
#elif defined(__OS2__)
|
||||
# define INCL_DOSPROCESS
|
||||
# define INCL_DOSERRORS
|
||||
# include <os2.h>
|
||||
#else
|
||||
# include "syscall.h"
|
||||
@ -102,8 +102,8 @@ qse_pio_t* qse_pio_init (
|
||||
STARTUPINFO startup;
|
||||
qse_char_t* dup = QSE_NULL;
|
||||
HANDLE windevnul = INVALID_HANDLE_VALUE;
|
||||
BOOL x;
|
||||
#elif defined(__OS2__)
|
||||
BOOL x;
|
||||
#elif defined(__OS2__)
|
||||
/* TODO: implmenet this for os/2 */
|
||||
#else
|
||||
qse_pio_pid_t pid;
|
||||
@ -273,8 +273,8 @@ qse_pio_t* qse_pio_init (
|
||||
}
|
||||
|
||||
CloseHandle (procinfo.hThread);
|
||||
pio->child = procinfo.hProcess;
|
||||
#elif defined(__OS2__)
|
||||
pio->child = procinfo.hProcess;
|
||||
#elif defined(__OS2__)
|
||||
/* TODO: implement this for OS/2 */
|
||||
#else
|
||||
|
||||
@ -609,9 +609,9 @@ oops:
|
||||
if (tio[i] != QSE_NULL) qse_tio_close (tio[i]);
|
||||
}
|
||||
#if defined(_WIN32)
|
||||
for (i = minidx; i < maxidx; i++) CloseHandle (handle[i]);
|
||||
#elif defined(__OS2__)
|
||||
/* TODO: */
|
||||
for (i = minidx; i < maxidx; i++) CloseHandle (handle[i]);
|
||||
#elif defined(__OS2__)
|
||||
/* TODO: */
|
||||
for (i = minidx; i < maxidx; i++) DosClose (handle[i]);
|
||||
#else
|
||||
for (i = minidx; i < maxidx; i++) QSE_CLOSE (handle[i]);
|
||||
@ -678,9 +678,9 @@ static qse_ssize_t pio_read (
|
||||
qse_pio_t* pio, void* buf, qse_size_t size, qse_pio_hnd_t hnd)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
DWORD count;
|
||||
#elif defined(__OS2__)
|
||||
ULONG count;
|
||||
DWORD count;
|
||||
#elif defined(__OS2__)
|
||||
ULONG count;
|
||||
APIRET rc;
|
||||
#else
|
||||
qse_ssize_t n;
|
||||
@ -703,16 +703,16 @@ static qse_ssize_t pio_read (
|
||||
pio->errnum = QSE_PIO_ESUBSYS;
|
||||
return -1;
|
||||
}
|
||||
return (qse_ssize_t)count;
|
||||
#elif defined(__OS2__)
|
||||
if (size > QSE_TYPE_MAX(ULONG)) size = QSE_TYPE_MAX(ULONG);
|
||||
rc = DosRead (hnd, buf, (ULONG)size, &count);
|
||||
if (rc != NO_ERROR)
|
||||
{
|
||||
if (rc == ERROR_BROKEN_PIPE) return 0; /* TODO: check this */
|
||||
pio->errnum = QSE_PIO_ESUBSYS;
|
||||
return -1;
|
||||
}
|
||||
return (qse_ssize_t)count;
|
||||
#elif defined(__OS2__)
|
||||
if (size > QSE_TYPE_MAX(ULONG)) size = QSE_TYPE_MAX(ULONG);
|
||||
rc = DosRead (hnd, buf, (ULONG)size, &count);
|
||||
if (rc != NO_ERROR)
|
||||
{
|
||||
if (rc == ERROR_BROKEN_PIPE) return 0; /* TODO: check this */
|
||||
pio->errnum = QSE_PIO_ESUBSYS;
|
||||
return -1;
|
||||
}
|
||||
return (qse_ssize_t)count;
|
||||
#else
|
||||
|
||||
@ -755,9 +755,9 @@ static qse_ssize_t pio_write (
|
||||
qse_pio_t* pio, const void* data, qse_size_t size, qse_pio_hnd_t hnd)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
DWORD count;
|
||||
#elif defined(__OS2__)
|
||||
ULONG count;
|
||||
DWORD count;
|
||||
#elif defined(__OS2__)
|
||||
ULONG count;
|
||||
APIRET rc;
|
||||
#else
|
||||
qse_ssize_t n;
|
||||
@ -778,17 +778,17 @@ static qse_ssize_t pio_write (
|
||||
QSE_PIO_EPIPE: QSE_PIO_ESUBSYS;
|
||||
return -1;
|
||||
}
|
||||
return (qse_ssize_t)count;
|
||||
#elif defined(__OS2__)
|
||||
if (size > QSE_TYPE_MAX(ULONG)) size = QSE_TYPE_MAX(ULONG);
|
||||
rc = DosWrite (hnd, (PVOID)data, (ULONG)size, &count);
|
||||
if (rc != NO_ERROR)
|
||||
{
|
||||
pio->errnum = (rc == ERROR_BROKEN_PIPE)?
|
||||
QSE_PIO_EPIPE: QSE_PIO_ESUBSYS; /* TODO: check this */
|
||||
return -1;
|
||||
}
|
||||
return (qse_ssize_t)count;
|
||||
return (qse_ssize_t)count;
|
||||
#elif defined(__OS2__)
|
||||
if (size > QSE_TYPE_MAX(ULONG)) size = QSE_TYPE_MAX(ULONG);
|
||||
rc = DosWrite (hnd, (PVOID)data, (ULONG)size, &count);
|
||||
if (rc != NO_ERROR)
|
||||
{
|
||||
pio->errnum = (rc == ERROR_BROKEN_PIPE)?
|
||||
QSE_PIO_EPIPE: QSE_PIO_ESUBSYS; /* TODO: check this */
|
||||
return -1;
|
||||
}
|
||||
return (qse_ssize_t)count;
|
||||
|
||||
#else
|
||||
if (size > QSE_TYPE_MAX(size_t)) size = QSE_TYPE_MAX(size_t);
|
||||
@ -843,8 +843,8 @@ void qse_pio_end (qse_pio_t* pio, qse_pio_hid_t hid)
|
||||
if (pio->pin[hid].handle != QSE_PIO_HND_NIL)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
CloseHandle (pio->pin[hid].handle);
|
||||
#elif defined(__OS2__)
|
||||
CloseHandle (pio->pin[hid].handle);
|
||||
#elif defined(__OS2__)
|
||||
DosClose (pio->pin[hid].handle);
|
||||
#else
|
||||
QSE_CLOSE (pio->pin[hid].handle);
|
||||
@ -906,9 +906,9 @@ int qse_pio_wait (qse_pio_t* pio)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ecode;
|
||||
#elif defined(__OS2__)
|
||||
/* TODO: implement this */
|
||||
return ecode;
|
||||
#elif defined(__OS2__)
|
||||
/* TODO: implement this */
|
||||
return -1;
|
||||
#else
|
||||
int opt = 0;
|
||||
@ -990,8 +990,8 @@ int qse_pio_wait (qse_pio_t* pio)
|
||||
int qse_pio_kill (qse_pio_t* pio)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
DWORD n;
|
||||
#elif defined(__OS2__)
|
||||
DWORD n;
|
||||
#elif defined(__OS2__)
|
||||
APIRET n;
|
||||
#else
|
||||
int n;
|
||||
@ -1011,16 +1011,16 @@ int qse_pio_kill (qse_pio_t* pio)
|
||||
pio->errnum = QSE_PIO_ESUBSYS;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
#elif defined(__OS2__)
|
||||
|
||||
/*TODO: must use DKP_PROCESSTREE? */
|
||||
n = DosKillProcess (pio->child, DKP_PROCESS);
|
||||
if (n != NO_ERROR)
|
||||
{
|
||||
pio->errnum = QSE_PIO_ESUBSYS;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
#elif defined(__OS2__)
|
||||
|
||||
/*TODO: must use DKP_PROCESSTREE? */
|
||||
n = DosKillProcess (pio->child, DKP_PROCESS);
|
||||
if (n != NO_ERROR)
|
||||
{
|
||||
pio->errnum = QSE_PIO_ESUBSYS;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
n = QSE_KILL (pio->child, SIGKILL);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: rex.c 398 2011-03-15 15:20:03Z hyunghwan.chung $
|
||||
* $Id: rex.c 400 2011-03-16 08:37:06Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -887,15 +887,15 @@ static qse_rex_node_t* comp_atom (comp_t* com)
|
||||
default:
|
||||
if (com->rex->option & QSE_REX_STRICT)
|
||||
{
|
||||
qse_char_t spc[] =
|
||||
{
|
||||
QSE_T(')'),
|
||||
QSE_T('?'),
|
||||
QSE_T('*'),
|
||||
QSE_T('+'),
|
||||
QSE_T('{'),
|
||||
QSE_T('\0')
|
||||
};
|
||||
qse_char_t spc[] =
|
||||
{
|
||||
QSE_T(')'),
|
||||
QSE_T('?'),
|
||||
QSE_T('*'),
|
||||
QSE_T('+'),
|
||||
QSE_T('{'),
|
||||
QSE_T('\0')
|
||||
};
|
||||
|
||||
if (com->rex->option & QSE_REX_NOBOUND)
|
||||
spc[4] = QSE_T('\0');
|
||||
|
@ -360,12 +360,12 @@ QSE_FILE* qse_fopen (const qse_char_t* path, const qse_char_t* mode)
|
||||
}
|
||||
|
||||
QSE_FILE* qse_popen (const qse_char_t* cmd, const qse_char_t* mode)
|
||||
{
|
||||
#if defined(QSE_CHAR_IS_MCHAR)
|
||||
#if defined(__OS2__)
|
||||
return _popen (cmd, mode);
|
||||
{
|
||||
#if defined(QSE_CHAR_IS_MCHAR)
|
||||
#if defined(__OS2__)
|
||||
return _popen (cmd, mode);
|
||||
#else
|
||||
return popen (cmd, mode);
|
||||
return popen (cmd, mode);
|
||||
#endif
|
||||
#elif defined(_WIN32) || defined(__OS2__)
|
||||
return _wpopen (cmd, mode);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: time.c 398 2011-03-15 15:20:03Z hyunghwan.chung $
|
||||
* $Id: time.c 400 2011-03-16 08:37:06Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -22,8 +22,8 @@
|
||||
#include "mem.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
#elif defined(__OS2__)
|
||||
# include <windows.h>
|
||||
#elif defined(__OS2__)
|
||||
# include <os2.h>
|
||||
#else
|
||||
# include "syscall.h"
|
||||
@ -88,9 +88,9 @@ int qse_gettime (qse_ntime_t* t)
|
||||
if (SystemTimeToFileTime (&st, &ft) == FALSE) return -1;
|
||||
*t = ((qse_ntime_t)(*((qse_int64_t*)&ft)) / (10 * 1000));
|
||||
*t -= EPOCH_DIFF_MSECS;
|
||||
return 0;
|
||||
#elif defined(__OS2__)
|
||||
/* TODO: implement this */
|
||||
return 0;
|
||||
#elif defined(__OS2__)
|
||||
/* TODO: implement this */
|
||||
return -1;
|
||||
#else
|
||||
struct timeval tv;
|
||||
@ -114,9 +114,9 @@ int qse_settime (qse_ntime_t t)
|
||||
*((qse_int64_t*)&ft) = ((t + EPOCH_DIFF_MSECS) * (10 * 1000));
|
||||
if (FileTimeToSystemTime (&ft, &st) == FALSE) return -1;
|
||||
if (SetSystemTime(&st) == FALSE) return -1;
|
||||
return 0;
|
||||
#elif defined(__OS2__)
|
||||
/* TODO: implement this */
|
||||
return 0;
|
||||
#elif defined(__OS2__)
|
||||
/* TODO: implement this */
|
||||
return -1;
|
||||
#else
|
||||
struct timeval tv;
|
||||
@ -224,7 +224,7 @@ int qse_localtime (qse_ntime_t nt, qse_btime_t* bt)
|
||||
|
||||
/* TODO: remove dependency on localtime/localtime_r */
|
||||
#if defined(_WIN32)
|
||||
tm = localtime (&t);
|
||||
tm = localtime (&t);
|
||||
#elif defined(__OS2__)
|
||||
#else
|
||||
struct tm btm;
|
||||
|
@ -766,7 +766,7 @@ void qse_xma_dump (qse_xma_t* xma, qse_xma_dumper_t dumper, void* target)
|
||||
dumper (target, QSE_T("Total : %18llu bytes\n"), (unsigned long long)(asum + fsum + isum));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef QSE_XMA_ENABLE_STAT
|
||||
QSE_ASSERT (asum == xma->stat.alloc);
|
||||
QSE_ASSERT (fsum == xma->stat.avail);
|
||||
|
Loading…
Reference in New Issue
Block a user