*** empty log message ***

This commit is contained in:
hyung-hwan 2006-10-28 16:08:34 +00:00
parent 33dd3d9677
commit 361819ecd4
5 changed files with 48 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: lsp.c,v 1.10 2006-10-26 09:31:28 bacon Exp $ * $Id: lsp.c,v 1.11 2006-10-28 16:08:34 bacon Exp $
*/ */
#if defined(__BORLANDC__) #if defined(__BORLANDC__)
@ -38,6 +38,7 @@ ase_lsp_t* ase_lsp_open (
syscas->to_lower == ASE_NULL) return ASE_NULL; syscas->to_lower == ASE_NULL) return ASE_NULL;
if (syscas->sprintf == ASE_NULL || if (syscas->sprintf == ASE_NULL ||
syscas->aprintf == ASE_NULL ||
syscas->dprintf == ASE_NULL || syscas->dprintf == ASE_NULL ||
syscas->abort == ASE_NULL) return ASE_NULL; syscas->abort == ASE_NULL) return ASE_NULL;

View File

@ -1,5 +1,5 @@
/* /*
* $Id: lsp.h,v 1.27 2006-10-26 09:31:28 bacon Exp $ * $Id: lsp.h,v 1.28 2006-10-28 16:08:34 bacon Exp $
*/ */
#ifndef _ASE_LSP_LSP_H_ #ifndef _ASE_LSP_LSP_H_
@ -42,6 +42,7 @@ struct ase_lsp_syscas_t
void* (*memset) (void* dst, int val, ase_size_t n); void* (*memset) (void* dst, int val, ase_size_t n);
int (*sprintf) (ase_char_t* buf, ase_size_t size, ase_char_t* fmt, ...); int (*sprintf) (ase_char_t* buf, ase_size_t size, ase_char_t* fmt, ...);
int (*aprintf) (ase_char_t* fmt, ...);
int (*dprintf) (ase_char_t* fmt, ...); int (*dprintf) (ase_char_t* fmt, ...);
void (*abort) (void); void (*abort) (void);

View File

@ -1,5 +1,5 @@
/* /*
* $Id: misc.c,v 1.3 2006-10-26 09:31:28 bacon Exp $ * $Id: misc.c,v 1.4 2006-10-28 16:08:34 bacon Exp $
*/ */
#include <ase/lsp/lsp_i.h> #include <ase/lsp/lsp_i.h>
@ -753,7 +753,7 @@ ase_char_t* ase_lsp_strxnstr (
int ase_lsp_assertfail (ase_lsp_t* lsp, int ase_lsp_assertfail (ase_lsp_t* lsp,
const ase_char_t* expr, const ase_char_t* file, int line) const ase_char_t* expr, const ase_char_t* file, int line)
{ {
lsp->syscas.dprintf ( lsp->syscas.aprintf (
ASE_T("ASSERTION FAILURE AT FILE %s, LINE %d\n%s\n"), ASE_T("ASSERTION FAILURE AT FILE %s, LINE %d\n%s\n"),
file, line, expr); file, line, expr);
lsp->syscas.abort (); lsp->syscas.abort ();

View File

@ -17,7 +17,8 @@ static xp_ssize_t get_input (int cmd, void* arg, xp_char_t* data, xp_size_t size
{ {
xp_ssize_t n; xp_ssize_t n;
switch (cmd) { switch (cmd)
{
case ASE_LSP_IO_OPEN: case ASE_LSP_IO_OPEN:
case ASE_LSP_IO_CLOSE: case ASE_LSP_IO_CLOSE:
return 0; return 0;
@ -36,7 +37,8 @@ static xp_ssize_t get_input (int cmd, void* arg, xp_char_t* data, xp_size_t size
static xp_ssize_t put_output (int cmd, void* arg, xp_char_t* data, xp_size_t size) static xp_ssize_t put_output (int cmd, void* arg, xp_char_t* data, xp_size_t size)
{ {
switch (cmd) { switch (cmd)
{
case ASE_LSP_IO_OPEN: case ASE_LSP_IO_OPEN:
case ASE_LSP_IO_CLOSE: case ASE_LSP_IO_CLOSE:
return 0; return 0;
@ -53,7 +55,8 @@ int to_int (const xp_char_t* str)
{ {
int r = 0; int r = 0;
while (*str != XP_CHAR('\0')) { while (*str != XP_CHAR('\0'))
{
if (!xp_isdigit(*str)) break; if (!xp_isdigit(*str)) break;
r = r * 10 + (*str - XP_CHAR('0')); r = r * 10 + (*str - XP_CHAR('0'));
str++; str++;
@ -157,7 +160,7 @@ static void __lsp_free (void* ptr, void* custom_data)
#endif #endif
} }
static int __dprintf (const xp_char_t* fmt, ...) static int __aprintf (const xp_char_t* fmt, ...)
{ {
int n; int n;
va_list ap; va_list ap;
@ -181,6 +184,21 @@ static int __dprintf (const xp_char_t* fmt, ...)
return n; return n;
} }
static int __dprintf (const ase_char_t* fmt, ...)
{
int n;
va_list ap;
va_start (ap, fmt);
#ifdef _WIN32
n = _vftprintf (stderr, fmt, ap);
#else
n = xp_vfprintf (stderr, fmt, ap);
#endif
va_end (ap);
return n;
}
int __main (int argc, xp_char_t* argv[]) int __main (int argc, xp_char_t* argv[])
{ {
@ -247,6 +265,7 @@ int __main (int argc, xp_char_t* argv[])
syscas.memcpy = memcpy; syscas.memcpy = memcpy;
syscas.memset = memset; syscas.memset = memset;
syscas.sprintf = xp_sprintf; syscas.sprintf = xp_sprintf;
syscas.aprintf = __aprintf;
syscas.dprintf = __dprintf; syscas.dprintf = __dprintf;
syscas.abort = abort; syscas.abort = abort;

19
ase/test/lsp/makefile.bcc Normal file
View File

@ -0,0 +1,19 @@
CC = bcc32
LD = ilink32
CFLAGS = -I..\..\.. -I$(XPKIT)
LDFLAGS = -L..\..\lsp -L"c:\program files\borland\bds\4.0\lib" -L$(XPKIT)\xp\bas
LIBS = import32.lib cw32mt.lib aselsp.lib xpbas.lib
STARTUP = c0x32w.obj
all: lsp
lsp: lsp.obj
$(LD) $(LDFLAGS) $(STARTUP) lsp.obj,lsp.exe,,$(LIBS),,
clean:
del $(OBJS) *.obj $(OUT)
.SUFFIXES: .c .obj
.c.obj:
$(CC) $(CFLAGS) -c $<