From f194151767d10fe705231224a565c5a3b26a7d6b Mon Sep 17 00:00:00 2001 From: HyungKyu Song Date: Sat, 16 Feb 2013 00:18:08 +0900 Subject: [PATCH] Tizen 2.0 Release --- AUTHORS | 2 +- COPYING | 75 ++-- ChangeLog | 51 +++ INSTALL | 244 ++++++++++- Makefile.am | 26 +- NEWS | 53 +++ README | 90 ++++ autogen.sh | 28 +- configure.ac | 222 ++++++++++ debian/changelog | 420 +++++++++++++++++++ debian/compat | 2 +- debian/control | 22 +- debian/copyright | 48 ++- debian/libembryo-dev.install | 2 +- debian/libembryo0.symbols | 36 ++ debian/rules | 28 +- doc/Doxyfile.in | 137 ++++++ doc/Makefile.am | 33 ++ doc/e.css | 591 +++++++++++++++++++------- doc/embryo.dox.in | 0 doc/foot.html | 21 +- doc/head.html | 104 +++-- doc/img/e.png | Bin 0 -> 3825 bytes doc/img/e_big.png | Bin 0 -> 30052 bytes doc/img/edoxy.css | 966 +++++++++++++++++++++++++++++++++++++++++++ doc/img/foot_bg.png | Bin 0 -> 173 bytes doc/img/head_bg.png | Bin 0 -> 214 bytes doc/img/menu_bg.png | Bin 0 -> 192 bytes doc/img/menu_bg_current.png | Bin 0 -> 1200 bytes doc/img/menu_bg_hover.png | Bin 0 -> 3278 bytes doc/img/menu_bg_last.png | Bin 0 -> 637 bytes doc/img/menu_bg_unsel.png | Bin 0 -> 1596 bytes embryo.manifest | 5 + embryo.pc.in | 8 +- embryo.spec.in | 6 +- include/default.inc | 18 + m4/ac_attribute.m4 | 47 +++ m4/efl_binary.m4 | 44 ++ m4/efl_doxygen.m4 | 97 +++++ m4/efl_fnmatch.m4 | 31 ++ m4/efl_gettimeofday.m4 | 48 +++ m4/efl_path_max.m4 | 36 ++ packaging/embryo.spec | 68 +++ src/bin/Makefile.am | 10 +- src/bin/embryo_cc_amx.h | 24 +- src/bin/embryo_cc_osdefs.h | 38 -- src/bin/embryo_cc_prefix.c | 423 +------------------ src/bin/embryo_cc_prefix.h | 5 - src/bin/embryo_cc_sc.h | 21 +- src/bin/embryo_cc_sc1.c | 266 ++++++------ src/bin/embryo_cc_sc2.c | 235 ++++++----- src/bin/embryo_cc_sc3.c | 108 +++-- src/bin/embryo_cc_sc4.c | 39 +- src/bin/embryo_cc_sc5.c | 28 +- src/bin/embryo_cc_sc6.c | 90 ++-- src/bin/embryo_cc_sc7.c | 53 ++- src/bin/embryo_cc_scexpand.c | 3 - src/bin/embryo_cc_sclist.c | 49 +-- src/bin/embryo_cc_scvars.c | 10 +- src/lib/Embryo.h | 874 ++++++++++++++++++++++++++++++++++++--- src/lib/Makefile.am | 16 +- src/lib/embryo_amx.c | 462 +++------------------ src/lib/embryo_args.c | 26 +- src/lib/embryo_float.c | 199 +++++++-- src/lib/embryo_main.c | 46 +-- src/lib/embryo_private.h | 53 +-- src/lib/embryo_rand.c | 9 +- src/lib/embryo_str.c | 53 ++- src/lib/embryo_time.c | 26 +- 69 files changed, 4976 insertions(+), 1799 deletions(-) create mode 100644 README create mode 100644 configure.ac create mode 100644 debian/changelog create mode 100644 debian/libembryo0.symbols mode change 100644 => 100755 debian/rules create mode 100644 doc/Doxyfile.in create mode 100644 doc/Makefile.am create mode 100644 doc/embryo.dox.in create mode 100755 doc/img/e.png create mode 100755 doc/img/e_big.png create mode 100755 doc/img/edoxy.css create mode 100755 doc/img/foot_bg.png create mode 100755 doc/img/head_bg.png create mode 100755 doc/img/menu_bg.png create mode 100755 doc/img/menu_bg_current.png create mode 100755 doc/img/menu_bg_hover.png create mode 100755 doc/img/menu_bg_last.png create mode 100755 doc/img/menu_bg_unsel.png create mode 100644 embryo.manifest create mode 100644 m4/ac_attribute.m4 create mode 100644 m4/efl_binary.m4 create mode 100644 m4/efl_doxygen.m4 create mode 100644 m4/efl_fnmatch.m4 create mode 100644 m4/efl_gettimeofday.m4 create mode 100644 m4/efl_path_max.m4 create mode 100644 packaging/embryo.spec diff --git a/AUTHORS b/AUTHORS index 7bf31c1..0f8136b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,2 @@ The Rasterman (Carsten Haitzler) - +Jérôme Pinot diff --git a/COPYING b/COPYING index 474fcc5..26d6208 100644 --- a/COPYING +++ b/COPYING @@ -1,28 +1,47 @@ -Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies of the Software and its Copyright notices. In addition publicly -documented acknowledgment must be given that this software has been used if no -source code of this software is made available publicly. This includes -acknowledgments in either Copyright notices, Manuals, Publicity and Marketing -documents or any documentation provided with any product containing this -software. This License does not apply to any software that links to the -libraries provided by this software (statically or dynamically), but only to -the software provided. - -Please see the COPYING.PLAIN for a plain-english explanation of this notice -and it's intent. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +Copyright notice for Embryo: + +Copyright (C) 2004-2011 Carsten Haitzler and various contributors (see AUTHORS) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Large parts of this source come under the following license from the +original Small (renamed to Pawn afterwards, but was named Small when +Embryo split off). See the source files that are clearly marked as below: + +Copyright (c) ITB CompuPhase, 1997-2003 + +This software is provided "as-is", without any express or implied warranty. +In no event will the authors be held liable for any damages arising from +the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in + a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. diff --git a/ChangeLog b/ChangeLog index e69de29..2611b84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -0,0 +1,51 @@ +2011-01-29 Carsten Haitzler (The Rasterman) + + 1.0.0 release + +2011-05-12 Carsten Haitzler (The Rasterman) + + * Make embryo_cc use eina and eina_prefix to determine include location + +2011-07-16 Vincent Torri + + * delete temporary files on Windows + +2011-10-05 Vincent Torri + + * use fseek() instead of rewind() as the latter does not exist on + Windows CE and fix compilation with Evil. + +2011-12-02 Carsten Haitzler (The Rasterman) + + 1.1.0 release + +2012-02-24 Cedric Bail + + * Add exotic support + +2012-03-07 Vincent Torri + + * Fix windows compilation issues + +2012-04-16 Carsten Haitzler (The Rasterman) + + * Add asin(), acos(), atan(), atan2(), log1p(), cbrt(), exp(), + exp2(), hypot(), EMBRYO_12 define + +2012-04-26 Carsten Haitzler (The Rasterman) + + 1.2.0 release + +2012-06-14 Carsten Haitzler (The Rasterman) + + * Fix divide by 0 possibilities in the fp support so no FPE is + produced (bad). + +2012-08-30 Carsten Haitzler (The Rasterman) + + 1.7.0 release + +2012-09-12 Carsten Haitzler (The Rasterman) + + * Fix windows utf/whitespace parsing issue in windows + diff --git a/INSTALL b/INSTALL index 348d009..23e5f25 100644 --- a/INSTALL +++ b/INSTALL @@ -1,14 +1,236 @@ -COMPILING and INSTALLING: +Installation Instructions +************************* -If you got a official release tar archive do: - ./configure - -( otherwise if you got this from enlightenment cvs do: ./autogen.sh ) - -Then to compile: - make +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. -To install (run this as root, or the user who handles installs): - make install +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. -NOTE: You MUST make install Embryo for it to run properly. diff --git a/Makefile.am b/Makefile.am index 44b44d4..5c70db3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,6 @@ -SUBDIRS = src include +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = src include doc MAINTAINERCLEANFILES = \ Makefile.in \ @@ -6,13 +8,16 @@ aclocal.m4 \ compile \ config.guess \ config.h.in \ +config.h.in~ \ config.sub \ configure \ depcomp \ install-sh \ ltmain.sh \ missing \ -embryo_docs.tar.gz \ +$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \ +$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \ +$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2 \ m4/libtool.m4 \ m4/lt~obsolete.m4 \ m4/ltoptions.m4 \ @@ -22,17 +27,18 @@ m4/ltversion.m4 EXTRA_DIST = \ AUTHORS \ COPYING \ -COPYING-PLAIN \ autogen.sh \ -embryo.c.in \ embryo.pc.in \ embryo.spec.in \ -embryo.spec \ -README.in \ -README \ -Doxyfile \ -doc \ -gendoc +embryo.spec pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = embryo.pc + +.PHONY: doc + +# Documentation + +doc: + @echo "entering doc/" + make -C doc doc diff --git a/NEWS b/NEWS index e69de29..5b0201b 100644 --- a/NEWS +++ b/NEWS @@ -0,0 +1,53 @@ +Embryo 1.8.0 + +Changes since Embryo 1.7.0: +--------------------------- + +Fixes: + + * Fix windows utf8 shitepsace parse issue. + +Changes since Embryo 1.2.0: +--------------------------- + +Fixes: + + * Fix divide by 0 n FP support to avoid FPE. + +Changes since Embryo 1.1.0: +--------------------------- + +Additions: + + * exotic support + * asin() + * acos() + * atan() + * atan2() + * log1p() + * cbrt() + * exp(), + * exp2() + * hypot() + * EMBRYO_12 + +Fixes: + + * windows compilation support + +Improvements: + + * exotic support + +Changes since Embryo 1.0.0: +--------------------------- + +Fixes: + + * on windows use fseek instead of rewind as rewind doesn't exist on wince + * delete tmp files on windows + +Improvements: + + * make embryo_cc use eina_prefix to determine installation location + diff --git a/README b/README new file mode 100644 index 0000000..a434404 --- /dev/null +++ b/README @@ -0,0 +1,90 @@ +Embryo 1.7.99 + +****************************************************************************** + + FOR ANY ISSUES PLEASE EMAIL: + enlightenment-devel@lists.sourceforge.net + +****************************************************************************** + +Requirements: +------------- + +Must: + eina + libc + +WARNING: gcc compatibility!!! +There seems to be some bug (or disagreement) between embryo and gcc 3.2.x +where IEEE floating point format encoding does not "agree" with embryo's own +hand-made tests. embryo_cc may not work if you compile using gcc 3.2.x. gcc +3.3.x is known to work fine. we are not 100% sure whose fault this is yet, so +we won't be jumping up and down, but be warned - gcc 3.2.x does not agree +with embryo. + +To view the API docs, run ./gendoc and view doc/html/index.html. + +OK a lot of people ask this. What is Embryo? + +Embryo is primarily a shared library that gives you an API to load and control +interpreted programs compiled into an abstract machine bytecode that it +understands. This abstract (or virtual) machine is similar to a real machine +with a CPU, but it is emulated in software. The architecture is simple and is +the same as the abstract machine (AMX) in the +PAWN language (formerly called +SMALL) as it is based on exactly the same code. Embryo has modified the code +for the AMX extensively and has made it smaller and more portable. It is VERY +small. The total size of the virtual machine code AND header files is less +than 2500 lines of code. It includes the floating point library support by +default as well. This makes it one of the smallest interpreters around, and +thus makes is very efficient to use in code. + +Embryo also uses the PAWN compiler from the same code base. This code has +barely been touched and so suffers from lots of portability issues. It has +been partially fixed and now works on both big and little endian but the code +still need to be gone over and really cleaned up . It does work, but it's only +just working. It has been called embryo_cc and compiled a subset of PAWN +binary outputs. It does not support packed strings, variable alignment, or +debugging output. It does not support many features of the full PAWN +compiler because the Embryo AMX does not support these either. You will find +the Embryo codebase to work much better on Linux (and BSD and MacOS X) and +other UNIX operating systems as it has been developed and tested on them. IT +is known to work on: + gcc Linux (x86-32) + gcc Linux (PPC) + gcc MacOS X (PPC) + +And will likely work on more combinations. IT currently has problems on 64bit +SPARC CPUs. Other 64bit systems are untested. It is the aim to fix the code +so it works on all commonly used architectures (32, 64bit, big and little +endian, alignment forgiving/unforgiving). So far 64bit support is the major +issue. + +For more documentation please see the Language guide here: + +Pawn Language Booklet + +This documents the PAWN language and is 100% relevant for Embryo and the +syntax of files it can compile (.sma files). + +Any help is appreciated in helping clean and port this code, so feel free to +send patches to the Enlightenment development lists. + +The main aim of Embryo is to provide an easy to use library for running +compiled PAWN programs and giving them access to the calling program and +any API it exports to the PAWN script. PAWN programs/scripts are completely +sand-boxed. They cannot access any system or function calls other than the +ones provided by the calling application to the Embryo API. This means a +PAWN script cannot open or write to, delete or load files. It is fairly +harmless and this also keeps Embryo small. + +This is a work in progress, so please be patient if things don't work for you +- and patches and help in fixing it is very much appreciated. + +------------------------------------------------------------------------------ +COMPILING AND INSTALLING: + + ./configure + make +(as root unless you are installing in your users directories): + make install diff --git a/autogen.sh b/autogen.sh index 0846992..72e1033 100755 --- a/autogen.sh +++ b/autogen.sh @@ -3,14 +3,36 @@ rm -rf autom4te.cache rm -f aclocal.m4 ltmain.sh -touch README +touch ABOUT-NLS -echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || exit 1 +echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1 echo "Running autoheader..." ; autoheader || exit 1 echo "Running autoconf..." ; autoconf || exit 1 echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1 echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1 +W=0 + +rm -f config.cache-env.tmp +echo "OLD_PARM=\"$@\"" >> config.cache-env.tmp +echo "OLD_CFLAGS=\"$CFLAGS\"" >> config.cache-env.tmp +echo "OLD_PATH=\"$PATH\"" >> config.cache-env.tmp +echo "OLD_PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"" >> config.cache-env.tmp +echo "OLD_LDFLAGS=\"$LDFLAGS\"" >> config.cache-env.tmp + +cmp config.cache-env.tmp config.cache-env >> /dev/null +if [ $? -ne 0 ]; then + W=1; +fi + +if [ $W -ne 0 ]; then + echo "Cleaning configure cache..."; + rm -f config.cache config.cache-env + mv config.cache-env.tmp config.cache-env +else + rm -f config.cache-env.tmp +fi + if [ -z "$NOCONFIGURE" ]; then - ./configure "$@" + ./configure -C "$@" fi diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..a918f3e --- /dev/null +++ b/configure.ac @@ -0,0 +1,222 @@ +##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## +##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## +m4_define([v_maj], [1]) +m4_define([v_min], [7]) +m4_define([v_mic], [99]) +m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n'])) +m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))]) +##-- When released, remove the dnl on the below line +dnl m4_undefine([v_rev]) +##-- When doing snapshots - change soname. remove dnl on below line +dnl m4_define([relname], [ver-pre-svn-07]) +dnl m4_define([v_rel], [-release ver-pre-svn-07]) +##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## +m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])]) +m4_define([lt_cur], m4_eval(v_maj + v_min)) +m4_define([lt_rev], v_mic) +m4_define([lt_age], v_min) +##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## +##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## + +AC_INIT([embryo], [v_ver], [enlightenment-devel@lists.sourceforge.net]) +AC_PREREQ([2.52]) +AC_CONFIG_SRCDIR([configure.ac]) +AC_CONFIG_MACRO_DIR([m4]) + +AC_CONFIG_HEADERS([config.h]) +AH_TOP([ +#ifndef EFL_CONFIG_H__ +#define EFL_CONFIG_H__ +]) +AH_BOTTOM([ +#endif /* EFL_CONFIG_H__ */ +]) + +AM_INIT_AUTOMAKE([1.6 dist-bzip2]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +AC_LIBTOOL_WIN32_DLL +define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl +define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl +AC_PROG_LIBTOOL + +##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## +##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## +m4_ifdef([v_rev], , [m4_define([v_rev], [0])]) +m4_ifdef([v_rel], , [m4_define([v_rel], [])]) +AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version]) +AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version]) +AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version]) +AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison]) +version_info="lt_cur:lt_rev:lt_age" +release_info="v_rel" +AC_SUBST(version_info) +AC_SUBST(release_info) +##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## +##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## +VMAJ=v_maj +AC_SUBST(VMAJ) + +### Default options with respect to host + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST + +requirement_embryo="" +embryoincludedir="${datadir}/include" + + +### Additional options to configure + +EFL_ENABLE_BIN([embryo-cc]) + + +### Checks for programs +AC_PROG_CC + +# doxygen program for documentation building + +EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"]) + +# pkg-config + +PKG_PROG_PKG_CONFIG + +# Check whether pkg-config supports Requires.private +if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then + pkgconfig_requires_private="Requires.private" +else + pkgconfig_requires_private="Requires" +fi +AC_SUBST(pkgconfig_requires_private) + + +### Checks for libraries + +# Evil library for compilation on Windows + +EFL_EMBRYO_BUILD="" +case "$host_os" in + mingw*) + PKG_CHECK_MODULES([EVIL], [evil >= 1.6.99]) + AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed]) + requirement_embryo="evil ${requirement_embryo}" + EFL_EMBRYO_BUILD="-DEFL_EMBRYO_BUILD" + ;; +esac +AC_SUBST(EFL_EMBRYO_BUILD) + +# For embryo_cc_prefix.c +PKG_CHECK_MODULES([EINA], [eina >= 1.6.99]) + +### Checks for portability layer + +PKG_CHECK_MODULES([EXOTIC], + [exotic], + [enable_exotic="yes"], + [enable_exotic="no"]) + +if test "x${enable_exotic}" = "xyes"; then + requirement_embryo="exotic ${requirement_embryo}" + + AC_DEFINE([HAVE_EXOTIC], [1], [Define to 1 if you have Exotic.]) +fi + +### Checks for header files + +AC_CHECK_HEADERS([unistd.h]) +EFL_CHECK_PATH_MAX + + +### Checks for types + + +### Checks for structures + + +### Checks for compiler characteristics +AC_C_BIGENDIAN +AM_PROG_CC_C_O +AC_C_CONST +AC_C_INLINE +AC_PROG_CC_STDC +AC_HEADER_STDC +AC_C___ATTRIBUTE__ + +EMBRYO_CPPFLAGS="" +EMBRYO_CFLAGS="" +case "$host_os" in + mingw32ce*) + EMBRYO_CPPFLAGS="-D_WIN32_WCE=0x0420" + ;; +esac +AC_SUBST(EMBRYO_CPPFLAGS) +AC_SUBST(EMBRYO_CFLAGS) + + +### Checks for linker characteristics + +lt_enable_auto_import="" +case "$host_os" in + mingw*) + lt_enable_auto_import="-Wl,--enable-auto-import" + ;; +esac +AC_SUBST(lt_enable_auto_import) + + +### Checks for library functions + +AC_ISC_POSIX + +# alloca +AC_FUNC_ALLOCA + +# fnmatch +EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])]) + +# gettimeofday +EFL_CHECK_GETTIMEOFDAY([], [AC_MSG_ERROR([Cannot find gettimeofday()])]) + + +AC_SUBST(requirement_embryo) +AC_SUBST(embryoincludedir) + +AC_OUTPUT([ +Makefile +doc/Makefile +doc/Doxyfile +doc/embryo.dox +embryo.pc +include/Makefile +src/Makefile +src/lib/Makefile +src/bin/Makefile +embryo.spec +]) + + +##################################################################### +## Info + +echo +echo +echo +echo "------------------------------------------------------------------------" +echo "$PACKAGE $VERSION" +echo "------------------------------------------------------------------------" +echo +echo "Configuration Options Summary:" +echo +echo " Build embryo_cc......: $have_embryo_cc" +echo +echo " Documentation........: ${build_doc}" +echo +echo "Compilation............: make (or gmake)" +echo " CPPFLAGS.............: $CPPFLAGS" +echo " CFLAGS...............: $CFLAGS" +echo " LDFLAGS..............: $LDFLAGS" +echo +echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')" +echo " prefix...............: $prefix" +echo diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..b59df57 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,420 @@ +embryo (1.2.0+svn.70375slp2+build02) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.2.0+svn.70375slp2+build02 + + -- Myungjae Lee Wed, 25 Apr 2012 17:28:40 +0900 + +embryo (1.2.0+svn.70375slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.2.0+svn.70375slp2+build01 + + -- Myungjae Lee Wed, 25 Apr 2012 15:14:02 +0900 + +embryo (1.2.0+svn.70344slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.2.0+svn.70344slp2+build01 + + -- Jaehwan Kim Mon, 23 Apr 2012 15:29:05 +0900 + +embryo (1.2.0+svn.70204slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.2.0+svn.70204slp2+build01 + + -- Hyoyoung Chang Wed, 18 Apr 2012 18:08:02 +0900 + +embryo (1.2.0+svn.69899slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.2.0+svn.69899slp2+build01 + + -- Jeonghyun Yun Fri, 06 Apr 2012 18:17:05 +0900 + +embryo (1.1.0+svn.69490slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.1.0+svn.69490slp2+build01 + + -- Jeonghyun Yun Wed, 28 Mar 2012 14:29:30 +0900 + +embryo (1.1.0+svn.68928slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.1.0+svn.68928slp2+build01 + + -- Jeonghyun Yun Sat, 10 Mar 2012 13:51:25 +0900 + +embryo (1.1.0+svn.68718slp2+build02) unstable; urgency=low + + * 68928 + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.1.0+svn.68718slp2+build02 + + -- Jeonghyun Yun Sat, 10 Mar 2012 13:21:01 +0900 + +embryo (1.1.0+svn.68718slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.1.0+svn.68718slp2+build01 + + -- Jeonghyun Yun Wed, 07 Mar 2012 16:44:53 +0900 + +embryo (1.1.0+svn.68421slp2+build01) unstable; urgency=low + + * Package upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.1.0+svn.68421slp2+build01 + + -- Jeonghyun Yun Fri, 02 Mar 2012 06:32:43 -0500 + +embryo (1.1.0+svn.67705slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.1.0+svn.67705slp2+build01 + + -- Jaehwan Kim Wed, 15 Feb 2012 19:01:34 +0900 + +embryo (1.1.0+svn.66150slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/embryo + * Tag: embryo_1.1.0+svn.66150slp2+build01 + + -- Jaehwan Kim Mon, 16 Jan 2012 18:36:25 +0900 + +embryo (1.1.0+svn.65860slp2+build01) unstable; urgency=low + + * Package Upload for migration + * Git: slp-scm.sec.samsung.net:slp/pkgs/e/embryo + * Tag: embryo_1.1.0+svn.65860slp2+build01 + + -- Jaehwan Kim Thu, 08 Dec 2011 13:52:17 +0900 + +embryo (1.1.0+svn.65304slp2+build01) unstable; urgency=low + + * Merge with upstream @65304 + + -- Mike McCormack Thu, 17 Nov 2011 09:10:41 +0900 + +embryo (1.0.0.001+svn.64802slp2+build01) unstable; urgency=low + + * Merge with upstream @64802 + + -- Mike McCormack Thu, 10 Nov 2011 14:10:35 +0900 + +embryo (1.0.0.001+svn.63811slp2+build01) unstable; urgency=low + + * Merge with upstream + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.63811slp2+build01 + + -- Mike McCormack Wed, 05 Oct 2011 16:45:36 +0900 + +embryo (1.0.0.001+svn.62382slp2+build01) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r62382 + * Important Changes + [Migration upstream r62382] + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.62382slp2+build01 + + -- Jaehwan Kim Fri, 02 Sep 2011 18:43:44 +0900 + +embryo (1.0.0.001+svn.60294slp2+build02) unstable; urgency=low + + * Package Upload + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.60294slp2+build02 + + -- Jaehwan Kim Fri, 24 Jun 2011 19:33:14 +0900 + +embryo (1.0.0.001+svn.60294slp2+build01) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r60294 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.60294slp2+build01 + + -- Jaehwan Kim Fri, 24 Jun 2011 18:10:13 +0900 + +embryo (1.0.0.001+svn.58120slp2+build01) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r58120 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.58120slp2+build01 + + -- Jaehwan Kim Tue, 05 Apr 2011 15:55:13 +0900 + +embryo (1.0.0.001+svn.57246slp2+build06) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r57246 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.57246slp2+build06 + + -- Shinwoo Kim Tue, 29 Mar 2011 18:55:38 +0900 + +embryo (1.0.0.001+svn.57246slp2+build05) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r57246 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.57246slp2+build05 + + -- Myungjae Lee Wed, 09 Mar 2011 11:29:49 +0900 + +embryo (1.0.0.001+svn.57246slp2+build04) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r57246 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.57246slp2+build04 + + -- Myungjae Lee Wed, 09 Mar 2011 11:15:04 +0900 + +embryo (1.0.0.001+svn.57246slp2+build03) unstable; urgency=low + + * Package Uplaod : Rollback + * Git: 165.213.180.234:/slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.57246slp2+build03 + + -- WooHyun Jung Tue, 08 Mar 2011 12:41:39 +0900 + +embryo (1.0.0.001+svn.57246slp2+build02) unstable; urgency=low + + * Package Upload : rollback + * Git: 165.213.180.234:/slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.57246slp2+build02 + + -- WooHyun Jung Tue, 08 Mar 2011 11:11:56 +0900 + +embryo (1.0.0.001+svn.57246slp2+build01) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r57246 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.57246slp2+build01 + + -- Myungjae Lee Mon, 07 Mar 2011 17:28:18 +0900 + +embryo (1.0.0.001+svn.56205slp2+build01) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r56205 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.56205slp2+build01 + + -- WooHyun Jung Thu, 27 Jan 2011 12:22:41 +0900 + +embryo (1.0.0.001+svn.55945slp2+build01) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r55945 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.55945slp2+build01 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.55945slp2+build01 + + -- WooHyun Jung Wed, 19 Jan 2011 16:18:16 +0900 + +embryo (1.0.0.001+svn.55682slp2+build01) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r55682 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.55682slp2+build01 + + -- Jaehwan Kim Mon, 03 Jan 2011 21:20:27 +0900 + +embryo (1.0.0.001+svn.55489slp2+build01) unstable; urgency=low + + * [SVN EFL Migration] embryo in SLP is merged with SVN r55489 + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.55489slp2+build01 + + -- Jaehwan Kim Wed, 22 Dec 2010 20:04:36 +0900 + +embryo (1.0.0.001+svn.55238slp2+build01) unstable; urgency=low + + * [SVN's EFL Migration] embryo in SLP is merged with SVN r55238. + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.55238slp2+build01 + + -- Juyung Seo Tue, 14 Dec 2010 17:51:21 +0900 + +embryo (1.0.0.001+svn.51480slp2+build04) unstable; urgency=low + + * [SVN's EFL Migration] embryo in SLP is merged with SVN r55238. + * Git: 165.213.180.234:slp/pkgs/e/embryo + * Tag: embryo_1.0.0.001+svn.51480slp2+build04 + + -- Juyung Seo Tue, 14 Dec 2010 14:58:09 +0900 + +embryo (1.0.0.001+svn.51480slp2+build03) unstable; urgency=low + + * [SVN 54507 Merge] + * Update to SVN Revision 54507. + * Git: 165.213.180.234:/git/slp/pkgs/embryo + * Tag: embryo_1.0.0.001+svn.51480slp2+build03 + + -- Juyung Seo Fri, 26 Nov 2010 15:39:26 +0900 + +embryo (1.0.0.001+svn.51480slp2+build02) unstable; urgency=low + + * add as-needed + * Git: 165.213.180.234:/git/slp/pkgs/embryo + * Tag: embryo_1.0.0.001+svn.51480slp2+build02 + + -- Jaehwan Kim Wed, 15 Sep 2010 10:51:24 +0900 + +embryo (1.0.0.001+svn.51480slp2+build01) unstable; urgency=low + + * efl 1.0 alpha upgrade + * Git: 165.213.180.234:/git/slp/pkgs/embryo + * Tag: embryo_1.0.0.001+svn.51480slp2+build01 + + -- Jaehwan Kim Tue, 31 Aug 2010 22:47:22 +0900 + +embryo (0.9.9.060+svn.49540slp2+3build04) unstable; urgency=low + + * Packaging. + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/EFL-pkgs/embryo + * Tag: embryo_0.9.9.060+svn.49540slp2+3build04 + + -- Daniel Juyung Seo Thu, 10 Jun 2010 21:09:44 +0900 + +embryo (0.9.9.060+svn.49540slp2+3build03) unstable; urgency=low + + * Packaging. + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/EFL-pkgs/embryo + * Tag: embryo_0.9.9.060+svn.49540slp2+3build03 + + -- Daniel Juyung Seo Thu, 10 Jun 2010 21:04:28 +0900 + +embryo (0.9.9.060+svn.49540slp2+3build02) unstable; urgency=low + + * Packaging. + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/EFL-pkgs/embryo + * Tag: embryo_0.9.9.060+svn.49540slp2+3build02 + + -- Daniel Juyung Seo 목, 10 6월 2010 21:00:52 +0900 + +embryo (0.9.9.060+svn.49540slp2+3) unstable; urgency=low + + * Packaging. + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/EFL-pkgs/embryo + * Tag: embryo_0.9.9.060+svn.49540slp2+3 + + -- Daniel Juyung Seo Thu, 10 Jun 2010 20:46:54 +0900 + +embryo (0.9.9.060+svn.49540slp2+2) unstable; urgency=low + + * Packaging. + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/EFL-pkgs/embryo + * Tag: embryo_0.9.9.060+svn.49540slp2+2 + + -- Daniel Juyung Seo Thu, 10 Jun 2010 20:46:08 +0900 + +embryo (0.9.9.060+svn.49540slp2+1) unstable; urgency=low + + * Packaging. + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/EFL-pkgs/embryo + * Tag: embryo_0.9.9.060+svn.49540slp2+1 + + -- Daniel Juyung Seo Thu, 10 Jun 2010 20:22:44 +0900 + +embryo (0.9.9.060+svn.49540slp2+0) unstable; urgency=low + + * Update opensource EFL from SVN + * SVN revision: 49540 (Total EFL revision: 49550) + * Tag: 0.9.9.060+svn.49540slp2+0 + + -- Daniel Juyung Seo Thu, 10 Jun 2010 15:50:43 +0900 + +embryo (0.9.9.060+svn20100304slp2) unstable; urgency=low + + * change package version + + -- Jaehwan Kim Thu, 25 Mar 2010 16:03:48 +0900 + +embryo (0.9.9.060+svn20100304-1) unstable; urgency=low + + * EFL_update_revision_46864 + + -- Jaehwan Kim Wed, 10 Mar 2010 16:06:36 +0900 + +embryo (0.9.9.060+svn20100203-2) unstable; urgency=low + + * repack + + -- Jaehwan Kim Thu, 04 Feb 2010 20:29:08 +0900 + +embryo (0.9.9.060+svn20100203-1) unstable; urgency=low + + * EFL_update_revision_45828 + + -- Jaehwan Kim Wed, 03 Feb 2010 16:39:22 +0900 + +embryo (0.9.9.060+svn20100119-1) unstable; urgency=low + + * EFL_update_revision_45322 + + -- Jihoon Kim Tue, 19 Jan 2010 20:44:48 +0900 + +embryo (0.9.9.060+svn20100111-3) unstable; urgency=low + + * reupload EFL i686 + + -- Jaehwan Kim Tue, 12 Jan 2010 17:35:36 +0900 + +embryo (0.9.9.060+svn20100111-2) unstable; urgency=low + + * reupload EFL + + -- Jaehwan Kim Mon, 11 Jan 2010 22:16:57 +0900 + +embryo (0.9.9.060+svn20100111-1) unstable; urgency=low + + * update EFL revision + + -- Jaehwan Kim Mon, 11 Jan 2010 13:28:05 +0900 + +embryo (0.9.9.060+svn20091229-1) unstable; urgency=low + + * update EFL + + -- Jaehwan Kim Tue, 29 Dec 2009 14:27:04 +0900 + +embryo (0.9.9.060+svn20091112-3) unstable; urgency=low + + * change arch to any + + -- youmin ha Fri, 27 Nov 2009 16:31:01 +0900 + +embryo (0.9.9.060+svn20091112-2) unstable; urgency=low + + * svn stable version + + -- Sangho Park Thu, 19 Nov 2009 19:01:51 +0900 + +embryo (0.9.9.060+svn20091112-1) unstable; urgency=low + + * Clean up changelog + + -- Sangho Park Fri, 13 Nov 2009 08:56:08 +0900 + +embryo (0.9.9.060+svnYYYYMMDD-1) unstable; urgency=low + + * Clean up changelog + + -- quaker Thu, 22 Apr 2009 19:26:08 +0100 + +embryo (0.9.9.050+svnYYYYMMDD-1) unstable; urgency=low + + * Clean up changelog + + -- quaker Tue, 21 Apr 2009 19:15:09 +0100 diff --git a/debian/compat b/debian/compat index 1e8b314..7ed6ff8 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -6 +5 diff --git a/debian/control b/debian/control index 6ab8585..06cad25 100644 --- a/debian/control +++ b/debian/control @@ -1,16 +1,16 @@ Source: embryo Section: libs Priority: optional -Maintainer: Falko Schmidt -Build-Depends: debhelper (>= 6), cdbs, doxygen -Standards-Version: 3.7.3 +Maintainer: Jaehwan Kim , Juyung Seo , Mike McCormack , Jeonghyun Yun , Hyoyoung Chang +Build-Depends: dpkg-dev , debhelper (>= 6), cdbs, doxygen, pkg-config, libtool, libeina-dev +Standards-Version: 3.8.1 Homepage: http://www.enlightenment.org Package: libembryo-dev Section: libdevel Architecture: any -Depends: libembryo0 (= ${Source-Version}), pkg-config -Description: Development files for libembryo +Depends: ${misc:Depends}, libembryo0 (= ${binary:Version}), pkg-config +Description: Development files for libembryo0 Embryo is primarily a shared library that gives you an API to load and control interpreted programs compiled into an abstract machine bytecode that it understands. This abstract (or virtual) machine is @@ -21,8 +21,7 @@ Description: Development files for libembryo Package: libembryo0 Architecture: any -Provides: libembryo -Depends: ${shlibs:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Suggests: libembryo-bin Description: SMALL-based abstract machine (AMX) bytecode interpreter Embryo is primarily a shared library that gives you an API to load @@ -43,7 +42,8 @@ Description: SMALL-based abstract machine (AMX) bytecode interpreter Package: libembryo-doc Section: doc -Architecture: all +Architecture: any +Depends: ${misc:Depends} Enhances: libembryo-dev Description: libembryo0 development documentation Embryo is primarily a shared library that gives you an API to load @@ -57,9 +57,9 @@ Description: libembryo0 development documentation Package: libembryo-dbg Architecture: any Section: libdevel -Depends: libembryo0 (= ${binary:Version}) +Depends: ${misc:Depends}, libembryo0 (= ${binary:Version}) Priority: extra -Description: SMALL-based abstract machine (AMX) bytecode interpreter +Description: Debugging symbols for libembryo Embryo is primarily a shared library that gives you an API to load and control interpreted programs compiled into an abstract machine bytecode that it understands. This abstract (or virtual) machine is @@ -74,7 +74,7 @@ Description: SMALL-based abstract machine (AMX) bytecode interpreter Package: libembryo-bin Section: devel Architecture: any -Depends: ${shlibs:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Description: SMALL compiler creating Embryo bytecode Embryo is primarily a shared library that gives you an API to load and control interpreted programs compiled into an abstract machine diff --git a/debian/copyright b/debian/copyright index 62a8856..cee0fb6 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,18 +1,46 @@ -This package was debianized by Falko Schmidt on -Fri, 4 Apr 2008 15:43:15 +0000. +This package was debianized by Victor Koeppel on +Wed, 24 Mar 2004 15:44:55 +0100. -The source is from the e17/libs/embryo module of the enlightenment CVS -tree. For more information, see: +It was downloaded from http://download.enlightenment.org/ - http://www.enlightenment.org - -Upstream Author: - - Carsten Haitzler +Upstream Author: Carsten Haitzler Copyright: - Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS) + Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS) + +Additional copyrights: + src/bin: embryo_cc_amx.h, embryo_cc_osdefs.h, embryo_cc_scvars.c, + embryo_cc_sc[1-7].c, embryo_cc_scvars.c: Copyright ITB CompuPhase, 1997-2003 + + src/bin/embryo_cc_sc{5,7}.scp: Copyright (c) ITB CompuPhase, 2000-2003 + src/bin/embryo_cc_sclist.c: Copyright (c) ITB CompuPhase, 2001-2003 + src/bin/embryo_cc_scexpand.c: Copyright 1996 Philip Gage + src/bin/embryo_cc_sc.h: Copyright R. Cain, 1980, J.E. Hendrix, 1982, 1983, + T. Riemersma, 1997-2003 + + src/lib/embryo_amx.c: Copyright (c) ITB CompuPhase, 1997-2003 + Portions Copyright (c) Carsten Haitzler, 2004 + src/lib/embryo_float.c: Copyright (c) Artran, Inc. 1999 + Portions Copyright (c) Carsten Haitzler, 2004 + + These files are all licensed under the zLib license: + This software is provided "as-is", without any express or implied warranty. + In no event will the authors be held liable for any damages arising from + the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in + a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + License: Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/debian/libembryo-dev.install b/debian/libembryo-dev.install index 33c14b5..5f9e41c 100644 --- a/debian/libembryo-dev.install +++ b/debian/libembryo-dev.install @@ -1,4 +1,4 @@ debian/tmp/usr/include/* +debian/tmp/usr/lib/pkgconfig/* debian/tmp/usr/lib/lib*.a debian/tmp/usr/lib/lib*.so -debian/tmp/usr/lib/pkgconfig/* diff --git a/debian/libembryo0.symbols b/debian/libembryo0.symbols new file mode 100644 index 0000000..eb4c0f5 --- /dev/null +++ b/debian/libembryo0.symbols @@ -0,0 +1,36 @@ +libembryo.so.0 libembryo0 #MINVER# + embryo_data_address_get@Base 0.9.1.042 + embryo_data_heap_pop@Base 0.9.1.042 + embryo_data_heap_push@Base 0.9.1.042 + embryo_data_string_get@Base 0.9.1.042 + embryo_data_string_length_get@Base 0.9.1.042 + embryo_data_string_set@Base 0.9.1.042 + embryo_error_string_get@Base 0.9.1.042 + embryo_init@Base 0.9.1.042 + embryo_parameter_cell_array_push@Base 0.9.1.042 + embryo_parameter_cell_push@Base 0.9.1.042 + embryo_parameter_string_push@Base 0.9.1.042 + embryo_program_const_new@Base 0.9.1.042 + embryo_program_data_get@Base 0.9.1.042 + embryo_program_data_set@Base 0.9.1.042 + embryo_program_error_get@Base 0.9.1.042 + embryo_program_error_set@Base 0.9.1.042 + embryo_program_free@Base 0.9.1.042 + embryo_program_function_find@Base 0.9.1.042 + embryo_program_load@Base 0.9.1.042 + embryo_program_max_cycle_run_get@Base 0.9.1.042 + embryo_program_max_cycle_run_set@Base 0.9.1.042 + embryo_program_native_call_add@Base 0.9.1.042 + embryo_program_new@Base 0.9.1.042 + embryo_program_recursion_get@Base 0.9.1.042 + embryo_program_return_value_get@Base 0.9.1.042 + embryo_program_run@Base 0.9.1.042 + embryo_program_variable_count_get@Base 0.9.1.042 + embryo_program_variable_find@Base 0.9.1.042 + embryo_program_variable_get@Base 0.9.1.042 + embryo_program_vm_pop@Base 0.9.1.042 + embryo_program_vm_push@Base 0.9.1.042 + embryo_program_vm_reset@Base 0.9.1.042 + embryo_shutdown@Base 0.9.1.042 + embryo_swap_16@Base 0.9.1.042 + embryo_swap_32@Base 0.9.1.042 diff --git a/debian/rules b/debian/rules old mode 100644 new mode 100755 index 7cfecc0..ee17a73 --- a/debian/rules +++ b/debian/rules @@ -4,19 +4,23 @@ include /usr/share/cdbs/1/class/autotools.mk include /usr/share/cdbs/1/rules/debhelper.mk DEB_DH_STRIP_ARGS := --dbg-package=libembryo-dbg -DEB_CONFIGURE_EXTRA_FLAGS := --disable-rpath -DEB_MAKE_CLEAN_TARGET := clean +DEB_CONFIGURE_EXTRA_FLAGS := +DEB_CONFIGURE_SCRIPT := ./autogen.sh +DEB_MAKE_CLEAN_TARGET := distclean +#DEB_SOURCE_VERSION := $(shell grep AC_INIT $(DEB_SRCDIR)/configure.ac | cut -d, -f2 | tr -d ' []') +DEB_SOURCE_VERSION := 0.9.9.0 +CFLAGS += -fvisibility=hidden -fPIC +LDFLAGS += -fvisibility=hidden -Wl,--hash-style=both -Wl,--as-needed -build/libembryo-doc:: - cd $(DEB_SRCDIR) && doxygen +#build/libembryo-doc:: +# cd $(DEB_SRCDIR)/doc && make doc -install/libembryo-doc:: - cp -R $(DEB_SRCDIR)/doc/html debian/libembryo-doc/usr/share/doc/libembryo-doc/ - rm $(DEB_SRCDIR)/doc/man/man3/todo.3 +#install/libembryo-doc:: +# tar jxf embryo-*-doc.tar.bz2 -C $(DEB_SRCDIR) +# cp -R $(DEB_SRCDIR)/doc/html $(DEB_SRCDIR)/debian/libembryo-doc/usr/share/doc/libembryo-doc/ +# cp -R $(DEB_SRCDIR)/embryo-$(DEB_SOURCE_VERSION)-doc/doc/html debian/libembryo-doc/usr/share/doc/libembryo-doc/ +# rm -rf $(DEB_SRCDIR)/doc/ clean:: - rm -rf $(DEB_SRCDIR)/doc/html $(DEB_SRCDIR)/doc/latex $(DEB_SRCDIR)/doc/man - mkdir -p $(DEB_SRCDIR)/doc/html - cp $(DEB_SRCDIR)/doc/img/*.png $(DEB_SRCDIR)/doc/html/ - cp $(DEB_SRCDIR)/doc/img/*.gif $(DEB_SRCDIR)/doc/html/ - ./autogen.sh --prefix=/usr $(DEB_CONFIGURE_EXTRA_FLAGS) + [ ! -f Makefile ] || make distclean + rm -f embryo-*.tar.* embryo-*.cdbs-config_list diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in new file mode 100644 index 0000000..5476347 --- /dev/null +++ b/doc/Doxyfile.in @@ -0,0 +1,137 @@ +PROJECT_NAME = Embryo +PROJECT_NUMBER = +OUTPUT_DIRECTORY = . +INPUT = @srcdir@/embryo.dox @top_srcdir@/src/lib/ +IMAGE_PATH = img +OUTPUT_LANGUAGE = English +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = @srcdir@/head.html +HTML_FOOTER = @srcdir@/foot.html +HTML_STYLESHEET = @srcdir@/e.css +HTML_ALIGN_MEMBERS = YES +ENUM_VALUES_PER_LINE = 1 +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = YES +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = YES +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +INTERNAL_DOCS = NO +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = NO +SHOW_INCLUDE_FILES = NO +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 2 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ALIASES = +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +SHOW_USED_FILES = NO +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +FILE_PATTERNS = +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 2 +IGNORE_PREFIX = +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +GENERATE_MAN = YES +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = YES +GENERATE_XML = NO +XML_SCHEMA = +XML_DTD = +GENERATE_AUTOGEN_DEF = NO +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = NO +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +CLASS_DIAGRAMS = NO +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = NO +COLLABORATION_GRAPH = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = NO +INCLUDED_BY_GRAPH = NO +GRAPHICAL_HIERARCHY = NO +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +SEARCHENGINE = NO diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..91c79f3 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,33 @@ + +MAINTAINERCLEANFILES = Makefile.in embryo.dox + +.PHONY: doc + +PACKAGE_DOCNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc + +if EFL_BUILD_DOC + +doc-clean: + rm -rf html/ latex/ man/ xml/ $(top_builddir)/$(PACKAGE_DOCNAME).tar* + +doc: all doc-clean + $(efl_doxygen) + cp $(srcdir)/img/* html/ + rm -rf $(PACKAGE_DOCNAME).tar* + mkdir -p $(PACKAGE_DOCNAME)/doc + cp -R html/ latex/ man/ $(PACKAGE_DOCNAME)/doc + tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/ + bzip2 -9 $(PACKAGE_DOCNAME).tar + rm -rf $(PACKAGE_DOCNAME)/ + mv $(PACKAGE_DOCNAME).tar.bz2 $(top_builddir) + +clean-local: doc-clean + +else + +doc: + @echo "Documentation not built. Run ./configure --help" + +endif + +EXTRA_DIST = Doxyfile e.css foot.html head.html $(wildcard img/*.*) embryo.dox.in diff --git a/doc/e.css b/doc/e.css index 604ee7f..07ebd1e 100644 --- a/doc/e.css +++ b/doc/e.css @@ -1,161 +1,436 @@ +/* + Author: + Andres Blanc + DaveMDS Andreoli + + Supported Browsers: + ie7, opera9, konqueror4 and firefox3 + + Please use a different file for ie6, ie5, etc. hacks. +*/ + + +/* Necessary to place the footer at the bottom of the page */ +html, body { + height: 100%; + margin: 0px; + padding: 0px; +} + +#container { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -53px; +} + +#footer, #push { + height: 53px; +} + + +* html #container { + height: 100%; +} + +/* Prevent floating elements overflowing containers */ +.clear { + clear: both; + width: 0px; + height: 0px; +} + +/* Flexible & centered layout from 750 to 960 pixels */ +.layout { + max-width: 960px; + min-width: 760px; + margin-left: auto; + margin-right: auto; +} + body { - background: url("b.png"); - background-repeat: repeat-x; - background-position: top left; - background-color: #f4f4f4; - text-align: center; - font-family: sans-serif; - padding: 0; - margin: 0; -} - -div.main { - margin: 1em auto; - vertical-align: top; - font-family: "Bitstream Vera", "Vera", "Trebuchet MS", Trebuchet, Tahoma, sans-serif; - color: #444444; - font-size: 0.8em; - text-align: justify; - width: 80%; -} - -td.t { background-image:url("t.gif"); } -td.t[class] { background-image:url("t.png"); } -td.tl { background-image:url("tl.gif"); } -td.tl[class] { background-image:url("tl.png"); } - -td.nav, td.lnav, td.rnav { - align: middle; - text-align: center; - vertical-align: middle; - width: 100px; - height: 25px; - font-family: "Bitstream Vera", "Vera", "Trebuchet MS", Trebuchet, Tahoma, sans-serif; - color: #000000; - font-size: 9px; - font-weight: bold; - white-space: no-wrap; -} - -td.lnav[class] { background-image:url("n.png"); } -td.lnav[class] { background-image:url("n.png"); } -td.rnav { background-image:url("n.gif"); } -td.rnav[class] { background-image:url("n.png"); } - -hr { - width: 200px; - height: 1px; - background: #dddddd; - border: 0; -} - -p { color: #444444 ;} -p.tiny, small { - color: #888888; - font-size: 0.5em; -} - -h1 { - text-align: center; - font-size: 1.3em; -} - -h2 { font-size: 1.1em; } -h3 { font-size: 0.9em; } - -span.keyword { color: #008000; } -span.keywordtype { color: #604020; } -span.keywordflow { color: #e08000; } -span.comment { color: #800000; } -span.preprocessor { color: #806020; } -span.stringliteral { color: #002080; } -span.charliteral { color: #008080; } - -a:link { - color: #445566; - text-decoration: underline; -} - -a:visited { - color: #667788; - text-decoration: underline; -} - -a:active { - color: #88cccc; - text-decoration: none; -} - -a:hover { - color: #112266; - text-decoration: underline; -} - -a.nav { - text-decoration: none; - display: block; -} - -a.nav:link, a.nav:visited { color: #888888; } -a.nav:active { color: #000000; } -a.nav:hover { color: #444444; } -a.code:link, a.code:visited { text-decoration: none; } - -div.fragment { - font-size: 1em; - border: 1px dotted #cccccc; - background-color: #ffffff; - text-align: left; - vertical-align: middle; - padding: 2px; - margin-left: 25px; - margin-right: 25px; - overflow: auto; -} - -td.indexkey { - font-weight: bold; - padding-left: 10px; - padding-right: 0; - padding-top: 2px; - padding-bottom: 0px; - margin: 0; - margin-top: 2px; - margin-bottom: 2px; - border: 1px dotted #cccccc; - border-right: 0px dotted #cccccc; -} - -td.indexvalue { - font-style: italic; - padding-right: 10px; - padding-left: 0; - padding-top: 2px; - padding-bottom: 2px; - margin: 0; - margin-top: 2px; - margin-bottom: 2px; - border: 1px dotted #cccccc; - border-left: 0px dotted #cccccc; -} - -.mdescRight { font-style: italic; } -.memitem { - padding-left: 2px; - padding-right: 2px; - border: 1px dotted #cccccc; - background-color: #ffffff; -} -.memname { - white-space: nowrap; - font-weight: bold; -} -.paramname { font-weight: normal; } - -div.ah { - border: thin solid #888888; - font-weight: bold; - margin-bottom: 3px; - margin-top: 3px; + /*font-family: Lucida Grande, Helvetica, sans-serif;*/ + font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif +} + +/* Prevent design overflowing the viewport in small resolutions */ +#container { + padding-right: 17px; + padding-left: 17px; + background-image: url(head_bg.png); + background-repeat: repeat-x; +} + +#header { + width: 100%; + height: 102px; +} + +#header h1 { + width: 63px; + height: 63px; + background-image: url(e.png); + background-repeat: no-repeat; + position: absolute; + margin: 0px; +} + +#header h1 span { + display: none; +} + +#header h2 { + display: none; +} + +/* .menu-container is used to set properties common to .menu and .submenu */ +#header .menu-container { +} + +#header .menu-container ul { + list-style-type: none; + list-style-position: inside; + margin: 0; +} + +#header .menu-container li { + display: block; + float: right; +} + +#header .menu { + height: 63px; + display: block; + background-image: url(menu_bg.png); + background-repeat: repeat-x; +} + +#header .menu ul { + height: 100%; + display: block; + background-image: url(menu_bg_last.png); + background-repeat: no-repeat; + background-position: top right; + padding-right: 17px; +} + +#header .menu li { + height: 100%; + text-align: center; + background-image: url(menu_bg_unsel.png); + background-repeat: no-repeat; +} + +#header .menu a { + height: 100%; + display: block; + color: #cdcdcd; + text-decoration: none; + font-size: 10pt; + line-height: 59px; + text-align: center; + padding: 0px 15px 0px 15px; +} + +#header .menu li:hover { + background-image: url(menu_bg_hover.png); + background-repeat: no-repeat; +} + +#header .menu li:hover a { + color: #FFFFFF; +} + +#header .menu li.current { + background-image: url(menu_bg_current.png); + background-repeat: no-repeat; +} + +#header .menu li.current a { + color: #646464; +} + + +/* Hide all the submenus but the current */ +#header .submenu ul { + display: none; +} + +#header .submenu .current { + display: block; +} + +#header .submenu { + font: bold 10px verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif; + margin-top: 10px; +} + +#header .submenu a { + color: #888888; + text-decoration: none; + font-size: 0.9em; + line-height: 15px; + padding:0px 5px 0px 5px; +} + +#header .submenu a:hover { + color: #444444; +} + +#header .submenu li { + border-left: 1px solid #DDDDDD; +} + +#header .submenu li:last-child { + border-left: 0; +} + +#header .doxytitle { + position: absolute; + font-size: 1.8em; + font-weight: bold; + color: #444444; + line-height: 35px; +} + +#header small { + font-size: 0.4em; +} + +#footer { + background-image: url(foot_bg.png); + width: 100%; +} + +#footer table { + width: 100%; + text-align: center; + white-space: nowrap; + padding: 5px 30px 5px 30px; + font-size: 0.8em; + font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif; + color: #888888; +} + +#footer td.copyright { + width: 100%; +} + +/* + Author: + Andres Blanc + DaveMDS Andreoli + + Supported Browsers: + ie7, opera9, konqueror4 and firefox3 + + Please use a different file for ie6, ie5, etc. hacks. +*/ + + +/* Necessary to place the footer at the bottom of the page */ +html, body { + height: 100%; + margin: 0px; + padding: 0px; +} + +#container { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -53px; +} + +#footer, #push { + height: 53px; +} + + +* html #container { + height: 100%; +} + +/* Prevent floating elements overflowing containers */ +.clear { + clear: both; + width: 0px; + height: 0px; +} + +/* Flexible & centered layout from 750 to 960 pixels */ +.layout { + max-width: 960px; + min-width: 760px; + margin-left: auto; + margin-right: auto; +} + +body { + /*font-family: Lucida Grande, Helvetica, sans-serif;*/ + font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif +} + +/* Prevent design overflowing the viewport in small resolutions */ +#container { + padding-right: 17px; + padding-left: 17px; + background-image: url(head_bg.png); + background-repeat: repeat-x; +} + +#header { + width: 100%; + height: 102px; +} + +#header h1 { + width: 63px; + height: 63px; + background-image: url(e.png); + background-repeat: no-repeat; + position: absolute; + margin: 0px; +} + +#header h1 span { + display: none; +} + +#header h2 { + display: none; +} + +/* .menu-container is used to set properties common to .menu and .submenu */ +#header .menu-container { +} + +#header .menu-container ul { + list-style-type: none; + list-style-position: inside; + margin: 0; +} + +#header .menu-container li { + display: block; + float: right; +} + +#header .menu { + height: 63px; + display: block; + background-image: url(menu_bg.png); + background-repeat: repeat-x; +} + +#header .menu ul { + height: 100%; + display: block; + background-image: url(menu_bg_last.png); + background-repeat: no-repeat; + background-position: top right; + padding-right: 17px; +} + +#header .menu li { + height: 100%; + text-align: center; + background-image: url(menu_bg_unsel.png); + background-repeat: no-repeat; +} + +#header .menu a { + height: 100%; + display: block; + color: #cdcdcd; + text-decoration: none; + font-size: 10pt; + line-height: 59px; + text-align: center; + padding: 0px 15px 0px 15px; +} + +#header .menu li:hover { + background-image: url(menu_bg_hover.png); + background-repeat: no-repeat; +} + +#header .menu li:hover a { + color: #FFFFFF; +} + +#header .menu li.current { + background-image: url(menu_bg_current.png); + background-repeat: no-repeat; +} + +#header .menu li.current a { + color: #646464; +} + + +/* Hide all the submenus but the current */ +#header .submenu ul { + display: none; +} + +#header .submenu .current { + display: block; +} + +#header .submenu { + font: bold 10px verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif; + margin-top: 10px; +} + +#header .submenu a { + color: #888888; + text-decoration: none; + font-size: 0.9em; + line-height: 15px; + padding:0px 5px 0px 5px; +} + +#header .submenu a:hover { + color: #444444; +} + +#header .submenu li { + border-left: 1px solid #DDDDDD; +} + +#header .submenu li:last-child { + border-left: 0; +} + +#header .doxytitle { + position: absolute; + font-size: 1.8em; + font-weight: bold; + color: #444444; + line-height: 35px; +} + +#header small { + font-size: 0.4em; +} + +#footer { + background-image: url(foot_bg.png); + width: 100%; +} + +#footer table { + width: 100%; + text-align: center; + white-space: nowrap; + padding: 5px 30px 5px 30px; + font-size: 0.8em; + font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif; + color: #888888; +} + +#footer td.copyright { + width: 100%; } diff --git a/doc/embryo.dox.in b/doc/embryo.dox.in new file mode 100644 index 0000000..e69de29 diff --git a/doc/foot.html b/doc/foot.html index 0d3303d..78ef911 100644 --- a/doc/foot.html +++ b/doc/foot.html @@ -1,6 +1,19 @@ + +
+ + + + + + + -
-

