Recovered from cvs revision 2007-10-14 04:33:00
This commit is contained in:
parent
3847f21e2b
commit
d2709ef099
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Awk.cpp,v 1.74 2007/10/13 06:28:17 bacon Exp $
|
||||
* $Id: Awk.cpp,v 1.75 2007/10/13 17:25:30 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
@ -195,11 +195,7 @@ void Awk::Argument::clear ()
|
||||
{
|
||||
if (this->val->type != ASE_AWK_VAL_STR)
|
||||
{
|
||||
#if defined(__DMC__)
|
||||
awk_t* awk = (awk_t*)*(this->run->awk);
|
||||
#else
|
||||
awk_t* awk = this->run->awk->awk;
|
||||
#endif
|
||||
ase_awk_free (awk, this->str.ptr);
|
||||
}
|
||||
|
||||
@ -427,7 +423,7 @@ int Awk::Argument::getIndexed (long_t idx, Argument& val) const
|
||||
char_t ri[128];
|
||||
|
||||
int rl = Awk::sprintf (
|
||||
&this->run->awk, ri, ASE_COUNTOF(ri),
|
||||
this->run->awk, ri, ASE_COUNTOF(ri),
|
||||
#if ASE_SIZEOF_LONG_LONG > 0
|
||||
ASE_T("%lld"), (long long)idx
|
||||
#elif ASE_SIZEOF___INT64 > 0
|
||||
|
155
ase/awk/msw-cl.mak
Normal file
155
ase/awk/msw-cl.mak
Normal file
@ -0,0 +1,155 @@
|
||||
NAME = aseawk
|
||||
JNI =
|
||||
|
||||
JNI_INC = \
|
||||
-I"$(JAVA_HOME)/include" \
|
||||
-I"$(JAVA_HOME)/include\win32"
|
||||
|
||||
CC = dmc
|
||||
CXX = dmc
|
||||
LD = link
|
||||
AR = lib
|
||||
JAVAC = javac
|
||||
|
||||
CFLAGS = -mn -I..\.. $(JNI_INC)
|
||||
CXXFLAGS = -Aa -Ab -Ae -mn -I..\.. $(JNI_INC)
|
||||
JAVACFLAGS = -classpath ..\.. -Xlint:unchecked
|
||||
|
||||
MODE=debug
|
||||
|
||||
OUT_DIR = ..\$(MODE)\lib
|
||||
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
||||
OUT_FILE_JNI = $(OUT_DIR)\lib$(NAME)_jni.la
|
||||
OUT_FILE_LIB_CXX = $(OUT_DIR)\$(NAME)pp.lib
|
||||
OUT_FILE_JAR = $(OUT_DIR)/$(NAME).jar
|
||||
|
||||
TMP_DIR = $(MODE)
|
||||
TMP_DIR_CXX = $(TMP_DIR)\cxx
|
||||
|
||||
OBJ_FILES_LIB = \
|
||||
$(TMP_DIR)\awk.obj \
|
||||
$(TMP_DIR)\err.obj \
|
||||
$(TMP_DIR)\tree.obj \
|
||||
$(TMP_DIR)\tab.obj \
|
||||
$(TMP_DIR)\map.obj \
|
||||
$(TMP_DIR)\parse.obj \
|
||||
$(TMP_DIR)\run.obj \
|
||||
$(TMP_DIR)\rec.obj \
|
||||
$(TMP_DIR)\val.obj \
|
||||
$(TMP_DIR)\func.obj \
|
||||
$(TMP_DIR)\misc.obj \
|
||||
$(TMP_DIR)\extio.obj \
|
||||
$(TMP_DIR)\rex.obj
|
||||
|
||||
OBJ_FILES_JNI = $(TMP_DIR)\jni.obj
|
||||
|
||||
OBJ_FILES_LIB_CXX = \
|
||||
$(TMP_DIR)\cxx\Awk.obj \
|
||||
$(TMP_DIR)\cxx\StdAwk.obj
|
||||
|
||||
OBJ_FILES_JAR = \
|
||||
$(TMP_DIR)/ase/awk/Awk.class \
|
||||
$(TMP_DIR)/ase/awk/StdAwk.class \
|
||||
$(TMP_DIR)/ase/awk/Extio.class \
|
||||
$(TMP_DIR)/ase/awk/IO.class \
|
||||
$(TMP_DIR)/ase/awk/Console.class \
|
||||
$(TMP_DIR)/ase/awk/File.class \
|
||||
$(TMP_DIR)/ase/awk/Pipe.class \
|
||||
$(TMP_DIR)/ase/awk/Exception.class
|
||||
|
||||
lib: build$(JNI)
|
||||
|
||||
build: $(OUT_FILE_LIB) $(OUT_FILE_LIB_CXX)
|
||||
|
||||
buildjni: build $(OUT_FILE_JNI)
|
||||
|
||||
$(OUT_FILE_LIB): $(TMP_DIR) $(OUT_DIR) $(OBJ_FILES_LIB)
|
||||
$(AR) -c $(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
||||
|
||||
$(OUT_FILE_LIB_CXX): $(TMP_DIR_CXX) $(OUT_DIR) $(OUT_FILE_LIB) $(OBJ_FILES_LIB_CXX)
|
||||
$(AR) -c $(OUT_FILE_LIB_CXX) $(OBJ_FILES_LIB_CXX)
|
||||
|
||||
$(TMP_DIR)\awk.obj: awk.c
|
||||
$(CC) $(CFLAGS) -o$@ -c awk.c
|
||||
|
||||
$(TMP_DIR)\err.obj: err.c
|
||||
$(CC) $(CFLAGS) -o$@ -c err.c
|
||||
|
||||
$(TMP_DIR)\tree.obj: tree.c
|
||||
$(CC) $(CFLAGS) -o$@ -c tree.c
|
||||
|
||||
$(TMP_DIR)\tab.obj: tab.c
|
||||
$(CC) $(CFLAGS) -o$@ -c tab.c
|
||||
|
||||
$(TMP_DIR)\map.obj: map.c
|
||||
$(CC) $(CFLAGS) -o$@ -c map.c
|
||||
|
||||
$(TMP_DIR)\parse.obj: parse.c
|
||||
$(CC) $(CFLAGS) -o$@ -c parse.c
|
||||
|
||||
$(TMP_DIR)\run.obj: run.c
|
||||
$(CC) $(CFLAGS) -o$@ -c run.c
|
||||
|
||||
$(TMP_DIR)\rec.obj: rec.c
|
||||
$(CC) $(CFLAGS) -o$@ -c rec.c
|
||||
|
||||
$(TMP_DIR)\val.obj: val.c
|
||||
$(CC) $(CFLAGS) -o$@ -c val.c
|
||||
|
||||
$(TMP_DIR)\func.obj: func.c
|
||||
$(CC) $(CFLAGS) -o$@ -c func.c
|
||||
|
||||
$(TMP_DIR)\misc.obj: misc.c
|
||||
$(CC) $(CFLAGS) -o$@ -c misc.c
|
||||
|
||||
$(TMP_DIR)\extio.obj: extio.c
|
||||
$(CC) $(CFLAGS) -o$@ -c extio.c
|
||||
|
||||
$(TMP_DIR)\rex.obj: rex.c
|
||||
$(CC) $(CFLAGS) -o$@ -c rex.c
|
||||
|
||||
$(TMP_DIR)\jni.obj: jni.c
|
||||
$(CC) $(CFLAGS) $(CFLAGS_JNI) -o $@ -c jni.c
|
||||
|
||||
$(TMP_DIR)\cxx\Awk.obj: Awk.cpp Awk.hpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c Awk.cpp
|
||||
|
||||
$(TMP_DIR)\cxx\StdAwk.obj: StdAwk.cpp StdAwk.hpp Awk.hpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c StdAwk.cpp
|
||||
|
||||
$(TMP_DIR)/ase/awk/Awk.class: Awk.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) Awk.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/StdAwk.class: StdAwk.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) StdAwk.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/Extio.class: Extio.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) Extio.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/IO.class: IO.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) IO.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/Console.class: Console.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) Console.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/File.class: File.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) File.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/Pipe.class: Pipe.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) Pipe.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/Exception.class: Exception.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) Exception.java
|
||||
|
||||
$(OUT_DIR):
|
||||
md $(OUT_DIR)
|
||||
|
||||
$(TMP_DIR):
|
||||
md $(TMP_DIR)
|
||||
|
||||
$(TMP_DIR_CXX): $(TMP_DIR)
|
||||
md $(TMP_DIR_CXX)
|
||||
|
||||
clean:
|
||||
rm -rf $(OUT_FILE_LIB) $(OUT_FILE_JNI) $(OUT_FILE_JAR) $(OUT_FILE_LIB_CXX) $(OBJ_FILES_LIB) $(OBJ_FILES_JNI) $(OBJ_FILES_JAR) $(OBJ_FILES_LIB_CXX)
|
||||
|
46
ase/cmn/msw-dmc.mak
Normal file
46
ase/cmn/msw-dmc.mak
Normal file
@ -0,0 +1,46 @@
|
||||
#
|
||||
# You may override the value of MODE by specifying from the command-line
|
||||
# make -f msw-dmc.mak MODE=debug
|
||||
#
|
||||
|
||||
NAME = asecmn
|
||||
MODE = release
|
||||
|
||||
CC = dmc
|
||||
AR = lib
|
||||
|
||||
CFLAGS = -mn -I..\.. -DUNICODE -D_UNICODE
|
||||
|
||||
OUT_DIR = ..\$(MODE)\lib
|
||||
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
||||
|
||||
TMP_DIR = $(MODE)
|
||||
|
||||
OBJ_FILES_LIB = \
|
||||
$(TMP_DIR)\mem.obj \
|
||||
$(TMP_DIR)\str.obj \
|
||||
$(TMP_DIR)\misc.obj
|
||||
|
||||
all: $(OUT_FILE_LIB)
|
||||
|
||||
$(OUT_FILE_LIB): $(TMP_DIR) $(OUT_DIR) $(OBJ_FILES_LIB)
|
||||
$(AR) -c $(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
||||
|
||||
$(TMP_DIR)\mem.obj: mem.c
|
||||
$(CC) $(CFLAGS) -o$@ -c mem.c
|
||||
|
||||
$(TMP_DIR)\str.obj: str.c
|
||||
$(CC) $(CFLAGS) -o$@ -c str.c
|
||||
|
||||
$(TMP_DIR)\misc.obj: misc.c
|
||||
$(CC) $(CFLAGS) -o$@ -c misc.c
|
||||
|
||||
$(OUT_DIR):
|
||||
md $(OUT_DIR)
|
||||
|
||||
$(TMP_DIR):
|
||||
md $(TMP_DIR)
|
||||
|
||||
clean:
|
||||
del $(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: AseAwk.java,v 1.10 2007/10/12 16:13:34 bacon Exp $
|
||||
* $Id: AseAwk.java,v 1.11 2007/10/13 17:25:30 bacon Exp $
|
||||
*/
|
||||
|
||||
import java.awt.*;
|
||||
@ -22,6 +22,7 @@ import java.net.URL;
|
||||
|
||||
import ase.awk.StdAwk;
|
||||
import ase.awk.Console;
|
||||
import ase.awk.Context;
|
||||
|
||||
public class AseAwk extends StdAwk
|
||||
{
|
||||
@ -302,7 +303,7 @@ public class AseAwk extends StdAwk
|
||||
|
||||
public Object sleep (Context ctx, String name, Object[] args) throws ase.awk.Exception
|
||||
{
|
||||
long x = builtinFunctionArgumentToLong (runid, args[0]);
|
||||
long x = builtinFunctionArgumentToLong (ctx.getId(), args[0]);
|
||||
try { Thread.sleep (x * 1000); }
|
||||
catch (InterruptedException e) {}
|
||||
return new Long(0);
|
||||
|
46
ase/utl/msw-dmc.mak
Normal file
46
ase/utl/msw-dmc.mak
Normal file
@ -0,0 +1,46 @@
|
||||
#
|
||||
# You may override the value of MODE by specifying from the command-line
|
||||
# make -f msw-dmc.mak MODE=debug
|
||||
#
|
||||
|
||||
NAME = aseutl
|
||||
MODE = release
|
||||
|
||||
CC = dmc
|
||||
AR = lib
|
||||
|
||||
CFLAGS = -mn -I..\.. -DUNICODE -D_UNICODE
|
||||
|
||||
OUT_DIR = ..\$(MODE)\lib
|
||||
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
||||
|
||||
TMP_DIR = $(MODE)
|
||||
|
||||
OBJ_FILES_LIB = \
|
||||
$(TMP_DIR)\main.obj \
|
||||
$(TMP_DIR)\ctype.obj \
|
||||
$(TMP_DIR)\stdio.obj
|
||||
|
||||
all: $(OUT_FILE_LIB)
|
||||
|
||||
$(OUT_FILE_LIB): $(TMP_DIR) $(OUT_DIR) $(OBJ_FILES_LIB)
|
||||
$(AR) -c $(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
||||
|
||||
$(TMP_DIR)\main.obj: main.c
|
||||
$(CC) $(CFLAGS) -o$@ -c main.c
|
||||
|
||||
$(TMP_DIR)\ctype.obj: ctype.c
|
||||
$(CC) $(CFLAGS) -o$@ -c ctype.c
|
||||
|
||||
$(TMP_DIR)\stdio.obj: stdio.c
|
||||
$(CC) $(CFLAGS) -o$@ -c stdio.c
|
||||
|
||||
$(OUT_DIR):
|
||||
md $(OUT_DIR)
|
||||
|
||||
$(TMP_DIR):
|
||||
md $(TMP_DIR)
|
||||
|
||||
clean:
|
||||
del $(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio.c,v 1.4 2007/06/16 13:34:47 bacon Exp $
|
||||
* $Id: stdio.c,v 1.5 2007/10/13 17:25:30 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
@ -344,7 +344,12 @@ FILE* ase_fopen (const ase_char_t* path, const ase_char_t* mode)
|
||||
FILE* ase_popen (const ase_char_t* cmd, const ase_char_t* mode)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
#if defined(__DMC__)
|
||||
/* TODO: implement this for DMC */
|
||||
return ASE_NULL;
|
||||
#else
|
||||
return _tpopen (cmd, mode);
|
||||
#endif
|
||||
#elif defined(ASE_CHAR_IS_MCHAR)
|
||||
return popen (cmd, mode);
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user