| @@ -8,7 +8,7 @@ Patrick H. E. Foubet <nife@seriane.fr> | |||
| * Stack to Stack protocol developer, and much more. | |||
| Christophe Ondrejec <ondrejec@seriane.fr> | |||
| * Administrator of the site k-nife.org. | |||
| * Administrator of the site nifesys.org. | |||
| * Internationalization support head. | |||
| * Package tester. | |||
| @@ -1,42 +1,99 @@ | |||
| History of Nife releases : | |||
| 2016-08-15 - Nife 0.59 is released. | |||
| * Add implementation of data meta-stacks tools for context swapping : | |||
| [ and ] for respectively increment and decrement the numerical stack, | |||
| { and } to do theses operations with the character stack, | |||
| ( and ) to do the same thing with the logical stack, | |||
| and [* and ]* to operate on the three stacks. | |||
| * Fixed a bug causing an error with network functions netDt> and NetKey. | |||
| * The Nife official site is now : http://www.nifesys.org. | |||
| 2015-08-10 - Nife 0.55 is released. | |||
| * Changing the log file contents to be able to use it for debugging. | |||
| The log file is in the subdirectory .nife. His name is the type | |||
| .nife_PID.log, PID being its number of pid. | |||
| We can display the content in real time with tail -f. | |||
| The .nifeNS_pid.log and .nifeRPC_PID.log files are those of the | |||
| server networks and its bodies. | |||
| Log files are deleted at the end of the Nife session unless an error | |||
| occured. | |||
| * Added "savelog function to save the logs before going out. | |||
| * Placing aid debugging functions. All these functions begin with the _ | |||
| character and are listed with ?libp function. | |||
| * Added shell script command, ex/NifeDebugTerms, to facilitate | |||
| establishment and closing of the display terminals for the logs. | |||
| * Added the possibility, in graphic mode, to open or close | |||
| terminals with keys 'home' and 'end'. These functionalities are | |||
| based on performance in the window manager of the above script. | |||
| * Reorganization of system functions in the function stack. | |||
| * Improved tasks and consoles. | |||
| * Added the ability to execute external command interactively, with the | |||
| character ! at the beginning of the line. | |||
| 2014-08-31 - Nife 0.51 is released. | |||
| * Finalising the version 1.0 of the functions dump and restore with the | |||
| definition of the NBLF, Nife Binary Linkable Format. | |||
| * Modify some labels to clarify the perception of internal mechanisms. | |||
| * Some modifications to avoid unnecessary warnings at compilation. | |||
| * Temporary suspension of some functions related to the dynamic aspect | |||
| of the language because, used improperly, it could be dangerous. | |||
| These functions will be include again, but with more explanations and | |||
| examples. | |||
| 2014-06-27 - Nife 0.49 is released. | |||
| * Add DEC, HEX, OCT and BIN functions to define the print mode for the | |||
| integers. The default is decimal. | |||
| * Modify signals comportment to accept interrupt from terminal to stop | |||
| execution in the main (interactive) task. | |||
| * Fixed an error in the case of the end: label is before the onerr: one. | |||
| * Fixed a bug when a signal "segmentation violation" is catched. | |||
| * Add some help facilities suggested by Alain Empain, until his tools | |||
| are efficient in Nife. | |||
| * Beginning the functions dump and restore with definition of the NBLF, | |||
| Nife Binary Linkable Format (just for a Request for Comments ;-). | |||
| * The installation has been tested by Gaetan Angely on three ARM SBCs: | |||
| Raspberry Pi, Beaglebone Black, ODROID-U3 with Arch Linux ARM. | |||
| All information about Arch Linux ARM at http://archlinuxarm.org/. | |||
| He have compared with two Intel processors and have published a | |||
| benchmak on the two mailing lists. | |||
| 2014-05-10 - Nife 0.47 is released. | |||
| * Beginning an I2C interface for Linux systems, inspired by the Linux | |||
| package i2c-tools. | |||
| * The I2C interface has been developped and tested by P. Foubet | |||
| with his students of ESIGETEL Villejuif, Elodie Kerfourn and Aymeric | |||
| Diankouika Ntinou. They connected a Raspberry Pi with an Arduino | |||
| board through the I2C bus and wrote a Nife program to highlight the | |||
| data exchange between the two elements. | |||
| * The Nife official site is now : http://www.k-nife.org. | |||
| * The installation has been tested by Bernard Bonno on a Raspberry Pi | |||
| board Model A with Porteus ARM (based on a Slackware ARM 14.0). | |||
| * Beginning an I2C interface for Linux systems, inspired by the Linux | |||
| package i2c-tools. | |||
| * The I2C interface has been developped and tested by P. Foubet | |||
| with his students Elodie Kerfourn and Aymeric Diankouika. They | |||
| connected a Raspberry Pi with an Arduino board through the I2C bus | |||
| and wrote a Nife program to highlight the data exchange between the | |||
| two elements. | |||
| * The installation has been tested by Bernard Bonno on a Raspberry Pi | |||
| board Model A with Porteus ARM (based on a Slackware ARM 14.0). | |||
| 2013-09-25 - Nife 0.44 is released. | |||
| * Fixed a bug causing a "segmentation violation" during compilation | |||
| of the Nife code on some systems as Raspberry Pi A and B and others. | |||
| This bug was reported by Bernard Bonno during tests on a Raspberry Pi | |||
| Model A with 256 Mo of memory. | |||
| of the Nife code on some systems as Raspberry Pi A and B and others. | |||
| This bug was reported by Bernard Bonno during tests on a Raspberry Pi | |||
| Model A with 256 Mo of memory. | |||
| * The installation has been tested by Bernard Bonno on a PC i484 | |||
| with a Linux Porteus 2.0. | |||
| with a Linux Porteus 2.0. | |||
| All information about Porteus at http://www.porteus.org/. | |||
| 2013-09-09 - Nife 0.43 is released. | |||
| * Establishment of a sub-directory .nife to facilitate debugging and | |||
| store temporary files. | |||
| store temporary files. | |||
| * Update some functions dependant on working directory. | |||
| * Fixed some bugs in the gplot tools due to new versions of gnuplot. | |||
| * The installation has been tested by Patrick Foubet on a Raspberry Pi | |||
| board Model B with standard Raspbian (Squeeze). | |||
| board Model B with standard Raspbian (Squeeze). | |||
| All information about the board at http://www.raspberrypi.org/faqs. | |||
| 2012-10-23 - Nife 0.405 is released. | |||
| * Fixed a bug in the data transfer protocol STSP. | |||
| * Adding Dt indicators in the list giving by ?n function. | |||
| * Fixed a bug in the netDt> function. | |||
| * Fixed a bug in the data transfer protocol STSP. | |||
| * Adding Dt indicators in the list giving by ?n function. | |||
| * Fixed a bug in the netDt> function. | |||
| * The installation has been tested by Patrick Foubet on a Beaglebone | |||
| board (Linux beaglebone 3.2.5+ #1 ... armv7l GNU/Linux) lended by the | |||
| school ESME Sudria for preparing a course on Linux drivers. | |||
| board (Linux beaglebone 3.2.5+ #1 ... armv7l GNU/Linux) lended by the | |||
| school ESME Sudria for preparing a course on Linux drivers. | |||
| All information about the board at http://beagleboard.org/bone. | |||
| 2012-09-01 - Nife 0.401 is released. | |||
| @@ -77,12 +134,12 @@ History of Nife releases : | |||
| 2012-06-06 - Nife 0.320 is released. | |||
| * Beginning of the gplot module for use of gnuplot (www.gnuplot.info). | |||
| * adding theses functions : | |||
| - gplot and gplotM (multiple) to create gplots, | |||
| - gplotCmd to append text to the plot command, | |||
| - ?gp to list the gplots, | |||
| - del_gplot to delete a gplot, | |||
| - gplotAdd and gplotRepl (with replacement) to add values to plots, | |||
| - gplotClear to clear a display panel. | |||
| - gplot and gplotM (multiple) to create gplots, | |||
| - gplotCmd to append text to the plot command, | |||
| - ?gp to list the gplots, | |||
| - del_gplot to delete a gplot, | |||
| - gplotAdd and gplotRepl (with replacement) to add values to plots, | |||
| - gplotClear to clear a display panel. | |||
| * The installation has been tested by Bruno Guilbert on a Fox board G20 | |||
| (Debian debarm 2.6.38 with CPU Atmel AT91SAM9G20 based on ARM926EJ-S) | |||
| with the students TRSE2 of Ingesup-Paris : | |||
| @@ -1,5 +1,14 @@ | |||
| History of Nife releases : | |||
| 2016-08-15 - Nife 0.59 is released. | |||
| * Add implementation of data meta-stacks tools for context swapping : | |||
| [ and ] for respectively increment and decrement the numerical stack, | |||
| { and } to do theses operations with the character stack, | |||
| ( and ) to do the same thing with the logical stack, | |||
| and [* and ]* to operate on the three stacks. | |||
| * Fixed a bug causing an error with network functions netDt> and NetKey. | |||
| * The Nife official site is now : http://www.nifesys.org. | |||
| 2015-08-10 - Nife 0.55 is released. | |||
| * Changing the log file contents to be able to use it for debugging. | |||
| The log file is in the subdirectory .nife. His name is the type | |||
| @@ -11,7 +20,7 @@ History of Nife releases : | |||
| occured. | |||
| * Added "savelog function to save the logs before going out. | |||
| * Placing aid debugging functions. All these functions begin with the _ | |||
| character and are listed with ?libp function. | |||
| character and are listed with ?libp function. | |||
| * Added shell script command, ex/NifeDebugTerms, to facilitate | |||
| establishment and closing of the display terminals for the logs. | |||
| * Added the possibility, in graphic mode, to open or close | |||
| @@ -58,33 +67,33 @@ History of Nife releases : | |||
| and wrote a Nife program to highlight the data exchange between the | |||
| two elements. | |||
| * The installation has been tested by Bernard Bonno on a Raspberry Pi | |||
| board Model A with Porteus ARM (based on a Slackware ARM 14.0). | |||
| board Model A with Porteus ARM (based on a Slackware ARM 14.0). | |||
| 2013-09-25 - Nife 0.44 is released. | |||
| * Fixed a bug causing a "segmentation violation" during compilation | |||
| of the Nife code on some systems as Raspberry Pi A and B and others. | |||
| This bug was reported by Bernard Bonno during tests on a Raspberry Pi | |||
| Model A with 256 Mo of memory. | |||
| of the Nife code on some systems as Raspberry Pi A and B and others. | |||
| This bug was reported by Bernard Bonno during tests on a Raspberry Pi | |||
| Model A with 256 Mo of memory. | |||
| * The installation has been tested by Bernard Bonno on a PC i484 | |||
| with a Linux Porteus 2.0. | |||
| with a Linux Porteus 2.0. | |||
| All information about Porteus at http://www.porteus.org/. | |||
| 2013-09-09 - Nife 0.43 is released. | |||
| * Establishment of a sub-directory .nife to facilitate debugging and | |||
| store temporary files. | |||
| store temporary files. | |||
| * Update some functions dependant on working directory. | |||
| * Fixed some bugs in the gplot tools due to new versions of gnuplot. | |||
| * The installation has been tested by Patrick Foubet on a Raspberry Pi | |||
| board Model B with standard Raspbian (Squeeze). | |||
| board Model B with standard Raspbian (Squeeze). | |||
| All information about the board at http://www.raspberrypi.org/faqs. | |||
| 2012-10-23 - Nife 0.405 is released. | |||
| * Fixed a bug in the data transfer protocol STSP. | |||
| * Adding Dt indicators in the list giving by ?n function. | |||
| * Fixed a bug in the netDt> function. | |||
| * Fixed a bug in the data transfer protocol STSP. | |||
| * Adding Dt indicators in the list giving by ?n function. | |||
| * Fixed a bug in the netDt> function. | |||
| * The installation has been tested by Patrick Foubet on a Beaglebone | |||
| board (Linux beaglebone 3.2.5+ #1 ... armv7l GNU/Linux) lended by the | |||
| school ESME Sudria for preparing a course on Linux drivers. | |||
| board (Linux beaglebone 3.2.5+ #1 ... armv7l GNU/Linux) lended by the | |||
| school ESME Sudria for preparing a course on Linux drivers. | |||
| All information about the board at http://beagleboard.org/bone. | |||
| 2012-09-01 - Nife 0.401 is released. | |||
| @@ -125,12 +134,12 @@ History of Nife releases : | |||
| 2012-06-06 - Nife 0.320 is released. | |||
| * Beginning of the gplot module for use of gnuplot (www.gnuplot.info). | |||
| * adding theses functions : | |||
| - gplot and gplotM (multiple) to create gplots, | |||
| - gplotCmd to append text to the plot command, | |||
| - ?gp to list the gplots, | |||
| - del_gplot to delete a gplot, | |||
| - gplotAdd and gplotRepl (with replacement) to add values to plots, | |||
| - gplotClear to clear a display panel. | |||
| - gplot and gplotM (multiple) to create gplots, | |||
| - gplotCmd to append text to the plot command, | |||
| - ?gp to list the gplots, | |||
| - del_gplot to delete a gplot, | |||
| - gplotAdd and gplotRepl (with replacement) to add values to plots, | |||
| - gplotClear to clear a display panel. | |||
| * The installation has been tested by Bruno Guilbert on a Fox board G20 | |||
| (Debian debarm 2.6.38 with CPU Atmel AT91SAM9G20 based on ARM926EJ-S) | |||
| with the students TRSE2 of Ingesup-Paris : | |||
| @@ -79,25 +79,25 @@ How to compile and install nife | |||
| Web Page | |||
| http://www.k-nife.org | |||
| http://www.nifesys.org | |||
| Mailing List and Bug Reports | |||
| k-nife.org hosts all the nife-related mailing-lists. | |||
| nifesys.org hosts all the nife-related mailing-lists. | |||
| + nife-mailing-list@googlegroups.com is the list used by the people | |||
| that make Nife and a general development discussion list, with | |||
| moderate traffic. | |||
| To subscribe, go directely to : | |||
| http://k-nife.org/mailing_list.html | |||
| http://nifesys.org/mailing_list.html | |||
| + nife-project@mailman.k-nife.org is the list reserved for people | |||
| + nife-project@mailman.nifesys.org is the list reserved for people | |||
| who want to discuss Nife in French, with also a moderate traffic. | |||
| To subscribe, go directely to : | |||
| http://mailman.k-nife.org/mailman/listinfo/nife-project | |||
| http://mailman.nifesys.org/mailman/listinfo/nife-project | |||
| For general bug reports, send a description of the problem to | |||
| nife@seriane.fr or directly to the development list. | |||
| @@ -79,34 +79,34 @@ How to compile and install nife | |||
| Web Page | |||
| http://www.k-nife.org | |||
| http://www.nifesys.org | |||
| Mailing List and Bug Reports | |||
| k-nife.org hosts all the nife-related mailing-lists. | |||
| nifesys.org hosts all the nife-related mailing-lists. | |||
| + nife-mailing-list AT googlegroups.com is the list used by the people | |||
| + nife-mailing-list@googlegroups.com is the list used by the people | |||
| that make Nife and a general development discussion list, with | |||
| moderate traffic. | |||
| To subscribe, go directely to : | |||
| http://k-nife.org/mailing_list.html | |||
| http://nifesys.org/mailing_list.html | |||
| + nife-project AT mailman.k-nife.org is the list reserved for people | |||
| + nife-project@mailman.nifesys.org is the list reserved for people | |||
| who want to discuss Nife in French, with also a moderate traffic. | |||
| To subscribe, go directely to : | |||
| http://mailman.k-nife.org/mailman/listinfo/nife-project | |||
| http://mailman.nifesys.org/mailman/listinfo/nife-project | |||
| For general bug reports, send a description of the problem to | |||
| nife AT seriane POINT fr or directly to the development list. | |||
| nife@seriane.fr or directly to the development list. | |||
| Current Status | |||
| nife is still in beta version. | |||
| Patrick Foubet (nife AT seriane POINT fr) | |||
| Patrick Foubet (nife@seriane.fr) | |||
| @@ -1,6 +1,6 @@ | |||
| #! /bin/sh | |||
| # Guess values for system-dependent variables and create Makefiles. | |||
| # Generated by GNU Autoconf 2.69 for nife 0.51. | |||
| # Generated by GNU Autoconf 2.69 for nife 0.59. | |||
| # | |||
| # Report bugs to <nife@seriane.fr>. | |||
| # | |||
| @@ -580,8 +580,8 @@ MAKEFLAGS= | |||
| # Identity of this package. | |||
| PACKAGE_NAME='nife' | |||
| PACKAGE_TARNAME='nife' | |||
| PACKAGE_VERSION='0.51' | |||
| PACKAGE_STRING='nife 0.51' | |||
| PACKAGE_VERSION='0.59' | |||
| PACKAGE_STRING='nife 0.59' | |||
| PACKAGE_BUGREPORT='nife@seriane.fr' | |||
| PACKAGE_URL='' | |||
| @@ -1262,7 +1262,7 @@ if test "$ac_init_help" = "long"; then | |||
| # Omit some internal or obsolete options to make the list less imposing. | |||
| # This message is too long to be a string in the A/UX 3.1 sh. | |||
| cat <<_ACEOF | |||
| \`configure' configures nife 0.51 to adapt to many kinds of systems. | |||
| \`configure' configures nife 0.59 to adapt to many kinds of systems. | |||
| Usage: $0 [OPTION]... [VAR=VALUE]... | |||
| @@ -1328,7 +1328,7 @@ fi | |||
| if test -n "$ac_init_help"; then | |||
| case $ac_init_help in | |||
| short | recursive ) echo "Configuration of nife 0.51:";; | |||
| short | recursive ) echo "Configuration of nife 0.59:";; | |||
| esac | |||
| cat <<\_ACEOF | |||
| @@ -1415,7 +1415,7 @@ fi | |||
| test -n "$ac_init_help" && exit $ac_status | |||
| if $ac_init_version; then | |||
| cat <<\_ACEOF | |||
| nife configure 0.51 | |||
| nife configure 0.59 | |||
| generated by GNU Autoconf 2.69 | |||
| Copyright (C) 2012 Free Software Foundation, Inc. | |||
| @@ -1838,7 +1838,7 @@ cat >config.log <<_ACEOF | |||
| This file contains any messages produced by compilers while | |||
| running configure, to aid debugging if configure makes a mistake. | |||
| It was created by nife $as_me 0.51, which was | |||
| It was created by nife $as_me 0.59, which was | |||
| generated by GNU Autoconf 2.69. Invocation command line was | |||
| $ $0 $@ | |||
| @@ -2653,7 +2653,7 @@ fi | |||
| # Define the identity of the package. | |||
| PACKAGE='nife' | |||
| VERSION='0.51' | |||
| VERSION='0.59' | |||
| cat >>confdefs.h <<_ACEOF | |||
| @@ -5480,7 +5480,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |||
| # report actual input values of CONFIG_FILES etc. instead of their | |||
| # values after options handling. | |||
| ac_log=" | |||
| This file was extended by nife $as_me 0.51, which was | |||
| This file was extended by nife $as_me 0.59, which was | |||
| generated by GNU Autoconf 2.69. Invocation command line was | |||
| CONFIG_FILES = $CONFIG_FILES | |||
| @@ -5546,7 +5546,7 @@ _ACEOF | |||
| cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |||
| ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" | |||
| ac_cs_version="\\ | |||
| nife config.status 0.51 | |||
| nife config.status 0.59 | |||
| configured by $0, generated by GNU Autoconf 2.69, | |||
| with options \\"\$ac_cs_config\\" | |||
| @@ -2,7 +2,7 @@ | |||
| # Process this file with autoconf to produce a configure script. | |||
| AC_PREREQ([2.67]) | |||
| AC_INIT([nife], [0.51], [nife@seriane.fr]) | |||
| AC_INIT([nife], [0.59], [nife@seriane.fr]) | |||
| AM_INIT_AUTOMAKE | |||
| AC_CONFIG_SRCDIR([src/tasks.c]) | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/> | |||
| #ifdef HAVE_CONFIG_H | |||
| #include "../config.h" | |||
| #else | |||
| #define VERSION "0.55" | |||
| #define VERSION "0.59" | |||
| #endif | |||
| #ifdef HAVE_COMEDILIB_H | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -119,10 +119,11 @@ static char *TabErr[] = { | |||
| "I2C read failed", | |||
| "binary dump error", | |||
| "binary restore error", | |||
| "-", /* 60 */ | |||
| "meta-stack size limit reached", /* 60 */ | |||
| "no previous stack", | |||
| "-" | |||
| }; | |||
| #define ERR_MAX 59 | |||
| #define ERR_MAX 61 | |||
| void stopErr(char *M, char *F) | |||
| { | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -274,6 +274,20 @@ void IF_show_libusr(void) | |||
| Show_library(triList(F_USR)); | |||
| } | |||
| void IF_new_stackAll(void) | |||
| { | |||
| IF_new_stackN(); | |||
| IF_new_stackC(); | |||
| IF_new_stackL(); | |||
| } | |||
| void IF_old_stackAll(void) | |||
| { | |||
| IF_old_stackN(); | |||
| IF_old_stackC(); | |||
| IF_old_stackL(); | |||
| } | |||
| void initLib(void) | |||
| { | |||
| addFonc(".",IF_point); | |||
| @@ -369,6 +383,15 @@ void initLib(void) | |||
| addFonP("_?ls",IFD_show_stackL); | |||
| addFonc("?s",IF_show_stack); | |||
| addFonP("_?s",IFD_show_stack); | |||
| addFonc("?ms",IF_show_TStacks); | |||
| addFonc("[",IF_new_stackN); | |||
| addFonc("]",IF_old_stackN); | |||
| addFonc("{",IF_new_stackC); | |||
| addFonc("}",IF_old_stackC); | |||
| addFonc("(",IF_new_stackL); | |||
| addFonc(")",IF_old_stackL); | |||
| addFonc("[*",IF_new_stackAll); | |||
| addFonc("]*",IF_old_stackAll); | |||
| /* addFonc("?libX",show_lib_addr); for internal debugging */ | |||
| addFonc("?libs",IF_show_liball); | |||
| addFonc("?lib",IF_show_libstd); | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -182,6 +182,15 @@ void TH_init(void) | |||
| #else /* NOT _MULTI_THREADING_ */ | |||
| /* meta-stacks */ | |||
| void * G_TStackN[LSTACKS]; | |||
| char ** G_TStackC[LSTACKS]; | |||
| int G_TiStackC[LSTACKS]; | |||
| bool * G_TStackL[LSTACKS]; | |||
| int G_TiStackL[LSTACKS]; | |||
| int G_i_TStackN=0; | |||
| int G_i_TStackC=0; | |||
| int G_i_TStackL=0; | |||
| void * G_StackN = VIDE; | |||
| int G_Double=0; /* 0 si LONG, 1 si DOUBLE */ | |||
| @@ -193,9 +202,11 @@ short G_VARS=1, /* 0 VAR_OFF , 1 VAR_DOWN (default), 2 VAR_UP */ | |||
| G_FCT_TYP=0; /* 0 None (default) , 1 Lib Fct , 2 User Fct */ | |||
| void * G_F_INS=VIDE; /* fct lib ou usr a installer */ | |||
| uint32_t G_NetKey=0; | |||
| bool G_stackL[LSTACKL]; | |||
| bool G_stackL0[LSTACKL]; | |||
| bool * G_stackL = G_stackL0; | |||
| int G_i_stackL=0; | |||
| char * G_stackC[LSTACKC]; | |||
| char * G_stackC0[LSTACKC]; | |||
| char ** G_stackC = G_stackC0;; | |||
| int G_i_stackC=0; | |||
| char G_bufC[MAXSTRING]; | |||
| short G_Run=1; | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -27,6 +27,7 @@ extern void TH_init(void); | |||
| #define LSTACKL 512 | |||
| #define LSTACKC 512 | |||
| #define LSTACKS 512 | |||
| #define MAXSTRING 512 | |||
| #define NBTRSUITE 10 | |||
| #define LBUF 512 | |||
| @@ -110,6 +111,14 @@ extern pthread_key_t k_Base, k_StkN, k_FIns, k_NetK, k_NLig, k_NTab, k_Vars, | |||
| #define ENV_INT (jmp_buf*)pthread_getspecific(k_EnvI) | |||
| #else /* *************** NOT _MULTI_THREADING_ ******************** */ | |||
| extern void * G_TStackN[]; | |||
| extern char ** G_TStackC[]; | |||
| extern int G_TiStackC[]; | |||
| extern bool * G_TStackL[]; | |||
| extern int G_TiStackL[]; | |||
| extern int G_i_TStackN; | |||
| extern int G_i_TStackC; | |||
| extern int G_i_TStackL; | |||
| extern void * G_StackN; | |||
| extern int G_Double; | |||
| @@ -121,9 +130,9 @@ extern short G_VARS; | |||
| extern short G_FCT_TYP; | |||
| extern void * G_F_INS; | |||
| extern uint32_t G_NetKey; | |||
| extern bool G_stackL[]; | |||
| extern bool * G_stackL; | |||
| extern int G_i_stackL; | |||
| extern char * G_stackC[]; | |||
| extern char ** G_stackC; | |||
| extern int G_i_stackC; | |||
| extern char G_bufC[]; | |||
| extern short G_Run; | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -257,14 +257,28 @@ char * b, *f; | |||
| while (1) { | |||
| if (read(s,(void*)b,1) <= 0) break; | |||
| if (*b == NET_EOM) break; | |||
| if (b == f) break; | |||
| b++; | |||
| if (b>f) { b--; break; } | |||
| } | |||
| if (*b != NET_EOM) return -1; | |||
| b++; | |||
| return(b-NET_BUF); | |||
| } | |||
| static int readMess2(int s, int n) | |||
| { | |||
| char * b, *f; | |||
| b = NET_BUF; | |||
| f = b + n; | |||
| while (1) { | |||
| if (read(s,(void*)b,1) <= 0) break; | |||
| b++; | |||
| if (b == f) break; | |||
| } | |||
| if (*b != NET_EOM) return -1; | |||
| return(n); | |||
| } | |||
| static void readAff(int s, char C) | |||
| { | |||
| char b[2]; | |||
| @@ -791,7 +805,7 @@ long long v; | |||
| if (NET) { | |||
| if (connSock()) return; | |||
| sendGetStd(Code); | |||
| if (readMess(Sock) != 2+sizeof(v)) { messErr(35); return; } | |||
| if (readMess2(Sock,(2+sizeof(v))) != 2+sizeof(v)) { messErr(35); return; } | |||
| close(Sock); | |||
| if (*NET_BUF != (Code+1)) { messErr(40); return; } | |||
| bcopy((void*)(NET_BUF+1),(void*)&v,sizeof(v)); | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -3,12 +3,12 @@ | |||
| begins a string wich is terminated by itself. The first blank is a separator. | |||
| The character \ masks the character " as end of string. | |||
| ' : { string -- } | |||
| begins, into a function (beetween : and ;), a string which represents a name of | |||
| begins, into a function (between : and ;), a string which represents a name of | |||
| a user function, or a variable. This string will be interpreted and executed | |||
| during the function execution. | |||
| There is no verification : if the name does not exist, it does nothing. | |||
| ` : { string -- } | |||
| begins, into a function (beetween : and ;), a string which represents a name of | |||
| begins, into a function (between : and ;), a string which represents a name of | |||
| a user function, or a variable. This string will be interpreted and executed | |||
| during the function execution. At the first time the code is updated if the | |||
| function or the variable is found. | |||
| @@ -16,7 +16,7 @@ | |||
| "cat : { str1 str2 -- 'str1str2' } | |||
| catenates the two elements on the top string stack entry. | |||
| "cats : { str1 str2 -- 'str1 str2' } | |||
| catenates the two elements on the top string stack entry with a space beetween. | |||
| catenates the two elements on the top string stack entry with a space between. | |||
| "date : { -- date_string } | |||
| puts the date string (JJ/MM/AAAA) on the top string stack entry. | |||
| "drop : { str1 -- } | |||
| @@ -193,9 +193,21 @@ | |||
| ?t/f : ( bool -- ) | |||
| displays and removes the top logical stack entry. | |||
| ?vars : | |||
| display the list of constants of the system environment. | |||
| displays the list of constants of the system environment. | |||
| DEBUG_I/O : | |||
| toggle to set debug mode on or off. | |||
| toggle to set debug mode on or off. All debug functions begin whith '_'. | |||
| See ?libP list to get all the functions. | |||
| In an X11 environment, it is possible to display debug terminals in the same | |||
| time than the main one. | |||
| To activate or refresh displays of the log files press the "home" key. | |||
| Pressing the "end" key will close all of them. | |||
| You can also : | |||
| 1°) open a shell with 'sh' command, | |||
| 2°) execute 'ex/NifeDebugTerms -r' to start display terminals, | |||
| 3°) type 'exit' to return to Nife ! | |||
| After the end of Nife, type 'ex/NifeDebugTerms -s' to close the displays. | |||
| The script NifeDebugTerms have been made for the Gnome window-manager. But | |||
| it's easy to adapt for others environments. | |||
| DEC : | |||
| sets the default print mode for integers to decimal. | |||
| HEX : | |||
| @@ -277,7 +289,8 @@ help : | |||
| ( -- ) for booleans. | |||
| The "--" represents the execution. So before it, what it's necessary for the | |||
| function (used during execution), and after it what the function products. | |||
| If a stack is not used there is nothing about it. Here, "help" use no stack. | |||
| If a stack is not used there is nothing about it. Here, the "help" function | |||
| don't use any stack. | |||
| ls_clear : ( bool1 bool2 ... boolN -- ) | |||
| clears the logical stack. | |||
| cs_clear : { str1 ... strn -- } | |||
| @@ -368,13 +381,13 @@ vers : [ -- version ] | |||
| ?console : [ n -- ] | |||
| displays the background console of task number n. | |||
| ?f : | |||
| display the function stack. | |||
| displays the function stack. | |||
| ?t : | |||
| display the task stack. | |||
| displays the task stack. | |||
| ?task_run : [ n -- ] ( -- true/false ) | |||
| tests if the task number n is running and put a boolean on the logical stack. | |||
| ?v : | |||
| display the variable stack. | |||
| displays the variable stack. | |||
| Task : [ -- no_task ] | |||
| creates a task from a function. The name of the function must following it. | |||
| The avaibles names are thoses giving by ?f. In success, the task number is on | |||
| @@ -390,18 +403,18 @@ Var : | |||
| again : | |||
| use in function programmation to create an infinite loop. For example : | |||
| : f1 ... begin ... again ... ; | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| begin : | |||
| use in function programmation to create a loop. For example : | |||
| : f1 ... begin ... [condition] while ... repeat ... ; | |||
| : f2 ... begin ... [condition] until ... ; | |||
| or infinite loop : | |||
| : f3 ... begin ... again ... ; | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| break : | |||
| use in function programmation to exit a loop. For example : | |||
| : f1 ... begin ... [condition] if ... break then ... again ... ; | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| del_func : | |||
| delete the more recent version of a function. | |||
| The name of the function must follow this instruction. | |||
| @@ -420,7 +433,7 @@ else : | |||
| toto 1 > if 12 else -7 then | |||
| At execution time, if toto is greater than 1 12 is put on the stack else -7 is | |||
| put. Then dup is executed. | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| fdrop : | |||
| removes the top function stack entry. In fact, the last function created. | |||
| fscan : | |||
| @@ -431,7 +444,7 @@ if : | |||
| toto 1 > if 12 else -7 then | |||
| At execution time, if toto is greater than 1 12 is put on the stack else -7 is | |||
| put. Then dup is executed. | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| in : | |||
| used to complete the install commands. | |||
| Example : install f1 in var | |||
| @@ -454,11 +467,11 @@ load : | |||
| loads a source file taking the name of the file on the top of character stack. | |||
| myself : | |||
| use in a function definition to call the function herself (recursive case). | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| repeat : | |||
| use in function programmation to create a loop. For example : | |||
| : fonction ... begin ... [condition] while ... repeat ... ; | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| reset_var : | |||
| resets a variable. The name of the variable must follow this instruction. | |||
| return : | |||
| @@ -470,11 +483,11 @@ then : | |||
| toto 1 > if 12 else -7 then | |||
| At execution time, if toto is greater than 1 12 is put on the stack else -7 is | |||
| put. Then dup is executed. | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| until : | |||
| use in function programmation to create a loop. For example : | |||
| : f1 ... begin ... [condition] until ... ; | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| var_down : | |||
| set DOWN execution of variables. | |||
| To execute an instruction seach first in user functions, and then in system | |||
| @@ -490,7 +503,7 @@ var_up : | |||
| while : | |||
| use in function programmation to create a loop. For example : | |||
| : fonction ... begin ... [condition] while ... repeat ... ; | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| vdrop : | |||
| removes the top variable stack entry. In fact, the last variable created. | |||
| >csv [ tab1 tab2 ... tabn n -- ] { "filename;libtabn; ... ;libtab1" -- } | |||
| @@ -498,19 +511,19 @@ vdrop : | |||
| >net : [ E1 E2 ... En n -- ] | |||
| transfert the n elements from local stack to Net stack using NetKey. | |||
| ?n : | |||
| display the Net informations. | |||
| displays the Net informations. | |||
| ?ns : | |||
| display the Net stack using NetKey. | |||
| displays the Net stack using NetKey. | |||
| ndepth : [ -- Net_Stack_Depth ] | |||
| returns the number of entries on the Net stack using NetKey. | |||
| NetKey : [ key -- ] | |||
| change the value of NetKey. It is a 32 bits INTEGER. | |||
| changes the value of NetKey. It is a 32 bits INTEGER. | |||
| NetErr : [ -- err_value ] | |||
| put the Net Error value on the top of the stack. It is the negative of NetKey! | |||
| puts the Net Error value on the top of the stack. It is the negative of NetKey! | |||
| NetServer : { "ServerName" -- } | |||
| change the default NetServer (localhost). | |||
| changes the default NetServer (localhost). | |||
| ndrop : | |||
| drop the elements on the Net stack using NetKey. | |||
| drops the elements on the Net stack using NetKey. | |||
| net> : [ -- E1 E2 ... En ] | |||
| transfert all elements from Net stack to local stack using NetKey. | |||
| netDt> : [ -- dt ] | |||
| @@ -564,7 +577,7 @@ do : [ limit val -- ] | |||
| a loop with an index going from 5 to 1 decremented by 1 (i = 5,4,3,2,1). | |||
| : f2 15 1 do ... 3 +loop ... ; | |||
| a loop with an index going from 1 to 15 incremented by 3 (i = 1,4,7,10,13). | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| loop : | |||
| use in function programmation to create an auto-convergent loop with do using | |||
| the default 1 by 1 progression. For example : | |||
| @@ -572,26 +585,26 @@ loop : | |||
| a loop with an index going from 0 to 4 incremented by 1 (i = 0,1,2,3,4). | |||
| : f 0 5 do ... loop ... ; | |||
| a loop with an index going from 5 to 1 decremented by 1 (i = 5,4,3,2,1). | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| +loop : [ inc -- ] | |||
| use in function programmation to create a loop with do using the value inc for | |||
| incrementation. For example : | |||
| : f 15 1 do ... 3 +loop ... ; | |||
| a loop with an index going from 1 to 15 incremented by 3 (i = 1,4,7,10,13). | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| ndo : [ n -- ] | |||
| returns the number of do-loop in the running context. | |||
| It's usefull before using the indexes I J or K. | |||
| I : [ -- val ] | |||
| returns the value of the index of the current do-loop. | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| J : [ -- val ] | |||
| returns the value of the index of the do-loop containing the current one. | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| K : [ -- val ] | |||
| returns the value of the index of the second level do-loop containing the | |||
| current one. | |||
| This must be done into a function (beetween : and ;). | |||
| This must be done into a function (between : and ;). | |||
| do_next : [ -- ] | |||
| free-context instruction to bypass the end of a loop and go to the next step. | |||
| do_leave : [ -- ] | |||
| @@ -641,18 +654,18 @@ cos : [ v -- cos(v) ] | |||
| sin : [ v -- sin(v) ] | |||
| compute the sinus of the value on the top of the stack. | |||
| onerr: : | |||
| defines, into a function (beetween : and ;), a label for programming an errors | |||
| defines, into a function (between : and ;), a label for programming an errors | |||
| treatment in case of an error occurs. | |||
| end: : | |||
| defines, into a function (beetween : and ;), a label for programming a end | |||
| defines, into a function (between : and ;), a label for programming a end | |||
| treatment. In case of an error occurs, theses instructions will be executed if | |||
| this label is AFTER the onerr: label. | |||
| goto_end : | |||
| instruction, into a function (beetween : and ;), to go to the end: label. | |||
| instruction, into a function (between : and ;), to go to the end: label. | |||
| ?err : ( -- T/F ) | |||
| tests if an error have occured and put true or false, on the logical stack. | |||
| ?lasterr : | |||
| displays the last error elements. | |||
| displays the elements of last error catched by an onerr: label. | |||
| messerr : [ n -- ] { -- "error message" } | |||
| puts on the character stack the error message number n. | |||
| noerr : [ -- n ] | |||
| @@ -670,11 +683,42 @@ i2c_read : [ Offset Address I2C-ID -- Value ] | |||
| dump : | |||
| dumps all things in Nife. The name of the file must follow this instruction. | |||
| The contents is not in Nife code, but in Nife Binary Linkable Format (NBLF). | |||
| So, the extension ".nblf" will be add automatically to the file name. | |||
| This format depends on Scs key and the version of Nife. That's mean that a such | |||
| file can be used in an environment with same Scs and same Nife version. It does | |||
| not depend on architecture (Intel, ARM, ...) or processor size (32 or 64 bits). | |||
| restore : | |||
| restores a dumped file. The name of the file must follow this instruction. | |||
| The extension ".nblf" will be add automatically to the file name. | |||
| See dump for more details. | |||
| "saveLog : { "filename" -- } | |||
| saves the log and debug file as filename, in the current directory. | |||
| [ : | |||
| increment the numerical meta-stack. This operation leave the current stack in | |||
| his state and create a new one, or reuse it if previously initialised. | |||
| ] : | |||
| decrement the numerical meta-stack. This operation leave the current stack in | |||
| his state and use the previous. All data on the previous stack are retrieved. | |||
| { : | |||
| increment the character meta-stack. This operation leave the current stack in | |||
| his state and create a new one, or reuse it if previously initialised. | |||
| } : | |||
| decrement the character meta-stack. This operation leave the current stack in | |||
| his state and use the previous. All data on the previous stack are retrieved. | |||
| ( : | |||
| increment the logical meta-stack. This operation leave the current stack in | |||
| his state and create a new one, or reuse it if previously initialised. | |||
| ) : | |||
| decrement the logical meta-stack. This operation leave the current stack in | |||
| his state and use the previous. All data on the previous stack are retrieved. | |||
| [* : | |||
| increment the all data meta-stacks (numerical, character and logical). This | |||
| operation leave the currents stacks in their state and create three new one, or | |||
| reuse if previously initialised. | |||
| ]* : | |||
| increment the all data meta-stacks (numerical, character and logical). This | |||
| operation leave the currents stacks in their state and use the previous. All | |||
| data on the previous stacks are retrieved. | |||
| ?ms : | |||
| display the indices of meta-stacks. The first is 1. | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -288,3 +288,32 @@ uint32_t n=0, i, j; | |||
| dump_rest_pr(1,n,"character"); | |||
| } | |||
| /* gestion des meta-stacks */ | |||
| void IF_new_stackC(void) | |||
| { | |||
| if (G_i_TStackC == LSTACKS) { | |||
| messErr(60); return; | |||
| } | |||
| G_TiStackC[G_i_TStackC] = i_StackC; | |||
| G_TStackC[G_i_TStackC++] = stackC; | |||
| stackC = G_TStackC[G_i_TStackC]; | |||
| i_StackC = G_TiStackC[G_i_TStackC]; | |||
| if (stackC == (char **)0) { | |||
| if ((stackC = (char**)malloc(sizeof(char**)*LSTACKC)) == NULL) | |||
| stopErr("IF_new_stackC","malloc"); | |||
| i_StackC=0; | |||
| } | |||
| } | |||
| void IF_old_stackC(void) | |||
| { | |||
| if (G_i_TStackC == 0) { | |||
| messErr(61); return; | |||
| } | |||
| G_TiStackC[G_i_TStackC] = i_StackC; | |||
| G_TStackC[G_i_TStackC--] = stackC; | |||
| stackC = G_TStackC[G_i_TStackC]; | |||
| i_StackC = G_TiStackC[G_i_TStackC]; | |||
| } | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -41,4 +41,8 @@ extern char * restore_eltC(int fd); | |||
| extern void dump_stackC(int fd); | |||
| extern void restore_stackC(int fd); | |||
| /* meta-stacks */ | |||
| extern void IF_new_stackC(void); | |||
| extern void IF_old_stackC(void); | |||
| #endif | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/> | |||
| #include "conf.h" | |||
| #include <stdio.h> | |||
| #include <stdlib.h> | |||
| #include "nife.h" | |||
| #include "mth.h" | |||
| @@ -206,3 +207,33 @@ uint32_t n=0; | |||
| } | |||
| dump_rest_pr(1,n,"logical"); | |||
| } | |||
| /* gestion des meta-stacks */ | |||
| void IF_new_stackL(void) | |||
| { | |||
| if (G_i_TStackL == LSTACKS) { | |||
| messErr(60); return; | |||
| } | |||
| G_TiStackL[G_i_TStackL] = i_StackL; | |||
| G_TStackL[G_i_TStackL++] = stackL; | |||
| stackL = G_TStackL[G_i_TStackL]; | |||
| i_StackL = G_TiStackL[G_i_TStackL]; | |||
| if (stackL == (bool *)0) { | |||
| if ((stackL = (bool*)malloc(sizeof(bool*)*LSTACKL)) == NULL) | |||
| stopErr("IF_new_stackL","malloc"); | |||
| i_StackL=0; | |||
| } | |||
| } | |||
| void IF_old_stackL(void) | |||
| { | |||
| if (G_i_TStackL == 0) { | |||
| messErr(61); return; | |||
| } | |||
| G_TiStackL[G_i_TStackL] = i_StackL; | |||
| G_TStackL[G_i_TStackL--] = stackL; | |||
| stackL = G_TStackL[G_i_TStackL]; | |||
| i_StackL = G_TiStackL[G_i_TStackL]; | |||
| } | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -41,5 +41,8 @@ extern void IFD_show_stackL(void); | |||
| extern void dump_stackL(int fd); | |||
| extern void restore_stackL(int fd); | |||
| /* meta-stacks */ | |||
| extern void IF_new_stackL(void); | |||
| extern void IF_old_stackL(void); | |||
| #endif | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -2079,3 +2079,30 @@ void * M; | |||
| dump_rest_pr(1,n,"numerical"); | |||
| } | |||
| /* gestion des meta-stacks */ | |||
| void IF_new_stackN(void) | |||
| { | |||
| if (G_i_TStackN == LSTACKS) { | |||
| messErr(60); return; | |||
| } | |||
| G_TStackN[G_i_TStackN++] = StackN; | |||
| StackN = G_TStackN[G_i_TStackN]; | |||
| } | |||
| void IF_old_stackN(void) | |||
| { | |||
| if (G_i_TStackN == 0) { | |||
| messErr(61); return; | |||
| } | |||
| G_TStackN[G_i_TStackN--] = StackN; | |||
| StackN = G_TStackN[G_i_TStackN]; | |||
| } | |||
| void IF_show_TStacks(void) | |||
| { | |||
| printf("Indices of meta-stacks :\n"); | |||
| printf("Numerical stack = %d\n",G_i_TStackN+1); | |||
| printf("Character stack = %d\n",G_i_TStackC+1); | |||
| printf("Logical stack = %d\n",G_i_TStackL+1); | |||
| } | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -134,4 +134,10 @@ extern int NetDepth(uint32_t k); | |||
| extern void IF_show_netStack(uint32_t k); | |||
| extern void IF_netDrop(uint32_t k); | |||
| /* meta-stacks */ | |||
| extern void IF_new_stackN(void); | |||
| extern void IF_old_stackN(void); | |||
| extern void IF_show_TStacks(void); | |||
| #endif | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| @@ -1,4 +1,4 @@ | |||
| /* Copyright (C) 2011-2015 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| /* Copyright (C) 2011-2016 Patrick H. E. Foubet - S.E.R.I.A.N.E. | |||
| This program is free software: you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||