Copyright © Enlightenment.org

-

$projectname Documentation Generated: $datetime

- + + + diff --git a/doc/head.html b/doc/head.html index daaa652..48032d9 100644 --- a/doc/head.html +++ b/doc/head.html @@ -1,44 +1,66 @@ - - - - $title - - + + $title + + + + + + + + + + + - - - - - - -
- - - - - -
Download
-
- - - - - - - - -
-
-
- - - - - -
Support
-
- -
+ +
+ + + +
+
diff --git a/doc/img/e.png b/doc/img/e.png new file mode 100755 index 0000000000000000000000000000000000000000..b3884a5cbca7bce5747eb3b8a92145d60511a718 GIT binary patch literal 3825 zcm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`L740IIRyCy>}D(QbVl7I(%Yzv>fXibabHV__2+O3b!=YR4#uAk_atf1 z!HbgcBMT3f(%PCVKzJwTZNqa%VSRn-xJHPb>C&)qd1~>h9G7TY8B3ROAlCY(3m7V`)Cg8F{nAxPk^c7=gLOvdsLnXTQ~$YpXX zzL{FPJ!AQrxnqKX<6lKU1`K*uyLNg*`IOVJ6KjJMD{=_;2QOv!nSk$$6Xd z;#kz-)f{t){MJsk$tB6{TkO^qvHm%F-SUFEnGsy#<~t+As3osV|Jyd$x*gXvnKW)y zwpug)Rpi7NW6?WRx}b>r>m0p&nPf8JT6jF|MqZTgc-$m`oZHO3;Mo!l#>uvCbBCjn zyBo?b5K|OCCiXdtg1p>wk)+tieEd-b*J+#CzvwzL4Ik9lpok3b$_o`BUI-;%tRdOE z*}|Njm(}u7(GEgQe9+yjoE&2Kevw3Egj0i(*x178a?_9e%WV#gV){=Ck{r4!9P#h) z5%}y@-%!3$A)5@oNdbzhClLwq$KR3zk9I3Uf=;EGgZv0&c84d&2l0C_wF6%mn-cl@ zlw`<&IjF@+hx|dU{3 zJ?m|medZd-l+TeQ;dl$#a>d1S*(C6_7$<3G#^s!sj+e=Zjgl-0UV(~Gl2?-}eqiGN EKVH2_NB{r; literal 0 HcmV?d00001 diff --git a/doc/img/edoxy.css b/doc/img/edoxy.css new file mode 100755 index 0000000..616a0c5 --- /dev/null +++ b/doc/img/edoxy.css @@ -0,0 +1,966 @@ +/* + * This file contain a custom doxygen style to match e.org graphics + */ + + + +/* BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +}*/ +BODY, TD { + font-size: 12px; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { + font-weight: bold +} +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navpath { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { + text-decoration: none; + background-color: #6666cc; + color: #ffffff +} +A.el { + text-decoration: none; + font-weight: bold +} +A.elRef { + font-weight: bold +} +A.code:link { + text-decoration: none; + font-weight: normal; + color: #0000FF +} +A.code:visited { + text-decoration: none; + font-weight: normal; + color: #0000FF +} +A.codeRef:link { + font-weight: normal; + color: #0000FF +} +A.codeRef:visited { + font-weight: normal; + color: #0000FF +} +A:hover, A:visited:hover { + text-decoration: none; + /* background-color: #f2f2ff; */ + color: #000055; +} +A.anchor { + color: #000; +} +DL.el { + margin-left: -1cm +} +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px +} + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { + margin-left: 16px; + font-style: italic; + font-size: 90% +} +/*BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +}*/ +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { + text-align: center; +} +IMG.formulaDsp { +} +IMG.formulaInl { + vertical-align: middle; +} +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +SPAN.vhdldigit { color: #ff00ff } +SPAN.vhdlchar { color: #000000 } +SPAN.vhdlkeyword { color: #700070 } +SPAN.vhdllogic { color: #ff0000 } + +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { + color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { + font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { + background: #e8eef2; + font-weight: bold; +} +HR { + height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; + margin-left: 3px; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; + white-space: nowrap; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +/* these are for tree view when used as main index */ +.directory { + font-size: 9pt; + font-weight: bold; +} +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* The following two styles can be used to replace the root node title */ +/* with an image of your choice. Simply uncomment the next two styles, */ +/* specify the name of your image and be sure to set 'height' to the */ +/* proper pixel height of your image. */ + +/* .directory h3.swap { */ +/* height: 61px; */ +/* background-repeat: no-repeat; */ +/* background-image: url("yourimage.gif"); */ +/* } */ +/* .directory h3.swap span { */ +/* display: none; */ +/* } */ + +.directory > h3 { + margin-top: 0; +} +.directory p { + margin: 0px; + white-space: nowrap; +} +.directory div { + display: none; + margin: 0px; +} +.directory img { + vertical-align: -30%; +} +/* these are for tree view when not used as main index */ +.directory-alt { + font-size: 100%; + font-weight: bold; +} +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} +.directory-alt > h3 { + margin-top: 0; +} +.directory-alt p { + margin: 0px; + white-space: nowrap; +} +.directory-alt div { + display: none; + margin: 0px; +} +.directory-alt img { + vertical-align: -30%; +} + +/* + * This file contain a custom doxygen style to match e.org graphics + */ + + + +/* BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +}*/ +BODY, TD { + font-size: 12px; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { + font-weight: bold +} +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navpath { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { + text-decoration: none; + background-color: #6666cc; + color: #ffffff +} +A.el { + text-decoration: none; + font-weight: bold +} +A.elRef { + font-weight: bold +} +A.code:link { + text-decoration: none; + font-weight: normal; + color: #0000FF +} +A.code:visited { + text-decoration: none; + font-weight: normal; + color: #0000FF +} +A.codeRef:link { + font-weight: normal; + color: #0000FF +} +A.codeRef:visited { + font-weight: normal; + color: #0000FF +} +A:hover, A:visited:hover { + text-decoration: none; + /* background-color: #f2f2ff; */ + color: #000055; +} +A.anchor { + color: #000; +} +DL.el { + margin-left: -1cm +} +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px +} + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { + margin-left: 16px; + font-style: italic; + font-size: 90% +} +/*BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +}*/ +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { + text-align: center; +} +IMG.formulaDsp { +} +IMG.formulaInl { + vertical-align: middle; +} +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +SPAN.vhdldigit { color: #ff00ff } +SPAN.vhdlchar { color: #000000 } +SPAN.vhdlkeyword { color: #700070 } +SPAN.vhdllogic { color: #ff0000 } + +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { + color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { + font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { + background: #e8eef2; + font-weight: bold; +} +HR { + height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; + margin-left: 3px; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; + white-space: nowrap; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +/* these are for tree view when used as main index */ +.directory { + font-size: 9pt; + font-weight: bold; +} +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* The following two styles can be used to replace the root node title */ +/* with an image of your choice. Simply uncomment the next two styles, */ +/* specify the name of your image and be sure to set 'height' to the */ +/* proper pixel height of your image. */ + +/* .directory h3.swap { */ +/* height: 61px; */ +/* background-repeat: no-repeat; */ +/* background-image: url("yourimage.gif"); */ +/* } */ +/* .directory h3.swap span { */ +/* display: none; */ +/* } */ + +.directory > h3 { + margin-top: 0; +} +.directory p { + margin: 0px; + white-space: nowrap; +} +.directory div { + display: none; + margin: 0px; +} +.directory img { + vertical-align: -30%; +} +/* these are for tree view when not used as main index */ +.directory-alt { + font-size: 100%; + font-weight: bold; +} +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} +.directory-alt > h3 { + margin-top: 0; +} +.directory-alt p { + margin: 0px; + white-space: nowrap; +} +.directory-alt div { + display: none; + margin: 0px; +} +.directory-alt img { + vertical-align: -30%; +} + diff --git a/doc/img/foot_bg.png b/doc/img/foot_bg.png new file mode 100755 index 0000000000000000000000000000000000000000..b24f3a48b4e076b88cf1e802b46087ffbb3fabd5 GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^j6iJ9!3HE1Qx}DR1d4;)ofy`glX(f`uqAoByD;nl zL8a%*b^=8>3p^r=85p>QL70(Y)*K0-AbW|YuPgga7CvEi%SZD}LFVdux;TbNTu#2R zIsJTn+kYTPulo1Ll3AD;2!xfDmD#wLvj}>v&@k-CVP=T_%(cphxuXQAk-^i|&t;uc GLK6Ub>Mc;VkfoEM{Qf z76xHPhFNnYfP(BLp1!W^H+WcuRXD>A=l%i;Wq7(chG?8W+i%Esz<`6f_y7NWHH!5o z63R1{^0cb0vMSkFaE_%x<+7O{*?Xs&Ff%xKT5jO&GtAqcqoa~}b>qg&H07ky z617wnX2HUfTT*8{k002J-1^@s6XaB>y00001b5ch_0Itp) z=>Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RT3Fc5TrKj#zpOzs?z2=A0p@aw&u*pMn|G)ug+?Vh;0+zHe5dVLoF=!DBW&zJ?E zp99|S_j0@4%Io#|xG+sqdB5NP{rn5Cj%O+78UIn|DpKcsK9>`B2V6JsOB3oD&r;4a z{-e%Sw9ela{A&{jdu5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qhsglZT044iyETcyS}V2|@r$*~aQWf13kir_}T z&tv-(1*4o9(g#N0im7WEaGCfZABR?kjnAY1>8xN=B|ZdvM?TLa_y~M%WdcR~%>2gr zLP}&LG(~0^EeOl!xi#d7BiCFXL5M2Dv6Kv|TEri;YkLH7J|})weg8xTVYNQk*}F!q zVC(LK*AXzNh#8r$9N=|CqZv?WXN;MYjaqu39=c|yS9zjUX=T%jZs!oe`3P82x zoCIb8gsR3f`)rcc z&IiudZ)HD{0aMjs&nzpb#0-vh4&}`l=o~;fU~}GACC856SOSnmxRr2J`Gv?obbyLX zbru_-pRNQ;=?7<+PAQ1kmlLA2iOYnuz^eocGZAui%=-TRF25GkVKk*?VLM7WBGYPB zT*tpuphVY?L>99zcgqh{8?J&32Rv?+%)Z_WCB$d`hC#@mKYy$$hzm4z911e3T@BQE z6}a5Q^z2GI$3(jeiH2?d26Vp6Zr1N{77{V3le;970pcooz1rBP zTCCqm&A0&u`_5tKoG#cZcARCvr+{+b_xPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iOZ8 z6%`IG`XD&~00I3;L_t(o!^Kz8j>8}fODg_+AF{uksuh}hxC0rJP`W$mkkHl^jB%XM z>f`Y+`Dtd>`gxwMmr`2KIk$cshdiH8N#}XW6$o}5WA?p%5)sKc%eHO9fR!#HlFUqU z&XQ6Z1~3DUmCHm#rjx?$lu|lm24QA+Eh4g2CJ}X<;QbGo;J_$CohD|s1Tu}z3KIrH zRtpQ8-Z|UyQP4caCB~&Z3QG0mMzcQLYIcQ!(sFW-xf9knF@|(?iY~XAOhHzd%#8OD2m>x}XSSsVf@;^obfpX48<@ZgFF$M4@xtjbM#B=Ojp!9yfFNKXj22K7STvD?00000NkvXXu0mjfB76)l literal 0 HcmV?d00001 diff --git a/doc/img/menu_bg_unsel.png b/doc/img/menu_bg_unsel.png new file mode 100755 index 0000000000000000000000000000000000000000..50e5fd8d3d17114bc71e14c483532f2c082920b2 GIT binary patch literal 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s@kF8aj)Hk+cY4=Q!sYBVE3usz00Cd{g}$bgX+ zEs`2}PM|AlPwbhc>#U3~dKV?KArhvt%U4th9!;L?oeXA`K|g&EO%g=b=rg7ws`Z0W zfG^}&b8$*k*B4={a+xJocKjaIK(oCqTOT@;wzHCX)@Jr%Fnd8LdMj})ftln4_kht_ z?hOuGQ#w0_X^UxNi{yO`dG|z5aq*tmGIh6m-ucZ4$E=q33^;eTcR-I+1i!M{_!a$H z+wPGv{WJp#!l6$>RG?fqm4Ls$zapS;ZU)p6ES#PJ^<&F|2q=hvg78!V{`~xifWmnM uoCT@+p&H=~TxzX#9LMtc`Kf3KPscx4r4cOw-wj9r0000 + + + + diff --git a/embryo.pc.in b/embryo.pc.in index 8ffd2c6..540f27c 100644 --- a/embryo.pc.in +++ b/embryo.pc.in @@ -1,13 +1,15 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ -datadir=@datadir@/@PACKAGE@ libdir=@libdir@ includedir=@includedir@ +datarootdir=@datarootdir@ +datadir=@datadir@/@PACKAGE@ embryoincludedir=@embryoincludedir@ Name: embryo Description: A small virtual machine engine and bytecode compiler +@pkgconfig_requires_private@: @requirement_embryo@ Version: @VERSION@ Libs: -L${libdir} -lembryo -Libs.private: -lm -Cflags: -I${includedir} +Libs.private: @EFL_FNMATCH_LIBS@ -lm +Cflags: -I${includedir}/embryo-@VMAJ@ diff --git a/embryo.spec.in b/embryo.spec.in index 140d4d3..4c37ede 100644 --- a/embryo.spec.in +++ b/embryo.spec.in @@ -1,9 +1,11 @@ %define _missing_doc_files_terminate_build 0 +%{!?_rel:%{expand:%%global _rel 0.enl%{?dist}}} + Summary: A small virtual machine engine (in a library) and bytecode compiler Name: @PACKAGE@ Version: @VERSION@ -Release: 0.%(date '+%Y%m%d') +Release: %{_rel} License: BSD Group: System Environment/Libraries Source: %{name}-%{version}.tar.gz @@ -70,6 +72,6 @@ test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT %{_libdir}/*.la %{_libdir}/*.a %{_libdir}/pkgconfig/* -%{_includedir}/*.h +%{_includedir}/embryo-1/*.h %changelog diff --git a/include/default.inc b/include/default.inc index 0733503..b82ff14 100644 --- a/include/default.inc +++ b/include/default.inc @@ -211,3 +211,21 @@ stock bool:operator!(Float:oper) forward operator%(Float:oper1, Float:oper2); forward operator%(Float:oper1, oper2); forward operator%(oper1, Float:oper2); + +/**************************************************************************/ +/* ADDED in embryo 1.2 */ +/**************************************************************************/ +/* use this to determine embryo age */ +#define EMBRYO_12 12 +/* Return the inverse sine, cosine or tangent. The output may be radians, */ +/* degrees or grades. */ +native Float:asin(Float:value, Float_Angle_Mode:mode=RADIAN); +native Float:acos(Float:value, Float_Angle_Mode:mode=RADIAN); +native Float:atan(Float:value, Float_Angle_Mode:mode=RADIAN); +native Float:atan2(Float:valuey, Float:valuex, Float_Angle_Mode:mode=RADIAN); +/* same as libc functions */ +native Float:log1p(Float:value); +native Float:cbrt(Float:value); +native Float:exp(Float:value); +native Float:exp2(Float:value); +native Float:hypot(Float:valuex, Float:valuey); diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4 new file mode 100644 index 0000000..23479a9 --- /dev/null +++ b/m4/ac_attribute.m4 @@ -0,0 +1,47 @@ +dnl Copyright (C) 2004-2008 Kim Woelders +dnl Copyright (C) 2008 Vincent Torri +dnl That code is public domain and can be freely used or copied. +dnl Originally snatched from somewhere... + +dnl Macro for checking if the compiler supports __attribute__ + +dnl Usage: AC_C___ATTRIBUTE__ +dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__ +dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is +dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused)) +dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is +dnl defined to nothing. + +AC_DEFUN([AC_C___ATTRIBUTE__], +[ + +AC_MSG_CHECKING([for __attribute__]) + +AC_CACHE_VAL([ac_cv___attribute__], + [AC_TRY_COMPILE( + [ +#include + +int func(int x); +int foo(int x __attribute__ ((unused))) +{ + exit(1); +} + ], + [], + [ac_cv___attribute__="yes"], + [ac_cv___attribute__="no"] + )]) + +AC_MSG_RESULT($ac_cv___attribute__) + +if test "x${ac_cv___attribute__}" = "xyes" ; then + AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__]) + AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused]) + else + AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused]) +fi + +]) + +dnl End of ac_attribute.m4 diff --git a/m4/efl_binary.m4 b/m4/efl_binary.m4 new file mode 100644 index 0000000..93d6934 --- /dev/null +++ b/m4/efl_binary.m4 @@ -0,0 +1,44 @@ +dnl Copyright (C) 2010 Vincent Torri +dnl That code is public domain and can be freely used or copied. + +dnl Macro that check if a binary is built or not + +dnl Usage: EFL_ENABLE_BIN(binary) +dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _) +dnl Define have_binary (- is transformed into _) +dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _) + +AC_DEFUN([EFL_ENABLE_BIN], +[ + +m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl +m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl + +have_[]m4_defn([DOWN])="yes" + +dnl configure option + +AC_ARG_ENABLE([$1], + [AC_HELP_STRING([--disable-$1], [disable building of ]DOWN)], + [ + if test "x${enableval}" = "xyes" ; then + have_[]m4_defn([DOWN])="yes" + else + have_[]m4_defn([DOWN])="no" + fi + ]) + +AC_MSG_CHECKING([whether to build ]DOWN[ binary]) +AC_MSG_RESULT([$have_[]m4_defn([DOWN])]) + +if test "x$have_[]m4_defn([DOWN])" = "xyes"; then + UP[]_PRG=DOWN[${EXEEXT}] +fi + +AC_SUBST(UP[]_PRG) + +AM_CONDITIONAL(BUILD_[]UP, test "x$have_[]m4_defn([DOWN])" = "xyes") + +AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$2], [$3]) + +]) diff --git a/m4/efl_doxygen.m4 b/m4/efl_doxygen.m4 new file mode 100644 index 0000000..d83ed68 --- /dev/null +++ b/m4/efl_doxygen.m4 @@ -0,0 +1,97 @@ +dnl Copyright (C) 2008 Vincent Torri +dnl That code is public domain and can be freely used or copied. + +dnl Macro that check if doxygen is available or not. + +dnl EFL_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for the doxygen program +dnl Defines efl_doxygen +dnl Defines the automake conditionnal EFL_BUILD_DOC +dnl +AC_DEFUN([EFL_CHECK_DOXYGEN], +[ + +dnl +dnl Disable the build of the documentation +dnl +AC_ARG_ENABLE([doc], + [AC_HELP_STRING( + [--disable-doc], + [Disable documentation build @<:@default=enabled@:>@])], + [ + if test "x${enableval}" = "xyes" ; then + efl_enable_doc="yes" + else + efl_enable_doc="no" + fi + ], + [efl_enable_doc="yes"]) + +AC_MSG_CHECKING([whether to build documentation]) +AC_MSG_RESULT([${efl_enable_doc}]) + +if test "x${efl_enable_doc}" = "xyes" ; then + +dnl Specify the file name, without path + + efl_doxygen="doxygen" + + AC_ARG_WITH([doxygen], + [AC_HELP_STRING( + [--with-doxygen=FILE], + [doxygen program to use @<:@default=doxygen@:>@])], + +dnl Check the given doxygen program. + + [efl_doxygen=${withval} + AC_CHECK_PROG([efl_have_doxygen], + [${efl_doxygen}], + [yes], + [no]) + if test "x${efl_have_doxygen}" = "xno" ; then + echo "WARNING:" + echo "The doxygen program you specified:" + echo "${efl_doxygen}" + echo "was not found. Please check the path and make sure " + echo "the program exists and is executable." + AC_MSG_WARN([no doxygen detected. Documentation will not be built]) + fi + ], + [AC_CHECK_PROG([efl_have_doxygen], + [${efl_doxygen}], + [yes], + [no]) + if test "x${efl_have_doxygen}" = "xno" ; then + echo "WARNING:" + echo "The doxygen program was not found in your execute path." + echo "You may have doxygen installed somewhere not covered by your path." + echo "" + echo "If this is the case make sure you have the packages installed, AND" + echo "that the doxygen program is in your execute path (see your" + echo "shell manual page on setting the \$PATH environment variable), OR" + echo "alternatively, specify the program to use with --with-doxygen." + AC_MSG_WARN([no doxygen detected. Documentation will not be built]) + fi + ]) +fi + +dnl +dnl Substitution +dnl +AC_SUBST([efl_doxygen]) + +if ! test "x${efl_have_doxygen}" = "xyes" ; then + efl_enable_doc="no" +fi + +AM_CONDITIONAL(EFL_BUILD_DOC, test "x${efl_enable_doc}" = "xyes") + +if test "x${efl_enable_doc}" = "xyes" ; then + m4_default([$1], [:]) +else + m4_default([$2], [:]) +fi + +]) + +dnl End of efl_doxygen.m4 diff --git a/m4/efl_fnmatch.m4 b/m4/efl_fnmatch.m4 new file mode 100644 index 0000000..c857046 --- /dev/null +++ b/m4/efl_fnmatch.m4 @@ -0,0 +1,31 @@ +dnl Copyright (C) 2010 Vincent Torri +dnl That code is public domain and can be freely used or copied. + +dnl Macro that check if fnmatch functions are available or not. + +dnl Usage: EFL_CHECK_FNMATCH([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Call AC_SUBST(EFL_FNMATCH_LIBS) + +AC_DEFUN([EFL_CHECK_FNMATCH], +[ + +AC_CHECK_HEADER([fnmatch.h], [_efl_have_fnmatch="yes"], [_efl_have_fnmatch="no"]) + +if test "x${_efl_have_fnmatch}" = "xyes" ; then + AC_SEARCH_LIBS([fnmatch], + [fnmatch evil exotic iberty], + [_efl_have_fnmatch="yes"], + [_efl_have_fnmatch="no"]) +fi + +EFL_FNMATCH_LIBS="" + +if (! test "x${ac_cv_search_fnmatch}" = "xnone required") && (! test "x${ac_cv_search_fnmatch}" = "xno") && (! test "x${ac_cv_search_fnmatch}" = "x-levil") ; then + EFL_FNMATCH_LIBS=${ac_cv_search_fnmatch} +fi + +AC_SUBST(EFL_FNMATCH_LIBS) + +AS_IF([test "x$_efl_have_fnmatch" = "xyes"], [$1], [$2]) + +]) diff --git a/m4/efl_gettimeofday.m4 b/m4/efl_gettimeofday.m4 new file mode 100644 index 0000000..9b767e5 --- /dev/null +++ b/m4/efl_gettimeofday.m4 @@ -0,0 +1,48 @@ +dnl Copyright (C) 2011 Cedric Bail +dnl This code is public domain and can be freely used or copied. + +dnl Macro that check for gettimeofday definition + +dnl Usage: EFL_CHECK_GETTIMEOFDAY(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +dnl Define EFL_HAVE_GETTIMEOFDAY + +AC_DEFUN([EFL_CHECK_GETTIMEOFDAY], +[ + +_efl_have_gettimeofday="no" + +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ +#include +#include + ]], + [[ +int res; +res = gettimeofday(NULL, NULL); + ]])], + [_efl_have_gettimeofday="yes"], + [_efl_have_gettimeofday="no"]) + +if test "x${_efl_have_gettimeofday}" = "xno" -a "x${enable_exotic}" = "xyes"; then + SAVE_LIBS="${LIBS}" + SAVE_CFLAGS="${CFLAGS}" + LIBS="${LIBS} ${EXOTIC_LIBS}" + CFLAGS="${CFLAGS} ${EXOTIC_CFLAGS}" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ +#include + ]], + [[ +int res; +res = gettimeofday(NULL, NULL); + ]])], + [_efl_have_gettimeofday="yes"], + [_efl_have_gettimeofday="no"]) +fi + +if test "x${_efl_have_gettimeofday}" = "xyes"; then + AC_DEFINE([EFL_HAVE_GETTIMEOFDAY], [1], [Defined if gettimeofday is available.]) +fi + +AS_IF([test "x${_efl_have_gettimeofday}" = "xyes"], [$1], [$2]) +]) diff --git a/m4/efl_path_max.m4 b/m4/efl_path_max.m4 new file mode 100644 index 0000000..f57bfd2 --- /dev/null +++ b/m4/efl_path_max.m4 @@ -0,0 +1,36 @@ +dnl Check for PATH_MAX in limits.h, and define a default value if not found +dnl This is a workaround for systems not providing PATH_MAX, like GNU/Hurd + +dnl EFL_CHECK_PATH_MAX([DEFAULT_VALUE_IF_NOT_FOUND]) +dnl +dnl If PATH_MAX is not defined in , defines it +dnl to DEFAULT_VALUE_IF_NOT_FOUND if it exists, or fallback +dnl to using 4096 + +AC_DEFUN([EFL_CHECK_PATH_MAX], +[ + +default_max=m4_default([$1], "4096") +AC_LANG_PUSH([C]) + +AC_MSG_CHECKING([for PATH_MAX in limits.h]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include + ]], + [[ +int i = PATH_MAX; + ]])], + [AC_MSG_RESULT([yes])], + [ + AC_DEFINE_UNQUOTED([PATH_MAX], + [${default_max}], + [default value since PATH_MAX is not defined]) + AC_MSG_RESULT([no: using ${default_max}]) + ]) + +AC_LANG_POP([C]) + +]) +dnl end of efl_path_max.m4 diff --git a/packaging/embryo.spec b/packaging/embryo.spec new file mode 100644 index 0000000..4a569c7 --- /dev/null +++ b/packaging/embryo.spec @@ -0,0 +1,68 @@ +#sbs-git:slp/pkgs/e/embryo embryo 1.1.0+svn.68928slp2+build01 ff312ab0f1dd243c5f94e56b2e55f3c43b0cf40f +Name: embryo +Summary: A small virtual machine engine (in a library) and bytecode compiler +Version: 1.7.1+svn.76491+build01r01 +Release: 1 +Group: System/Libraries +License: BSD +URL: http://www.enlightenment.org/ +Source0: %{name}-%{version}.tar.gz +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig +BuildRequires: pkgconfig(eina) +Provides: embryo-bin + + +%description +Development files for libembryo0 Embryo is primarily a shared library that gives you an API to load + and control interpreted programs compiled into an abstract machine + bytecode that it understands. This abstract (or virtual) machine is + similar to a real machine with a CPU, but it is emulated in + software. + . + This packages contains headers and static libraries for Embryo. + + + +%package devel +Summary: A small virtual machine engine and bytecode compile (devel) +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +A small virtual machine engine (in a library) and bytecode compile (devel) + +%prep +%setup -q + + +%build +export CFLAGS+=" -fvisibility=hidden -fPIC" +export LDFLAGS+=" -fvisibility=hidden -Wl,--hash-style=both -Wl,--as-needed" + +%autogen --disable-static +%configure --disable-static +make %{?jobs:-j%jobs} + +%install +%make_install +mkdir -p %{buildroot}/usr/share/license +cp %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/usr/share/license/%{name} + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%{_libdir}/libembryo.so.* +%{_bindir}/embryo_cc +%{_datadir}/embryo/include/default.inc +/usr/share/license/%{name} +%manifest %{name}.manifest + +%files devel +%defattr(-,root,root,-) +%{_includedir}/embryo-1/Embryo.h +%{_libdir}/libembryo.so +%{_libdir}/pkgconfig/*.pc diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index e26d109..09f6ffd 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -9,13 +9,14 @@ AM_CPPFLAGS = \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ +@EINA_CFLAGS@ \ @EVIL_CFLAGS@ -bin_PROGRAMS = embryo_cc +bin_PROGRAMS = @EMBRYO_CC_PRG@ +EXTRA_PROGRAMS = embryo_cc embryo_cc_SOURCES = \ embryo_cc_amx.h \ -embryo_cc_osdefs.h \ embryo_cc_sc.h \ embryo_cc_sc1.c \ embryo_cc_sc2.c \ @@ -30,10 +31,9 @@ embryo_cc_scvars.c \ embryo_cc_prefix.c \ embryo_cc_prefix.h -embryo_cc_CFLAGS = @WIN32_CFLAGS@ -embryo_cc_LDADD = $(top_builddir)/src/lib/libembryo.la @EVIL_LIBS@ -lm +embryo_cc_CFLAGS = @EMBRYO_CFLAGS@ +embryo_cc_LDADD = $(top_builddir)/src/lib/libembryo.la @EVIL_LIBS@ @EINA_LIBS@ -lm embryo_cc_LDFLAGS = @lt_enable_auto_import@ -embryo_cc_DEPENDENCIES = $(top_builddir)/src/lib/libembryo.la EXTRA_DIST = \ embryo_cc_sc5.scp \ diff --git a/src/bin/embryo_cc_amx.h b/src/bin/embryo_cc_amx.h index d5cb64e..0118e2d 100644 --- a/src/bin/embryo_cc_amx.h +++ b/src/bin/embryo_cc_amx.h @@ -21,8 +21,6 @@ * Version: $Id$ */ -#include "embryo_cc_osdefs.h" - #ifndef EMBRYO_CC_AMX_H #define EMBRYO_CC_AMX_H @@ -67,11 +65,20 @@ #define sEXPMAX 19 /* maximum name length for file version <= 6 */ #define sNAMEMAX 31 /* maximum name length of symbol name */ +#if defined (_MSC_VER) || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100) +# pragma pack(1) +# define EMBRYO_STRUCT_PACKED +#elif defined (__GNUC__) || (defined (__SUNPRO_C) && __SUNPRO_C >= 0x5100) +# define EMBRYO_STRUCT_PACKED __attribute__((packed)) +#else +# define EMBRYO_STRUCT_PACKED +#endif + typedef struct tagAMX_FUNCSTUB { unsigned int address; char name[sEXPMAX + 1]; - } __attribute__((packed)) AMX_FUNCSTUB; + } EMBRYO_STRUCT_PACKED AMX_FUNCSTUB; /* The AMX structure is the internal structure for many functions. Not all * fields are valid at all times; many fields are cached in local variables. @@ -108,7 +115,7 @@ cell reset_stk ; cell reset_hea ; cell *syscall_d; /* relocated value/address for the SYSCALL.D opcode */ - } __attribute__((packed)) AMX; + } EMBRYO_STRUCT_PACKED AMX; /* The AMX_HEADER structure is both the memory format as the file format. The * structure is used internaly. @@ -132,7 +139,12 @@ int pubvars ; /* the "public variables" table */ int tags ; /* the "public tagnames" table */ int nametable ; /* name table, file version 7 only */ - } __attribute__((packed)) AMX_HEADER; + } EMBRYO_STRUCT_PACKED AMX_HEADER; + +#if defined _MSC_VER || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100) +# pragma pack() +#endif + #define AMX_MAGIC 0xf1e0 enum @@ -206,7 +218,7 @@ amx_GetAddr((amx), (param), &amx_cstr_); \ amx_StrLen(amx_cstr_, &amx_length_); \ if (amx_length_ > 0 && \ - ((result) = (char*)alloca(amx_length_ + 1)) != NULL) \ + ((result) = (char *)alloca(amx_length_ + 1))) \ amx_GetString((result), amx_cstr_); \ else (result) = NULL; \ } diff --git a/src/bin/embryo_cc_osdefs.h b/src/bin/embryo_cc_osdefs.h index 3e21814..e69de29 100644 --- a/src/bin/embryo_cc_osdefs.h +++ b/src/bin/embryo_cc_osdefs.h @@ -1,38 +0,0 @@ -/* - * Copyright 1998-2003, ITB CompuPhase, The Netherlands. - * info@compuphase.com. - */ - -#ifndef EMBRYO_CC_OSDEFS_H -# define EMBRYO_CC_OSDEFS_H - -# ifdef HAVE_STDINT_H -# include -# endif - -/* _MAX_PATH is sometimes called differently and it may be in limits.h instead - * stdio.h. - */ -# if !defined _MAX_PATH -/* not defined, perhaps stdio.h was not included */ -# include -# if !defined _MAX_PATH -/* still undefined, try a common alternative name */ -# if defined MAX_PATH -# define _MAX_PATH MAX_PATH -# else -/* no _MAX_PATH and no MAX_PATH, perhaps it is in limits.h */ -# include -# if defined PATH_MAX -# define _MAX_PATH PATH_MAX -# elif defined _POSIX_PATH_MAX -# define _MAX_PATH _POSIX_PATH_MAX -# else -/* everything failed, actually we have a problem here... */ -# define _MAX_PATH 4096 -# endif -# endif -# endif -# endif - -#endif diff --git a/src/bin/embryo_cc_prefix.c b/src/bin/embryo_cc_prefix.c index dad6e3c..9b57704 100644 --- a/src/bin/embryo_cc_prefix.c +++ b/src/bin/embryo_cc_prefix.c @@ -1,446 +1,61 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ - #ifdef HAVE_CONFIG_H # include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* dlopen,dlclose,etc */ -#ifdef HAVE_EVIL -# include /* for realpath */ -#else -# include -# include -# include -#endif /* ! HAVE_EVIL */ +#include #include "embryo_cc_prefix.h" /* local subsystem functions */ -static int _e_prefix_share_hunt(void); -static int _e_prefix_fallbacks(void); -static int _e_prefix_try_proc(void); -static int _e_prefix_try_argv(char *argv0); /* local subsystem globals */ -static char *_exe_path = NULL; -static char *_prefix_path = NULL; -static char *_prefix_path_bin = NULL; -static char *_prefix_path_data = NULL; -static char *_prefix_path_lib = NULL; - -#define E_FREE(p) { if (p) {free(p); p = NULL;} } -/*#define PREFIX_CACHE_FILE 1*/ -#define SHARE_D "share/embryo" -#define MAGIC_FILE "include/default.inc" -#define MAGIC_DAT SHARE_D"/"MAGIC_FILE +static Eina_Prefix *pfx = NULL; /* externally accessible functions */ int e_prefix_determine(char *argv0) { - char *p, buf[4096]; - struct stat st; - - e_prefix_shutdown(); - - /* if user provides E_PREFIX - then use that or also more specific sub - * dirs for bin, lib, data and locale */ - if (getenv("E_PREFIX")) - { - _prefix_path = strdup(getenv("E_PREFIX")); - if (getenv("E_BIN_DIR")) - snprintf(buf, sizeof(buf), "%s/bin", getenv("E_BIN_DIR")); - else - snprintf(buf, sizeof(buf), "%s/bin", _prefix_path); - _prefix_path_bin = strdup(buf); - - if (getenv("E_LIB_DIR")) - snprintf(buf, sizeof(buf), "%s/lib", getenv("E_LIB_DIR")); - else - snprintf(buf, sizeof(buf), "%s/lib", _prefix_path); - _prefix_path_lib = strdup(buf); - - if (getenv("E_DATA_DIR")) - snprintf(buf, sizeof(buf), "%s/"SHARE_D, getenv("E_DATA_DIR")); - else - snprintf(buf, sizeof(buf), "%s/"SHARE_D, _prefix_path); - _prefix_path_data = strdup(buf); - return 1; - } - /* no env var - examine process and possible argv0 */ - if (!_e_prefix_try_proc()) - { - if (!_e_prefix_try_argv(argv0)) - { - _e_prefix_fallbacks(); - return 0; - } - } - /* _exe_path is now a full absolute path TO this exe - figure out rest */ - /* if - * exe = /blah/whatever/bin/exe - * then - * prefix = /blah/whatever - * bin_dir = /blah/whatever/bin - * data_dir = /blah/whatever/share/enlightenment - * lib_dir = /blah/whatever/lib - */ - p = strrchr(_exe_path, '/'); - if (p) - { - p--; - while (p >= _exe_path) - { - if (*p == '/') - { - _prefix_path = malloc(p - _exe_path + 1); - if (_prefix_path) - { - strncpy(_prefix_path, _exe_path, p - _exe_path); - _prefix_path[p - _exe_path] = 0; - - /* bin and lib always together */ - snprintf(buf, sizeof(buf), "%s/bin", _prefix_path); - _prefix_path_bin = strdup(buf); - snprintf(buf, sizeof(buf), "%s/lib", _prefix_path); - _prefix_path_lib = strdup(buf); - - /* check if AUTHORS file is there - then our guess is right */ - snprintf(buf, sizeof(buf), "%s/"MAGIC_DAT, _prefix_path); - if (stat(buf, &st) == 0) - { - snprintf(buf, sizeof(buf), "%s/"SHARE_D, _prefix_path); - _prefix_path_data = strdup(buf); - } - /* AUTHORS file not there. time to start hunting! */ - else - { - if (_e_prefix_share_hunt()) - { - return 1; - } - else - { - e_prefix_fallback(); - return 0; - } - } - return 1; - } - else - { - e_prefix_fallback(); - return 0; - } - } - p--; - } - } - e_prefix_fallback(); - return 0; + if (pfx) return 1; + eina_init(); + pfx = eina_prefix_new(argv0, e_prefix_determine, + "EMBRYO", "embryo", "include/default.inc", + PACKAGE_BIN_DIR, + PACKAGE_LIB_DIR, + PACKAGE_DATA_DIR, + PACKAGE_DATA_DIR); + if (!pfx) return 0; + return 1; } void e_prefix_shutdown(void) { - E_FREE(_exe_path); - E_FREE(_prefix_path); - E_FREE(_prefix_path_bin); - E_FREE(_prefix_path_data); - E_FREE(_prefix_path_lib); -} - -void -e_prefix_fallback(void) -{ - e_prefix_shutdown(); - _e_prefix_fallbacks(); + eina_prefix_free(pfx); + pfx = NULL; + eina_shutdown(); } const char * e_prefix_get(void) { - return _prefix_path; + return eina_prefix_get(pfx); } const char * e_prefix_bin_get(void) { - return _prefix_path_bin; + return eina_prefix_bin_get(pfx); } const char * e_prefix_data_get(void) { - return _prefix_path_data; + return eina_prefix_data_get(pfx); } const char * e_prefix_lib_get(void) { - return _prefix_path_lib; -} - -/* local subsystem functions */ -static int -_e_prefix_share_hunt(void) -{ - char buf[4096], buf2[4096], *p; - struct stat st; - - /* sometimes this isnt the case - so we need to do a more exhaustive search - * through more parent and subdirs. hre is an example i have seen: - * - * /blah/whatever/exec/bin/exe - * -> - * /blah/whatever/exec/bin - * /blah/whatever/common/share/enlightenment - * /blah/whatever/exec/lib - */ - - /* this is pure black magic to try and find data shares */ - /* 2. cache file doesn't exist or is invalid - we need to search - this is - * where the real black magic begins */ - - /* BLACK MAGIC 1: - * /blah/whatever/dir1/bin - * /blah/whatever/dir2/share/enlightenment - */ - if (!_prefix_path_data) - { - DIR *dirp; - struct dirent *dp; - - snprintf(buf, sizeof(buf), "%s", _prefix_path); - p = strrchr(buf, '/'); - if (p) *p = 0; - dirp = opendir(buf); - if (dirp) - { - char *file; - - while ((dp = readdir(dirp))) - { - if ((strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, ".."))) - { - file = dp->d_name; - snprintf(buf2, sizeof(buf2), "%s/%s/"MAGIC_DAT, buf, file); - if (stat(buf2, &st) == 0) - { - snprintf(buf2, sizeof(buf2), "%s/%s/"SHARE_D, buf, file); - _prefix_path_data = strdup(buf2); - break; - } - } - } - closedir(dirp); - } - } - - /* BLACK MAGIC 2: - * /blah/whatever/dir1/bin - * /blah/whatever/share/enlightenment - */ - if (!_prefix_path_data) - { - snprintf(buf, sizeof(buf), "%s", _prefix_path); - p = strrchr(buf, '/'); - if (p) *p = 0; - snprintf(buf2, sizeof(buf2), "%s/"MAGIC_DAT, buf); - if (stat(buf, &st) == 0) - { - snprintf(buf2, sizeof(buf2), "%s/"SHARE_D, buf); - _prefix_path_data = strdup(buf2); - } - } - - /* add more black magic as required as we discover weridnesss - remember - * this is to save users having to set environment variables to tell - * e where it lives, so e auto-adapts. so these code snippets are just - * logic to figure that out for the user - */ - - /* done. we found it - write cache file */ - if (_prefix_path_data) - { - return 1; - } - /* fail. everything failed */ - return 0; -} - -static int -_e_prefix_fallbacks(void) -{ - char *p; - - _prefix_path = strdup(PACKAGE_BIN_DIR); - p = strrchr(_prefix_path, '/'); - if (p) *p = 0; - _prefix_path_bin = strdup(PACKAGE_BIN_DIR); - _prefix_path_data = strdup(PACKAGE_DATA_DIR); - _prefix_path_lib = strdup(PACKAGE_LIB_DIR); - printf("WARNING: Embryo could not determine its installed prefix\n" - " and is falling back on the compiled in default:\n" - " %s\n" - " You might like to try setting the following environment variables:\n" - " E_PREFIX - points to the base prefix of install\n" - " E_BIN_DIR - optional in addition to E_PREFIX to provide\n" - " a more specific binary directory\n" - " E_LIB_DIR - optional in addition to E_PREFIX to provide\n" - " a more specific library dir\n" - " E_DATA_DIR - optional in addition to E_PREFIX to provide\n" - " a more specific location for shared data\n" - , - _prefix_path); - return 1; -} - -static int -_e_prefix_try_proc(void) -{ - FILE *f; - char buf[4096]; - void *func = NULL; - - func = (void *)_e_prefix_try_proc; - f = fopen("/proc/self/maps", "r"); - if (!f) return 0; - while (fgets(buf, sizeof(buf), f)) - { - int len; - char *p, mode[5] = ""; - unsigned long ptr1 = 0, ptr2 = 0; - - len = strlen(buf); - if (buf[len - 1] == '\n') - { - buf[len - 1] = 0; - len--; - } - if (sscanf(buf, "%lx-%lx %4s", &ptr1, &ptr2, mode) == 3) - { - if (!strcmp(mode, "r-xp")) - { - if (((void *)ptr1 <= func) && (func < (void *)ptr2)) - { - p = strchr(buf, '/'); - if (p) - { - if (len > 10) - { - if (!strcmp(buf + len - 10, " (deleted)")) - buf[len - 10] = 0; - } - _exe_path = strdup(p); - fclose(f); - return 1; - } - else - break; - } - } - } - } - fclose(f); - return 0; -} - -static int -_e_prefix_try_argv(char *argv0) -{ - char *path, *p, *cp, *s; - int len, lenexe; - char buf[4096], buf2[4096], buf3[4096]; - - /* 1. is argv0 abs path? */ - if (argv0[0] == '/') - { - _exe_path = strdup(argv0); - if (access(_exe_path, X_OK) == 0) return 1; - free(_exe_path); - _exe_path = NULL; - return 0; - } - /* 2. relative path */ - if (strchr(argv0, '/')) - { - if (getcwd(buf3, sizeof(buf3))) - { - snprintf(buf2, sizeof(buf2), "%s/%s", buf3, argv0); - if (realpath(buf2, buf)) - { - _exe_path = strdup(buf); - if (access(_exe_path, X_OK) == 0) return 1; - free(_exe_path); - _exe_path = NULL; - } - } - } - /* 3. argv0 no path - look in PATH */ - path = getenv("PATH"); - if (!path) return 0; - p = path; - cp = p; - lenexe = strlen(argv0); - while ((p = strchr(cp, ':'))) - { - len = p - cp; - s = malloc(len + 1 + lenexe + 1); - if (s) - { - strncpy(s, cp, len); - s[len] = '/'; - strcpy(s + len + 1, argv0); - if (realpath(s, buf)) - { - if (access(buf, X_OK) == 0) - { - _exe_path = strdup(buf); - free(s); - return 1; - } - } - free(s); - } - cp = p + 1; - } - len = strlen(cp); - s = malloc(len + 1 + lenexe + 1); - if (s) - { - strncpy(s, cp, len); - s[len] = '/'; - strcpy(s + len + 1, argv0); - if (realpath(s, buf)) - { - if (access(buf, X_OK) == 0) - { - _exe_path = strdup(buf); - free(s); - return 1; - } - } - free(s); - } - /* 4. big problems. arg[0] != executable - weird execution */ - return 0; + return eina_prefix_lib_get(pfx); } diff --git a/src/bin/embryo_cc_prefix.h b/src/bin/embryo_cc_prefix.h index 4bea3f9..d6dc7b2 100644 --- a/src/bin/embryo_cc_prefix.h +++ b/src/bin/embryo_cc_prefix.h @@ -1,10 +1,5 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ - int e_prefix_determine(char *argv0); void e_prefix_shutdown(void); -void e_prefix_fallback(void); const char *e_prefix_get(void); const char *e_prefix_bin_get(void); const char *e_prefix_data_get(void); diff --git a/src/bin/embryo_cc_sc.h b/src/bin/embryo_cc_sc.h index 53a4992..9eaf6b8 100644 --- a/src/bin/embryo_cc_sc.h +++ b/src/bin/embryo_cc_sc.h @@ -35,15 +35,16 @@ #include #include #include -#include "embryo_cc_osdefs.h" -#include "embryo_cc_amx.h" -#if HAVE___ATTRIBUTE__ -#define __UNUSED__ __attribute__((unused)) +#ifndef _MSC_VER +# include #else -#define __UNUSED__ +# include +# include #endif +#include "embryo_cc_amx.h" + /* Note: the "cell" and "ucell" types are defined in AMX.H */ #define PUBLIC_CHAR '@' /* character that defines a function "public" */ @@ -53,13 +54,13 @@ #define sDIMEN_MAX 2 /* maximum number of array dimensions */ #define sDEF_LITMAX 500 /* initial size of the literal pool, in "cells" */ -#define sLINEMAX 65535 /* input line length (in characters) */ +#define sLINEMAX (640 * 1024) /* input line length (in characters) */ #define sDEF_AMXSTACK 4096 /* default stack size for AMX files */ #define sSTKMAX 80 /* stack for nested #includes and other uses */ #define PREPROC_TERM '\x7f' /* termination character for preprocessor expressions (the "DEL" code) */ #define sDEF_PREFIX "default.inc" /* default prefix filename */ -typedef void *stkitem; /* type of items stored on the stack */ +typedef intptr_t stkitem; /* type of items stored on the stack */ typedef struct __s_arginfo { /* function argument info */ @@ -663,4 +664,10 @@ extern FILE *outf; /* file written to */ extern jmp_buf errbuf; /* target of longjmp() on a fatal error */ +#define sc_isspace(x) isspace ((int)((unsigned char)x)) +#define sc_isalpha(x) isalpha ((int)((unsigned char)x)) +#define sc_isdigit(x) isdigit ((int)((unsigned char)x)) +#define sc_isupper(x) isupper ((int)((unsigned char)x)) +#define sc_isxdigit(x) isxdigit((int)((unsigned char)x)) + #endif diff --git a/src/bin/embryo_cc_sc1.c b/src/bin/embryo_cc_sc1.c index c34688e..9ee3ad8 100644 --- a/src/bin/embryo_cc_sc1.c +++ b/src/bin/embryo_cc_sc1.c @@ -1,7 +1,4 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - * - * Small compiler +/* Small compiler * Function and variable definition and declaration, statement parser. * * Copyright (c) ITB CompuPhase, 1997-2003 @@ -24,9 +21,6 @@ * Version: $Id$ */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ #ifdef HAVE_CONFIG_H # include @@ -39,12 +33,15 @@ #include #include #include -#include + +#ifdef HAVE_UNISTD_H +# include +#endif + #ifdef HAVE_EVIL # include #endif /* HAVE_EVIL */ -#include "embryo_cc_osdefs.h" #include "embryo_cc_sc.h" #include "embryo_cc_prefix.h" @@ -117,36 +114,12 @@ static int rettype = 0; /* the type that a "return" expression should h static int skipinput = 0; /* number of lines to skip from the first input file */ static int wq[wqTABSZ]; /* "while queue", internal stack for nested loops */ static int *wqptr; /* pointer to next entry */ -static char binfname[_MAX_PATH]; /* binary file name */ +static char binfname[PATH_MAX]; /* binary file name */ int main(int argc, char *argv[], char *env[] __UNUSED__) { - char argv0[_MAX_PATH]; - int i; - - snprintf(argv0, _MAX_PATH, "%s", argv[0]); - /* Linux stores the name of the program in argv[0], but not the path. - * To adjust this, I store a string with the path in argv[0]. To do - * so, I try to get the current path with getcwd(), and if that fails - * I search for the PWD= setting in the environment. - */ - if (NULL != getcwd(argv0, _MAX_PATH)) - { - i = strlen(argv0); - snprintf(argv0 + i, _MAX_PATH - i, "/%s", argv[0]); - } - else - { - char *pwd = getenv("PWD"); - - if (pwd != NULL) - snprintf(argv0, _MAX_PATH, "%s/%s", pwd, argv[0]); - } /* if */ - argv[0] = argv0; /* set location to new first parameter */ - - e_prefix_determine(argv0); - + e_prefix_determine(argv[0]); return sc_compile(argc, argv); } @@ -224,7 +197,7 @@ sc_openasm(int fd) void sc_closeasm(void *handle) { - if (handle != NULL) + if (handle) fclose((FILE *) handle); } @@ -287,8 +260,8 @@ sc_compile(int argc, char *argv[]) { int entry, i, jmpcode, fd_out; int retcode; - char incfname[_MAX_PATH]; - char reportname[_MAX_PATH]; + char incfname[PATH_MAX]; + char reportname[PATH_MAX]; FILE *binf; void *inpfmark; char lcl_ctrlchar; @@ -308,9 +281,9 @@ sc_compile(int argc, char *argv[]) goto cleanup; /* allocate memory for fixed tables */ - inpfname = (char *)malloc(_MAX_PATH); + inpfname = (char *)malloc(PATH_MAX); litq = (cell *) malloc(litmax * sizeof(cell)); - if (litq == NULL) + if (!litq) error(103); /* insufficient memory */ if (!phopt_init()) error(103); /* insufficient memory */ @@ -326,33 +299,31 @@ sc_compile(int argc, char *argv[]) tmpdir = (char *)evil_tmpdir_get(); #endif /* ! HAVE_EVIL */ - snprintf(outfname, _MAX_PATH, "%s/embryo_cc.asm-tmp-XXXXXX", tmpdir); + snprintf(outfname, PATH_MAX, "%s/embryo_cc.asm-tmp-XXXXXX", tmpdir); fd_out = mkstemp(outfname); if (fd_out < 0) error(101, outfname); - unlink (outfname); /* kill this file as soon as it's (f)close'd */ - setconfig(argv[0]); /* the path to the include files */ lcl_ctrlchar = sc_ctrlchar; lcl_packstr = sc_packstr; lcl_needsemicolon = sc_needsemicolon; lcl_tabsize = sc_tabsize; inpf = inpf_org = (FILE *) sc_opensrc(inpfname); - if (inpf == NULL) + if (!inpf) error(100, inpfname); freading = TRUE; outf = (FILE *) sc_openasm(fd_out); /* first write to assembler * file (may be temporary) */ - if (outf == NULL) + if (!outf) error(101, outfname); /* immediately open the binary file, for other programs to check */ binf = (FILE *) sc_openbin(binfname); - if (binf == NULL) + if (!binf) error(101, binfname); setconstants(); /* set predefined constants and tagnames */ for (i = 0; i < skipinput; i++) /* skip lines in the input file */ - if (sc_readsrc(inpf, pline, sLINEMAX) != NULL) + if (sc_readsrc(inpf, pline, sLINEMAX)) fline++; /* keep line number up to date */ skipinput = fline; sc_status = statFIRST; @@ -425,7 +396,7 @@ sc_compile(int argc, char *argv[]) error(13); /* no entry point (no public functions) */ cleanup: - if (inpf != NULL) /* main source file is not closed, do it now */ + if (inpf) /* main source file is not closed, do it now */ sc_closesrc(inpf); /* write the binary file (the file is already open) */ if (errnum == 0 && jmpcode == 0) @@ -434,14 +405,15 @@ sc_compile(int argc, char *argv[]) sc_resetasm(outf); /* flush and loop back, for reading */ assemble(binf, outf); /* assembler file is now input */ } /* if */ - if (outf != NULL) + if (outf) sc_closeasm(outf); - if (binf != NULL) + unlink (outfname); + if (binf) sc_closebin(binf, errnum != 0); - if (inpfname != NULL) + if (inpfname) free(inpfname); - if (litq != NULL) + if (litq) free(litq); phopt_cleanup(); stgbuffer_cleanup(); @@ -492,7 +464,7 @@ sc_addtag(char *name) constvalue *ptr; int last, tag; - if (name == NULL) + if (!name) { /* no tagname was given, check for one */ if (lex(&val, &name) != tLABEL) @@ -504,7 +476,7 @@ sc_addtag(char *name) last = 0; ptr = tagname_tab.next; - while (ptr != NULL) + while (ptr) { tag = (int)(ptr->value & TAGMASK); if (strcmp(name, ptr->name) == 0) @@ -517,7 +489,7 @@ sc_addtag(char *name) /* tagname currently unknown, add it */ tag = last + 1; /* guaranteed not to exist already */ - if (isupper(*name)) + if (sc_isupper(*name)) tag |= (int)FIXEDTAG; append_constval(&tagname_tab, name, (cell) tag, 0); return tag; @@ -677,20 +649,22 @@ setopt(int argc, char **argv, char *iname, char *oname, static void setconfig(char *root) { - char path[_MAX_PATH]; + char path[PATH_MAX]; char *ptr; int len; + path[sizeof(path) - 1] = 0; + /* add the default "include" directory */ - if (root != NULL) + if (root) { /* path + filename (hopefully) */ strncpy(path, root, sizeof(path) - 1); path[sizeof(path) - 1] = 0; } /* terminate just behind last \ or : */ - if ((ptr = strrchr(path, DIRSEP_CHAR)) != NULL - || (ptr = strchr(path, ':')) != NULL) + if ((ptr = strrchr(path, DIRSEP_CHAR)) + || (ptr = strchr(path, ':'))) { /* If there was no terminating "\" or ":", * the filename probably does not @@ -831,7 +805,7 @@ parse(void) case tSTATIC: /* This can be a static function or a static global variable; * we know which of the two as soon as we have parsed up to the - * point where an opening paranthesis of a function would be + * point where an opening parenthesis of a function would be * expected. To back out after deciding it was a declaration of * a static variable after all, we have to store the symbol name * and tag. @@ -1045,7 +1019,7 @@ declglb(char *firstname, int firsttag, int fpublic, int fstatic, size = 1; /* single size (no array) */ numdim = 0; /* no dimensions */ ident = iVARIABLE; - if (firstname != NULL) + if (firstname) { assert(strlen(firstname) <= sNAMEMAX); strcpy(name, firstname); /* save symbol name */ @@ -1061,9 +1035,9 @@ declglb(char *firstname, int firsttag, int fpublic, int fstatic, strcpy(name, str); /* save symbol name */ } /* if */ sym = findglb(name); - if (sym == NULL) + if (!sym) sym = findconst(name); - if (sym != NULL && (sym->usage & uDEFINE) != 0) + if (sym && (sym->usage & uDEFINE) != 0) error(21, name); /* symbol already defined */ ispublic = fpublic; if (name[0] == PUBLIC_CHAR) @@ -1097,7 +1071,7 @@ declglb(char *firstname, int firsttag, int fpublic, int fstatic, * for public variables */ cidx = 0; /* only to avoid a compiler warning */ - if (sc_status == statWRITE && sym != NULL + if (sc_status == statWRITE && sym && (sym->usage & (uREAD | uWRITTEN | uPUBLIC)) == 0) { sc_status = statSKIP; @@ -1124,7 +1098,7 @@ declglb(char *firstname, int firsttag, int fpublic, int fstatic, dumplits(); /* dump the literal queue */ dumpzero((int)size - litidx); litidx = 0; - if (sym == NULL) + if (!sym) { /* define only if not yet defined */ sym = addvariable(name, sizeof(cell) * glb_declared, ident, sGLOBAL, @@ -1204,14 +1178,14 @@ declloc(int fstatic) * the "nesting level" of local variables to verify the * multi-definition of symbols. */ - if ((sym = findloc(name)) != NULL && sym->compound == nestlevel) + if ((sym = findloc(name)) && sym->compound == nestlevel) error(21, name); /* symbol already defined */ /* Although valid, a local variable whose name is equal to that * of a global variable or to that of a local variable at a lower * level might indicate a bug. */ - if (((sym = findloc(name)) != NULL && sym->compound != nestlevel) - || findglb(name) != NULL) + if (((sym = findloc(name)) && sym->compound != nestlevel) + || findglb(name)) error(219, name); /* variable shadows another symbol */ while (matchtoken('[')) { @@ -1713,7 +1687,7 @@ fetchfunc(char *name, int tag) * symbol instruction. */ } /* if */ - if ((sym = findglb(name)) != 0) + if ((sym = findglb(name))) { /* already in symbol table? */ if (sym->ident != iFUNCTN) { @@ -1761,7 +1735,7 @@ define_args(void) * local symbols are function arguments. */ sym = loctab.next; - while (sym != NULL) + while (sym) { assert(sym->ident != iLABEL); assert(sym->vclass == sLOCAL); @@ -1770,7 +1744,7 @@ define_args(void) { symbol *sub = sym; - while (sub != NULL) + while (sub) { symbolrange(sub->dim.array.level, sub->dim.array.length); sub = finddepend(sub); @@ -1907,7 +1881,7 @@ operatoradjust(int opertok, symbol * sym, char *opername, int resulttag) /* change the operator name */ assert(opername[0] != '\0'); operator_symname(tmpname, opername, tags[0], tags[1], count, resulttag); - if ((oldsym = findglb(tmpname)) != NULL) + if ((oldsym = findglb(tmpname))) { int i; @@ -1921,7 +1895,7 @@ operatoradjust(int opertok, symbol * sym, char *opername, int resulttag) sym->usage |= oldsym->usage; /* copy flags from the previous * definition */ for (i = 0; i < oldsym->numrefers; i++) - if (oldsym->refer[i] != NULL) + if (oldsym->refer[i]) refer_symbol(sym, oldsym->refer[i]); delete_symbol(&glbtab, oldsym); } /* if */ @@ -1975,7 +1949,7 @@ tag2str(char *dest, int tag) tag &= TAGMASK; assert(tag >= 0); sprintf(dest, "0%x", tag); - return isdigit(dest[1]) ? &dest[1] : dest; + return sc_isdigit(dest[1]) ? &dest[1] : dest; } char * @@ -2021,7 +1995,7 @@ parse_funcname(char *fname, int *tag1, int *tag2, char *opname) } /* if */ assert(!unary || *tag1 == 0); assert(*ptr != '\0'); - for (name = opname; !isdigit(*ptr);) + for (name = opname; !sc_isdigit(*ptr);) *name++ = *ptr++; *name = '\0'; *tag2 = (int)strtol(ptr, NULL, 16); @@ -2036,7 +2010,7 @@ funcdisplayname(char *dest, char *funcname) constvalue *tagsym[2]; int unary; - if (isalpha(*funcname) || *funcname == '_' || *funcname == PUBLIC_CHAR + if (sc_isalpha(*funcname) || *funcname == '_' || *funcname == PUBLIC_CHAR || *funcname == '\0') { if (dest != funcname) @@ -2113,7 +2087,7 @@ funcstub(int native) sym = fetchfunc(symbolname, tag); /* get a pointer to the * function entry */ - if (sym == NULL) + if (!sym) return; if (native) { @@ -2202,7 +2176,7 @@ newfunc(char *firstname, int firsttag, int fpublic, int fstatic, int stock) glbdecl = 0; filenum = fcurrent; /* save file number at start of declaration */ - if (firstname != NULL) + if (firstname) { assert(strlen(firstname) <= sNAMEMAX); strcpy(symbolname, firstname); /* save symbol name */ @@ -2246,7 +2220,7 @@ newfunc(char *firstname, int firsttag, int fpublic, int fstatic, int stock) } /* if */ sym = fetchfunc(symbolname, tag); /* get a pointer to the * function entry */ - if (sym == NULL) + if (!sym) return TRUE; if (fpublic) sym->usage |= uPUBLIC; @@ -2520,7 +2494,7 @@ declargs(symbol * sym) sym->dim.arglist = (arginfo *) realloc(sym->dim.arglist, (argcnt + 2) * sizeof(arginfo)); - if (sym->dim.arglist == 0) + if (!sym->dim.arglist) error(103); /* insufficient memory */ sym->dim.arglist[argcnt] = arg; sym->dim.arglist[argcnt + 1].ident = 0; /* keep the list @@ -2557,7 +2531,7 @@ declargs(symbol * sym) sym->dim.arglist = (arginfo *) realloc(sym->dim.arglist, (argcnt + 2) * sizeof(arginfo)); - if (sym->dim.arglist == 0) + if (!sym->dim.arglist) error(103); /* insufficient memory */ sym->dim.arglist[argcnt + 1].ident = 0; /* keep the list * terminated */ @@ -2568,7 +2542,7 @@ declargs(symbol * sym) sym->dim.arglist[argcnt].numtags = numtags; sym->dim.arglist[argcnt].tags = (int *)malloc(numtags * sizeof tags[0]); - if (sym->dim.arglist[argcnt].tags == NULL) + if (!sym->dim.arglist[argcnt].tags) error(103); /* insufficient memory */ memcpy(sym->dim.arglist[argcnt].tags, tags, numtags * sizeof tags[0]); @@ -2700,7 +2674,7 @@ doarg(char *name, int ident, int offset, int tags[], int numtags, assert(size >= litidx); /* allocate memory to hold the initial values */ arg->defvalue.array.data = (cell *) malloc(litidx * sizeof(cell)); - if (arg->defvalue.array.data != NULL) + if (arg->defvalue.array.data) { int i; @@ -2708,7 +2682,7 @@ doarg(char *name, int ident, int offset, int tags[], int numtags, arg->hasdefault = TRUE; /* argument has default value */ arg->defvalue.array.size = litidx; arg->defvalue.array.addr = -1; - /* calulate size to reserve on the heap */ + /* calculate size to reserve on the heap */ arg->defvalue.array.arraysize = 1; for (i = 0; i < arg->numdim; i++) arg->defvalue.array.arraysize *= arg->dim[i]; @@ -2747,8 +2721,7 @@ doarg(char *name, int ident, int offset, int tags[], int numtags, cell val; tokeninfo(&val, &name); - if ((arg->defvalue.size.symname = - strdup(name)) == NULL) + if (!(arg->defvalue.size.symname = strdup(name))) error(103); /* insufficient memory */ arg->defvalue.size.level = 0; if (size_tag_token == uSIZEOF) @@ -2779,17 +2752,17 @@ doarg(char *name, int ident, int offset, int tags[], int numtags, arg->usage = (char)(fconst ? uCONST : 0); arg->numtags = numtags; arg->tags = (int *)malloc(numtags * sizeof tags[0]); - if (arg->tags == NULL) + if (!arg->tags) error(103); /* insufficient memory */ memcpy(arg->tags, tags, numtags * sizeof tags[0]); argsym = findloc(name); - if (argsym != NULL) + if (argsym) { error(21, name); /* symbol already defined */ } else { - if ((argsym = findglb(name)) != NULL && argsym->ident != iFUNCTN) + if ((argsym = findglb(name)) && argsym->ident != iFUNCTN) error(219, name); /* variable shadows another symbol */ /* add details of type and address */ assert(numtags > 0); @@ -2813,7 +2786,7 @@ count_referrers(symbol * entry) count = 0; for (i = 0; i < entry->numrefers; i++) - if (entry->refer[i] != NULL) + if (entry->refer[i]) count++; return count; } @@ -2832,9 +2805,9 @@ reduce_referrers(symbol * root) do { restart = 0; - for (sym = root->next; sym != NULL; sym = sym->next) + for (sym = root->next; sym; sym = sym->next) { - if (sym->parent != NULL) + if (sym->parent) continue; /* hierarchical data type */ if (sym->ident == iFUNCTN && (sym->usage & uNATIVE) == 0 @@ -2845,9 +2818,9 @@ reduce_referrers(symbol * root) sym->usage &= ~(uREAD | uWRITTEN); /* erase usage bits if * there is no referrer */ /* find all symbols that are referred by this symbol */ - for (ref = root->next; ref != NULL; ref = ref->next) + for (ref = root->next; ref; ref = ref->next) { - if (ref->parent != NULL) + if (ref->parent) continue; /* hierarchical data type */ assert(ref->refer != NULL); for (i = 0; i < ref->numrefers && ref->refer[i] != sym; @@ -2863,7 +2836,7 @@ reduce_referrers(symbol * root) } else if ((sym->ident == iVARIABLE || sym->ident == iARRAY) && (sym->usage & uPUBLIC) == 0 - && sym->parent == NULL && count_referrers(sym) == 0) + && !sym->parent && count_referrers(sym) == 0) { sym->usage &= ~(uREAD | uWRITTEN); /* erase usage bits if * there is no referrer */ @@ -2895,7 +2868,7 @@ testsymbols(symbol * root, int level, int testlabs, int testconst) symbol *sym = root->next; - while (sym != NULL && sym->compound >= level) + while (sym && sym->compound >= level) { switch (sym->ident) { @@ -2926,7 +2899,7 @@ testsymbols(symbol * root, int level, int testlabs, int testconst) break; default: /* a variable */ - if (sym->parent != NULL) + if (sym->parent) break; /* hierarchical data type */ if ((sym->usage & (uWRITTEN | uREAD | uSTOCK | uPUBLIC)) == 0) error(203, sym->name); /* symbol isn't used (and not stock @@ -2959,7 +2932,7 @@ calc_array_datasize(symbol * sym, cell * offset) { cell sublength = calc_array_datasize(finddepend(sym), offset); - if (offset != NULL) + if (offset) *offset = length * (*offset + sizeof(cell)); if (sublength > 0) length *= length * sublength; @@ -2968,7 +2941,7 @@ calc_array_datasize(symbol * sym, cell * offset) } else { - if (offset != NULL) + if (offset) *offset = 0; } /* if */ return length; @@ -2981,7 +2954,7 @@ destructsymbols(symbol * root, int level) int savepri = FALSE; symbol *sym = root->next; - while (sym != NULL && sym->compound >= level) + while (sym && sym->compound >= level) { if (sym->ident == iVARIABLE || sym->ident == iARRAY) { @@ -2991,9 +2964,9 @@ destructsymbols(symbol * root, int level) /* check that the '~' operator is defined for this tag */ operator_symname(symbolname, "~", sym->tag, 0, 1, 0); - if ((opsym = findglb(symbolname)) != NULL) + if ((opsym = findglb(symbolname))) { - /* save PRI, in case of a return statment */ + /* save PRI, in case of a return statement */ if (!savepri) { push1(); /* right-hand operand is in PRI */ @@ -3025,7 +2998,7 @@ destructsymbols(symbol * root, int level) if (sc_status != statSKIP) markusage(opsym, uREAD); /* do not mark as "used" when this * call itself is skipped */ - if (opsym->x.lib != NULL) + if (opsym->x.lib) opsym->x.lib->value += 1; /* increment "usage count" * of the library */ } /* if */ @@ -3039,41 +3012,41 @@ destructsymbols(symbol * root, int level) static constvalue * insert_constval(constvalue * prev, constvalue * next, char *name, - cell val, short index) + cell val, short idx) { constvalue *cur; - if ((cur = (constvalue *) malloc(sizeof(constvalue))) == NULL) + if (!(cur = (constvalue *)malloc(sizeof(constvalue)))) error(103); /* insufficient memory (fatal error) */ memset(cur, 0, sizeof(constvalue)); strcpy(cur->name, name); cur->value = val; - cur->index = index; + cur->index = idx; cur->next = next; prev->next = cur; return cur; } constvalue * -append_constval(constvalue * table, char *name, cell val, short index) +append_constval(constvalue * table, char *name, cell val, short idx) { constvalue *cur, *prev; /* find the end of the constant table */ - for (prev = table, cur = table->next; cur != NULL; + for (prev = table, cur = table->next; cur; prev = cur, cur = cur->next) /* nothing */ ; - return insert_constval(prev, NULL, name, val, index); + return insert_constval(prev, NULL, name, val, idx); } constvalue * -find_constval(constvalue * table, char *name, short index) +find_constval(constvalue * table, char *name, short idx) { constvalue *ptr = table->next; - while (ptr != NULL) + while (ptr) { - if (strcmp(name, ptr->name) == 0 && ptr->index == index) + if (strcmp(name, ptr->name) == 0 && ptr->index == idx) return ptr; ptr = ptr->next; } /* while */ @@ -3085,7 +3058,7 @@ find_constval_byval(constvalue * table, cell val) { constvalue *ptr = table->next; - while (ptr != NULL) + while (ptr) { if (ptr->value == val) return ptr; @@ -3121,7 +3094,7 @@ delete_consttable(constvalue * table) { constvalue *cur = table->next, *next; - while (cur != NULL) + while (cur) { next = cur->next; free(cur); @@ -3190,7 +3163,7 @@ statement(int *lastindent, int allow_decl) if (tok != '{') setline(fline, fcurrent); /* lex() has set stmtindent */ - if (lastindent != NULL && tok != tLABEL) + if (lastindent && tok != tLABEL) { #if 0 if (*lastindent >= 0 && *lastindent != stmtindent && @@ -3355,7 +3328,7 @@ static void doexpr(int comma, int chkeffect, int allowarray, int mark_endexpr, int *tag, int chkfuncresult) { - int constant, index, ident; + int constant, idx, ident; int localstaging = FALSE; cell val; @@ -3365,12 +3338,12 @@ doexpr(int comma, int chkeffect, int allowarray, int mark_endexpr, localstaging = TRUE; assert(stgidx == 0); } /* if */ - index = stgidx; + idx = stgidx; errorset(sEXPRMARK); do { /* on second round through, mark the end of the previous expression */ - if (index != stgidx) + if (idx != stgidx) endexpr(TRUE); sideeffect = FALSE; ident = expression(&constant, &val, tag, chkfuncresult); @@ -3385,7 +3358,7 @@ doexpr(int comma, int chkeffect, int allowarray, int mark_endexpr, errorset(sEXPRRELEASE); if (localstaging) { - stgout(index); + stgout(idx); stgset(FALSE); /* stop staging */ } /* if */ } @@ -3395,14 +3368,14 @@ doexpr(int comma, int chkeffect, int allowarray, int mark_endexpr, int constexpr(cell * val, int *tag) { - int constant, index; + int constant, idx; cell cidx; stgset(TRUE); /* start stage-buffering */ - stgget(&index, &cidx); /* mark position in code generator */ + stgget(&idx, &cidx); /* mark position in code generator */ errorset(sEXPRMARK); expression(&constant, val, tag, FALSE); - stgdel(index, cidx); /* scratch generated code */ + stgdel(idx, cidx); /* scratch generated code */ stgset(FALSE); /* stop stage-buffering */ if (constant == 0) error(8); /* must be constant expression */ @@ -3424,7 +3397,7 @@ constexpr(cell * val, int *tag) static void test(int label, int parens, int invert) { - int index, tok; + int idx, tok; cell cidx; value lval = { NULL, 0, 0, 0, 0, NULL }; int localstaging = FALSE; @@ -3434,20 +3407,19 @@ test(int label, int parens, int invert) stgset(TRUE); /* start staging */ localstaging = TRUE; #if !defined NDEBUG - stgget(&index, &cidx); /* should start at zero if started + stgget(&idx, &cidx); /* should start at zero if started * locally */ - assert(index == 0); + assert(idx == 0); #endif } /* if */ - /* FIXME: 64bit unsafe! putting an int on a stack of void *'s */ pushstk((stkitem) intest); intest = 1; if (parens) needtoken('('); do { - stgget(&index, &cidx); /* mark position (of last expression) in + stgget(&idx, &cidx); /* mark position (of last expression) in * code generator */ if (hier14(&lval)) rvalue(&lval); @@ -3461,13 +3433,13 @@ test(int label, int parens, int invert) if (lval.ident == iARRAY || lval.ident == iREFARRAY) { char *ptr = - (lval.sym->name != NULL) ? lval.sym->name : "-unknown-"; + (lval.sym->name) ? lval.sym->name : "-unknown-"; error(33, ptr); /* array must be indexed */ } /* if */ if (lval.ident == iCONSTEXPR) { /* constant expression */ intest = (int)(long)popstk(); /* restore stack */ - stgdel(index, cidx); + stgdel(idx, cidx); if (lval.constval) { /* code always executed */ error(206); /* redundant test: always non-zero */ @@ -3579,7 +3551,7 @@ dofor(void) { int wq[wqSIZE], skiplab; cell save_decl; - int save_nestlevel, index; + int save_nestlevel, idx; int *ptr; save_decl = declared; @@ -3625,7 +3597,7 @@ dofor(void) assert(!staging); stgset(TRUE); /* start staging */ assert(stgidx == 0); - index = stgidx; + idx = stgidx; stgmark(sSTARTREORDER); stgmark((char)(sEXPRSTART + 0)); /* mark start of 2nd expression * in stage */ @@ -3644,7 +3616,7 @@ dofor(void) needtoken(')'); } /* if */ stgmark(sENDREORDER); /* mark end of reversed evaluation */ - stgout(index); + stgout(idx); stgset(FALSE); /* stop staging */ statement(NULL, FALSE); jumplabel(wq[wqLOOP]); @@ -3734,10 +3706,10 @@ doswitch(void) * case values at the same time. */ for (csp = &caselist, cse = caselist.next; - cse != NULL && cse->value < val; + cse && cse->value < val; csp = cse, cse = cse->next) /* nothing */ ; - if (cse != NULL && cse->value == val) + if (cse && cse->value == val) error(40, val); /* duplicate "case" label */ /* Since the label is stored as a string in the * "constvalue", the size of an identifier must @@ -3760,10 +3732,10 @@ doswitch(void) casecount++; /* find the new insertion point */ for (csp = &caselist, cse = caselist.next; - cse != NULL && cse->value < val; + cse && cse->value < val; csp = cse, cse = cse->next) /* nothing */ ; - if (cse != NULL && cse->value == val) + if (cse && cse->value == val) error(40, val); /* duplicate "case" label */ insert_constval(csp, cse, itoh(lbl_case), val, 0); } /* if */ @@ -3802,10 +3774,10 @@ doswitch(void) while (tok != '}'); #if !defined NDEBUG - /* verify that the case table is sorted (unfortunatly, duplicates can + /* verify that the case table is sorted (unfortunately, duplicates can * occur; there really shouldn't be duplicate cases, but the compiler * may not crash or drop into an assertion for a user error). */ - for (cse = caselist.next; cse != NULL && cse->next != NULL; cse = cse->next) + for (cse = caselist.next; cse && cse->next; cse = cse->next) ; /* empty. no idea whether this is correct, but we MUST NOT do * the setlabel(lbl_table) call in the loop body. doing so breaks * switch statements that only have one case statement following. @@ -3827,7 +3799,7 @@ doswitch(void) } /* if */ ffcase(casecount, labelname, TRUE); /* generate the rest of the table */ - for (cse = caselist.next; cse != NULL; cse = cse->next) + for (cse = caselist.next; cse; cse = cse->next) ffcase(cse->value, cse->name, FALSE); setlabel(lbl_exit); @@ -3837,7 +3809,7 @@ doswitch(void) static void doassert(void) { - int flab1, index; + int flab1, idx; cell cidx; value lval = { NULL, 0, 0, 0, 0, NULL }; @@ -3854,12 +3826,12 @@ doassert(void) else { stgset(TRUE); /* start staging */ - stgget(&index, &cidx); /* mark position in code generator */ + stgget(&idx, &cidx); /* mark position in code generator */ do { if (hier14(&lval)) rvalue(&lval); - stgdel(index, cidx); /* just scrap the code */ + stgdel(idx, cidx); /* just scrap the code */ } while (matchtoken(',')); stgset(FALSE); /* stop staging */ @@ -3900,7 +3872,7 @@ dolabel(void) symbol *sym; tokeninfo(&val, &st); /* retrieve label name again */ - if (find_constval(&tagname_tab, st, 0) != NULL) + if (find_constval(&tagname_tab, st, 0)) error(221, st); /* label name shadows tagname */ sym = fetchlab(st); setlabel((int)sym->addr); @@ -3987,7 +3959,7 @@ dobreak(void) ptr = readwhile(); /* readwhile() gives an error if not in loop */ needtoken(tTERM); - if (ptr == NULL) + if (!ptr) return; destructsymbols(&loctab, nestlevel); modstk(((int)declared - ptr[wqBRK]) * sizeof(cell)); @@ -4001,7 +3973,7 @@ docont(void) ptr = readwhile(); /* readwhile() gives an error if not in loop */ needtoken(tTERM); - if (ptr == NULL) + if (!ptr) return; destructsymbols(&loctab, nestlevel); modstk(((int)declared - ptr[wqCONT]) * sizeof(cell)); @@ -4020,9 +3992,9 @@ exporttag(int tag) assert((tag & PUBLICTAG) == 0); for (ptr = tagname_tab.next; - ptr != NULL && tag != (int)(ptr->value & TAGMASK); ptr = ptr->next) + ptr && tag != (int)(ptr->value & TAGMASK); ptr = ptr->next) /* nothing */ ; - if (ptr != NULL) + if (ptr) ptr->value |= PUBLICTAG; } /* if */ } diff --git a/src/bin/embryo_cc_sc2.c b/src/bin/embryo_cc_sc2.c index 269b31e..f72703a 100644 --- a/src/bin/embryo_cc_sc2.c +++ b/src/bin/embryo_cc_sc2.c @@ -1,7 +1,4 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - * - * Small compiler - File input, preprocessing and lexical analysis functions +/* Small compiler - File input, preprocessing and lexical analysis functions * * Copyright (c) ITB CompuPhase, 1997-2003 * @@ -24,9 +21,6 @@ * Version: $Id$ */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ #ifdef HAVE_CONFIG_H # include @@ -38,7 +32,6 @@ #include #include #include -#include "embryo_cc_osdefs.h" #include "embryo_cc_sc.h" #include "Embryo.h" @@ -98,18 +91,19 @@ plungequalifiedfile(char *name) { fp = (FILE *) sc_opensrc(name); ext = strchr(name, '\0'); /* save position */ - if (fp == NULL) + if (!fp) { /* try to append an extension */ strcpy(ext, extensions[ext_idx]); fp = (FILE *) sc_opensrc(name); - if (fp == NULL) + if (!fp) *ext = '\0'; /* on failure, restore filename */ } /* if */ ext_idx++; } - while (fp == NULL && ext_idx < (sizeof extensions / sizeof extensions[0])); - if (fp == NULL) + while ((!fp) && + (ext_idx < (int)(sizeof extensions / sizeof extensions[0]))); + if (!fp) { *ext = '\0'; /* restore filename */ return FALSE; @@ -117,17 +111,13 @@ plungequalifiedfile(char *name) pushstk((stkitem) inpf); pushstk((stkitem) inpfname); /* pointer to current file name */ pushstk((stkitem) curlibrary); - /* FIXME: 64bit unsafe */ pushstk((stkitem) iflevel); assert(skiplevel == 0); - /* FIXME: 64bit unsafe */ pushstk((stkitem) icomment); - /* FIXME: 64bit unsafe */ pushstk((stkitem) fcurrent); - /* FIXME: 64bit unsafe */ pushstk((stkitem) fline); inpfname = strdup(name); /* set name of include file */ - if (inpfname == NULL) + if (!inpfname) error(103); /* insufficient memory */ inpf = fp; /* set input file pointer to include file */ fnumber++; @@ -152,9 +142,9 @@ plungefile(char *name, int try_currentpath, int try_includepaths) if (try_includepaths && name[0] != DIRSEP_CHAR) { - for (i = 0; !result && (ptr = get_path(i)) != NULL; i++) + for (i = 0; !result && (ptr = get_path(i)); i++) { - char path[_MAX_PATH]; + char path[PATH_MAX]; strncpy(path, ptr, sizeof path); path[sizeof path - 1] = '\0'; /* force '\0' termination */ @@ -190,7 +180,7 @@ check_empty(char *lptr) static void doinclude(void) { - char name[_MAX_PATH], c; + char name[PATH_MAX], c; int i, result; while (*lptr <= ' ' && *lptr != 0) /* skip leading whitespace */ @@ -208,11 +198,11 @@ doinclude(void) } /* if */ i = 0; - while (*lptr != c && *lptr != '\0' && i < sizeof name - 1) /* find the end of the string */ + while ((*lptr != c) && (*lptr != '\0') && (i < (int)(sizeof(name) - 1))) /* find the end of the string */ name[i++] = *lptr++; while (i > 0 && name[i - 1] <= ' ') i--; /* strip trailing whitespace */ - assert(i >= 0 && i < sizeof name); + assert((i >= 0) && (i < (int)(sizeof(name)))); name[i] = '\0'; /* zero-terminate the string */ if (*lptr != c) @@ -253,11 +243,11 @@ readline(char *line) cont = FALSE; do { - if (inpf == NULL || sc_eofsrc(inpf)) + if (!inpf || sc_eofsrc(inpf)) { if (cont) error(49); /* invalid line continuation */ - if (inpf != NULL && inpf != inpf_org) + if (inpf && inpf != inpf_org) sc_closesrc(inpf); i = (int)(long)popstk(); if (i == -1) @@ -288,7 +278,7 @@ readline(char *line) elsedone = 0; } /* if */ - if (sc_readsrc(inpf, line, num) == NULL) + if (!sc_readsrc(inpf, line, num)) { *line = '\0'; /* delete line */ cont = FALSE; @@ -307,10 +297,10 @@ readline(char *line) } /* if */ cont = FALSE; /* check whether a full line was read */ - if (strchr(line, '\n') == NULL && !sc_eofsrc(inpf)) + if (!strchr(line, '\n') && !sc_eofsrc(inpf)) error(75); /* line too long */ /* check if the next line must be concatenated to this line */ - if ((ptr = strchr(line, '\n')) != NULL && ptr > line) + if ((ptr = strchr(line, '\n')) && ptr > line) { assert(*(ptr + 1) == '\0'); /* '\n' should be last in the string */ while (ptr > line @@ -379,7 +369,7 @@ stripcom(char *line) } else if (*line == '/' && *(line + 1) == '/') { /* comment to end of line */ - if (strchr(line, '\a') != NULL) + if (strchr(line, '\a')) error(49); /* invalid line continuation */ *line++ = '\n'; /* put "newline" at first slash */ *line = '\0'; /* put "zero-terminator" at second slash */ @@ -453,9 +443,9 @@ dtoi(cell * val, char *curptr) *val = 0; ptr = curptr; - if (!isdigit(*ptr)) /* should start with digit */ + if (!sc_isdigit(*ptr)) /* should start with digit */ return 0; - while (isdigit(*ptr) || *ptr == '_') + while (sc_isdigit(*ptr) || *ptr == '_') { if (*ptr != '_') *val = (*val * 10) + (*ptr - '0'); @@ -463,7 +453,7 @@ dtoi(cell * val, char *curptr) } /* while */ if (alphanum(*ptr)) /* number must be delimited by non-alphanumerical */ return 0; - if (*ptr == '.' && isdigit(*(ptr + 1))) + if (*ptr == '.' && sc_isdigit(*(ptr + 1))) return 0; /* but a fractional part must not be present */ return (int)(ptr - curptr); } @@ -481,18 +471,18 @@ htoi(cell * val, char *curptr) *val = 0; ptr = curptr; - if (!isdigit(*ptr)) /* should start with digit */ + if (!sc_isdigit(*ptr)) /* should start with digit */ return 0; if (*ptr == '0' && *(ptr + 1) == 'x') { /* C style hexadecimal notation */ ptr += 2; - while (isxdigit(*ptr) || *ptr == '_') + while (sc_isxdigit(*ptr) || *ptr == '_') { if (*ptr != '_') { - assert(isxdigit(*ptr)); + assert(sc_isxdigit(*ptr)); *val = *val << 4; - if (isdigit(*ptr)) + if (sc_isdigit(*ptr)) *val += (*ptr - '0'); else *val += (tolower(*ptr) - 'a' + 10); @@ -564,9 +554,9 @@ ftoi(cell * val, char *curptr) fnum = 0.0; dnum = 0L; ptr = curptr; - if (!isdigit(*ptr)) /* should start with digit */ + if (!sc_isdigit(*ptr)) /* should start with digit */ return 0; - while (isdigit(*ptr) || *ptr == '_') + while (sc_isdigit(*ptr) || *ptr == '_') { if (*ptr != '_') { @@ -578,12 +568,12 @@ ftoi(cell * val, char *curptr) if (*ptr != '.') return 0; /* there must be a period */ ptr++; - if (!isdigit(*ptr)) /* there must be at least one digit after the dot */ + if (!sc_isdigit(*ptr)) /* there must be at least one digit after the dot */ return 0; ffrac = 0.0; fmult = 1.0; ignore = FALSE; - while (isdigit(*ptr) || *ptr == '_') + while (sc_isdigit(*ptr) || *ptr == '_') { if (*ptr != '_') { @@ -615,10 +605,10 @@ ftoi(cell * val, char *curptr) { sign = 1; } /* if */ - if (!isdigit(*ptr)) /* 'e' should be followed by a digit */ + if (!sc_isdigit(*ptr)) /* 'e' should be followed by a digit */ return 0; exp = 0; - while (isdigit(*ptr)) + while (sc_isdigit(*ptr)) { exp = (exp * 10) + (*ptr - '0'); ptr++; @@ -640,8 +630,9 @@ ftoi(cell * val, char *curptr) } else if (rational_digits == 0) { + float f = (float) fnum; /* floating point */ - *val = EMBRYO_FLOAT_TO_CELL((float) fnum); + *val = EMBRYO_FLOAT_TO_CELL(f); #if !defined NDEBUG /* I assume that the C/C++ compiler stores "float" values in IEEE 754 * format (as mandated in the ANSI standard). Test this assumption anyway. @@ -730,7 +721,7 @@ static int preproc_expr(cell * val, int *tag) { int result; - int index; + int idx; cell code_index; char *term; @@ -739,7 +730,7 @@ preproc_expr(cell * val, int *tag) * compilations. Reset the staging index, but keep the code * index. */ - if (stgget(&index, &code_index)) + if (stgget(&idx, &code_index)) { error(57); /* unfinished expression */ stgdel(0, code_index); @@ -764,29 +755,29 @@ preproc_expr(cell * val, int *tag) * character that caused the input to be ended. */ static char * -getstring(char *dest, int max, char *line) +getstring(char *dest, int max) { - assert(dest != NULL && line != NULL); + assert(dest != NULL); *dest = '\0'; - while (*line <= ' ' && *line != '\0') - line++; /* skip whitespace */ - if (*line != '"') + while (*lptr <= ' ' && *lptr != '\0') + lptr++; /* skip whitespace */ + if (*lptr != '"') { error(37); /* invalid string */ } - else if (*line == '\0') + else { int len = 0; - line++; /* skip " */ - while (*line != '"' && *line != '\0') + lptr++; /* skip " */ + while (*lptr != '"' && *lptr != '\0') { if (len < max - 1) - dest[len++] = *line; - line++; + dest[len++] = *lptr; + lptr++; } /* if */ dest[len] = '\0'; - if (*line == '"') + if (*lptr == '"') lptr++; /* skip closing " */ else error(37); /* invalid string */ @@ -828,7 +819,7 @@ command(void) int tok, ret; cell val; char *str; - int index; + int idx; cell code_index; while (*lptr <= ' ' && *lptr != '\0') @@ -843,7 +834,7 @@ command(void) /* on a pending expression, force to return a silent ';' token and force to * re-read the line */ - if (!sc_needsemicolon && stgget(&index, &code_index)) + if (!sc_needsemicolon && stgget(&idx, &code_index)) { lptr = term_expr; return CMD_TERM; @@ -932,14 +923,14 @@ command(void) case tpFILE: if (skiplevel == 0) { - char pathname[_MAX_PATH]; + char pathname[PATH_MAX]; - lptr = getstring(pathname, sizeof pathname, lptr); + lptr = getstring(pathname, sizeof pathname); if (pathname[0] != '\0') { free(inpfname); inpfname = strdup(pathname); - if (inpfname == NULL) + if (!inpfname) error(103); /* insufficient memory */ } /* if */ } /* if */ @@ -951,6 +942,22 @@ command(void) if (lex(&val, &str) != tNUMBER) error(8); /* invalid/non-constant expression */ fline = (int)val; + + while (*lptr == ' ' && *lptr != '\0') + lptr++; /* skip whitespace */ + if (*lptr == '"') + { + char pathname[PATH_MAX]; + + lptr = getstring(pathname, sizeof pathname); + if (pathname[0] != '\0') + { + free(inpfname); + inpfname = strdup(pathname); + if (!inpfname) + error(103); /* insufficient memory */ + } /* if */ + } } /* if */ check_empty(lptr); break; @@ -993,13 +1000,15 @@ command(void) lptr++; if (*lptr == '"') { - lptr = getstring(name, sizeof name, lptr); + lptr = getstring(name, sizeof name); } else { int i; - for (i = 0; i < sizeof name && alphanum(*lptr); + for (i = 0; + (i < (int)(sizeof(name))) && + (alphanum(*lptr)); i++, lptr++) name[i] = *lptr; name[i] = '\0'; @@ -1013,7 +1022,7 @@ command(void) if (strlen(name) > sEXPMAX) error(220, name, sEXPMAX); /* exported symbol is truncated */ /* add the name if it does not yet exist in the table */ - if (find_constval(&libname_tab, name, 0) == NULL) + if (!find_constval(&libname_tab, name, 0)) curlibrary = append_constval(&libname_tab, name, 0, 0); } /* if */ @@ -1032,9 +1041,11 @@ command(void) int i; /* first gather all information, start with the tag name */ - while (*lptr <= ' ' && *lptr != '\0') + while ((*lptr <= ' ') && (*lptr != '\0')) lptr++; - for (i = 0; i < sizeof name && alphanum(*lptr); + for (i = 0; + (i < (int)(sizeof(name))) && + (alphanum(*lptr)); i++, lptr++) name[i] = *lptr; name[i] = '\0'; @@ -1094,17 +1105,19 @@ command(void) do { /* get the name */ - while (*lptr <= ' ' && *lptr != '\0') + while ((*lptr <= ' ') && (*lptr != '\0')) lptr++; - for (i = 0; i < sizeof name && isalpha(*lptr); + for (i = 0; + (i < (int)(sizeof(name))) && + (sc_isalpha(*lptr)); i++, lptr++) name[i] = *lptr; name[i] = '\0'; /* get the symbol */ sym = findloc(name); - if (sym == NULL) + if (!sym) sym = findglb(name); - if (sym != NULL) + if (sym) { sym->usage |= uREAD; if (sym->ident == iVARIABLE @@ -1158,7 +1171,7 @@ command(void) while (*lptr <= ' ' && *lptr != '\0') lptr++; - for (i = 0; i < 40 && (isalpha(*lptr) || *lptr == '.'); i++, lptr++) + for (i = 0; i < 40 && (sc_isalpha(*lptr) || *lptr == '.'); i++, lptr++) name[i] = (char)tolower(*lptr); name[i] = '\0'; stgwrite("\t"); @@ -1182,9 +1195,9 @@ command(void) break; case tSYMBOL: sym = findloc(str); - if (sym == NULL) + if (!sym) sym = findglb(str); - if (sym == NULL || (sym->ident != iFUNCTN + if (!sym || (sym->ident != iFUNCTN && sym->ident != iREFFUNC && (sym->usage & uDEFINE) == 0)) { @@ -1240,14 +1253,14 @@ command(void) } /* while */ end = lptr; /* check pattern to match */ - if (!isalpha(*start) && *start != '_') + if (!sc_isalpha(*start) && *start != '_') { error(74); /* pattern must start with an alphabetic character */ break; } /* if */ /* store matched pattern */ pattern = malloc(count + 1); - if (pattern == NULL) + if (!pattern) error(103); /* insufficient memory */ lptr = start; count = 0; @@ -1259,7 +1272,7 @@ command(void) } /* while */ pattern[count] = '\0'; /* special case, erase trailing variable, because it could match anything */ - if (count >= 2 && isdigit(pattern[count - 1]) + if (count >= 2 && sc_isdigit(pattern[count - 1]) && pattern[count - 2] == '%') pattern[count - 2] = '\0'; /* find substitution string */ @@ -1273,7 +1286,7 @@ command(void) /* keep position of the start of trailing whitespace */ if (*lptr <= ' ') { - if (end == NULL) + if (!end) end = lptr; } else @@ -1283,11 +1296,11 @@ command(void) count++; lptr++; } /* while */ - if (end == NULL) + if (!end) end = lptr; /* store matched substitution */ substitution = malloc(count + 1); /* +1 for '\0' */ - if (substitution == NULL) + if (!substitution) error(103); /* insufficient memory */ lptr = start; count = 0; @@ -1300,11 +1313,11 @@ command(void) substitution[count] = '\0'; /* check whether the definition already exists */ for (prefixlen = 0, start = pattern; - isalpha(*start) || isdigit(*start) || *start == '_'; + sc_isalpha(*start) || sc_isdigit(*start) || *start == '_'; prefixlen++, start++) /* nothing */ ; assert(prefixlen > 0); - if ((def = find_subst(pattern, prefixlen)) != NULL) + if ((def = find_subst(pattern, prefixlen))) { if (strcmp(def->first, pattern) != 0 || strcmp(def->second, substitution) != 0) @@ -1471,7 +1484,7 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution) memset(args, 0, sizeof args); /* check the length of the prefix */ - for (prefixlen = 0, s = pattern; isalpha(*s) || isdigit(*s) || *s == '_'; + for (prefixlen = 0, s = pattern; sc_isalpha(*s) || sc_isdigit(*s) || *s == '_'; prefixlen++, s++) /* nothing */ ; assert(prefixlen > 0); @@ -1488,7 +1501,7 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution) if (*p == '%') { p++; /* skip '%' */ - if (isdigit(*p)) + if (sc_isdigit(*p)) { arg = *p - '0'; assert(arg >= 0 && arg <= 9); @@ -1502,18 +1515,18 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution) { if (is_startstring(e)) /* skip strings */ e = skipstring(e); - else if (strchr("({[", *e) != NULL) /* skip parenthized groups */ + else if (strchr("({[", *e)) /* skip parenthized groups */ e = skippgroup(e); if (*e != '\0') e++; /* skip non-alphapetic character (or closing quote of * a string, or the closing paranthese of a group) */ } /* while */ /* store the parameter (overrule any earlier) */ - if (args[arg] != NULL) + if (args[arg]) free(args[arg]); len = (int)(e - s); args[arg] = malloc(len + 1); - if (args[arg] == NULL) + if (!args[arg]) error(103); /* insufficient memory */ strncpy(args[arg], s, len); args[arg][len] = '\0'; @@ -1583,11 +1596,11 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution) /* calculate the length of the substituted string */ for (e = substitution, len = 0; *e != '\0'; e++) { - if (*e == '%' && isdigit(*(e + 1))) + if (*e == '%' && sc_isdigit(*(e + 1))) { arg = *(e + 1) - '0'; assert(arg >= 0 && arg <= 9); - if (args[arg] != NULL) + if (args[arg]) len += strlen(args[arg]); e++; /* skip %, digit is skipped later */ } @@ -1607,11 +1620,11 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution) strdel(line, (int)(s - line)); for (e = substitution, s = line; *e != '\0'; e++) { - if (*e == '%' && isdigit(*(e + 1))) + if (*e == '%' && sc_isdigit(*(e + 1))) { arg = *(e + 1) - '0'; assert(arg >= 0 && arg <= 9); - if (args[arg] != NULL) + if (args[arg]) { strins(s, args[arg], strlen(args[arg])); s += strlen(args[arg]); @@ -1628,7 +1641,7 @@ substpattern(char *line, size_t buffersize, char *pattern, char *substitution) } /* if */ for (arg = 0; arg < 10; arg++) - if (args[arg] != NULL) + if (args[arg]) free(args[arg]); return match; @@ -1647,7 +1660,7 @@ substallpatterns(char *line, int buffersize) /* find the start of a prefix (skip all non-alphabetic characters), * also skip strings */ - while (!isalpha(*start) && *start != '_' && *start != '\0') + while (!sc_isalpha(*start) && *start != '_' && *start != '\0') { /* skip strings */ if (is_startstring(start)) @@ -1663,14 +1676,14 @@ substallpatterns(char *line, int buffersize) /* get the prefix (length), look for a matching definition */ prefixlen = 0; end = start; - while (isalpha(*end) || isdigit(*end) || *end == '_') + while (sc_isalpha(*end) || sc_isdigit(*end) || *end == '_') { prefixlen++; end++; } /* while */ assert(prefixlen > 0); subst = find_subst(start, prefixlen); - if (subst != NULL) + if (subst) { /* properly match the pattern and substitute */ if (!substpattern @@ -2225,7 +2238,7 @@ stowlit(cell value) litmax += sDEF_LITMAX; p = (cell *) realloc(litq, litmax * sizeof(cell)); - if (p == NULL) + if (!p) error(102, "literal table"); /* literal table overflow (fatal error) */ litq = p; } /* if */ @@ -2305,7 +2318,7 @@ litchar(char **lptr, int rawmode) cptr += 1; break; default: - if (isdigit(*cptr)) + if (sc_isdigit(*cptr)) { /* \ddd */ c = 0; while (*cptr >= '0' && *cptr <= '9') /* decimal! */ @@ -2333,7 +2346,7 @@ litchar(char **lptr, int rawmode) static int alpha(char c) { - return (isalpha(c) || c == '_' || c == PUBLIC_CHAR); + return (sc_isalpha(c) || c == '_' || c == PUBLIC_CHAR); } /* alphanum @@ -2343,7 +2356,7 @@ alpha(char c) int alphanum(char c) { - return (alpha(c) || isdigit(c)); + return (alpha(c) || sc_isdigit(c)); } /* The local variable table must be searched backwards, so that the deepest @@ -2358,10 +2371,10 @@ add_symbol(symbol * root, symbol * entry, int sort) symbol *newsym; if (sort) - while (root->next != NULL && strcmp(entry->name, root->next->name) > 0) + while (root->next && strcmp(entry->name, root->next->name) > 0) root = root->next; - if ((newsym = (symbol *) malloc(sizeof(symbol))) == NULL) + if (!(newsym = (symbol *)malloc(sizeof(symbol)))) { error(103); return NULL; @@ -2431,7 +2444,7 @@ delete_symbols(symbol * root, int level, int delete_labels, /* erase only the symbols with a deeper nesting level than the * specified nesting level */ - while (root->next != NULL) + while (root->next) { sym = root->next; if (sym->compound < level) @@ -2463,7 +2476,7 @@ delete_symbols(symbol * root, int level, int delete_labels, /* for user defined operators, also remove the "prototyped" flag, as * user-defined operators *must* be declared before use */ - if (sym->ident == iFUNCTN && !isalpha(*sym->name) + if (sym->ident == iFUNCTN && !sc_isalpha(*sym->name) && *sym->name != '_' && *sym->name != PUBLIC_CHAR) sym->usage &= ~uPROTOTYPED; root = sym; /* skip the symbol */ @@ -2494,10 +2507,10 @@ find_symbol(symbol * root, char *name, int fnumber) symbol *ptr = root->next; unsigned long hash = namehash(name); - while (ptr != NULL) + while (ptr) { if (hash == ptr->hash && strcmp(name, ptr->name) == 0 - && ptr->parent == NULL && (ptr->fnumber < 0 + && !ptr->parent && (ptr->fnumber < 0 || ptr->fnumber == fnumber)) return ptr; ptr = ptr->next; @@ -2510,7 +2523,7 @@ find_symbol_child(symbol * root, symbol * sym) { symbol *ptr = root->next; - while (ptr != NULL) + while (ptr) { if (ptr->parent == sym) return ptr; @@ -2543,7 +2556,7 @@ refer_symbol(symbol * entry, symbol * bywhom) } /* if */ /* see if there is an empty spot in the referrer list */ - for (count = 0; count < entry->numrefers && entry->refer[count] != NULL; + for (count = 0; count < entry->numrefers && entry->refer[count]; count++) /* nothing */ ; assert(count <= entry->numrefers); @@ -2555,7 +2568,7 @@ refer_symbol(symbol * entry, symbol * bywhom) assert(newsize > 0); /* grow the referrer list */ refer = (symbol **) realloc(entry->refer, newsize * sizeof(symbol *)); - if (refer == NULL) + if (!refer) return FALSE; /* insufficient memory */ /* initialize the new entries */ entry->refer = refer; @@ -2585,7 +2598,7 @@ markusage(symbol * sym, int usage) * outside functions; in the case of syntax errors, however, the * compiler may arrive through this function */ - if (curfunc != NULL) + if (curfunc) refer_symbol(sym, curfunc); } /* if */ } /* if */ @@ -2618,9 +2631,9 @@ findconst(char *name) symbol *sym; sym = find_symbol(&loctab, name, -1); /* try local symbols first */ - if (sym == NULL || sym->ident != iCONSTEXPR) /* not found, or not a constant */ + if (!sym || sym->ident != iCONSTEXPR) /* not found, or not a constant */ sym = find_symbol(&glbtab, name, fcurrent); - if (sym == NULL || sym->ident != iCONSTEXPR) + if (!sym || sym->ident != iCONSTEXPR) return NULL; assert(sym->parent == NULL); /* constants have no hierarchy */ return sym; @@ -2632,7 +2645,7 @@ finddepend(symbol * parent) symbol *sym; sym = find_symbol_child(&loctab, parent); /* try local symbols first */ - if (sym == NULL) /* not found */ + if (!sym) /* not found */ sym = find_symbol_child(&glbtab, parent); return sym; } @@ -2654,7 +2667,7 @@ addsym(char *name, cell addr, int ident, int vclass, int tag, int usage) assert(ident != iLABEL || findloc(name) == NULL); /* create an empty referrer list */ - if ((refer = (symbol **) malloc(sizeof(symbol *))) == NULL) + if (!(refer = (symbol **)malloc(sizeof(symbol *)))) { error(103); /* insufficient memory */ return NULL; diff --git a/src/bin/embryo_cc_sc3.c b/src/bin/embryo_cc_sc3.c index f10bb35..1206857 100644 --- a/src/bin/embryo_cc_sc3.c +++ b/src/bin/embryo_cc_sc3.c @@ -21,9 +21,6 @@ * Version: $Id$ */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ #ifdef HAVE_CONFIG_H # include @@ -31,7 +28,7 @@ #include #include -#include /* for _MAX_PATH */ +#include /* for PATH_MAX */ #include #include "embryo_cc_sc.h" @@ -157,11 +154,11 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam, /* find the name with the operator */ if (numparam == 2) { - if (oper == NULL) + if (!oper) { /* assignment operator: a special case */ strcpy(opername, "="); - if (lval != NULL + if (lval && (lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR)) savealt = TRUE; } @@ -169,7 +166,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam, { assert((sizeof binoperstr / sizeof binoperstr[0]) == (sizeof op1 / sizeof op1[0])); - for (i = 0; i < sizeof op1 / sizeof op1[0]; i++) + for (i = 0; i < (int)(sizeof op1 / sizeof op1[0]); i++) { if (oper == op1[i]) { @@ -189,7 +186,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam, (sizeof unopers / sizeof unopers[0])); if (opername[0] == '\0') { - for (i = 0; i < sizeof unopers / sizeof unopers[0]; i++) + for (i = 0; i < (int)(sizeof unopers / sizeof unopers[0]); i++) { if (oper == unopers[i]) { @@ -208,10 +205,10 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam, operator_symname(symbolname, opername, tag1, tag2, numparam, tag2); swapparams = FALSE; sym = findglb(symbolname); - if (sym == NULL /*|| (sym->usage & uDEFINE)==0 */ ) + if (!sym /*|| (sym->usage & uDEFINE)==0 */ ) { /* ??? should not check uDEFINE; first pass clears these bits */ /* check for commutative operators */ - if (tag1 == tag2 || oper == NULL || !commutative(oper)) + if (tag1 == tag2 || !oper || !commutative(oper)) return FALSE; /* not commutative, cannot swap operands */ /* if arrived here, the operator is commutative and the tags are different, * swap tags and try again @@ -220,11 +217,11 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam, operator_symname(symbolname, opername, tag2, tag1, numparam, tag1); swapparams = TRUE; sym = findglb(symbolname); - if (sym == NULL /*|| (sym->usage & uDEFINE)==0 */ ) + if (!sym /*|| (sym->usage & uDEFINE)==0 */ ) return FALSE; } /* if */ - /* check existance and the proper declaration of this function */ + /* check existence and the proper declaration of this function */ if ((sym->usage & uMISSING) != 0 || (sym->usage & uPROTOTYPED) == 0) { char symname[2 * sNAMEMAX + 16]; /* allow space for user defined operators */ @@ -269,7 +266,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam, else if (savealt) { /* for the assignment operator, ALT may contain an address at which the - * result must be stored; this address must be preserved accross the + * result must be stored; this address must be preserved across the * call */ assert(lval != NULL); /* this was checked earlier */ @@ -278,7 +275,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam, } /* if */ /* push parameters, call the function */ - paramspassed = (oper == NULL) ? 1 : numparam; + paramspassed = (!oper) ? 1 : numparam; switch (paramspassed) { case 1: @@ -308,7 +305,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam, ffcall(sym, paramspassed); if (sc_status != statSKIP) markusage(sym, uREAD); /* do not mark as "used" when this call itself is skipped */ - if (sym->x.lib != NULL) + if (sym->x.lib) sym->x.lib->value += 1; /* increment "usage count" of the library */ sideeffect = TRUE; /* assume functions carry out a side-effect */ assert(resulttag != NULL); @@ -486,7 +483,7 @@ checkfunction(value * lval) { symbol *sym = lval->sym; - if (sym == NULL || (sym->ident != iFUNCTN && sym->ident != iREFFUNC)) + if (!sym || (sym->ident != iFUNCTN && sym->ident != iREFFUNC)) return; /* no known symbol, or not a function result */ if ((sym->usage & uDEFINE) != 0) @@ -535,7 +532,7 @@ plnge(int *opstr, int opoff, int (*hier) (value * lval), value * lval, plnge2(op1[opidx], hier, lval, &lval2); if (op1[opidx] == ob_and || op1[opidx] == ob_or) bitwise_opercount++; - if (forcetag != NULL) + if (forcetag) lval->tag = sc_addtag(forcetag); } while (nextop(&opidx, opstr)); /* do */ @@ -674,13 +671,13 @@ plnge2(void (*oper) (void), if (lval1->ident == iARRAY || lval1->ident == iREFARRAY) { char *ptr = - (lval1->sym != NULL) ? lval1->sym->name : "-unknown-"; + (lval1->sym) ? lval1->sym->name : "-unknown-"; error(33, ptr); /* array must be indexed */ } else if (lval2->ident == iARRAY || lval2->ident == iREFARRAY) { char *ptr = - (lval2->sym != NULL) ? lval2->sym->name : "-unknown-"; + (lval2->sym) ? lval2->sym->name : "-unknown-"; error(33, ptr); /* array must be indexed */ } /* if */ /* ??? ^^^ should do same kind of error checking with functions */ @@ -776,8 +773,9 @@ expression(int *constant, cell * val, int *tag, int chkfuncresult) else { *constant = FALSE; + *val = 0; } /* if */ - if (tag != NULL) + if (tag) *tag = lval.tag; if (chkfuncresult) checkfunction(&lval); @@ -822,7 +820,7 @@ array_levelsize(symbol * sym, int level) * * Lowest hierarchy level (except for the , operator). * - * Global references: intest (reffered to only) + * Global references: intest (referred to only) */ int hier14(value * lval1) @@ -843,7 +841,7 @@ hier14(value * lval1) for (i = 0; i < sDIMEN_MAX; i++) arrayidx1[i] = arrayidx2[i] = 0; org_arrayidx = lval1->arrayidx; /* save current pointer, to reset later */ - if (lval1->arrayidx == NULL) + if (!lval1->arrayidx) lval1->arrayidx = arrayidx1; lvalue = plnge1(hier13, lval1); if (lval1->ident != iARRAYCELL && lval1->ident != iARRAYCHAR) @@ -940,7 +938,7 @@ hier14(value * lval1) lval2.arrayidx = NULL; if (oper) pop2(); - if (!oper && lval3.arrayidx != NULL && lval2.arrayidx != NULL + if (!oper && lval3.arrayidx && lval2.arrayidx && lval3.ident == lval2.ident && lval3.sym == lval2.sym) { int same = TRUE; @@ -986,7 +984,7 @@ hier14(value * lval1) if (lval2.ident != iARRAY && lval2.ident != iREFARRAY) error(33, lval3.sym->name); /* array must be indexed */ - if (lval2.sym != NULL) + if (lval2.sym) { val = lval2.sym->dim.array.length; /* array variable */ level = lval2.sym->dim.array.level; @@ -1097,13 +1095,13 @@ hier13(value * lval) if (array1 && !array2) { char *ptr = - (lval->sym->name != NULL) ? lval->sym->name : "-unknown-"; + (lval->sym->name) ? lval->sym->name : "-unknown-"; error(33, ptr); /* array must be indexed */ } else if (!array1 && array2) { char *ptr = - (lval2.sym->name != NULL) ? lval2.sym->name : "-unknown-"; + (lval2.sym->name) ? lval2.sym->name : "-unknown-"; error(33, ptr); /* array must be indexed */ } /* if */ /* ??? if both are arrays, should check dimensions */ @@ -1297,13 +1295,13 @@ hier2(value * lval) if (tok != tSYMBOL) return error(20, st); /* illegal symbol name */ sym = findloc(st); - if (sym == NULL) + if (!sym) sym = findglb(st); - if (sym != NULL && sym->ident != iFUNCTN && sym->ident != iREFFUNC + if (sym && sym->ident != iFUNCTN && sym->ident != iREFFUNC && (sym->usage & uDEFINE) == 0) sym = NULL; /* symbol is not a function, it is in the table, but not "defined" */ - val = (sym != NULL); - if (!val && find_subst(st, strlen(st)) != NULL) + val = !!sym; + if (!val && find_subst(st, strlen(st))) val = 1; clear_value(lval); lval->ident = iCONSTEXPR; @@ -1320,9 +1318,9 @@ hier2(value * lval) if (tok != tSYMBOL) return error(20, st); /* illegal symbol name */ sym = findloc(st); - if (sym == NULL) + if (!sym) sym = findglb(st); - if (sym == NULL) + if (!sym) return error(17, st); /* undefined symbol */ if (sym->ident == iCONSTEXPR) error(39); /* constant symbol has no size */ @@ -1343,7 +1341,7 @@ hier2(value * lval) error(28); /* invalid subscript */ else lval->constval = array_levelsize(sym, level); - if (lval->constval == 0 && strchr(lptr, PREPROC_TERM) == NULL) + if (lval->constval == 0 && !strchr(lptr, PREPROC_TERM)) error(224, st); /* indeterminate array size in "sizeof" expression */ } /* if */ const1(lval->constval); @@ -1364,9 +1362,9 @@ hier2(value * lval) else { sym = findloc(st); - if (sym == NULL) + if (!sym) sym = findglb(st); - if (sym == NULL) + if (!sym) return error(17, st); /* undefined symbol */ if ((sym->usage & uDEFINE) == 0) return error(17, st); /* undefined symbol (symbol is in the table, but it is "used" only) */ @@ -1499,7 +1497,7 @@ hier1(value * lval1) if (matchtoken('[') || matchtoken('{') || matchtoken('(')) { tok = tokeninfo(&val, &st); /* get token read by matchtoken() */ - if (sym == NULL && symtok != tSYMBOL) + if (!sym && symtok != tSYMBOL) { /* we do not have a valid symbol and we appear not to have read a valid * symbol name (so it is unlikely that we would have read a name of an @@ -1511,7 +1509,7 @@ hier1(value * lval1) if (tok == '[' || tok == '{') { /* subscript */ close = (char)((tok == '[') ? ']' : '}'); - if (sym == NULL) + if (!sym) { /* sym==NULL if lval is a constant or a literal */ error(28); /* cannot subscript */ needtoken(close); @@ -1541,7 +1539,7 @@ hier1(value * lval1) if (lval2.ident == iCONSTEXPR) { /* constant expression */ stgdel(index, cidx); /* scratch generated code */ - if (lval1->arrayidx != NULL) + if (lval1->arrayidx) { /* keep constant index, for checking */ assert(sym->dim.array.level >= 0 && sym->dim.array.level < sDIMEN_MAX); @@ -1636,16 +1634,16 @@ hier1(value * lval1) } else { /* tok=='(' -> function(...) */ - if (sym == NULL + if (!sym || (sym->ident != iFUNCTN && sym->ident != iREFFUNC)) { - if (sym == NULL && sc_status == statFIRST) + if (!sym && sc_status == statFIRST) { /* could be a "use before declaration"; in that case, create a stub * function so that the usage can be marked. */ sym = fetchfunc(lastsymbol, 0); - if (sym != NULL) + if (sym) markusage(sym, uREAD); } /* if */ return error(12); /* invalid function call */ @@ -1664,7 +1662,7 @@ hier1(value * lval1) return FALSE; /* result of function call is no lvalue */ } /* if */ } /* if */ - if (sym != NULL && lval1->ident == iFUNCTN) + if (sym && lval1->ident == iFUNCTN) { assert(sym->ident == iFUNCTN); address(sym); @@ -1697,9 +1695,7 @@ primary(value * lval) if (matchtoken('(')) { /* sub-expression - (expression,...) */ - /* FIXME: 64bit unsafe */ pushstk((stkitem) intest); - /* FIXME: 64bit unsafe */ pushstk((stkitem) sc_allowtags); intest = 0; /* no longer in "test" expression */ @@ -1727,7 +1723,7 @@ primary(value * lval) if (tok == tSYMBOL && !findconst(st)) { /* first look for a local variable */ - if ((sym = findloc(st)) != 0) + if ((sym = findloc(st))) { if (sym->ident == iLABEL) { @@ -1749,7 +1745,7 @@ primary(value * lval) } /* if */ } /* if */ /* now try a global variable */ - if ((sym = findglb(st)) != 0) + if ((sym = findglb(st))) { if (sym->ident == iFUNCTN || sym->ident == iREFFUNC) { @@ -2013,7 +2009,7 @@ callfunction(symbol * sym) } /* if */ /* ??? handle const array passed by reference */ /* otherwise, the address is already in PRI */ - if (lval.sym != NULL) + if (lval.sym) markusage(lval.sym, uWRITTEN); /* * Dont need this warning - its varargs. there is no way of knowing the @@ -2042,7 +2038,7 @@ callfunction(symbol * sym) case iREFERENCE: if (!lvalue || lval.ident == iARRAYCHAR) error(35, argidx + 1); /* argument type mismatch */ - if (lval.sym != NULL && (lval.sym->usage & uCONST) != 0 + if (lval.sym && (lval.sym->usage & uCONST) != 0 && (arg[argidx].usage & uCONST) == 0) error(35, argidx + 1); /* argument type mismatch */ if (lval.ident == iVARIABLE || lval.ident == iREFERENCE) @@ -2063,7 +2059,7 @@ callfunction(symbol * sym) (arg[argidx].tags, arg[argidx].numtags, lval.tag)) error(213); argidx++; /* argument done */ - if (lval.sym != NULL) + if (lval.sym) markusage(lval.sym, uWRITTEN); break; case iREFARRAY: @@ -2073,14 +2069,14 @@ callfunction(symbol * sym) error(35, argidx + 1); /* argument type mismatch */ break; } /* if */ - if (lval.sym != NULL && (lval.sym->usage & uCONST) != 0 + if (lval.sym && (lval.sym->usage & uCONST) != 0 && (arg[argidx].usage & uCONST) == 0) error(35, argidx + 1); /* argument type mismatch */ /* Verify that the dimensions match with those in arg[argidx]. * A literal array always has a single dimension. * An iARRAYCELL parameter is also assumed to have a single dimension. */ - if (lval.sym == NULL || lval.ident == iARRAYCELL) + if (!lval.sym || lval.ident == iARRAYCELL) { if (arg[argidx].numdim != 1) { @@ -2271,7 +2267,7 @@ callfunction(symbol * sym) */ asz = find_constval(&arrayszlst, arg[argidx].defvalue.size.symname, arg[argidx].defvalue.size.level); - if (asz != NULL) + if (asz) { array_sz = asz->value; if (array_sz == 0) @@ -2288,9 +2284,9 @@ callfunction(symbol * sym) assert((arg[argidx].hasdefault & uTAGOF) != 0); sym = findloc(arg[argidx].defvalue.size.symname); - if (sym == NULL) + if (!sym) sym = findglb(arg[argidx].defvalue.size.symname); - array_sz = (sym != NULL) ? sym->tag : 0; + array_sz = (sym) ? sym->tag : 0; exporttag(array_sz); } /* if */ const1(array_sz); @@ -2305,7 +2301,7 @@ callfunction(symbol * sym) ffcall(sym, nargs); if (sc_status != statSKIP) markusage(sym, uREAD); /* do not mark as "used" when this call itself is skipped */ - if (sym->x.lib != NULL) + if (sym->x.lib) sym->x.lib->value += 1; /* increment "usage count" of the library */ modheap(-heapalloc * sizeof(cell)); sideeffect = TRUE; /* assume functions carry out a side-effect */ @@ -2375,7 +2371,7 @@ constant(value * lval) symbol *sym; tok = lex(&val, &st); - if (tok == tSYMBOL && (sym = findconst(st)) != 0) + if (tok == tSYMBOL && (sym = findconst(st))) { lval->constval = sym->addr; const1(lval->constval); diff --git a/src/bin/embryo_cc_sc4.c b/src/bin/embryo_cc_sc4.c index 600112f..258d714 100644 --- a/src/bin/embryo_cc_sc4.c +++ b/src/bin/embryo_cc_sc4.c @@ -21,9 +21,6 @@ * Version: $Id$ */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ #ifdef HAVE_CONFIG_H # include @@ -32,7 +29,7 @@ #include #include #include -#include /* for _MAX_PATH */ +#include /* for PATH_MAX */ #include #include "embryo_cc_sc.h" @@ -250,7 +247,7 @@ alignframe(int numbytes) /* "numbytes" should be a power of 2 for this code to work */ int i, count = 0; - for (i = 0; i < sizeof numbytes * 8; i++) + for (i = 0; i < (int)(sizeof(numbytes) * 8); i++) if (numbytes & (1 << i)) count++; assert(count == 1); @@ -484,9 +481,9 @@ copyarray(symbol * sym, cell size) } void -fillarray(symbol * sym, cell size, cell value) +fillarray(symbol * sym, cell size, cell val) { - const1(value); /* load value in PRI */ + const1(val); /* load val in PRI */ assert(sym != NULL); /* the symbol can be a local array, a global array, or an array @@ -640,7 +637,7 @@ ffswitch(int label) } void -ffcase(cell value, char *labelname, int newtable) +ffcase(cell val, char *labelname, int newtable) { if (newtable) { @@ -648,7 +645,7 @@ ffcase(cell value, char *labelname, int newtable) code_idx += opcodes(1); } /* if */ stgwrite("\tcase "); - outval(value, FALSE); + outval(val, FALSE); stgwrite(" "); stgwrite(labelname); stgwrite("\n"); @@ -752,17 +749,17 @@ modstk(int delta) /* set the stack to a hard offset from the frame */ void -setstk(cell value) +setstk(cell val) { stgwrite("\tlctrl 5\n"); /* get FRM */ - assert(value <= 0); /* STK should always become <= FRM */ - if (value < 0) + assert(val <= 0); /* STK should always become <= FRM */ + if (val < 0) { stgwrite("\tadd.c "); - outval(value, TRUE); /* add (negative) offset */ + outval(val, TRUE); /* add (negative) offset */ code_idx += opcodes(1) + opargs(1); - // ??? write zeros in the space between STK and the value in PRI (the new stk) - // get value of STK in ALT + // ??? write zeros in the space between STK and the val in PRI (the new stk) + // get val of STK in ALT // zero PRI // need new FILL opcode that takes a variable size } /* if */ @@ -792,10 +789,10 @@ setheap_pri(void) } void -setheap(cell value) +setheap(cell val) { - stgwrite("\tconst.pri "); /* load default value in PRI */ - outval(value, TRUE); + stgwrite("\tconst.pri "); /* load default val in PRI */ + outval(val, TRUE); code_idx += opcodes(1) + opargs(1); setheap_pri(); } @@ -878,12 +875,12 @@ charalign(void) * Add a constant to the primary register. */ void -addconst(cell value) +addconst(cell val) { - if (value != 0) + if (val != 0) { stgwrite("\tadd.c "); - outval(value, TRUE); + outval(val, TRUE); code_idx += opcodes(1) + opargs(1); } /* if */ } diff --git a/src/bin/embryo_cc_sc5.c b/src/bin/embryo_cc_sc5.c index cc5fd4f..a8af498 100644 --- a/src/bin/embryo_cc_sc5.c +++ b/src/bin/embryo_cc_sc5.c @@ -1,7 +1,4 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - * - * Small compiler - Error message system +/* Small compiler - Error message system * In fact a very simple system, using only 'panic mode'. * * Copyright (c) ITB CompuPhase, 1997-2003 @@ -25,19 +22,20 @@ * Version: $Id$ */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ #ifdef HAVE_CONFIG_H # include #endif -#include #include #include #include #include + +#ifdef HAVE_UNISTD_H +# include +#endif + #include "embryo_cc_sc.h" #include "embryo_cc_sc5.scp" @@ -51,17 +49,16 @@ static int errstart; /* line number at which the instruction started */ * errors are ignored until lex() finds a semicolumn or a keyword * (lex() resets "errflag" in that case). * - * Global references: inpfname (reffered to only) - * fline (reffered to only) - * fcurrent (reffered to only) + * Global references: inpfname (referred to only) + * fline (referred to only) + * fcurrent (referred to only) * errflag (altered) */ int error(int number, ...) { - static char *prefix[3] = { "error", "fatal error", "warning" }; static int lastline, lastfile, errorcount; - char *msg, *pre; + char *msg; va_list argptr; char string[1024]; int start; @@ -78,20 +75,17 @@ error(int number, ...) if (number < 100) { msg = errmsg[number - 1]; - pre = prefix[0]; errflag = TRUE; /* set errflag (skip rest of erroneous expression) */ errnum++; } else if (number < 200) { msg = fatalmsg[number - 100]; - pre = prefix[1]; errnum++; /* a fatal error also counts as an error */ } else { msg = warnmsg[number - 200]; - pre = prefix[2]; warnnum++; } @@ -116,7 +110,7 @@ error(int number, ...) sc_error(0, "\nCompilation aborted.", NULL, 0, 0, argptr); va_end(argptr); - if (outf != NULL) + if (outf) { sc_closeasm(outf); outf = NULL; diff --git a/src/bin/embryo_cc_sc6.c b/src/bin/embryo_cc_sc6.c index 3c2fca2..3525d27 100644 --- a/src/bin/embryo_cc_sc6.c +++ b/src/bin/embryo_cc_sc6.c @@ -21,9 +21,6 @@ * Version: $Id$ */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ #ifdef HAVE_CONFIG_H # include @@ -34,7 +31,6 @@ #include /* for macro max() */ #include #include -#include "embryo_cc_osdefs.h" #include "embryo_cc_sc.h" typedef cell(*OPCODE_PROC) (FILE * fbin, char *params, cell opcode); @@ -87,7 +83,7 @@ hex2long(char *s, char **n) result = (result << 4) | digit; s++; } /* for */ - if (n != NULL) + if (n) *n = s; if (negate) result = (~result) + 1; /* take two's complement of the result */ @@ -138,7 +134,7 @@ align32(long *v) static char * skipwhitespace(char *str) { - while (isspace(*str)) + while (sc_isspace(*str)) str++; return str; } @@ -148,7 +144,7 @@ stripcomment(char *str) { char *ptr = strchr(str, ';'); - if (ptr != NULL) + if (ptr) { *ptr++ = '\n'; /* terminate the line, but leave the '\n' */ *ptr = '\0'; @@ -227,7 +223,7 @@ noop(FILE * fbin __UNUSED__, char *params __UNUSED__, cell opcode __UNUSED__) static cell parm0(FILE * fbin, char *params __UNUSED__, cell opcode) { - if (fbin != NULL) + if (fbin) write_encoded(fbin, (ucell *) & opcode, 1); return opcodes(1); } @@ -237,7 +233,7 @@ parm1(FILE * fbin, char *params, cell opcode) { ucell p = hex2long(params, NULL); - if (fbin != NULL) + if (fbin) { write_encoded(fbin, (ucell *) & opcode, 1); write_encoded(fbin, &p, 1); @@ -252,7 +248,7 @@ parm2(FILE * fbin, char *params, cell opcode) p[0] = hex2long(params, ¶ms); p[1] = hex2long(params, NULL); - if (fbin != NULL) + if (fbin) { write_encoded(fbin, (ucell *) & opcode, 1); write_encoded(fbin, p, 2); @@ -273,10 +269,10 @@ do_dump(FILE * fbin, char *params, cell opcode __UNUSED__) while (*params != '\0') { p = hex2long(params, ¶ms); - if (fbin != NULL) + if (fbin) write_encoded(fbin, &p, 1); num++; - while (isspace(*params)) + while (sc_isspace(*params)) params++; } /* while */ return num * sizeof(cell); @@ -290,7 +286,7 @@ do_call(FILE * fbin, char *params, cell opcode) symbol *sym; ucell p; - for (i = 0; !isspace(*params); i++, params++) + for (i = 0; !sc_isspace(*params); i++, params++) { assert(*params != '\0'); assert(i < sNAMEMAX); @@ -307,7 +303,7 @@ do_call(FILE * fbin, char *params, cell opcode) assert(sym->vclass == sGLOBAL); p = sym->addr; - if (fbin != NULL) + if (fbin) { write_encoded(fbin, (ucell *) & opcode, 1); write_encoded(fbin, &p, 1); @@ -324,7 +320,7 @@ do_jump(FILE * fbin, char *params, cell opcode) i = (int)hex2long(params, NULL); assert(i >= 0 && i < labnum); - if (fbin != NULL) + if (fbin) { assert(lbltab != NULL); p = lbltab[i]; @@ -343,10 +339,10 @@ do_file(FILE * fbin, char *params, cell opcode) p = hex2long(params, ¶ms); /* remove leading and trailing white space from the filename */ - while (isspace(*params)) + while (sc_isspace(*params)) params++; len = strlen(params); - while (len > 0 && isspace(params[len - 1])) + while (len > 0 && sc_isspace(params[len - 1])) len--; params[len++] = '\0'; /* zero-terminate */ while (len % sizeof(cell) != 0) @@ -354,7 +350,7 @@ do_file(FILE * fbin, char *params, cell opcode) assert(len > 0 && len < 256); clen = len + sizeof(cell); /* add size of file ordinal */ - if (fbin != NULL) + if (fbin) { write_encoded(fbin, (ucell *) & opcode, 1); write_encoded(fbin, &clen, 1); @@ -372,7 +368,7 @@ do_symbol(FILE * fbin, char *params, cell opcode) int len; unsigned char mclass, type; - for (endptr = params; !isspace(*endptr) && endptr != '\0'; endptr++) + for (endptr = params; !sc_isspace(*endptr) && endptr != '\0'; endptr++) /* nothing */ ; assert(*endptr == ' '); @@ -389,7 +385,7 @@ do_symbol(FILE * fbin, char *params, cell opcode) params[len++] = '\0'; /* pad with zeros up to full cell */ clen = len + 2 * sizeof(cell); /* add size of symbol address and flags */ - if (fbin != NULL) + if (fbin) { write_encoded(fbin, (ucell *) & opcode, 1); write_encoded(fbin, &clen, 1); @@ -400,7 +396,7 @@ do_symbol(FILE * fbin, char *params, cell opcode) #if !defined NDEBUG /* function should start right after the symbolic information */ - if (fbin == NULL && mclass == 0 && type == iFUNCTN) + if (!fbin && mclass == 0 && type == iFUNCTN) assert(offset == codeindex + opcodes(1) + opargs(1) + clen); #endif @@ -416,7 +412,7 @@ do_switch(FILE * fbin, char *params, cell opcode) i = (int)hex2long(params, NULL); assert(i >= 0 && i < labnum); - if (fbin != NULL) + if (fbin) { assert(lbltab != NULL); p = lbltab[i]; @@ -440,7 +436,7 @@ do_case(FILE * fbin, char *params, cell opcode __UNUSED__) i = (int)hex2long(params, NULL); assert(i >= 0 && i < labnum); - if (fbin != NULL) + if (fbin) { assert(lbltab != NULL); p = lbltab[i]; @@ -662,14 +658,14 @@ assemble(FILE * fout, FILE * fin) constvalue *constptr; cell mainaddr; int nametable, tags, libraries, publics, natives, pubvars; - int cod, dat, hea, stp, cip, size, defsize; + int cod, defsize; #if !defined NDEBUG /* verify that the opcode list is sorted (skip entry 1; it is reserved - * for a non-existant opcode) + * for a non-existent opcode) */ assert(opcodelist[1].name != NULL); - for (i = 2; i < (sizeof opcodelist / sizeof opcodelist[0]); i++) + for (i = 2; i < (int)(sizeof(opcodelist) / sizeof(opcodelist[0])); i++) { assert(opcodelist[i].name != NULL); assert(strcasecmp(opcodelist[i].name, opcodelist[i - 1].name) > 0); @@ -683,7 +679,7 @@ assemble(FILE * fout, FILE * fin) numpubvars = 0; mainaddr = -1; /* count number of public and native functions and public variables */ - for (sym = glbtab.next; sym != NULL; sym = sym->next) + for (sym = glbtab.next; sym; sym = sym->next) { char alias[sNAMEMAX + 1] = ""; int match = 0; @@ -727,7 +723,7 @@ assemble(FILE * fout, FILE * fin) /* count number of libraries */ numlibraries = 0; - for (constptr = libname_tab.next; constptr != NULL; + for (constptr = libname_tab.next; constptr; constptr = constptr->next) { if (constptr->value > 0) @@ -740,7 +736,7 @@ assemble(FILE * fout, FILE * fin) /* count number of public tags */ numtags = 0; - for (constptr = tagname_tab.next; constptr != NULL; + for (constptr = tagname_tab.next; constptr; constptr = constptr->next) { if ((constptr->value & PUBLICTAG) != 0) @@ -785,11 +781,11 @@ assemble(FILE * fout, FILE * fin) tags = hdr.tags = hdr.pubvars + numpubvars * sizeof(FUNCSTUB); nametable = hdr.nametable = hdr.tags + numtags * sizeof(FUNCSTUB); cod = hdr.cod = hdr.nametable + nametablesize + padding; - dat = hdr.dat = hdr.cod + code_idx; - hea = hdr.hea = hdr.dat + glb_declared * sizeof(cell); - stp = hdr.stp = hdr.hea + sc_stksize * sizeof(cell); - cip = hdr.cip = mainaddr; - size = hdr.size = hdr.hea; /* preset, this is incorrect in case of compressed output */ + hdr.dat = hdr.cod + code_idx; + hdr.hea = hdr.dat + glb_declared * sizeof(cell); + hdr.stp = hdr.hea + sc_stksize * sizeof(cell); + hdr.cip = mainaddr; + hdr.size = hdr.hea; /* preset, this is incorrect in case of compressed output */ #ifdef WORDS_BIGENDIAN align32(&hdr.size); align16(&hdr.magic); @@ -816,7 +812,7 @@ assemble(FILE * fout, FILE * fin) /* write the public functions table */ count = 0; - for (sym = glbtab.next; sym != NULL; sym = sym->next) + for (sym = glbtab.next; sym; sym = sym->next) { if (sym->ident == iFUNCTN && (sym->usage & uPUBLIC) != 0 && (sym->usage & uDEFINE) != 0) @@ -851,12 +847,12 @@ assemble(FILE * fout, FILE * fin) if (numnatives > 0) { nativelist = (symbol **) malloc(numnatives * sizeof(symbol *)); - if (nativelist == NULL) + if (!nativelist) error(103); /* insufficient memory */ #if !defined NDEBUG memset(nativelist, 0, numnatives * sizeof(symbol *)); /* for NULL checking */ #endif - for (sym = glbtab.next; sym != NULL; sym = sym->next) + for (sym = glbtab.next; sym; sym = sym->next) { if (sym->ident == iFUNCTN && (sym->usage & uNATIVE) != 0 && (sym->usage & uREAD) != 0 && sym->addr >= 0) @@ -896,7 +892,7 @@ assemble(FILE * fout, FILE * fin) /* write the libraries table */ count = 0; - for (constptr = libname_tab.next; constptr != NULL; + for (constptr = libname_tab.next; constptr; constptr = constptr->next) { if (constptr->value > 0) @@ -919,7 +915,7 @@ assemble(FILE * fout, FILE * fin) /* write the public variables table */ count = 0; - for (sym = glbtab.next; sym != NULL; sym = sym->next) + for (sym = glbtab.next; sym; sym = sym->next) { if (sym->ident == iVARIABLE && (sym->usage & uPUBLIC) != 0) { @@ -942,7 +938,7 @@ assemble(FILE * fout, FILE * fin) /* write the public tagnames table */ count = 0; - for (constptr = tagname_tab.next; constptr != NULL; + for (constptr = tagname_tab.next; constptr; constptr = constptr->next) { if ((constptr->value & PUBLICTAG) != 0) @@ -984,11 +980,11 @@ assemble(FILE * fout, FILE * fin) /* only very short programs have zero labels; no first pass is needed * if there are no labels */ lbltab = (cell *) malloc(labnum * sizeof(cell)); - if (lbltab == NULL) + if (!lbltab) error(103); /* insufficient memory */ codeindex = 0; sc_resetasm(fin); - while (sc_readasm(fin, line, sizeof line) != NULL) + while (sc_readasm(fin, line, sizeof line)) { stripcomment(line); instr = skipwhitespace(line); @@ -1007,12 +1003,12 @@ assemble(FILE * fout, FILE * fin) /* get to the end of the instruction (make use of the '\n' that fgets() * added at the end of the line; this way we will *always* drop on a * whitespace character) */ - for (params = instr; *params != '\0' && !isspace(*params); + for (params = instr; *params != '\0' && !sc_isspace(*params); params++) /* nothing */ ; assert(params > instr); i = findopcode(instr, (int)(params - instr)); - if (opcodelist[i].name == NULL) + if (!opcodelist[i].name) { *params = '\0'; error(104, instr); /* invalid assembler instruction */ @@ -1031,7 +1027,7 @@ assemble(FILE * fout, FILE * fin) for (pass = sIN_CSEG; pass <= sIN_DSEG; pass++) { sc_resetasm(fin); - while (sc_readasm(fin, line, sizeof line) != NULL) + while (sc_readasm(fin, line, sizeof line)) { stripcomment(line); instr = skipwhitespace(line); @@ -1043,7 +1039,7 @@ assemble(FILE * fout, FILE * fin) /* get to the end of the instruction (make use of the '\n' that fgets() * added at the end of the line; this way we will *always* drop on a * whitespace character) */ - for (params = instr; *params != '\0' && !isspace(*params); + for (params = instr; *params != '\0' && !sc_isspace(*params); params++) /* nothing */ ; assert(params > instr); @@ -1057,7 +1053,7 @@ assemble(FILE * fout, FILE * fin) if (bytes_out - bytes_in > 0) error(106); /* compression buffer overflow */ - if (lbltab != NULL) + if (lbltab) { free(lbltab); #if !defined NDEBUG diff --git a/src/bin/embryo_cc_sc7.c b/src/bin/embryo_cc_sc7.c index 7eecabb..b51f2ea 100644 --- a/src/bin/embryo_cc_sc7.c +++ b/src/bin/embryo_cc_sc7.c @@ -38,9 +38,6 @@ * Version: $Id$ */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ #ifdef HAVE_CONFIG_H # include @@ -80,7 +77,7 @@ static void grow_stgbuffer(int requiredsize) { char *p; - int clear = stgbuf == NULL; /* if previously none, empty buffer explicitly */ + int clear = !stgbuf; /* if previously none, empty buffer explicitly */ assert(stgmax < requiredsize); /* if the staging buffer (holding intermediate code for one line) grows @@ -89,11 +86,11 @@ grow_stgbuffer(int requiredsize) if (requiredsize > sSTG_MAX) error(102, "staging buffer"); /* staging buffer overflow (fatal error) */ stgmax = requiredsize + sSTG_GROW; - if (stgbuf != NULL) + if (stgbuf) p = (char *)realloc(stgbuf, stgmax * sizeof(char)); else p = (char *)malloc(stgmax * sizeof(char)); - if (p == NULL) + if (!p) error(102, "staging buffer"); /* staging buffer overflow (fatal error) */ stgbuf = p; if (clear) @@ -103,7 +100,7 @@ grow_stgbuffer(int requiredsize) void stgbuffer_cleanup(void) { - if (stgbuf != NULL) + if (stgbuf) { free(stgbuf); stgbuf = NULL; @@ -238,7 +235,7 @@ typedef struct * by '[', sENDREORDER by ']' and sEXPRSTART by '|' the following applies: * '[]...' valid, but useless; no output * '[|...] valid, but useless; only one string - * '[|...|...] valid and usefull + * '[|...|...] valid and useful * '[...|...] invalid, first string doesn't start with '|' * '[|...|] invalid */ @@ -256,7 +253,7 @@ stgstring(char *start, char *end) start += 1; /* skip token */ /* allocate a argstack with sMAXARGS items */ stack = (argstack *) malloc(sMAXARGS * sizeof(argstack)); - if (stack == NULL) + if (!stack) error(103); /* insufficient memory */ nest = 1; /* nesting counter */ argc = 0; /* argument counter */ @@ -319,7 +316,7 @@ stgstring(char *start, char *end) * Scraps code from the staging buffer by resetting "stgidx" to "index". * * Global references: stgidx (altered) - * staging (reffered to only) + * staging (referred to only) */ void stgdel(int index, cell code_index) @@ -384,11 +381,11 @@ phopt_init(void) char str[160]; /* count number of sequences */ - for (number = 0; sequences_cmp[number].find != NULL; number++) + for (number = 0; sequences_cmp[number].find; number++) /* nothing */ ; number++; /* include an item for the NULL terminator */ - if ((sequences = (SEQUENCE *) malloc(number * sizeof(SEQUENCE))) == NULL) + if (!(sequences = (SEQUENCE *)malloc(number * sizeof(SEQUENCE)))) return FALSE; /* pre-initialize all to NULL (in case of failure) */ @@ -405,21 +402,21 @@ phopt_init(void) len = strexpand(str, (unsigned char *)sequences_cmp[i].find, sizeof str, SCPACK_TABLE); - assert(len <= sizeof str); - assert(len == (int)strlen(str) + 1); + assert(len <= (int)(sizeof(str))); + assert(len == (int)(strlen(str) + 1)); sequences[i].find = (char *)malloc(len); - if (sequences[i].find != NULL) + if (sequences[i].find) strcpy(sequences[i].find, str); len = strexpand(str, (unsigned char *)sequences_cmp[i].replace, sizeof str, SCPACK_TABLE); - assert(len <= sizeof str); - assert(len == (int)strlen(str) + 1); + assert(len <= (int)(sizeof(str))); + assert(len == (int)(strlen(str) + 1)); sequences[i].replace = (char *)malloc(len); - if (sequences[i].replace != NULL) + if (sequences[i].replace) strcpy(sequences[i].replace, str); sequences[i].savesize = sequences_cmp[i].savesize; - if (sequences[i].find == NULL || sequences[i].replace == NULL) + if (!sequences[i].find || !sequences[i].replace) return phopt_cleanup(); } /* for */ @@ -431,14 +428,14 @@ phopt_cleanup(void) { int i; - if (sequences != NULL) + if (sequences) { i = 0; - while (sequences[i].find != NULL || sequences[i].replace != NULL) + while (sequences[i].find || sequences[i].replace) { - if (sequences[i].find != NULL) + if (sequences[i].find) free(sequences[i].find); - if (sequences[i].replace != NULL) + if (sequences[i].replace) free(sequences[i].replace); i++; } /* while */ @@ -474,7 +471,7 @@ matchsequence(char *start, char *end, char *pattern, { case '%': /* new "symbol" */ pattern++; - assert(isdigit(*pattern)); + assert(sc_isdigit(*pattern)); var = atoi(pattern) - 1; assert(var >= 0 && var < _maxoptvars); assert(alphanum(*start)); @@ -545,7 +542,7 @@ replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1], { case '%': lptr++; /* skip '%' */ - assert(isdigit(*lptr)); + assert(sc_isdigit(*lptr)); var = atoi(lptr) - 1; assert(var >= 0 && var < _maxoptvars); assert(symbols[var][0] != '\0'); /* variable should be defined */ @@ -561,7 +558,7 @@ replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1], } /* while */ /* allocate a buffer to replace the sequence in */ - if ((buffer = malloc(*repl_length)) == NULL) + if (!(buffer = malloc(*repl_length))) { error(103); return NULL; @@ -578,7 +575,7 @@ replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1], case '%': /* write out the symbol */ pattern++; - assert(isdigit(*pattern)); + assert(sc_isdigit(*pattern)); var = atoi(pattern) - 1; assert(var >= 0 && var < _maxoptvars); assert(symbols[var][0] != '\0'); /* variable should be defined */ @@ -641,7 +638,7 @@ stgopt(char *start, char *end) else { seq = 0; - while (sequences[seq].find != NULL) + while (sequences[seq].find) { assert(seq >= 0); if (matchsequence diff --git a/src/bin/embryo_cc_scexpand.c b/src/bin/embryo_cc_scexpand.c index d724765..6ab34a1 100644 --- a/src/bin/embryo_cc_scexpand.c +++ b/src/bin/embryo_cc_scexpand.c @@ -11,9 +11,6 @@ * complete file. */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ #include "embryo_cc_sc.h" diff --git a/src/bin/embryo_cc_sclist.c b/src/bin/embryo_cc_sclist.c index 957fc19..e908248 100644 --- a/src/bin/embryo_cc_sclist.c +++ b/src/bin/embryo_cc_sclist.c @@ -24,9 +24,6 @@ * Version: $Id$ */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ #ifdef HAVE_CONFIG_H # include @@ -46,22 +43,22 @@ insert_stringpair(stringpair * root, char *first, char *second, int matchlength) assert(first != NULL); assert(second != NULL); /* create a new node, and check whether all is okay */ - if ((cur = (stringpair *) malloc(sizeof(stringpair))) == NULL) + if (!(cur = (stringpair *)malloc(sizeof(stringpair)))) return NULL; cur->first = strdup(first); cur->second = strdup(second); cur->matchlength = matchlength; - if (cur->first == NULL || cur->second == NULL) + if (!cur->first || !cur->second) { - if (cur->first != NULL) + if (cur->first) free(cur->first); - if (cur->second != NULL) + if (cur->second) free(cur->second); free(cur); return NULL; } /* if */ /* link the node to the tree, find the position */ - for (pred = root; pred->next != NULL && strcmp(pred->next->first, first) < 0; + for (pred = root; pred->next && strcmp(pred->next->first, first) < 0; pred = pred->next) /* nothing */ ; cur->next = pred->next; @@ -76,7 +73,7 @@ delete_stringpairtable(stringpair * root) assert(root != NULL); cur = root->next; - while (cur != NULL) + while (cur) { next = cur->next; assert(cur->first != NULL); @@ -96,7 +93,7 @@ find_stringpair(stringpair * cur, char *first, int matchlength) assert(matchlength > 0); /* the function cannot handle zero-length comparison */ assert(first != NULL); - while (cur != NULL && result <= 0) + while (cur && result <= 0) { result = (int)*cur->first - (int)*first; if (result == 0 && matchlength == cur->matchlength) @@ -117,7 +114,7 @@ delete_stringpair(stringpair * root, stringpair * item) assert(root != NULL); cur = root; - while (cur->next != NULL) + while (cur->next) { if (cur->next == item) { @@ -146,7 +143,7 @@ insert_alias(char *name, char *alias) assert(strlen(name) <= sNAMEMAX); assert(alias != NULL); assert(strlen(alias) <= sEXPMAX); - if ((cur = insert_stringpair(&alias_tab, name, alias, strlen(name))) == NULL) + if (!(cur = insert_stringpair(&alias_tab, name, alias, strlen(name)))) error(103); /* insufficient memory (fatal error) */ return cur; } @@ -156,12 +153,12 @@ lookup_alias(char *target, char *name) { stringpair *cur = find_stringpair(alias_tab.next, name, strlen(name)); - if (cur != NULL) + if (cur) { assert(strlen(cur->second) <= sEXPMAX); strcpy(target, cur->second); } /* if */ - return cur != NULL; + return !!cur; } void @@ -179,9 +176,9 @@ insert_path(char *path) stringlist *cur; assert(path != NULL); - if ((cur = (stringlist *) malloc(sizeof(stringlist))) == NULL) + if (!(cur = (stringlist *)malloc(sizeof(stringlist)))) error(103); /* insufficient memory (fatal error) */ - if ((cur->line = strdup(path)) == NULL) + if (!(cur->line = strdup(path))) error(103); /* insufficient memory (fatal error) */ cur->next = includepaths.next; includepaths.next = cur; @@ -193,9 +190,9 @@ get_path(int index) { stringlist *cur = includepaths.next; - while (cur != NULL && index-- > 0) + while (cur && index-- > 0) cur = cur->next; - if (cur != NULL) + if (cur) { assert(cur->line != NULL); return cur->line; @@ -208,7 +205,7 @@ delete_pathtable(void) { stringlist *cur = includepaths.next, *next; - while (cur != NULL) + while (cur) { next = cur->next; assert(cur->line != NULL); @@ -232,7 +229,7 @@ adjustindex(char c) assert((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_'); assert('A' < '_' && '_' < 'z'); - for (cur = substpair.next; cur != NULL && cur->first[0] != c; + for (cur = substpair.next; cur && cur->first[0] != c; cur = cur->next) /* nothing */ ; substindex[(int)c - 'A'] = cur; @@ -245,9 +242,7 @@ insert_subst(char *pattern, char *substitution, int prefixlen) assert(pattern != NULL); assert(substitution != NULL); - if ((cur = - insert_stringpair(&substpair, pattern, substitution, - prefixlen)) == NULL) + if (!(cur = insert_stringpair(&substpair, pattern, substitution, prefixlen))) error(103); /* insufficient memory (fatal error) */ adjustindex(*pattern); return cur; @@ -263,7 +258,7 @@ find_subst(char *name, int length) assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z') || *name == '_'); item = substindex[(int)*name - 'A']; - if (item != NULL) + if (item) item = find_stringpair(item, name, length); return item; } @@ -278,9 +273,9 @@ delete_subst(char *name, int length) assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z') || *name == '_'); item = substindex[(int)*name - 'A']; - if (item != NULL) + if (item) item = find_stringpair(item, name, length); - if (item == NULL) + if (!item) return FALSE; delete_stringpair(&substpair, item); adjustindex(*name); @@ -293,6 +288,6 @@ delete_substtable(void) int i; delete_stringpairtable(&substpair); - for (i = 0; i < sizeof substindex / sizeof substindex[0]; i++) + for (i = 0; i < (int)(sizeof(substindex) / sizeof(substindex[0])); i++) substindex[i] = NULL; } diff --git a/src/bin/embryo_cc_scvars.c b/src/bin/embryo_cc_scvars.c index 0fa802a..f369b9b 100644 --- a/src/bin/embryo_cc_scvars.c +++ b/src/bin/embryo_cc_scvars.c @@ -23,11 +23,11 @@ * Version: $Id$ */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ -#include /* for _MAX_PATH */ +#ifdef HAVE_CONFIG_H +# include /* for PATH_MAX */ +#endif + #include "embryo_cc_sc.h" /* global variables @@ -45,7 +45,7 @@ constvalue libname_tab = { NULL, "", 0, 0 }; /* library table (#pragma library " constvalue *curlibrary = NULL; /* current library */ symbol *curfunc; /* pointer to current function */ char *inpfname; /* pointer to name of the file currently read from */ -char outfname[_MAX_PATH]; /* output file name */ +char outfname[PATH_MAX]; /* output file name */ char sc_ctrlchar = CTRL_CHAR; /* the control character (or escape character) */ int litidx = 0; /* index to literal table */ int litmax = sDEF_LITMAX; /* current size of the literal table */ diff --git a/src/lib/Embryo.h b/src/lib/Embryo.h index 50ab731..650aa83 100644 --- a/src/lib/Embryo.h +++ b/src/lib/Embryo.h @@ -1,3 +1,312 @@ +/** +@brief Embryo Library + +These routines are used for Embryo. + +@mainpage Embryo Library Documentation + +@image html e_big.png + +@version 1.7.0 +@author Carsten Haitzler +@author Compuphase http://www.compuphase.com +@date 2004-2012 + +@section intro What is Embryo? + +Embryo is a tiny library designed to interpret limited Small programs +compiled by the included compiler, @c embryo_cc. It is mostly a cleaned +up and smaller version of the original Small abstract machine. The +compiler is mostly untouched. + +Small was renamed to Pawn. +For more information about the Pawn language, see +@htmlonly Pawn +@endhtmlonly +@latexonly http://www.compuphase.com/pawn/pawn.htm @endlatexonly +For the basics about the Small language, see @ref Small_Page. + +@section How_to_Use How to Use Embryo? + +To use Embryo in your code, you need to do at least the following: + +@li Include @ref Embryo.h. +@li Load the Embryo program using one of the + @ref Embryo_Program_Creation_Group. +@li Set up the native calls with @ref embryo_program_native_call_add. +@li Create a virtual machine with @ref embryo_program_vm_push. +@li Then run the program with @ref embryo_program_run. + +@todo Clean up compiler code. +@todo Proper overview of the operation of the interpreter, that is how + the heap, stack, virtual machines, etc fit together. + +@page Small_Page Brief Introduction to Small + +This section describes the basics of Small, as compiled and interpreted +with Embryo. + +This summary assumes that you are familar with C. For a full list of +differences between C and Small, again, see the full documentation. + +@section Small_Variables_Section Variables + +@subsection Small_Type_Subsection Types + +There is only one type, known as the "cell", which can hold an integer. + +@subsection Small_Scope_Subsection Scope + +The scope and usage of a variable depends on its declaration. + +@li A local variable is normally declared with the @c new keyword. E.g. + @code new variable @endcode +@li A static function variable is defined within a function with the + @c static keyword. +@li A global static variable is one that is only available within the + file it was declared in. Again, use the @c static keyword, but outside + of any function. +@li A stock variable is one that may not be compiled into a program if it + is not used. It is declared using @c stock. +@li A public variable is one that can be read by the host program using + @ref embryo_program_variable_find. It is declared using @c public + keyword. + +Remember that the keywords above are to be used on their own. That is, +for example: @code public testvar @endcode not: +@code new public testvar @endcode + +@subsection Small_Constants_Subsection Constants + +You can declare constants in two ways: +@li Using the preprocessor macro @c \#define. +@li By inserting @c const between the keyword and variable name of a + variable declaration. For example, to declare the variable @c var1 + constant, you type @code new const var1 = 2 @endcode Now @c var1 + cannot be changed. + +@subsection Small_Arrays_Subsection Arrays + +To declare an array, append square brackets to the end of the variable +name. The following examples show how to declare arrays. Note the +use of the ellipsis operator, which bases the array based on the last two +declared values: + +@code +new msg[] = "A message." +new ints[] = {1, 3, 4} +new ints2[20] = {1, 3} // All other elements 0. +new ints3[10] = {1, ... } // All elements = 1 +new ints4[10] = {10, 20, ... } // Elements = 10 -> 100. + // The difference can be negative. +new ints5[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} +@endcode + +@note Array initialisers need to be constant. + +@section Small_Func_Calls_Section Function Calls + +A typical function declaration is as follows: + +@code +testfunc(param) { + // Do something ... + // over a couple of lines. +} +@endcode + +You can pass by reference. That is, the parameter you pass is changed +outside of the function. For example: + +@code +testfunc(¶m) { + param = 10 + // The passed variable will be set to 10 outside of the function. +} +@endcode + +To pass an array: + +@code +testfunc(param[]) { + // Do something to the array +} +@endcode + +@note Arrays are passed by reference. + +@section Small_Control_Subsection Control Structures. + +Small has the following control structures, which similar to their C +counterparts: +@li @code if (expression) statement1 else statement2 @endcode +@li @code switch (expression) { + case 0: + statement1 // Can only be one statement. Look Ma, no breaks! + case 1..3: // For values between 1 and 3 inclusive. + statement2 + default: // Optional + statement3 +} +@endcode +@li @code while(expression) statement @endcode +@li @code do statement while (expression) @endcode +@li @code for (init_expression; before_iter_test_expression; after_iter_expression) statement @endcode + +@section Small_Preprocessor_Section Preprocessor + +The following preprocessor directives are available: +@li @code #assert constant_expression @endcode +@li @code #define pattern replacement @endcode +@li @code #define pattern(%1,%2,...) replacement @endcode +@li @code #include filename @endcode +@li @code #if constant_expression + // Various bits of code +#else + // Other bits of code +#endif +@endcode +@li @code #undef pattern @endcode + + +@page Available_Native_Calls_Page Available Calls + +Embryo provides a minimal set of native calls that can be used within +any Embryo script. Those calls are detailed here. + +@note Some of the "core" functions here are also described in the full + Small documentation given + +@todo Finish this section. + +@section Args_ANC_Section Argument Functions + +@subsection Numargs_Desc numargs + +Returns the number of arguments passed to a function. Useful +when dealing with variable argument lists. + +@subsection Getargs_Desc getarg(arg, index=0) + +Retrieves the argument number @c arg. If the argument is an array, +use @c index to specify the index of the array to return. + +@subsection Setargs_Desc setargs(arg, index=0, value) + +Sets the argument number @c arg to the given @c arg. @c index specifies +the index of @c arg to set if @c arg is an array. + +@section String_ANC_Section String Functions + +Functions that work on strings. + +@subsection Atoi_Desc atoi + +Translates an number in string form into an integer. + +@subsection Fnmatch_Desc fnmatch + +Buggered if I know what this does? + +@subsection Strcmp_Desc strcmp + +String comparing function. + + +@section Float_ANC_Section Float Functions + +@subsection Float_Desc float + +@subsection Atof_Desc atof + +@subsection Float_Mul_Desc float_mul + +@subsection Float_Div_Desc float_div + +@subsection Float_Add_Desc float_add + +@subsection Float_Sub_Desc float_sub + +@subsection Fract_Desc fract + +@subsection Round_Desc round + +@subsection Float_Cmp_Desc float_cmp + +@subsection Sqrt_Desc sqrt + +@subsection Pow_Desc pow + +@subsection Log_Desc log + +@subsection Sin_Desc sin + +@subsection Cos_Desc cos + +@subsection Tan_Desc tan + +@subsection Abs_Desc abs + +Returns the absolute value of the given float. + +@section Time_ANC_Section Time Functions + +@subsection Seconds_Desc seconds() + +@subsection Date_Desc date + + +@section Rand_ANC_Section Random Functions + +@subsection Rand_Desc rand() + +Returns a random integer. + +@subsection Randf_Desc randf() + +Returns a random float. + +@file Embryo.h +@brief Embryo virtual machine library. + +This file includes the routines needed for Embryo library interaction. +This is the @e only file you need to include. + +*/ + +// The following definitions are in Embryo.h, but I did not want to +// mess up the formatting of the file + +/** + @def EMBRYO_FUNCTION_NONE + An invalid/non-existent function. +*/ + +/** + @def EMBRYO_FUNCTION_MAIN + Start at program entry point. For use with @ref embryo_program_run. +*/ + +/** + @def EMBRYO_FUNCTION_CONT + Continue from last address. For use with @ref embryo_program_run. +*/ + +/** + @def EMBRYO_PROGRAM_OK + Program was run successfully. +*/ + +/** + @def EMBRYO_PROGRAM_SLEEP + The program's execution was interrupted by a Small @c sleep command. +*/ + +/** + @def EMBRYO_PROGRAM_FAIL + An error in the program caused it to fail. +*/ + #ifndef _EMBRYO_H #define _EMBRYO_H @@ -31,8 +340,21 @@ extern "C" { #endif - /* potentioal error values */ - enum +#define EMBRYO_VERSION_MAJOR 1 +#define EMBRYO_VERSION_MINOR 8 + + typedef struct _Embryo_Version + { + int major; + int minor; + int micro; + int revision; + } Embryo_Version; + + EAPI extern Embryo_Version *embryo_version; + + /* potential error values */ + typedef enum _Embryo_Error { EMBRYO_ERROR_NONE, /* reserve the first 15 error codes for exit codes of the abstract machine */ @@ -60,25 +382,29 @@ extern "C" { EMBRYO_ERROR_INIT_JIT, /** Cannot initialize the JIT */ EMBRYO_ERROR_PARAMS, /** Parameter error */ EMBRYO_ERROR_DOMAIN, /** Domain error, expression result does not fit in range */ - }; + } Embryo_Error; - /* possible function type values that are enumerated */ -#define EMBRYO_FUNCTION_NONE 0x7fffffff /* An invalid/non existant function */ -#define EMBRYO_FUNCTION_MAIN -1 /* Start at program entry point */ -#define EMBRYO_FUNCTION_CONT -2 /* Continue from last address */ - /** An invalid cell reference */ -#define EMBRYO_CELL_NONE 0x7fffffff /* program run return values */ -#define EMBRYO_PROGRAM_OK 1 -#define EMBRYO_PROGRAM_SLEEP 2 -#define EMBRYO_PROGRAM_BUSY 3 -#define EMBRYO_PROGRAM_TOOLONG 4 -#define EMBRYO_PROGRAM_FAIL 0 - + typedef enum _Embryo_Status + { + EMBRYO_PROGRAM_FAIL = 0, + EMBRYO_PROGRAM_OK = 1, + EMBRYO_PROGRAM_SLEEP = 2, + EMBRYO_PROGRAM_BUSY = 3, + EMBRYO_PROGRAM_TOOLONG = 4 + } Embryo_Status; + typedef unsigned int Embryo_UCell; typedef int Embryo_Cell; + /** An invalid cell reference */ +#define EMBRYO_CELL_NONE 0x7fffffff + typedef struct _Embryo_Program Embryo_Program; typedef int Embryo_Function; + /* possible function type values that are enumerated */ +#define EMBRYO_FUNCTION_NONE 0x7fffffff /* An invalid/non existent function */ +#define EMBRYO_FUNCTION_MAIN -1 /* Start at program entry point */ +#define EMBRYO_FUNCTION_CONT -2 /* Continue from last address */ typedef union { @@ -86,47 +412,487 @@ extern "C" { Embryo_Cell c; } Embryo_Float_Cell; +#if defined _MSC_VER || defined __SUNPRO_C /** Float to Embryo_Cell */ -#define EMBRYO_FLOAT_TO_CELL(f) ((Embryo_Float_Cell) f).c +# define EMBRYO_FLOAT_TO_CELL(f) (((Embryo_Float_Cell *)&(f))->c) /** Embryo_Cell to float */ -#define EMBRYO_CELL_TO_FLOAT(c) ((Embryo_Float_Cell) c).f - - EAPI int embryo_init(void); - EAPI int embryo_shutdown(void); - - EAPI Embryo_Program *embryo_program_new(void *data, int size); - EAPI Embryo_Program *embryo_program_const_new(void *data, int size); - EAPI Embryo_Program *embryo_program_load(char *file); - EAPI void embryo_program_free(Embryo_Program *ep); - EAPI void embryo_program_native_call_add(Embryo_Program *ep, const char *name, Embryo_Cell (*func) (Embryo_Program *ep, Embryo_Cell *params)); - EAPI void embryo_program_vm_reset(Embryo_Program *ep); - EAPI void embryo_program_vm_push(Embryo_Program *ep); - EAPI void embryo_program_vm_pop(Embryo_Program *ep); - EAPI void embryo_swap_16(unsigned short *v); - EAPI void embryo_swap_32(unsigned int *v); - EAPI Embryo_Function embryo_program_function_find(Embryo_Program *ep, const char *name); - EAPI Embryo_Cell embryo_program_variable_find(Embryo_Program *ep, const char *name); - EAPI int embryo_program_variable_count_get(Embryo_Program *ep); - EAPI Embryo_Cell embryo_program_variable_get(Embryo_Program *ep, int num); - EAPI void embryo_program_error_set(Embryo_Program *ep, int error); - EAPI int embryo_program_error_get(Embryo_Program *ep); - EAPI void embryo_program_data_set(Embryo_Program *ep, void *data); - EAPI void *embryo_program_data_get(Embryo_Program *ep); - EAPI const char *embryo_error_string_get(int error); - EAPI int embryo_data_string_length_get(Embryo_Program *ep, Embryo_Cell *str_cell); - EAPI void embryo_data_string_get(Embryo_Program *ep, Embryo_Cell *str_cell, char *dst); - EAPI void embryo_data_string_set(Embryo_Program *ep, const char *src, Embryo_Cell *str_cell); - EAPI Embryo_Cell *embryo_data_address_get(Embryo_Program *ep, Embryo_Cell addr); - EAPI Embryo_Cell embryo_data_heap_push(Embryo_Program *ep, int cells); - EAPI void embryo_data_heap_pop(Embryo_Program *ep, Embryo_Cell down_to); - EAPI int embryo_program_recursion_get(Embryo_Program *ep); - EAPI int embryo_program_run(Embryo_Program *ep, Embryo_Function func); - EAPI Embryo_Cell embryo_program_return_value_get(Embryo_Program *ep); - EAPI void embryo_program_max_cycle_run_set(Embryo_Program *ep, int max); - EAPI int embryo_program_max_cycle_run_get(Embryo_Program *ep); - EAPI int embryo_parameter_cell_push(Embryo_Program *ep, Embryo_Cell cell); - EAPI int embryo_parameter_string_push(Embryo_Program *ep, const char *str); - EAPI int embryo_parameter_cell_array_push(Embryo_Program *ep, Embryo_Cell *cells, int num); +# define EMBRYO_CELL_TO_FLOAT(c) (((Embryo_Float_Cell *)&(c))->f) +#else +/** Float to Embryo_Cell */ +# define EMBRYO_FLOAT_TO_CELL(f) ((Embryo_Float_Cell) f).c +/** Embryo_Cell to float */ +# define EMBRYO_CELL_TO_FLOAT(c) ((Embryo_Float_Cell) c).f +#endif + + /** + * @defgroup Embryo_Library_Group Library Maintenance Functions + * + * Functions that start up and shutdown the Embryo library. + */ + + +/** + * Initialises the Embryo library. + * @return The number of times the library has been initialised without being + * shut down. + * @ingroup Embryo_Library_Group + */ +EAPI int embryo_init(void); + +/** + * Shuts down the Embryo library. + * @return The number of times the library has been initialised without being + * shutdown. + * @ingroup Embryo_Library_Group + */ +EAPI int embryo_shutdown(void); + + /** + * @defgroup Embryo_Program_Creation_Group Program Creation and Destruction Functions + * + * Functions that set up programs, and destroy them. + */ + +/** + * Creates a new Embryo program, with bytecode data that can be freed. + * @param data Pointer to the bytecode of the program. + * @param size Number of bytes of bytecode. + * @return A new Embryo program. + * @ingroup Embryo_Program_Creation_Group + */ +EAPI Embryo_Program *embryo_program_new(void *data, int size); + +/** + * Creates a new Embryo program, with bytecode data that cannot be + * freed. + * @param data Pointer to the bytecode of the program. + * @param size Number of bytes of bytecode. + * @return A new Embryo program. + * @ingroup Embryo_Program_Creation_Group + */ +EAPI Embryo_Program *embryo_program_const_new(void *data, int size); + +/** + * Creates a new Embryo program based on the bytecode data stored in the + * given file. + * @param file Filename of the given file. + * @return A new Embryo program. + * @ingroup Embryo_Program_Creation_Group + */ +EAPI Embryo_Program *embryo_program_load(const char *file); + +/** + * Frees the given Embryo program. + * @param ep The given program. + * @ingroup Embryo_Program_Creation_Group + */ +EAPI void embryo_program_free(Embryo_Program *ep); + +/** + * Adds a native program call to the given Embryo program. + * @param ep The given Embryo program. + * @param name The name for the call used in the script. + * @param func The function to use when the call is made. + * @ingroup Embryo_Func_Group + */ + +/** + * @defgroup Embryo_Func_Group Function Functions + * + * Functions that deal with Embryo program functions. + */ +EAPI void embryo_program_native_call_add(Embryo_Program *ep, const char *name, Embryo_Cell (*func) (Embryo_Program *ep, Embryo_Cell *params)); + +/** + * Resets the current virtual machine session of the given program. + * @param ep The given program. + * @ingroup Embryo_Program_VM_Group + */ + +/** + * @defgroup Embryo_Program_VM_Group Virtual Machine Functions + * + * Functions that deal with creating and destroying virtual machine sessions + * for a given program. + * + * A given embryo program can have multiple virtual machine sessions running. + * This is useful when you have a native call that in turn calls a function in + * the embryo program. The native call can start a new virtual machine + * session to run the function it needs. Once completed, the session can be + * popped off the program's stack, and the native call can return its value + * to the old session. + * + * A new virtual machine session is created by pushing a new virtual machine + * onto the session stack of a program using @ref embryo_program_vm_push. + * The current virtual machine session can be destroyed by calling + * @ref embryo_program_vm_pop. + */ +EAPI void embryo_program_vm_reset(Embryo_Program *ep); + +/** + * Starts a new virtual machine session for the given program. + * + * See @ref Embryo_Program_VM_Group for more information about how this works. + * + * @param ep The given program. + * @ingroup Embryo_Program_VM_Group + */ +EAPI void embryo_program_vm_push(Embryo_Program *ep); + +/** + * Frees the current virtual machine session associated with the given program. + * + * See @ref Embryo_Program_VM_Group for more information about how this works. + * Note that you will need to retrieve any return data or data on the stack + * before you pop. + * + * @param ep The given program. + * @ingroup Embryo_Program_VM_Group + */ +EAPI void embryo_program_vm_pop(Embryo_Program *ep); + +/** + * Ensures that the given unsigned short integer is in the small + * endian format. + * @param v Pointer to the given integer. + * @ingroup Embryo_Swap_Group + */ + +/** + * @defgroup Embryo_Swap_Group Byte Swapping Functions + * + * Functions that are used to ensure that integers passed to the + * virtual machine are in small endian format. These functions are + * used to ensure that the virtual machine operates correctly on big + * endian machines. + */ +EAPI void embryo_swap_16(unsigned short *v); + +/** + * Ensures that the given unsigned integer is in the small endian + * format. + * @param v Pointer to the given integer. + * @ingroup Embryo_Swap_Group + */ +EAPI void embryo_swap_32(unsigned int *v); + +/** + * Returns the function in the given program with the given name. + * @param ep The given program. + * @param name The given function name. + * @return The function if successful. Otherwise, @c EMBRYO_FUNCTION_NONE. + * @ingroup Embryo_Func_Group + */ +EAPI Embryo_Function embryo_program_function_find(Embryo_Program *ep, const char *name); + +/** + * Retrieves the location of the public variable in the given program + * with the given name. + * @param ep The given program. + * @param name The given name. + * @return The address of the variable if found. @c EMBRYO_CELL_NONE + * otherwise. + * @ingroup Embryo_Public_Variable_Group + */ + +/** + * @defgroup Embryo_Public_Variable_Group Public Variable Access Functions + * + * In an Embryo program, a global variable can be declared public, as + * described in @ref Small_Scope_Subsection. The functions here allow + * the host program to access these public variables. + */ +EAPI Embryo_Cell embryo_program_variable_find(Embryo_Program *ep, const char *name); + +/** + * Retrieves the number of public variables in the given program. + * @param ep The given program. + * @return The number of public variables. + * @ingroup Embryo_Public_Variable_Group + */ +EAPI int embryo_program_variable_count_get(Embryo_Program *ep); + +/** + * Retrieves the location of the public variable in the given program + * with the given identifier. + * @param ep The given program. + * @param num The identifier of the public variable. + * @return The virtual machine address of the variable if found. + * @c EMBRYO_CELL_NONE otherwise. + * @ingroup Embryo_Public_Variable_Group + */ +EAPI Embryo_Cell embryo_program_variable_get(Embryo_Program *ep, int num); + +/** + * Sets the error code for the given program to the given code. + * @param ep The given program. + * @param error The given error code. + * @ingroup Embryo_Error_Group + */ + +/** + * @defgroup Embryo_Error_Group Error Functions + * + * Functions that set and retrieve error codes in Embryo programs. + */ +EAPI void embryo_program_error_set(Embryo_Program *ep, Embryo_Error error); + +/** + * Retrieves the current error code for the given program. + * @param ep The given program. + * @return The current error code. + * @ingroup Embryo_Error_Group + */ +EAPI Embryo_Error embryo_program_error_get(Embryo_Program *ep); + +/** + * Sets the data associated to the given program. + * @param ep The given program. + * @param data New bytecode data. + * @ingroup Embryo_Program_Data_Group + */ + +/** + * @defgroup Embryo_Program_Data_Group Program Data Functions + * + * Functions that set and retrieve data associated with the given + * program. + */ +EAPI void embryo_program_data_set(Embryo_Program *ep, void *data); + +/** + * Retrieves the data associated to the given program. + * @param ep The given program. + * @ingroup Embryo_Program_Data_Group + */ +EAPI void *embryo_program_data_get(Embryo_Program *ep); + +/** + * Retrieves a string describing the given error code. + * @param error The given error code. + * @return String describing the given error code. If the given code is not + * known, the string "(unknown)" is returned. + * @ingroup Embryo_Error_Group + */ +EAPI const char *embryo_error_string_get(Embryo_Error error); + +/** + * Retrieves the length of the string starting at the given cell. + * @param ep The program the cell is part of. + * @param str_cell Pointer to the first cell of the string. + * @return The length of the string. @c 0 is returned if there is an error. + * @ingroup Embryo_Data_String_Group + */ + +/** + * @defgroup Embryo_Data_String_Group Embryo Data String Functions + * + * Functions that operate on strings in the memory of a virtual machine. + */ +EAPI int embryo_data_string_length_get(Embryo_Program *ep, Embryo_Cell *str_cell); + +/** + * Copies the string starting at the given cell to the given buffer. + * @param ep The program the cell is part of. + * @param str_cell Pointer to the first cell of the string. + * @param dst The given buffer. + * @ingroup Embryo_Data_String_Group + */ +EAPI void embryo_data_string_get(Embryo_Program *ep, Embryo_Cell *str_cell, char *dst); + +/** + * Copies string in the given buffer into the virtual machine memory + * starting at the given cell. + * @param ep The program the cell is part of. + * @param src The given buffer. + * @param str_cell Pointer to the first cell to copy the string to. + * @ingroup Embryo_Data_String_Group + */ +EAPI void embryo_data_string_set(Embryo_Program *ep, const char *src, Embryo_Cell *str_cell); + +/** + * Retreives a pointer to the address in the virtual machine given by the + * given cell. + * @param ep The program whose virtual machine address is being queried. + * @param addr The given cell. + * @return A pointer to the cell at the given address. + * @ingroup Embryo_Data_String_Group + */ +EAPI Embryo_Cell *embryo_data_address_get(Embryo_Program *ep, Embryo_Cell addr); + +/** + * Increases the size of the heap of the given virtual machine by the given + * number of Embryo_Cells. + * @param ep The program with the given virtual machine. + * @param cells The given number of Embryo_Cells. + * @return The address of the new memory region on success. + * @c EMBRYO_CELL_NONE otherwise. + * @ingroup Embryo_Heap_Group + */ + +/** + * @defgroup Embryo_Heap_Group Heap Functions + * + * The heap is an area of memory that can be allocated for program + * use at runtime. The heap functions here change the amount of heap + * memory available. + */ +EAPI Embryo_Cell embryo_data_heap_push(Embryo_Program *ep, int cells); + +/** + * Decreases the size of the heap of the given virtual machine down to the + * given size. + * @param ep The program with the given virtual machine. + * @param down_to The given size. + * @ingroup Embryo_Heap_Group + */ +EAPI void embryo_data_heap_pop(Embryo_Program *ep, Embryo_Cell down_to); + +/** + * Returns the number of virtual machines are running for the given program. + * @param ep The given program. + * @return The number of virtual machines running. + * @ingroup Embryo_Run_Group + */ + +/** + * @defgroup Embryo_Run_Group Program Run Functions + * + * Functions that are involved in actually running functions in an + * Embryo program. + */ +EAPI int embryo_program_recursion_get(Embryo_Program *ep); + +/** + * Runs the given function of the given Embryo program in the current + * virtual machine. The parameter @p fn can be found using + * @ref embryo_program_function_find. + * + * @note For Embryo to be able to run a function, it must have been + * declared @c public in the Small source code. + * + * @param ep The given program. + * @param func The given function. Normally "main", in which case the + * constant @c EMBRYO_FUNCTION_MAIN can be used. + * @return @c EMBRYO_PROGRAM_OK on success. @c EMBRYO_PROGRAM_SLEEP if the + * program is halted by the Small @c sleep call. + * @c EMBRYO_PROGRAM_FAIL if there is an error. + * @c EMBRYO_PROGRAM_TOOLONG if the program executes for longer than + * it is allowed to in abstract machine instruction count. + * @ingroup Embryo_Run_Group + */ +EAPI Embryo_Status embryo_program_run(Embryo_Program *ep, Embryo_Function func); + +/** + * Retreives the return value of the last called function of the given + * program. + * @param ep The given program. + * @return An Embryo_Cell representing the return value of the function + * that was last called. + * @ingroup Embryo_Run_Group + */ +EAPI Embryo_Cell embryo_program_return_value_get(Embryo_Program *ep); + +/** + * Sets the maximum number of abstract machine cycles any given program run + * can execute before being put to sleep and returning. + * + * @param ep The given program. + * @param max The number of machine cycles as a limit. + * + * This sets the maximum number of abstract machine (virtual machine) + * instructions that a single run of an embryo function (even if its main) + * can use before embryo embryo_program_run() reutrns with the value + * EMBRYO_PROGRAM_TOOLONG. If the function fully executes within this number + * of cycles, embryo_program_run() will return as normal with either + * EMBRYO_PROGRAM_OK, EMBRYO_PROGRAM_FAIL or EMBRYO_PROGRAM_SLEEP. If the + * run exceeds this instruction count, then EMBRYO_PROGRAM_TOOLONG will be + * returned indicating the program exceeded its run count. If the app wishes + * to continue running this anyway - it is free to process its own events or + * whatever it wants and continue the function by calling + * embryo_program_run(program, EMBRYO_FUNCTION_CONT); which will start the + * run again until the instruction count is reached. This can keep being done + * to allow the calling program to still be able to control things outside the + * embryo function being called. If the maximum run cycle count is 0 then the + * program is allowed to run forever only returning when it is done. + * + * It is important to note that abstract machine cycles are NOT the same as + * the host machine cpu cycles. They are not fixed in runtime per cycle, so + * this is more of a helper tool than a way to HARD-FORCE a script to only + * run for a specific period of time. If the cycle count is set to something + * low like 5000 or 1000, then every 1000 (or 5000) cycles control will be + * returned to the calling process where it can check a timer to see if a + * physical runtime limit has been elapsed and then abort running further + * assuming a "runaway script" or keep continuing the script run. This + * limits resolution to only that many cycles which do not take a determined + * amount of time to execute, as this varies from cpu to cpu and also depends + * on how loaded the system is. Making the max cycle run too low will + * impact performance requiring the abstract machine to do setup and teardown + * cycles too often comapred to cycles actually executed. + * + * Also note it does NOT include nested abstract machines. IF this abstract + * machine run calls embryo script that calls a native function that in turn + * calls more embryo script, then the 2nd (and so on) levels are not included + * in this run count. They can set their own max instruction count values + * separately. + * + * The default max cycle run value is 0 in any program until set with this + * function. + * + * @ingroup Embryo_Run_Group + */ +EAPI void embryo_program_max_cycle_run_set(Embryo_Program *ep, int max); + +/** + * Retreives the maximum number of abstract machine cycles a program is allowed + * to run. + * @param ep The given program. + * @return The number of cycles a run cycle is allowed to run for this + * program. + * + * This returns the value set by embryo_program_max_cycle_run_set(). See + * embryo_program_max_cycle_run_set() for more information. + * + * @ingroup Embryo_Run_Group + */ +EAPI int embryo_program_max_cycle_run_get(Embryo_Program *ep); + +/** + * Pushes an Embryo_Cell onto the function stack to use as a parameter for + * the next function that is called in the given program. + * @param ep The given program. + * @param cell The Embryo_Cell to push onto the stack. + * @return @c 1 if successful. @c 0 otherwise. + * @ingroup Embryo_Parameter_Group + */ + +/** + * @defgroup Embryo_Parameter_Group Function Parameter Functions + * + * Functions that set parameters for the next function that is called. + */ +EAPI int embryo_parameter_cell_push(Embryo_Program *ep, Embryo_Cell cell); + +/** + * Pushes a string onto the function stack to use as a parameter for the + * next function that is called in the given program. + * @param ep The given program. + * @param str The string to push onto the stack. + * @return @c 1 if successful. @c 0 otherwise. + * @ingroup Embryo_Parameter_Group + */ +EAPI int embryo_parameter_string_push(Embryo_Program *ep, const char *str); + +/** + * Pushes an array of Embryo_Cells onto the function stack to be used as + * parameters for the next function that is called in the given program. + * @param ep The given program. + * @param cells The array of Embryo_Cells. + * @param num The number of cells in @p cells. + * @return @c 1 if successful. @c 0 otherwise. + * @ingroup Embryo_Parameter_Group + */ +EAPI int embryo_parameter_cell_array_push(Embryo_Program *ep, Embryo_Cell *cells, int num); #ifdef __cplusplus } diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 9b94e2c..d2ccb55 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -9,9 +9,14 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib/include \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ --DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" +-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ +@EVIL_CFLAGS@ \ +@EXOTIC_CFLAGS@ \ +@EMBRYO_CPPFLAGS@ \ +@EFL_EMBRYO_BUILD@ -include_HEADERS = Embryo.h +includes_HEADERS = Embryo.h +includesdir = $(includedir)/embryo-@VMAJ@ lib_LTLIBRARIES = libembryo.la @@ -24,9 +29,8 @@ embryo_rand.c \ embryo_str.c \ embryo_time.c -libembryo_la_CFLAGS = @WIN32_CFLAGS@ -libembryo_la_LIBADD = -lm @fnmatch_libs@ -libembryo_la_DEPENDENCIES = $(top_builddir)/config.h -libembryo_la_LDFLAGS = @lt_no_undefined@ @lt_enable_auto_import@ -version-info @version_info@ +libembryo_la_CFLAGS = @EMBRYO_CFLAGS@ +libembryo_la_LIBADD = @EXOTIC_LIBS@ @EVIL_LIBS@ -lm +libembryo_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ EXTRA_DIST = embryo_private.h diff --git a/src/lib/embryo_amx.c b/src/lib/embryo_amx.c index 8b4325c..55423b4 100644 --- a/src/lib/embryo_amx.c +++ b/src/lib/embryo_amx.c @@ -1,7 +1,7 @@ /* Abstract Machine for the Small compiler * * Copyright (c) ITB CompuPhase, 1997-2003 - * Portions Copyright (c) Carsten Haitzler, 2004 + * Portions Copyright (c) Carsten Haitzler, 2004-2010 * * This software is provided "as-is", without any express or implied warranty. * In no event will the authors be held liable for any damages arising from @@ -20,21 +20,32 @@ * 3. This notice may not be removed or altered from any source distribution. */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include + +#ifdef HAVE_EXOTIC +# include +#endif + +#include "Embryo.h" #include "embryo_private.h" + #define JUMPABS(base, ip) ((Embryo_Cell *)(code + (*ip))) #ifdef WORDS_BIGENDIAN static void _embryo_byte_swap_16 (unsigned short *v); static void _embryo_byte_swap_32 (unsigned int *v); #endif -static int _embryo_native_call (Embryo_Program *ep, Embryo_Cell index, Embryo_Cell *result, Embryo_Cell *params); -static int _embryo_func_get (Embryo_Program *ep, int index, char *funcname); -static int _embryo_var_get (Embryo_Program *ep, int index, char *varname, Embryo_Cell *ep_addr); +static int _embryo_native_call (Embryo_Program *ep, Embryo_Cell idx, Embryo_Cell *result, Embryo_Cell *params); +static int _embryo_func_get (Embryo_Program *ep, int idx, char *funcname); +static int _embryo_var_get (Embryo_Program *ep, int idx, char *varname, Embryo_Cell *ep_addr); static int _embryo_program_init (Embryo_Program *ep, void *code); #ifdef WORDS_BIGENDIAN @@ -59,14 +70,14 @@ _embryo_byte_swap_32(unsigned int *v) #endif static int -_embryo_native_call(Embryo_Program *ep, Embryo_Cell index, Embryo_Cell *result, Embryo_Cell *params) +_embryo_native_call(Embryo_Program *ep, Embryo_Cell idx, Embryo_Cell *result, Embryo_Cell *params) { Embryo_Header *hdr; Embryo_Func_Stub *func_entry; Embryo_Native f; hdr = (Embryo_Header *)ep->base; - func_entry = GETENTRY(hdr, natives, index); + func_entry = GETENTRY(hdr, natives, idx); if ((func_entry->address <= 0) || (func_entry->address > ep->native_calls_size)) { @@ -85,32 +96,32 @@ _embryo_native_call(Embryo_Program *ep, Embryo_Cell index, Embryo_Cell *result, } static int -_embryo_func_get(Embryo_Program *ep, int index, char *funcname) +_embryo_func_get(Embryo_Program *ep, int idx, char *funcname) { Embryo_Header *hdr; Embryo_Func_Stub *func; hdr = (Embryo_Header *)ep->code; - if (index >= (Embryo_Cell)NUMENTRIES(hdr, publics, natives)) + if (idx >= (Embryo_Cell)NUMENTRIES(hdr, publics, natives)) return EMBRYO_ERROR_INDEX; - func = GETENTRY(hdr, publics, index); + func = GETENTRY(hdr, publics, idx); strcpy(funcname, GETENTRYNAME(hdr, func)); return EMBRYO_ERROR_NONE; } static int -_embryo_var_get(Embryo_Program *ep, int index, char *varname, Embryo_Cell *ep_addr) +_embryo_var_get(Embryo_Program *ep, int idx, char *varname, Embryo_Cell *ep_addr) { Embryo_Header *hdr; Embryo_Func_Stub *var; hdr=(Embryo_Header *)ep->base; - if (index >= (Embryo_Cell)NUMENTRIES(hdr, pubvars, tags)) + if (idx >= (Embryo_Cell)NUMENTRIES(hdr, pubvars, tags)) return EMBRYO_ERROR_INDEX; - var = GETENTRY(hdr, pubvars, index); + var = GETENTRY(hdr, pubvars, idx); strcpy(varname, GETENTRYNAME(hdr, var)); *ep_addr = var->address; return EMBRYO_ERROR_NONE; @@ -195,12 +206,13 @@ _embryo_program_init(Embryo_Program *ep, void *code) ep->flags = EMBRYO_FLAG_RELOC; { - Embryo_Cell cip, code_size; + Embryo_Cell cip, code_size, cip_end; Embryo_Cell *code; code_size = hdr->dat - hdr->cod; code = (Embryo_Cell *)((unsigned char *)ep->code + (int)hdr->cod); - for (cip = 0; cip < (code_size / sizeof(Embryo_Cell)); cip++) + cip_end = code_size / sizeof(Embryo_Cell); + for (cip = 0; cip < cip_end; cip++) { /* move this here - later we probably want something that verifies opcodes * are valid and ok... @@ -222,19 +234,6 @@ _embryo_program_init(Embryo_Program *ep, void *code) /*** EXPORTED CALLS ***/ -/** - * @defgroup Embryo_Program_Creation_Group Program Creation and Destruction Functions - * - * Functions that set up programs, and destroy them. - */ - -/** - * Creates a new Embryo program, with bytecode data that can be freed. - * @param data Pointer to the bytecode of the program. - * @param size Number of bytes of bytecode. - * @return A new Embryo program. - * @ingroup Embryo_Program_Creation_Group - */ EAPI Embryo_Program * embryo_program_new(void *data, int size) { @@ -259,14 +258,6 @@ embryo_program_new(void *data, int size) return NULL; } -/** - * Creates a new Embryo program, with bytecode data that cannot be - * freed. - * @param data Pointer to the bytecode of the program. - * @param size Number of bytes of bytecode. - * @return A new Embryo program. - * @ingroup Embryo_Program_Creation_Group - */ EAPI Embryo_Program * embryo_program_const_new(void *data, int size) { @@ -286,15 +277,8 @@ embryo_program_const_new(void *data, int size) return NULL; } -/** - * Creates a new Embryo program based on the bytecode data stored in the - * given file. - * @param file Filename of the given file. - * @return A new Embryo program. - * @ingroup Embryo_Program_Creation_Group - */ EAPI Embryo_Program * -embryo_program_load(char *file) +embryo_program_load(const char *file) { Embryo_Program *ep; Embryo_Header hdr; @@ -306,7 +290,7 @@ embryo_program_load(char *file) if (!f) return NULL; fseek(f, 0, SEEK_END); program_size = ftell(f); - rewind(f); + fseek(f, 0L, SEEK_SET); if (program_size < (int)sizeof(Embryo_Header)) { fclose(f); @@ -317,7 +301,7 @@ embryo_program_load(char *file) fclose(f); return NULL; } - rewind(f); + fseek(f, 0L, SEEK_SET); #ifdef WORDS_BIGENDIAN embryo_swap_32((unsigned int *)(&hdr.size)); #endif @@ -340,11 +324,6 @@ embryo_program_load(char *file) return ep; } -/** - * Frees the given Embryo program. - * @param ep The given program. - * @ingroup Embryo_Program_Creation_Group - */ EAPI void embryo_program_free(Embryo_Program *ep) { @@ -362,19 +341,7 @@ embryo_program_free(Embryo_Program *ep) free(ep); } -/** - * @defgroup Embryo_Func_Group Function Functions - * - * Functions that deal with Embryo program functions. - */ -/** - * Adds a native program call to the given Embryo program. - * @param ep The given Embryo program. - * @param name The name for the call used in the script. - * @param func The function to use when the call is made. - * @ingroup Embryo_Func_Group - */ EAPI void embryo_program_native_call_add(Embryo_Program *ep, const char *name, Embryo_Cell (*func) (Embryo_Program *ep, Embryo_Cell *params)) { @@ -382,7 +349,7 @@ embryo_program_native_call_add(Embryo_Program *ep, const char *name, Embryo_Cell Embryo_Header *hdr; int i, num; - if ((ep == NULL ) || (name == NULL) || (func == NULL)) return; + if ((!ep ) || (!name) || (!func)) return; if (strlen(name) > sNAMEMAX) return; hdr = (Embryo_Header *)ep->code; @@ -395,13 +362,13 @@ embryo_program_native_call_add(Embryo_Program *ep, const char *name, Embryo_Cell { Embryo_Native *calls; - ep->native_calls_alloc += 16; + ep->native_calls_alloc += 32; calls = realloc(ep->native_calls, ep->native_calls_alloc * sizeof(Embryo_Native)); if (!calls) { ep->native_calls_size--; - ep->native_calls_alloc -= 16; + ep->native_calls_alloc -= 32; return; } ep->native_calls = calls; @@ -430,30 +397,7 @@ embryo_program_native_call_add(Embryo_Program *ep, const char *name, Embryo_Cell } } -/** - * @defgroup Embryo_Program_VM_Group Virtual Machine Functions - * - * Functions that deal with creating and destroying virtual machine sessions - * for a given program. - * - * A given embryo program can have multiple virtual machine sessions running. - * This is useful when you have a native call that in turn calls a function in - * the embryo program. The native call can start a new virtual machine - * session to run the function it needs. Once completed, the session can be - * popped off the program's stack, and the native call can return its value - * to the old session. - * - * A new virtual machine session is created by pushing a new virtual machine - * onto the session stack of a program using @ref embryo_program_vm_push. - * The current virtual machine session can be destroyed by calling - * @ref embryo_program_vm_pop. - */ -/** - * Resets the current virtual machine session of the given program. - * @param ep The given program. - * @ingroup Embryo_Program_VM_Group - */ EAPI void embryo_program_vm_reset(Embryo_Program *ep) { @@ -470,14 +414,6 @@ embryo_program_vm_reset(Embryo_Program *ep) ep->stk = ep->stp; } -/** - * Starts a new virtual machine session for the given program. - * - * See @ref Embryo_Program_VM_Group for more information about how this works. - * - * @param ep The given program. - * @ingroup Embryo_Program_VM_Group - */ EAPI void embryo_program_vm_push(Embryo_Program *ep) { @@ -491,7 +427,7 @@ embryo_program_vm_push(Embryo_Program *ep) return; } hdr = (Embryo_Header *)ep->code; - ep->base = malloc(hdr->stp); + ep->base = calloc(1, hdr->stp); if (!ep->base) { ep->pushes = 0; @@ -500,16 +436,6 @@ embryo_program_vm_push(Embryo_Program *ep) embryo_program_vm_reset(ep); } -/** - * Frees the current virtual machine session associated with the given program. - * - * See @ref Embryo_Program_VM_Group for more information about how this works. - * Note that you will need to retrieve any return data or data on the stack - * before you pop. - * - * @param ep The given program. - * @ingroup Embryo_Program_VM_Group - */ EAPI void embryo_program_vm_pop(Embryo_Program *ep) { @@ -520,50 +446,31 @@ embryo_program_vm_pop(Embryo_Program *ep) ep->base = NULL; } -/** - * @defgroup Embryo_Swap_Group Byte Swapping Functions - * - * Functions that are used to ensure that integers passed to the - * virtual machine are in small endian format. These functions are - * used to ensure that the virtual machine operates correctly on big - * endian machines. - */ -/** - * Ensures that the given unsigned short integer is in the small - * endian format. - * @param v Pointer to the given integer. - * @ingroup Embryo_Swap_Group - */ EAPI void -embryo_swap_16(unsigned short *v) +embryo_swap_16(unsigned short *v +#ifndef WORDS_BIGENDIAN + __UNUSED__ +#endif + ) { #ifdef WORDS_BIGENDIAN _embryo_byte_swap_16(v); #endif } -/** - * Ensures that the given unsigned integer is in the small endian - * format. - * @param v Pointer to the given integer. - * @ingroup Embryo_Swap_Group - */ EAPI void -embryo_swap_32(unsigned int *v) +embryo_swap_32(unsigned int *v +#ifndef WORDS_BIGENDIAN + __UNUSED__ +#endif + ) { #ifdef WORDS_BIGENDIAN _embryo_byte_swap_32(v); #endif } -/** - * Returns the function in the given program with the given name. - * @param ep The given program. - * @param name The given function name. - * @return The function if successful. Otherwise, @c EMBRYO_FUNCTION_NONE. - * @ingroup Embryo_Func_Group - */ EAPI Embryo_Function embryo_program_function_find(Embryo_Program *ep, const char *name) { @@ -591,23 +498,7 @@ embryo_program_function_find(Embryo_Program *ep, const char *name) return EMBRYO_FUNCTION_NONE; } -/** - * @defgroup Embryo_Public_Variable_Group Public Variable Access Functions - * - * In an Embryo program, a global variable can be declared public, as - * described in @ref Small_Scope_Subsection. The functions here allow - * the host program to access these public variables. - */ -/** - * Retrieves the location of the public variable in the given program - * with the given name. - * @param ep The given program. - * @param name The given name. - * @return The address of the variable if found. @c EMBRYO_CELL_NONE - * otherwise. - * @ingroup Embryo_Public_Variable_Group - */ EAPI Embryo_Cell embryo_program_variable_find(Embryo_Program *ep, const char *name) { @@ -637,12 +528,6 @@ embryo_program_variable_find(Embryo_Program *ep, const char *name) return EMBRYO_CELL_NONE; } -/** - * Retrieves the number of public variables in the given program. - * @param ep The given program. - * @return The number of public variables. - * @ingroup Embryo_Public_Variable_Group - */ EAPI int embryo_program_variable_count_get(Embryo_Program *ep) { @@ -654,75 +539,35 @@ embryo_program_variable_count_get(Embryo_Program *ep) return NUMENTRIES(hdr, pubvars, tags); } -/** - * Retrieves the location of the public variable in the given program - * with the given identifier. - * @param ep The given program. - * @param num The identifier of the public variable. - * @return The virtual machine address of the variable if found. - * @c EMBRYO_CELL_NONE otherwise. - * @ingroup Embryo_Public_Variable_Group - */ EAPI Embryo_Cell embryo_program_variable_get(Embryo_Program *ep, int num) { - Embryo_Header *hdr; Embryo_Cell paddr; char pname[sNAMEMAX + 1]; if (!ep) return EMBRYO_CELL_NONE; if (!ep->base) return EMBRYO_CELL_NONE; - hdr = (Embryo_Header *)ep->base; if (_embryo_var_get(ep, num, pname, &paddr) == EMBRYO_ERROR_NONE) return paddr; return EMBRYO_CELL_NONE; } -/** - * @defgroup Embryo_Error_Group Error Functions - * - * Functions that set and retrieve error codes in Embryo programs. - */ -/** - * Sets the error code for the given program to the given code. - * @param ep The given program. - * @param error The given error code. - * @ingroup Embryo_Error_Group - */ EAPI void -embryo_program_error_set(Embryo_Program *ep, int error) +embryo_program_error_set(Embryo_Program *ep, Embryo_Error error) { if (!ep) return; ep->error = error; } -/** - * Retrieves the current error code for the given program. - * @param ep The given program. - * @return The current error code. - * @ingroup Embryo_Error_Group - */ -EAPI int +EAPI Embryo_Error embryo_program_error_get(Embryo_Program *ep) { if (!ep) return EMBRYO_ERROR_NONE; return ep->error; } -/** - * @defgroup Embryo_Program_Data_Group Program Data Functions - * - * Functions that set and retrieve data associated with the given - * program. - */ -/** - * Sets the data associated to the given program. - * @param ep The given program. - * @param data New bytecode data. - * @ingroup Embryo_Program_Data_Group - */ EAPI void embryo_program_data_set(Embryo_Program *ep, void *data) { @@ -730,11 +575,6 @@ embryo_program_data_set(Embryo_Program *ep, void *data) ep->data = data; } -/** - * Retrieves the data associated to the given program. - * @param ep The given program. - * @ingroup Embryo_Program_Data_Group - */ EAPI void * embryo_program_data_get(Embryo_Program *ep) { @@ -742,15 +582,8 @@ embryo_program_data_get(Embryo_Program *ep) return ep->data; } -/** - * Retrieves a string describing the given error code. - * @param error The given error code. - * @return String describing the given error code. If the given code is not - * known, the string "(unknown)" is returned. - * @ingroup Embryo_Error_Group - */ EAPI const char * -embryo_error_string_get(int error) +embryo_error_string_get(Embryo_Error error) { const char *messages[] = { @@ -781,24 +614,13 @@ embryo_error_string_get(int error) /* EMBRYO_ERROR_INIT_JIT */ "Cannot initialize the JIT", /* EMBRYO_ERROR_PARAMS */ "Parameter error", }; - if ((error < 0) || (error >= (int)(sizeof(messages) / sizeof(messages[0])))) + if (((int)error < 0) || + ((int)error >= (int)(sizeof(messages) / sizeof(messages[0])))) return (const char *)"(unknown)"; return messages[error]; } -/** - * @defgroup Embryo_Data_String_Group Embryo Data String Functions - * - * Functions that operate on strings in the memory of a virtual machine. - */ -/** - * Retrieves the length of the string starting at the given cell. - * @param ep The program the cell is part of. - * @param str_cell Pointer to the first cell of the string. - * @return The length of the string. @c 0 is returned if there is an error. - * @ingroup Embryo_Data_String_Group - */ EAPI int embryo_data_string_length_get(Embryo_Program *ep, Embryo_Cell *str_cell) { @@ -815,13 +637,6 @@ embryo_data_string_length_get(Embryo_Program *ep, Embryo_Cell *str_cell) return len; } -/** - * Copies the string starting at the given cell to the given buffer. - * @param ep The program the cell is part of. - * @param str_cell Pointer to the first cell of the string. - * @param dst The given buffer. - * @ingroup Embryo_Data_String_Group - */ EAPI void embryo_data_string_get(Embryo_Program *ep, Embryo_Cell *str_cell, char *dst) { @@ -859,14 +674,6 @@ embryo_data_string_get(Embryo_Program *ep, Embryo_Cell *str_cell, char *dst) dst[i] = 0; } -/** - * Copies string in the given buffer into the virtual machine memory - * starting at the given cell. - * @param ep The program the cell is part of. - * @param src The given buffer. - * @param str_cell Pointer to the first cell to copy the string to. - * @ingroup Embryo_Data_String_Group - */ EAPI void embryo_data_string_set(Embryo_Program *ep, const char *src, Embryo_Cell *str_cell) { @@ -908,14 +715,6 @@ embryo_data_string_set(Embryo_Program *ep, const char *src, Embryo_Cell *str_cel str_cell[i] = 0; } -/** - * Retreives a pointer to the address in the virtual machine given by the - * given cell. - * @param ep The program whose virtual machine address is being queried. - * @param addr The given cell. - * @return A pointer to the cell at the given address. - * @ingroup Embryo_Data_String_Group - */ EAPI Embryo_Cell * embryo_data_address_get(Embryo_Program *ep, Embryo_Cell addr) { @@ -929,33 +728,15 @@ embryo_data_address_get(Embryo_Program *ep, Embryo_Cell addr) return (Embryo_Cell *)(data + (int)addr); } -/** - * @defgroup Embryo_Heap_Group Heap Functions - * - * The heap is an area of memory that can be allocated for program - * use at runtime. The heap functions here change the amount of heap - * memory available. - */ -/** - * Increases the size of the heap of the given virtual machine by the given - * number of Embryo_Cells. - * @param ep The program with the given virtual machine. - * @param cells The given number of Embryo_Cells. - * @return The address of the new memory region on success. - * @c EMBRYO_CELL_NONE otherwise. - * @ingroup Embryo_Heap_Group - */ EAPI Embryo_Cell embryo_data_heap_push(Embryo_Program *ep, int cells) { Embryo_Header *hdr; - unsigned char *data; Embryo_Cell addr; if ((!ep) || (!ep->base)) return EMBRYO_CELL_NONE; hdr = (Embryo_Header *)ep->base; - data = ep->base + (int)hdr->dat; if (ep->stk - ep->hea - (cells * sizeof(Embryo_Cell)) < STKMARGIN) return EMBRYO_CELL_NONE; addr = ep->hea; @@ -963,13 +744,6 @@ embryo_data_heap_push(Embryo_Program *ep, int cells) return addr; } -/** - * Decreases the size of the heap of the given virtual machine down to the - * given size. - * @param ep The program with the given virtual machine. - * @param down_to The given size. - * @ingroup Embryo_Heap_Group - */ EAPI void embryo_data_heap_pop(Embryo_Program *ep, Embryo_Cell down_to) { @@ -978,19 +752,7 @@ embryo_data_heap_pop(Embryo_Program *ep, Embryo_Cell down_to) if (ep->hea > down_to) ep->hea = down_to; } -/** - * @defgroup Embryo_Run_Group Program Run Functions - * - * Functions that are involved in actually running functions in an - * Embryo program. - */ -/** - * Returns the number of virtual machines are running for the given program. - * @param ep The given program. - * @return The number of virtual machines running. - * @ingroup Embryo_Run_Group - */ EAPI int embryo_program_recursion_get(Embryo_Program *ep) { @@ -1016,25 +778,7 @@ embryo_program_recursion_get(Embryo_Program *ep) #define BREAK break #endif -/** - * Runs the given function of the given Embryo program in the current - * virtual machine. The parameter @p fn can be found using - * @ref embryo_program_function_find. - * - * @note For Embryo to be able to run a function, it must have been - * declared @c public in the Small source code. - * - * @param ep The given program. - * @param fn The given function. Normally "main", in which case the - * constant @c EMBRYO_FUNCTION_MAIN can be used. - * @return @c EMBRYO_PROGRAM_OK on success. @c EMBRYO_PROGRAM_SLEEP if the - * program is halted by the Small @c sleep call. - * @c EMBRYO_PROGRAM_FAIL if there is an error. - * @c EMBRYO_PROGRAM_TOOLONG if the program executes for longer than - * it is allowed to in abstract machine instruction count. - * @ingroup Embryo_Run_Group - */ -EAPI int +EAPI Embryo_Status embryo_program_run(Embryo_Program *ep, Embryo_Function fn) { Embryo_Header *hdr; @@ -2055,7 +1799,7 @@ embryo_program_run(Embryo_Program *ep, Embryo_Function fn) entry_name = GETENTRYNAME(hdr, func_entry); if (i == offs) - printf("EMBRYO: CALL [%i] %s() non-existant!\n", i, entry_name); + printf("EMBRYO: CALL [%i] %s() non-existent!\n", i, entry_name); func_entry = (Embryo_Func_Stub *)((unsigned char *)func_entry + hdr->defsize); } @@ -2142,14 +1886,6 @@ embryo_program_run(Embryo_Program *ep, Embryo_Function fn) return EMBRYO_PROGRAM_OK; } -/** - * Retreives the return value of the last called function of the given - * program. - * @param ep The given program. - * @return An Embryo_Cell representing the return value of the function - * that was last called. - * @ingroup Embryo_Run_Group - */ EAPI Embryo_Cell embryo_program_return_value_get(Embryo_Program *ep) { @@ -2157,54 +1893,6 @@ embryo_program_return_value_get(Embryo_Program *ep) return ep->retval; } -/** - * Sets the maximum number of abstract machine cycles any given program run - * can execute before being put to sleep and returning. - * - * @param ep The given program. - * @param max The number of machine cycles as a limit. - * - * This sets the maximum number of abstract machine (virtual machine) - * instructions that a single run of an embryo function (even if its main) - * can use before embryo embryo_program_run() reutrns with the value - * EMBRYO_PROGRAM_TOOLONG. If the function fully executes within this number - * of cycles, embryo_program_run() will return as normal with either - * EMBRYO_PROGRAM_OK, EMBRYO_PROGRAM_FAIL or EMBRYO_PROGRAM_SLEEP. If the - * run exceeds this instruction count, then EMBRYO_PROGRAM_TOOLONG will be - * returned indicating the program exceeded its run count. If the app wishes - * to continue running this anyway - it is free to process its own events or - * whatever it wants and continue the function by calling - * embryo_program_run(program, EMBRYO_FUNCTION_CONT); which will start the - * run again until the instruction count is reached. This can keep being done - * to allow the calling program to still be able to control things outside the - * embryo function being called. If the maximum run cycle count is 0 then the - * program is allowed to run forever only returning when it is done. - * - * It is important to note that abstract machine cycles are NOT the same as - * the host machine cpu cycles. They are not fixed in runtime per cycle, so - * this is more of a helper tool than a way to HARD-FORCE a script to only - * run for a specific period of time. If the cycle count is set to something - * low like 5000 or 1000, then every 1000 (or 5000) cycles control will be - * returned to the calling process where it can check a timer to see if a - * physical runtime limit has been elapsed and then abort runing further - * assuming a "runaway script" or keep continuing the script run. This - * limits resolution to only that many cycles which do not take a determined - * amount of time to execute, as this varies from cpu to cpu and also depends - * on how loaded the system is. Making the max cycle run too low will - * impact performance requiring the abstract machine to do setup and teardown - * cycles too often comapred to cycles actually executed. - * - * Also note it does NOT include nested abstract machines. IF this abstract - * machine run calls embryo script that calls a native function that in turn - * calls more embryo script, then the 2nd (and so on) levels are not included - * in this run count. They can set their own max instruction count values - * separately. - * - * The default max cycle run value is 0 in any program until set with this - * function. - * - * @ingroup Embryo_Run_Group - */ EAPI void embryo_program_max_cycle_run_set(Embryo_Program *ep, int max) { @@ -2213,18 +1901,6 @@ embryo_program_max_cycle_run_set(Embryo_Program *ep, int max) ep->max_run_cycles = max; } -/** - * Retreives the maximum number of abstract machine cycles a program is allowed - * to run. - * @param ep The given program. - * @return The number of cycles a run cycle is allowed to run for this - * program. - * - * This returns the value set by embryo_program_max_cycle_run_set(). See - * embryo_program_max_cycle_run_set() for more information. - * - * @ingroup Embryo_Run_Group - */ EAPI int embryo_program_max_cycle_run_get(Embryo_Program *ep) { @@ -2232,20 +1908,7 @@ embryo_program_max_cycle_run_get(Embryo_Program *ep) return ep->max_run_cycles; } -/** - * @defgroup Embryo_Parameter_Group Function Parameter Functions - * - * Functions that set parameters for the next function that is called. - */ -/** - * Pushes an Embryo_Cell onto the function stack to use as a parameter for - * the next function that is called in the given program. - * @param ep The given program. - * @param cell The Embryo_Cell to push onto the stack. - * @return @c 1 if successful. @c 0 otherwise. - * @ingroup Embryo_Parameter_Group - */ EAPI int embryo_parameter_cell_push(Embryo_Program *ep, Embryo_Cell cell) { @@ -2268,14 +1931,6 @@ embryo_parameter_cell_push(Embryo_Program *ep, Embryo_Cell cell) return 1; } -/** - * Pushes a string onto the function stack to use as a parameter for the - * next function that is called in the given program. - * @param ep The given program. - * @param str The string to push onto the stack. - * @return @c 1 if successful. @c 0 otherwise. - * @ingroup Embryo_Parameter_Group - */ EAPI int embryo_parameter_string_push(Embryo_Program *ep, const char *str) { @@ -2307,24 +1962,15 @@ embryo_parameter_string_push(Embryo_Program *ep, const char *str) return 1; } -/** - * Pushes an array of Embryo_Cells onto the function stack to be used as - * parameters for the next function that is called in the given program. - * @param ep The given program. - * @param cells The array of Embryo_Cells. - * @param num The number of cells in @p cells. - * @return @c 1 if successful. @c 0 otherwise. - * @ingroup Embryo_Parameter_Group - */ EAPI int embryo_parameter_cell_array_push(Embryo_Program *ep, Embryo_Cell *cells, int num) { Embryo_Param *pr; Embryo_Cell *cell_array; - cell_array = malloc(num * sizeof(Embryo_Cell)); if ((!cells) || (num <= 0)) return embryo_parameter_cell_push(ep, 0); + cell_array = malloc(num * sizeof(Embryo_Cell)); ep->params_size++; if (ep->params_size > ep->params_alloc) { diff --git a/src/lib/embryo_args.c b/src/lib/embryo_args.c index b7456f4..0c0089e 100644 --- a/src/lib/embryo_args.c +++ b/src/lib/embryo_args.c @@ -1,7 +1,25 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ - +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef HAVE_ALLOCA_H +# include +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# include +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +#endif + +#include "Embryo.h" #include "embryo_private.h" #define STRSET(ep, par, str) { \ diff --git a/src/lib/embryo_float.c b/src/lib/embryo_float.c index af241b6..ffaa87d 100644 --- a/src/lib/embryo_float.c +++ b/src/lib/embryo_float.c @@ -36,14 +36,21 @@ * Carsten Haitzler, */ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include #include + +#include "Embryo.h" #include "embryo_private.h" -#define PI 3.1415926535897932384626433832795 +#define PI 3.1415926535897932384626433832795f +#ifndef MAXFLOAT +#define MAXFLOAT 3.40282347e+38f +#endif /* internally useful calls */ @@ -53,9 +60,9 @@ _embryo_fp_degrees_to_radians(float angle, int radix) switch (radix) { case 1: /* degrees, sexagesimal system (technically: degrees/minutes/seconds) */ - return (float)(angle * PI / 180.0); + return (angle * PI / 180.0f); case 2: /* grades, centesimal system */ - return (float)(angle * PI / 200.0); + return (angle * PI / 200.0f); default: /* assume already radian */ break; } @@ -87,7 +94,7 @@ _embryo_fp_str(Embryo_Program *ep, Embryo_Cell *params) if (params[0] != (1 * sizeof(Embryo_Cell))) return 0; str = embryo_data_address_get(ep, params[1]); len = embryo_data_string_length_get(ep, str); - if ((len == 0) || (len >= sizeof(buf))) return 0; + if ((len == 0) || (len >= (int)sizeof(buf))) return 0; embryo_data_string_get(ep, str, buf); f = (float)atof(buf); return EMBRYO_FLOAT_TO_CELL(f); @@ -110,10 +117,21 @@ _embryo_fp_div(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) { /* params[1] = float dividend (top) */ /* params[2] = float divisor (bottom) */ - float f; + float f, ff; if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; - f = EMBRYO_CELL_TO_FLOAT(params[1]) / EMBRYO_CELL_TO_FLOAT(params[2]); + f = EMBRYO_CELL_TO_FLOAT(params[1]); + ff = EMBRYO_CELL_TO_FLOAT(params[2]); + if (ff == 0.0) + { + if (f == 0.0) + return EMBRYO_FLOAT_TO_CELL(0.0f); + else if (f < 0.0) + return EMBRYO_FLOAT_TO_CELL(-MAXFLOAT); + else + return EMBRYO_FLOAT_TO_CELL(MAXFLOAT); + } + f = f / ff; return EMBRYO_FLOAT_TO_CELL(f); } @@ -150,7 +168,7 @@ _embryo_fp_fract(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) if (params[0] != (1 * sizeof(Embryo_Cell))) return 0; f = EMBRYO_CELL_TO_FLOAT(params[1]); - f -= (float)(floor((double)f)); + f -= (floorf(f)); return EMBRYO_FLOAT_TO_CELL(f); } @@ -167,17 +185,17 @@ _embryo_fp_round(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) switch (params[2]) { case 1: /* round downwards (truncate) */ - f = (float)(floor((double)f)); + f = (floorf(f)); break; case 2: /* round upwards */ - f = (float)(ceil((double)f)); + f = (ceilf(f)); break; case 3: /* round towards zero */ - if (f >= 0.0) f = (float)(floor((double)f)); - else f = (float)(ceil((double)f)); + if (f >= 0.0) f = (floorf(f)); + else f = (ceilf(f)); break; default: /* standard, round to nearest */ - f = (float)(floor((double)f + 0.5)); + f = (floorf(f + 0.5)); break; } return (Embryo_Cell)f; @@ -206,7 +224,7 @@ _embryo_fp_sqroot(Embryo_Program *ep, Embryo_Cell *params) if (params[0] != (1 * sizeof(Embryo_Cell))) return 0; f = EMBRYO_CELL_TO_FLOAT(params[1]); - f = (float)sqrt(f); + f = sqrtf(f); if (f < 0) { embryo_program_error_set(ep, EMBRYO_ERROR_DOMAIN); @@ -225,7 +243,7 @@ _embryo_fp_power(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; f = EMBRYO_CELL_TO_FLOAT(params[1]); ff = EMBRYO_CELL_TO_FLOAT(params[2]); - f = (float)pow(f, ff); + f = powf(f, ff); return EMBRYO_FLOAT_TO_CELL(f); } @@ -234,7 +252,7 @@ _embryo_fp_log(Embryo_Program *ep, Embryo_Cell *params) { /* params[1] = float operand 1 (value) */ /* params[2] = float operand 2 (base) */ - float f, ff; + float f, ff, tf; if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; f = EMBRYO_CELL_TO_FLOAT(params[1]); @@ -244,8 +262,14 @@ _embryo_fp_log(Embryo_Program *ep, Embryo_Cell *params) embryo_program_error_set(ep, EMBRYO_ERROR_DOMAIN); return 0; } - if (ff == 10.0) f = (float)log10(f); - else f = (float)(log(f) / log(ff)); + if (ff == 10.0) f = log10f(f); + else if (ff == 2.0) f = log2f(f); + else + { + tf = logf(ff); + if (tf == 0.0) f = 0.0; + else f = (logf(f) / tf); + } return EMBRYO_FLOAT_TO_CELL(f); } @@ -259,7 +283,7 @@ _embryo_fp_sin(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; f = EMBRYO_CELL_TO_FLOAT(params[1]); f = _embryo_fp_degrees_to_radians(f, params[2]); - f = sin(f); + f = sinf(f); return EMBRYO_FLOAT_TO_CELL(f); } @@ -273,7 +297,7 @@ _embryo_fp_cos(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; f = EMBRYO_CELL_TO_FLOAT(params[1]); f = _embryo_fp_degrees_to_radians(f, params[2]); - f = cos(f); + f = cosf(f); return EMBRYO_FLOAT_TO_CELL(f); } @@ -287,7 +311,7 @@ _embryo_fp_tan(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; f = EMBRYO_CELL_TO_FLOAT(params[1]); f = _embryo_fp_degrees_to_radians(f, params[2]); - f = tan(f); + f = tanf(f); return EMBRYO_FLOAT_TO_CELL(f); } @@ -303,6 +327,125 @@ _embryo_fp_abs(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) return EMBRYO_FLOAT_TO_CELL(f); } +static Embryo_Cell +_embryo_fp_asin(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) +{ + /* params[1] = float operand 1 (angle) */ + /* params[2] = float operand 2 (radix) */ + float f; + + if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; + f = EMBRYO_CELL_TO_FLOAT(params[1]); + f = sinf(f); + f = _embryo_fp_degrees_to_radians(f, params[2]); + return EMBRYO_FLOAT_TO_CELL(f); +} + +static Embryo_Cell +_embryo_fp_acos(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) +{ + /* params[1] = float operand 1 (angle) */ + /* params[2] = float operand 2 (radix) */ + float f; + + if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; + f = EMBRYO_CELL_TO_FLOAT(params[1]); + f = cosf(f); + f = _embryo_fp_degrees_to_radians(f, params[2]); + return EMBRYO_FLOAT_TO_CELL(f); +} + +static Embryo_Cell +_embryo_fp_atan(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) +{ + /* params[1] = float operand 1 (angle) */ + /* params[2] = float operand 2 (radix) */ + float f; + + if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; + f = EMBRYO_CELL_TO_FLOAT(params[1]); + f = tanf(f); + f = _embryo_fp_degrees_to_radians(f, params[2]); + return EMBRYO_FLOAT_TO_CELL(f); +} + +static Embryo_Cell +_embryo_fp_atan2(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) +{ + /* params[1] = float operand 1 (y) */ + /* params[2] = float operand 2 (x) */ + /* params[3] = float operand 3 (radix) */ + float f, ff; + + if (params[0] != (3 * sizeof(Embryo_Cell))) return 0; + f = EMBRYO_CELL_TO_FLOAT(params[1]); + ff = EMBRYO_CELL_TO_FLOAT(params[2]); + f = atan2f(f, ff); + f = _embryo_fp_degrees_to_radians(f, params[3]); + return EMBRYO_FLOAT_TO_CELL(f); +} + +static Embryo_Cell +_embryo_fp_log1p(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) +{ + /* params[1] = float operand */ + float f; + + if (params[0] != (1 * sizeof(Embryo_Cell))) return 0; + f = EMBRYO_CELL_TO_FLOAT(params[1]); + f = log1pf(f); + return EMBRYO_FLOAT_TO_CELL(f); +} + +static Embryo_Cell +_embryo_fp_cbrt(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) +{ + /* params[1] = float operand */ + float f; + + if (params[0] != (1 * sizeof(Embryo_Cell))) return 0; + f = EMBRYO_CELL_TO_FLOAT(params[1]); + f = cbrtf(f); + return EMBRYO_FLOAT_TO_CELL(f); +} + +static Embryo_Cell +_embryo_fp_exp(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) +{ + /* params[1] = float operand */ + float f; + + if (params[0] != (1 * sizeof(Embryo_Cell))) return 0; + f = EMBRYO_CELL_TO_FLOAT(params[1]); + f = expf(f); + return EMBRYO_FLOAT_TO_CELL(f); +} + +static Embryo_Cell +_embryo_fp_exp2(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) +{ + /* params[1] = float operand */ + float f; + + if (params[0] != (1 * sizeof(Embryo_Cell))) return 0; + f = EMBRYO_CELL_TO_FLOAT(params[1]); + f = exp2f(f); + return EMBRYO_FLOAT_TO_CELL(f); +} + +static Embryo_Cell +_embryo_fp_hypot(Embryo_Program *ep __UNUSED__, Embryo_Cell *params) +{ + /* params[1] = float operand */ + float f, ff; + + if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; + f = EMBRYO_CELL_TO_FLOAT(params[1]); + ff = EMBRYO_CELL_TO_FLOAT(params[2]); + f = hypotf(f, ff); + return EMBRYO_FLOAT_TO_CELL(f); +} + /* functions used by the rest of embryo */ void @@ -324,4 +467,14 @@ _embryo_fp_init(Embryo_Program *ep) embryo_program_native_call_add(ep, "cos", _embryo_fp_cos); embryo_program_native_call_add(ep, "tan", _embryo_fp_tan); embryo_program_native_call_add(ep, "abs", _embryo_fp_abs); + /* Added in embryo 1.2 */ + embryo_program_native_call_add(ep, "asin", _embryo_fp_asin); + embryo_program_native_call_add(ep, "acos", _embryo_fp_acos); + embryo_program_native_call_add(ep, "atan", _embryo_fp_atan); + embryo_program_native_call_add(ep, "atan2", _embryo_fp_atan2); + embryo_program_native_call_add(ep, "log1p", _embryo_fp_log1p); + embryo_program_native_call_add(ep, "cbrt", _embryo_fp_cbrt); + embryo_program_native_call_add(ep, "exp", _embryo_fp_exp); + embryo_program_native_call_add(ep, "exp2", _embryo_fp_exp2); + embryo_program_native_call_add(ep, "hypot", _embryo_fp_hypot); } diff --git a/src/lib/embryo_main.c b/src/lib/embryo_main.c index 48f5ba8..3c57ec7 100644 --- a/src/lib/embryo_main.c +++ b/src/lib/embryo_main.c @@ -1,48 +1,42 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif -#include "embryo_private.h" +#include +#include #include +#include "Embryo.h" +#include "embryo_private.h" + +static Embryo_Version _version = { VMAJ, VMIN, VMIC, VREV }; +EAPI Embryo_Version *embryo_version = &_version; + static int _embryo_init_count = 0; /*** EXPORTED CALLS ***/ -/** - * @defgroup Embryo_Library_Group Library Maintenance Functions - * - * Functions that start up and shutdown the Embryo library. - */ - -/** - * Initialises the Embryo library. - * @return The number of times the library has been initialised without being - * shut down. - * @ingroup Embryo_Library_Group - */ EAPI int embryo_init(void) { - _embryo_init_count++; - if (_embryo_init_count > 1) return _embryo_init_count; + if (++_embryo_init_count != 1) + return _embryo_init_count; srand(time(NULL)); return _embryo_init_count; } -/** - * Shuts down the Embryo library. - * @return The number of times the library has been initialised without being - * shutdown. - * @ingroup Embryo_Library_Group - */ EAPI int embryo_shutdown(void) { - _embryo_init_count--; - if (_embryo_init_count > 0) return _embryo_init_count; + if (_embryo_init_count <= 0) + { + printf("%s:%i Init count not greater than 0 in shutdown.", __FUNCTION__, __LINE__); + return 0; + } + if (--_embryo_init_count != 0) + return _embryo_init_count; return _embryo_init_count; } diff --git a/src/lib/embryo_private.h b/src/lib/embryo_private.h index 0a0511c..a4205e1 100644 --- a/src/lib/embryo_private.h +++ b/src/lib/embryo_private.h @@ -1,36 +1,6 @@ #ifndef _EMBRYO_PRIVATE_H #define _EMBRYO_PRIVATE_H -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#ifdef HAVE_ALLOCA_H -# include -#elif defined __GNUC__ -# define alloca __builtin_alloca -#elif defined _AIX -# define alloca __alloca -#elif defined _MSC_VER -# include -# define alloca _alloca -#else -# include -# ifdef __cplusplus -extern "C" -# endif -void *alloca (size_t); -#endif - -#include "Embryo.h" #ifdef __GNUC__ # if __GNUC__ >= 4 @@ -39,12 +9,6 @@ void *alloca (size_t); # endif #endif -#if HAVE___ATTRIBUTE__ -#define __UNUSED__ __attribute__((unused)) -#else -#define __UNUSED__ -#endif - typedef enum _Embryo_Opcode Embryo_Opcode; enum _Embryo_Opcode @@ -285,11 +249,20 @@ struct _Embryo_Program void *data; }; +#if defined (_MSC_VER) || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100) +# pragma pack(1) +# define EMBRYO_STRUCT_PACKED +#elif defined (__GNUC__) || (defined (__SUNPRO_C) && __SUNPRO_C >= 0x5100) +# define EMBRYO_STRUCT_PACKED __attribute__((packed)) +#else +# define EMBRYO_STRUCT_PACKED +#endif + struct _Embryo_Func_Stub { int address; char name[sEXPMAX+1]; -} __attribute__((packed)); +} EMBRYO_STRUCT_PACKED; struct _Embryo_Header { @@ -310,7 +283,11 @@ struct _Embryo_Header int pubvars; /* the "public variables" table */ int tags; /* the "public tagnames" table */ int nametable; /* name table, file version 7 only */ -} __attribute__((packed)); +} EMBRYO_STRUCT_PACKED; + +#if defined _MSC_VER || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100) +# pragma pack() +#endif void _embryo_args_init(Embryo_Program *ep); void _embryo_fp_init(Embryo_Program *ep); diff --git a/src/lib/embryo_rand.c b/src/lib/embryo_rand.c index 16025b7..627f7ed 100644 --- a/src/lib/embryo_rand.c +++ b/src/lib/embryo_rand.c @@ -1,7 +1,10 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#include + +#include "Embryo.h" #include "embryo_private.h" /* exported random number api */ diff --git a/src/lib/embryo_str.c b/src/lib/embryo_str.c index 2ed03c7..0c2faa2 100644 --- a/src/lib/embryo_str.c +++ b/src/lib/embryo_str.c @@ -1,9 +1,44 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_ALLOCA_H +# include +#elif !defined alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _AIX +# define alloca __alloca +# elif defined _MSC_VER +# include +# define alloca _alloca +# elif !defined HAVE_ALLOCA +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +#ifdef HAVE_EXOTIC +# include +#endif + +#include +#include +#include +#include +#include "Embryo.h" #include "embryo_private.h" -#include #define STRGET(ep, str, par) { \ Embryo_Cell *___cptr; \ @@ -254,7 +289,7 @@ _embryo_str_snprintf(Embryo_Program *ep, Embryo_Cell *params) /* params[2] = bufsize */ /* params[3] = format_string */ /* params[4] = first arg ... */ - if (params[0] < (3 * sizeof(Embryo_Cell))) return 0; + if (params[0] < (Embryo_Cell)(3 * sizeof(Embryo_Cell))) return 0; if (params[2] <= 0) return 0; STRGET(ep, s1, params[3]); if (!s1) return -1; @@ -403,7 +438,7 @@ _embryo_str_strstr(Embryo_Program *ep, Embryo_Cell *params) STRGET(ep, s2, params[2]); if ((!s1) || (!s2)) return -1; p = strstr(s1, s2); - if (p == NULL) return -1; + if (!p) return -1; return (Embryo_Cell)(p - s1); } @@ -417,8 +452,9 @@ _embryo_str_strchr(Embryo_Program *ep, Embryo_Cell *params) if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; STRGET(ep, s1, params[1]); STRGET(ep, s2, params[2]); + if ((!s1) || (!s2)) return -1; p = strchr(s1, s2[0]); - if (p == NULL) return -1; + if (!p) return -1; return (Embryo_Cell)(p - s1); } @@ -432,8 +468,9 @@ _embryo_str_strrchr(Embryo_Program *ep, Embryo_Cell *params) if (params[0] != (2 * sizeof(Embryo_Cell))) return 0; STRGET(ep, s1, params[1]); STRGET(ep, s2, params[2]); + if ((!s1) || (!s2)) return -1; p = strrchr(s1, s2[0]); - if (p == NULL) return -1; + if (!p) return -1; return (Embryo_Cell)(p - s1); } diff --git a/src/lib/embryo_time.c b/src/lib/embryo_time.c index a05441e..90c14cf 100644 --- a/src/lib/embryo_time.c +++ b/src/lib/embryo_time.c @@ -1,15 +1,29 @@ -/* - * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 - */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifndef EFL_HAVE_GETTIMEOFDAY +# error "Your platform isn't supported yet" +#endif -#include "embryo_private.h" #include #include -#ifndef HAVE_GETTIMEOFDAY -# error "Your platform isn't supported yet" +#ifdef _MSC_VER +# include #endif +#ifdef HAVE_EVIL +# include +#endif + +#ifdef HAVE_EXOTIC +# include +#endif + +#include "Embryo.h" +#include "embryo_private.h" + /* exported time api */ static Embryo_Cell -- 2.7.4