interim commit
- fixed wrong qse_pio_hid_t definition
This commit is contained in:
parent
86a1d88307
commit
567eaa483b
@ -504,13 +504,13 @@ typedef struct qse_awk_val_ref_t qse_awk_val_ref_t;
|
||||
typedef struct qse_awk_val_chunk_t qse_awk_val_chunk_t;
|
||||
|
||||
#if QSE_SIZEOF_INT == 2
|
||||
#define QSE_AWK_VAL_HDR \
|
||||
unsigned int type: 3; \
|
||||
unsigned int ref: 13
|
||||
# define QSE_AWK_VAL_HDR \
|
||||
unsigned int type: 3; \
|
||||
unsigned int ref: 13
|
||||
#else
|
||||
#define QSE_AWK_VAL_HDR \
|
||||
unsigned int type: 3; \
|
||||
unsigned int ref: 29
|
||||
# define QSE_AWK_VAL_HDR \
|
||||
unsigned int type: 3; \
|
||||
unsigned int ref: 29
|
||||
#endif
|
||||
|
||||
#define QSE_AWK_VAL_TYPE(x) ((x)->type)
|
||||
|
@ -11,9 +11,9 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
/*#define QSE_NULL ((qse_uint_t)0)*/
|
||||
#define QSE_NULL (0)
|
||||
# define QSE_NULL (0)
|
||||
#else
|
||||
#define QSE_NULL ((void*)0)
|
||||
# define QSE_NULL ((void*)0)
|
||||
#endif
|
||||
|
||||
/****d* ase/QSE_TRUE,QSE_FALSE
|
||||
@ -108,64 +108,50 @@
|
||||
#define QSE_WT(txt) (L ## txt)
|
||||
|
||||
#if defined(QSE_CHAR_IS_MCHAR)
|
||||
#define QSE_Q(val) QSE_MQ(val)
|
||||
#define QSE_C(ch) QSE_MC(ch)
|
||||
#define QSE_S(str) QSE_MS(str)
|
||||
#define QSE_T(txt) QSE_MT(txt)
|
||||
# define QSE_Q(val) QSE_MQ(val)
|
||||
# define QSE_C(ch) QSE_MC(ch)
|
||||
# define QSE_S(str) QSE_MS(str)
|
||||
# define QSE_T(txt) QSE_MT(txt)
|
||||
#else
|
||||
#define QSE_Q(val) QSE_WQ(val)
|
||||
#define QSE_C(ch) QSE_WC(ch)
|
||||
#define QSE_S(str) QSE_WS(str)
|
||||
#define QSE_T(txt) QSE_WT(txt)
|
||||
# define QSE_Q(val) QSE_WQ(val)
|
||||
# define QSE_C(ch) QSE_WC(ch)
|
||||
# define QSE_S(str) QSE_WS(str)
|
||||
# define QSE_T(txt) QSE_WT(txt)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define QSE_BEGIN_PACKED_STRUCT(x) struct x {
|
||||
#define QSE_END_PACKED_STRUCT() } __attribute__((packed));
|
||||
# define QSE_BEGIN_PACKED_STRUCT(x) struct x {
|
||||
# define QSE_END_PACKED_STRUCT() } __attribute__((packed));
|
||||
#else
|
||||
#define QSE_BEGIN_PACKED_STRUCT(x) struct x {
|
||||
#define QSE_END_PACKED_STRUCT() };
|
||||
# define QSE_BEGIN_PACKED_STRUCT(x) struct x {
|
||||
# define QSE_END_PACKED_STRUCT() };
|
||||
#endif
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define QSE_ASSERT(expr) ((void)0)
|
||||
#define QSE_ASSERTX(expr,desc) ((void)0)
|
||||
# define QSE_ASSERT(expr) ((void)0)
|
||||
# define QSE_ASSERTX(expr,desc) ((void)0)
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
void qse_assert_failed (
|
||||
const qse_char_t* expr, const qse_char_t* desc,
|
||||
const qse_char_t* file, qse_size_t line);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#define QSE_ASSERT(expr) (void)((expr) || \
|
||||
# define QSE_ASSERT(expr) (void)((expr) || \
|
||||
(qse_assert_failed (QSE_T(#expr), QSE_NULL, QSE_T(__FILE__), __LINE__), 0))
|
||||
#define QSE_ASSERTX(expr,desc) (void)((expr) || \
|
||||
# define QSE_ASSERTX(expr,desc) (void)((expr) || \
|
||||
(qse_assert_failed (QSE_T(#expr), QSE_T(desc), QSE_T(__FILE__), __LINE__), 0))
|
||||
#endif
|
||||
|
||||
/****d* ase/QSE_FNS
|
||||
* NAME
|
||||
* QSE_FNS - define an ASE function name space
|
||||
* DESCRIPTION
|
||||
* The QSE_FNS macro enables you to simulate a function name space for the
|
||||
* types designed properly.
|
||||
* EXAMPLE
|
||||
* QSE_FNS (awk, AWK);
|
||||
* qse_awk_t* awk = AWK.open (....);
|
||||
* AWK.close (awk);
|
||||
******
|
||||
*/
|
||||
#define QSE_NS(type,name) struct qse_ns_##type##_t name = qse_ns_##type##_d
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define QSE_BEGIN_NAMESPACE(x) namespace x {
|
||||
#define QSE_END_NAMESPACE(x) }
|
||||
#define QSE_BEGIN_NAMESPACE2(x,y) namespace x { namespace y {
|
||||
#define QSE_END_NAMESPACE2(y,x) }}
|
||||
# define QSE_BEGIN_NAMESPACE(x) namespace x {
|
||||
# define QSE_END_NAMESPACE(x) }
|
||||
# define QSE_BEGIN_NAMESPACE2(x,y) namespace x { namespace y {
|
||||
# define QSE_END_NAMESPACE2(y,x) }}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -21,23 +21,13 @@
|
||||
/*#define QSE_HAVE_CONFIG_H*/
|
||||
|
||||
#if defined(QSE_HAVE_CONFIG_H)
|
||||
#include <qse/config.h>
|
||||
# include <qse/config.h>
|
||||
#elif defined(_WIN32)
|
||||
#include <qse/conf_msw.h>
|
||||
# include <qse/conf_msw.h>
|
||||
#elif defined(vms) || defined(__vms)
|
||||
#include <qse/conf_vms.h>
|
||||
/*
|
||||
#elif defined(__unix__) || defined(__unix) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__SPU__)
|
||||
#if !defined(__unix__)
|
||||
#define __unix__
|
||||
#endif
|
||||
#if !defined(__unix)
|
||||
#define __unix
|
||||
#endif
|
||||
#include <qse/config.h>
|
||||
*/
|
||||
# include <qse/conf_vms.h>
|
||||
#else
|
||||
#error unsupported operating system
|
||||
# error unsupported operating system
|
||||
#endif
|
||||
|
||||
/****t* ase/qse_bool_t
|
||||
@ -66,7 +56,8 @@ typedef int qse_tri_t;
|
||||
* qse_uint_t - define an unsigned integer type as large as a pointer type
|
||||
******
|
||||
*/
|
||||
#if (defined(hpux) || defined(__hpux) || defined(__hpux__)) && (QSE_SIZEOF_VOID_P == QSE_SIZEOF_LONG)
|
||||
#if (defined(hpux) || defined(__hpux) || defined(__hpux__)) && \
|
||||
(QSE_SIZEOF_VOID_P == QSE_SIZEOF_LONG)
|
||||
typedef long qse_int_t;
|
||||
typedef unsigned long qse_uint_t;
|
||||
#elif defined(__SPU__) && (QSE_SIZEOF_VOID_P == QSE_SIZEOF_LONG)
|
||||
@ -88,7 +79,7 @@ typedef int qse_tri_t;
|
||||
typedef __int64 qse_int_t;
|
||||
typedef unsigned __int64 qse_uint_t;
|
||||
#else
|
||||
#error unsupported pointer size
|
||||
# error unsupported pointer size
|
||||
#endif
|
||||
|
||||
/****t* ase/qse_long_t,qse_ulong_t
|
||||
@ -160,52 +151,52 @@ typedef int qse_tri_t;
|
||||
******
|
||||
*/
|
||||
#if QSE_SIZEOF_INT == 8
|
||||
#define QSE_HAVE_INT64_T
|
||||
#define QSE_HAVE_UINT64_T
|
||||
# define QSE_HAVE_INT64_T
|
||||
# define QSE_HAVE_UINT64_T
|
||||
typedef int qse_int64_t;
|
||||
typedef unsigned int qse_uint64_t;
|
||||
#elif QSE_SIZEOF_LONG == 8
|
||||
#define QSE_HAVE_INT64_T
|
||||
#define QSE_HAVE_UINT64_T
|
||||
# define QSE_HAVE_INT64_T
|
||||
# define QSE_HAVE_UINT64_T
|
||||
typedef long qse_int64_t;
|
||||
typedef unsigned long qse_uint64_t;
|
||||
#elif QSE_SIZEOF_LONG_LONG == 8
|
||||
#define QSE_HAVE_INT64_T
|
||||
#define QSE_HAVE_UINT64_T
|
||||
# define QSE_HAVE_INT64_T
|
||||
# define QSE_HAVE_UINT64_T
|
||||
typedef long long qse_int64_t;
|
||||
typedef unsigned long long qse_uint64_t;
|
||||
#elif QSE_SIZEOF___INT64 == 8
|
||||
#define QSE_HAVE_INT64_T
|
||||
#define QSE_HAVE_UINT64_T
|
||||
# define QSE_HAVE_INT64_T
|
||||
# define QSE_HAVE_UINT64_T
|
||||
typedef __int64 qse_int64_t;
|
||||
typedef unsigned __int64 qse_uint64_t;
|
||||
#endif
|
||||
|
||||
#if QSE_SIZEOF_INT == 16
|
||||
#define QSE_HAVE_INT128_T
|
||||
#define QSE_HAVE_UINT128_T
|
||||
# define QSE_HAVE_INT128_T
|
||||
# define QSE_HAVE_UINT128_T
|
||||
typedef int qse_int128_t;
|
||||
typedef unsigned int qse_uint128_t;
|
||||
#elif QSE_SIZEOF_LONG == 16
|
||||
#define QSE_HAVE_INT128_T
|
||||
#define QSE_HAVE_UINT128_T
|
||||
# define QSE_HAVE_INT128_T
|
||||
# define QSE_HAVE_UINT128_T
|
||||
typedef long qse_int128_t;
|
||||
typedef unsigned long qse_uint128_t;
|
||||
#elif QSE_SIZEOF_LONG_LONG == 16
|
||||
#define QSE_HAVE_INT128_T
|
||||
#define QSE_HAVE_UINT128_T
|
||||
# define QSE_HAVE_INT128_T
|
||||
# define QSE_HAVE_UINT128_T
|
||||
typedef long long qse_int128_t;
|
||||
typedef unsigned long long qse_uint128_t;
|
||||
#elif QSE_SIZEOF___INT128 == 16
|
||||
#define QSE_HAVE_INT128_T
|
||||
#define QSE_HAVE_UINT128_T
|
||||
# define QSE_HAVE_INT128_T
|
||||
# define QSE_HAVE_UINT128_T
|
||||
typedef __int128 qse_int128_t;
|
||||
typedef unsigned __int128 qse_uint128_t;
|
||||
#endif
|
||||
|
||||
/****t* ase/qse_byte_t
|
||||
* NAME
|
||||
* qse_word_t - define a byte type
|
||||
* qse_byte_t - define a byte type
|
||||
******
|
||||
*/
|
||||
typedef qse_uint8_t qse_byte_t;
|
||||
@ -216,9 +207,9 @@ typedef qse_uint8_t qse_byte_t;
|
||||
******
|
||||
*/
|
||||
#ifdef __SIZE_TYPE__
|
||||
typedef __SIZE_TYPE__ qse_size_t;
|
||||
typedef __SIZE_TYPE__ qse_size_t;
|
||||
#else
|
||||
typedef qse_uint_t qse_size_t;
|
||||
typedef qse_uint_t qse_size_t;
|
||||
#endif
|
||||
|
||||
/****t* ase/qse_ssize_t
|
||||
@ -239,13 +230,13 @@ typedef qse_uint_t qse_word_t;
|
||||
#if defined(__FreeBSD__)
|
||||
/* TODO: check if the support for long double is complete.
|
||||
* if so, use long double for qse_real_t */
|
||||
#define QSE_SIZEOF_REAL QSE_SIZEOF_DOUBLE
|
||||
# define QSE_SIZEOF_REAL QSE_SIZEOF_DOUBLE
|
||||
typedef double qse_real_t;
|
||||
#elif QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE
|
||||
#define QSE_SIZEOF_REAL QSE_SIZEOF_LONG_DOUBLE
|
||||
# define QSE_SIZEOF_REAL QSE_SIZEOF_LONG_DOUBLE
|
||||
typedef long double qse_real_t;
|
||||
#else
|
||||
#define QSE_SIZEOF_REAL QSE_SIZEOF_DOUBLE
|
||||
# define QSE_SIZEOF_REAL QSE_SIZEOF_DOUBLE
|
||||
typedef double qse_real_t;
|
||||
#endif
|
||||
|
||||
@ -264,7 +255,9 @@ typedef int qse_mcint_t;
|
||||
* qse_wcint_t - define a type that can hold qse_wchar_t and QSE_WCHAR_EOF
|
||||
******
|
||||
*/
|
||||
#if defined(__cplusplus) && (!defined(_MSC_VER) || (defined(_MSC_VER)&&defined(_NATIVE_WCHAR_T_DEFINED)))
|
||||
#if defined(__cplusplus) && \
|
||||
(!defined(_MSC_VER) || \
|
||||
(defined(_MSC_VER) && defined(_NATIVE_WCHAR_T_DEFINED)))
|
||||
/* C++ */
|
||||
|
||||
typedef wchar_t qse_wchar_t;
|
||||
@ -278,41 +271,41 @@ typedef int qse_mcint_t;
|
||||
typedef unsigned short qse_wchar_t;
|
||||
typedef unsigned short qse_wcint_t;
|
||||
#elif (QSE_SIZEOF_WCHAR_T == 4)
|
||||
#if defined(vms) || defined(__vms)
|
||||
# if defined(vms) || defined(__vms)
|
||||
typedef unsigned int qse_wchar_t;
|
||||
typedef int qse_wcint_t;
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
typedef int qse_wchar_t;
|
||||
typedef int qse_wcint_t;
|
||||
#elif (defined(sun) || defined(__sun) || defined(__linux))
|
||||
#if defined(_LP64)
|
||||
# elif (defined(sun) || defined(__sun) || defined(__linux))
|
||||
# if defined(_LP64)
|
||||
typedef int qse_wchar_t;
|
||||
typedef int qse_wcint_t;
|
||||
#else
|
||||
# else
|
||||
typedef long qse_wchar_t;
|
||||
typedef long qse_wcint_t;
|
||||
#endif
|
||||
#elif defined(__APPLE__) && defined(__MACH__)
|
||||
# endif
|
||||
# elif defined(__APPLE__) && defined(__MACH__)
|
||||
typedef int qse_wchar_t;
|
||||
typedef int qse_wcint_t;
|
||||
#elif defined(hpux) || defined(__hpux) || defined(__hpux__)
|
||||
#if defined(__HP_cc) || defined(__HP_aCC)
|
||||
typedef unsigned int qse_wchar_t;
|
||||
#else
|
||||
typedef int qse_wchar_t;
|
||||
#endif
|
||||
# elif defined(hpux) || defined(__hpux) || defined(__hpux__)
|
||||
# if defined(__HP_cc) || defined(__HP_aCC)
|
||||
typedef unsigned int qse_wchar_t;
|
||||
# else
|
||||
typedef int qse_wchar_t;
|
||||
# endif
|
||||
typedef int qse_wcint_t;
|
||||
#elif QSE_SIZEOF_LONG == 4
|
||||
# elif QSE_SIZEOF_LONG == 4
|
||||
typedef long qse_wchar_t;
|
||||
typedef long qse_wcint_t;
|
||||
#elif QSE_SIZEOF_INT == 4
|
||||
# elif QSE_SIZEOF_INT == 4
|
||||
typedef int qse_wchar_t;
|
||||
typedef int qse_wcint_t;
|
||||
#else
|
||||
#error no supported data type for wchar_t
|
||||
#endif
|
||||
# else
|
||||
# error no supported data type for wchar_t
|
||||
# endif
|
||||
#else
|
||||
#error unsupported size of wchar_t
|
||||
# error unsupported size of wchar_t
|
||||
#endif
|
||||
|
||||
/****t* ase/qse_char_t,qse_cint_t
|
||||
@ -322,34 +315,34 @@ typedef int qse_mcint_t;
|
||||
******
|
||||
*/
|
||||
#if defined(_WIN32) && (defined(UNICODE)||defined(_UNICODE))
|
||||
#define QSE_CHAR_IS_WCHAR
|
||||
# define QSE_CHAR_IS_WCHAR
|
||||
typedef qse_wchar_t qse_char_t;
|
||||
typedef qse_wcint_t qse_cint_t;
|
||||
#else
|
||||
#if defined(QSE_CHAR_IS_MCHAR)
|
||||
# if defined(QSE_CHAR_IS_MCHAR)
|
||||
typedef qse_mchar_t qse_char_t;
|
||||
typedef qse_mcint_t qse_cint_t;
|
||||
#elif defined(QSE_CHAR_IS_WCHAR)
|
||||
# elif defined(QSE_CHAR_IS_WCHAR)
|
||||
typedef qse_wchar_t qse_char_t;
|
||||
typedef qse_wcint_t qse_cint_t;
|
||||
#elif defined(_MBCS)
|
||||
#define QSE_CHAR_IS_MCHAR
|
||||
# elif defined(_MBCS)
|
||||
# define QSE_CHAR_IS_MCHAR
|
||||
typedef qse_mchar_t qse_char_t;
|
||||
typedef qse_mcint_t qse_cint_t;
|
||||
#else
|
||||
#define QSE_CHAR_IS_WCHAR
|
||||
# else
|
||||
# define QSE_CHAR_IS_WCHAR
|
||||
typedef qse_wchar_t qse_char_t;
|
||||
typedef qse_wcint_t qse_cint_t;
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(QSE_CHAR_IS_WCHAR) && defined(_WIN32)
|
||||
#ifndef UNICODE
|
||||
#define UNICODE
|
||||
#endif
|
||||
#ifndef _UNICODE
|
||||
#define _UNICODE
|
||||
#endif
|
||||
# ifndef UNICODE
|
||||
# define UNICODE
|
||||
# endif
|
||||
# ifndef _UNICODE
|
||||
# define _UNICODE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef struct qse_xstr_t qse_xstr_t;
|
||||
@ -366,7 +359,7 @@ typedef struct qse_ccls_t qse_ccls_t;
|
||||
struct qse_xstr_t
|
||||
{
|
||||
qse_char_t* ptr; /* this is not a const pointer */
|
||||
qse_size_t len;
|
||||
qse_size_t len; /* the number of characters */
|
||||
};
|
||||
/******/
|
||||
|
||||
@ -379,7 +372,7 @@ struct qse_xstr_t
|
||||
struct qse_cstr_t
|
||||
{
|
||||
const qse_char_t* ptr; /* this is a const pointer */
|
||||
qse_size_t len;
|
||||
qse_size_t len; /* the number of characters */
|
||||
};
|
||||
/******/
|
||||
|
||||
@ -400,7 +393,7 @@ struct qse_mmgr_t
|
||||
|
||||
/****t* ase/qse_ccls_type_t
|
||||
* NAME
|
||||
* qse_ccls_type_t - define types of character class
|
||||
* qse_ccls_type_t - define character class types
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
|
@ -20,12 +20,12 @@
|
||||
#include "mem.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
# include <windows.h>
|
||||
# include <tchar.h>
|
||||
#else
|
||||
#include "syscall.h"
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
# include "syscall.h"
|
||||
# include <fcntl.h>
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
qse_pio_t* qse_pio_open (
|
||||
@ -174,6 +174,7 @@ qse_pio_t* qse_pio_init (
|
||||
if (flags & QSE_PIO_SHELL)
|
||||
{
|
||||
const qse_mchar_t* mcmd;
|
||||
qse_mchar_t* argv[4];
|
||||
|
||||
#ifdef QSE_CHAR_IS_MCHAR
|
||||
mcmd = cmd;
|
||||
@ -204,7 +205,16 @@ qse_pio_t* qse_pio_init (
|
||||
|
||||
n = qse_wcstombs (cmd, mcmd, &mn);
|
||||
|
||||
execl ("/bin/sh", "sh", "-c", mcmd, QSE_NULL);
|
||||
argv[0] = QSE_MT("/bin/sh");
|
||||
argv[1] = QSE_MT("-c");
|
||||
argv[2] = mcmd;
|
||||
argv[3] = QSE_NULL;
|
||||
|
||||
/* TODO: */
|
||||
{
|
||||
extern char** environ;
|
||||
QSE_EXECVE (QSE_MT("/bin/sh"), argv, environ);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -73,7 +73,6 @@ static int test2 (void)
|
||||
{
|
||||
qse_byte_t buf[128];
|
||||
|
||||
/*qse_pio_canread (pio, QSE_PIO_ERR, 1000)*/
|
||||
qse_ssize_t n = qse_pio_read (pio, buf, sizeof(buf), QSE_PIO_ERR);
|
||||
if (n == 0) break;
|
||||
if (n < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user