rev 351 - in trunk: . modules modules/OS pr
SVN User <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: bcollins
Date: 2004-04-14 15:05:02 -0400 (Wed, 14 Apr 2004)
New Revision: 351
Added:
trunk/modules/OS/
trunk/modules/OS/Makefile.in
trunk/modules/OS/OS.c
trunk/pr/system-test.pr
Modified:
trunk/configure
trunk/configure.in
trunk/modules/Makefile.in
Log:
The start of an OS module.
Modified: trunk/configure
===================================================================
--- trunk/configure 2004-04-14 16:58:43 UTC (rev 350)
+++ trunk/configure 2004-04-14 19:05:02 UTC (rev 351)
@@ -19478,7 +19478,7 @@
- ac_config_files="$ac_config_files Rules.mk Makefile src/Makefile modules/Makefile modules/File/Makefile modules/Re/Makefile modules/Prosist/Makefile modules/SQLite/Makefile"
+ ac_config_files="$ac_config_files Rules.mk Makefile src/Makefile modules/Makefile modules/File/Makefile modules/Re/Makefile modules/Prosist/Makefile modules/SQLite/Makefile modules/OS/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -20012,6 +20012,7 @@
"modules/Re/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/Re/Makefile" ;;
"modules/Prosist/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/Prosist/Makefile" ;;
"modules/SQLite/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/SQLite/Makefile" ;;
+ "modules/OS/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/OS/Makefile" ;;
"include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2004-04-14 16:58:43 UTC (rev 350)
+++ trunk/configure.in 2004-04-14 19:05:02 UTC (rev 351)
@@ -81,4 +81,5 @@
AC_OUTPUT(Rules.mk Makefile src/Makefile modules/Makefile
modules/File/Makefile modules/Re/Makefile
- modules/Prosist/Makefile modules/SQLite/Makefile)
+ modules/Prosist/Makefile modules/SQLite/Makefile
+ modules/OS/Makefile)
Modified: trunk/modules/Makefile.in
===================================================================
--- trunk/modules/Makefile.in 2004-04-14 16:58:43 UTC (rev 350)
+++ trunk/modules/Makefile.in 2004-04-14 19:05:02 UTC (rev 351)
@@ -7,7 +7,7 @@
include $(top_builddir)/Rules.mk
-MODULES = File Prosist
+MODULES = File Prosist OS
ifeq (@HAVE_BOOST_REGEX@,yes)
MODULES += Re
Added: trunk/modules/OS/Makefile.in
===================================================================
--- trunk/modules/OS/Makefile.in 2004-04-14 16:58:43 UTC (rev 350)
+++ trunk/modules/OS/Makefile.in 2004-04-14 19:05:02 UTC (rev 351)
@@ -0,0 +1,28 @@
+# prothon
+#
+# Copyright (C) 2004 Mark Hahn <[email protected]>
+
+srcdir=@srcdir@
+top_builddir=@top_builddir@
+
+include $(top_builddir)/Rules.mk
+
+MODULE_NAME=OS
+
+TARGET = $(MODULE_NAME).la
+
+OBJS = $(MODULE_NAME).lo
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(LINK_MODULE) $(OBJS) -o $@
+
+install: $(TARGET)
+ $(LIB_INSTALL) $(TARGET) $(DESTDIR)$(PROTHON_DEFAULT_MODDIR)/
+
+distclean: clean
+ rm -f Makefile
+
+clean:
+ rm -fr *.o *.lo *.la .libs
Added: trunk/modules/OS/OS.c
===================================================================
--- trunk/modules/OS/OS.c 2004-04-14 16:58:43 UTC (rev 350)
+++ trunk/modules/OS/OS.c 2004-04-14 19:05:02 UTC (rev 351)
@@ -0,0 +1,79 @@
+/* ====================================================================
+ * The Prothon License Agreement, Version 1.1
+ *
+ * Copyright (c) 2004 Hahn Creative Applications, http://hahnca.com.
+ * All rights reserved.
+ *
+ * 1. This LICENSE AGREEMENT is between Hahn Creative Applications ("HCA"),
+ * and the Individual or Organization ("Licensee") accessing and otherwise
+ * using Prothon software in source or binary form and its associated
+ * documentation.
+ *
+ * 2. Subject to the terms and conditions of this License Agreement, HCA
+ * hereby grants Licensee a nonexclusive, royalty-free, world-wide license
+ * to reproduce, analyze, test, perform and/or display publicly, prepare
+ * derivative works, distribute, and otherwise use Prothon alone or in any
+ * derivative version, provided, however, that HCA's License Agreement and
+ * HCA's notice of copyright, i.e., "Copyright (c) 2004 Hahn Creative
+ * Applications; All Rights Reserved" are retained in Prothon alone or
+ * in any derivative version prepared by Licensee.
+ *
+ * 3. In the event Licensee prepares a derivative work that is based on or
+ * incorporates Prothon or any part thereof, and wants to make the
+ * derivative work available to others as provided herein, then Licensee
+ * hereby agrees to include in any such work a brief summary of the
+ * changes made to Prothon.
+ *
+ * 4. HCA is making Prothon available to Licensee on an "AS IS" basis.
+ * HCA MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY
+ * OF EXAMPLE, BUT NOT LIMITATION, HCA MAKES NO AND DISCLAIMS ANY
+ * REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY
+ * PARTICULAR PURPOSE OR THAT THE USE OF PROTHON WILL NOT INFRINGE ANY
+ * THIRD PARTY RIGHTS.
+ *
+ * 5. HCA SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PROTHON
+ * FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A
+ * RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PROTHON, OR ANY
+ * DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+ *
+ * 6. This License Agreement will automatically terminate upon a material
+ * breach of its terms and conditions.
+ *
+ * 7. Nothing in this License Agreement shall be deemed to create any
+ * relationship of agency, partnership, or joint venture between HCA and
+ * Licensee. This License Agreement does not grant permission to use HCA
+ * trademarks or trade name in a trademark sense to endorse or promote
+ * products or services of Licensee, or any third party.
+ *
+ * 8. By copying, installing or otherwise using Prothon, Licensee agrees
+ * to be bound by the terms and conditions of this License Agreement.
+ * ====================================================================
+ */
+
+
+// OS.c - OS routines
+
+#include <stdlib.h>
+#include <prothon/prothon_dll.h>
+
+
+MODULE_DECLARE(OS);
+
+MODULE_START(OS)
+{
+ OS_OBJ = new_object(ist, NULL);
+ MODULE_SET_DOC(OS, "Operating System specific routines");
+ MODULE_ADD_TO_BASE(OS);
+}
+
+DEF(OS, system, FPARM1(cmd, NULL)) {
+ CHECK_TYPE_EXC(parms[1], OBJ(STRING_PROTO), "string");
+
+ return new_int_obj(ist, system(strch(parms[1])));
+}
+
+MAIN_MODULE_INIT(OS)
+{
+ MODULE_SUB_INIT(OS);
+ MODULE_ADD_SYM(OS, system);
+}
Property changes on: trunk/modules/OS/OS.c
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/pr/system-test.pr
===================================================================
--- trunk/pr/system-test.pr 2004-04-14 16:58:43 UTC (rev 350)
+++ trunk/pr/system-test.pr 2004-04-14 19:05:02 UTC (rev 351)
@@ -0,0 +1,7 @@
+#!/usr/bin/env prothon
+
+import OS
+
+ret = OS.system("echo hello")
+
+print ret
Property changes on: trunk/pr/system-test.pr
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native