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