2025-01-07: fth v1.4.3
======================

* examples/dbm/dbm.fs:
* examples/dbm/dbm-test.fth:

	New files added.

* examples/fth-lib/fth.fs:

	New words:

        array-search   ( ary reg -- res )
        hash-search    ( ary reg -- res )
        mktemp         ( -- fname )

	Assoc and Alist Object Types moved from src/array.c to fth.fs:

        assoc?         ( obj -- f )
        make-assoc     ( -- ass )
        assoc          ( ass key val -- ass' )
        assoc-ref      ( ass key -- val|#f )
        assoc-set!     ( ass key val -- ass' )
        assoc-delete!  ( ass key -- ass' )
        assoc-array    ( ass key -- key-val|#f )
        >assoc         ( vals n -- ass )
        #a()           ( -- empty-ass )
        object->assoc  ( obj -- ass )

        alist?         ( obj -- f )
        make-alist     ( -- ass )
        alist          ( ass key val -- ass' )
        alist-ref      ( ass key -- val|#f )
        alist-set!     ( ass key val -- ass' )
        alist-delete!  ( ass key -- ass' )
        alist-array    ( ass key -- key-val|#f )
        >alist         ( vals n -- ass )
        'a()           ( -- empty-ass )
        object->alist  ( obj -- ass )

* examples/fth-lib/net.fs:

	New words:

        array-filter   ( ary cmd -- ary2 )
        string-filter  ( str cmd -- str2 )

* src/fth.h:

	Nine new constants for file descriptors, file pointer and IO
	objects for stdin, stdout and stderr.

        fth_{fd,fp,io}_std{in,out,err}
        fth_fd_stdin etc
        fth_fp_stdin etc
        fth_io_stdin etc

* src/array.c:

	Word removed: list-head

* src/hash.c:

	Prototype has changed: fth_hash_set changed from void to
	returning the updated hash:

        FTH fth_hash_set(FTH, FTH, FTH);

* src/io.c:

	New public C-functions:

        FTH fth_io_tmpfile(void);
        int fth_get_exit_status(void);

	New words:

        fd-read        ( fd -- line )
        fd-write       ( fd line -- )

* src/misc.c:

	New public C-functions:

        FTH fth_gethostname(void);
        int fth_sethostname(FTH);

	C-functions removed, moved to local in misc.c:

        void fth_make_ficl(unsigned, unsigned, unsigned, unsigned);
        void fth_install(void);

	New alias for putenv added:

        setenv ( name value -- )

	New words:

        getpgrp        ( -- pgrp )    returns process group of current process
        tcgetpgrp      ( fd -- pgrp ) foreground process group

* src/numbers.c:

	Complex numbers recognize exponents (e or E).

* src/object.c:

	Prototype of fth_object_index() has changed from FTH to ficlInteger!

        ficlInteger fth_object_index(FTH, FTH);

	Prototype of public C-functions changed from void to return FTH.

        FTH fth_gc_mark(FTH);
        FTH fth_gc_unmark(FTH);

	New public C-functions:

        void fth_gc_run(void);
        FTH fth_instance_ref_obj(FTH);

	New word:

        make-object-type-from ( name base -- ot )

* src/printf.c:

	New public C-functions:

        char *fth_read(void);
        void fth_die(const char *, ...);

	Two C-functions removed:

        int fth_sprintf(char *, const char *, ...);
        int fth_vsprintf(char *, const char *, va_list);

* src/proc.c:

	New public C-functions:

        ficlWord *fth_word_ref(const char *name);
        FTH fth_proc_ref(const char *name);
        FTH fth_variable_obj(const char *name);

	New word:

        name->xt  ( name -- xt )  returns xt of name

* src/string.c:

	New word:

        int->char ( n -- c ) returns integer N as character (string)
        fth-read  ( -- str ) reads from Ficl's input

* src/utils.c:

	This function takes now only two args:

        int fth_set_argv(int, char **);

	Return code changed from void to int:

        int fth_repl(int, char **);

	New public C-function:

        size_t fth_strnlen(const char *, size_t);

	New tecla-related words:

        history          ( :optional action arg -- ) handles history events
        history-lineno   ( -- n )           current history line number
        history-next     ( -- line )        next event
        history-prev     ( -- line )        previous event
        tecla-puts       ( :optional text -- ) print string formatted
        tecla-get-line   ( prompt -- line ) get input line
        tecla-query-char ( prompt -- c )    next character
        tecla-read-char  ( -- c )           next character
        tecla-repl       ( -- )             read eval print loop

	New tecla-related variable:

        *tecla-symbol-list*   for a different tab-completion list

2022-10-01: fth v1.4.2
======================

* src/fth.c:

	Evaluation from standard input prints stack result if any to
	standard output:

        echo "80 f2c" | tee foo | fth -    => 26.6667
        cat foo | fth -                    => 26.6667
        fth - < foo                        => 26.6667

* src/file.c:

	Slightly changed behavior:

        FTH fth_file_realpath(const char *path);

	Don't throw exception if path does not exist, call perror(path)
	and return path instead.

* src/hash.c:

	New public C-function and Forth-word:

        ficlInteger fth_hash_length(FTH obj);
        hash-length ( obj -- n )

* src/io.c:

	Sockets can now use domain AF_INET6.

	The public socket open function has two additional arguments:
	int type and int fam.

        FTH fth_io_nopen(const char *host, int port, int domain,
            int type, int fam);

	New public C-functions.

        FTH fth_gethostbyaddr(FTH host);
        FTH fth_gethostbyname(FTH host);
        FILE *fth_tmpfile(void);

	New Forth-words:
	
	The original behavior of net-sendto and net-recvfrom is now in
	net-sendto2 and net-recvfrom2.  net-sendto and net-recvfrom each
	take an address to be more dynamic.

        io-address     ( io -- ip-add ) returns ip address if socket object
        gethostbyaddr  ( host -- hash ) returns hash with host and addresses
        .gethostbyaddr ( host -- )      prints host found by gethostbyaddr
        gethostbyname  ( host -- hash ) returns hash with host and addresses
        .gethostbyname ( host -- )      prints host found by gethostbyname
        ntohl          ( u1 -- u2 )     convert byte order (ntohl(3)).
        htonl          ( u1 -- u2 )     convert byte order (htonl(3)).
        ntohs          ( u1 -- u2 )     convert byte order (ntohs(3)).
        htons          ( u1 -- u2 )     convert byte order (htons(3)).
        h_errno        ( -- n )         returns error number from host funcs
        hstrerror      ( n -- str )     returns error string from h_error
        io-select      ( keyargs -- f ) select(2)
        io-tmpfile     ( -- io )        returns temporary file IO object
        net-eos?       ( fd -- f )      end of stream?
        net-getpeername ( sfd -- name ) returns foreign name of SFD
        net-getsockname ( sfd -- name ) returns local name of SFD
        net-socketpair ( type -- sfd-ary ) returns array with socket pair
        net-sendto2    ( fd msg flags host port domain -- ) old net-sendto
        net-recvfrom2  ( fd flags host port domain -- msg ) old net-recvfrom
        net-sendto     ( fd msg flags addr -- ) new using addr sendto
        net-recvfrom   ( fd flags addr -- msg ) new using addr recvfrom
        make-sockaddr  ( host port domain -- addr ) builds sockaddr struct
        make-socket-io ( fd -- io )     wraps FD in a socket IO
        fd-close       ( obj -- )       closes OBJ with io-close or close(2)
        fd-dup2        ( oldfd newfd -- ) performs dup2(2)
        fd-ioctl       ( fd request flag -- res ) ioctl(2)

* src/misc.c:

	New public C-function:

	FTH fth_uname(void);

	New Forth-words:

        openlog    ( id opt fac -- )    syslog words for daemons
        syslog     ( prio fmt args -- ) syslog
        closelog   ( -- )               syslog
        umask      ( mask=nil -- mask ) get/set umask
        getsid     ( pid -- sid )       get session id
        setsid     ( -- sid )           set session id
        getrusage  ( -- ary )   returns an array of resource utilization
        .getrusage ( -- )       prints resource utilization
        uname      ( -- hs )    returns hash with uname entries
        .uname     ( -- )       prints uname entries
        errno      ( -- n )     returns current set error number
        strerrno   ( n -- str ) returns corresponding message string
        strsignal  ( n -- str ) returns signal description
        _exit!     ( n -- )     calls C function _exit(2)

	Slightly changed behavior:  They all replace '~' as first
	character in name with $HOME.  'require ~/my-test.fs', for
	example, is now possible.

        FTH fth_load_file(const char *name);
        FTH fth_require_file(const char *name);
        include ( "name" -- )
        require ( "name" -- )
        load-init-file ( name - )

* src/regexp.c:

	New pubic C-function:

        int fth_regexp_find_flags(const char *reg, const char *str, int flags);

	New constants for regcomp() cflags:

        REG_BASIC
        REG_NOSPEC
        REG_PEND

	New variable and constants for regexec() eflags:

        *re-exec-options*
        REG_NOTBOL
        REG_NOTEOL
        REG_STARTEND

* src/string.c:

	The C function as well as the Fth word now take a string or
	regexp as search key similar to string-find.

        int fth_string_member_p(FTH string, FTH string_or_regexp);
        string-member? ( str str-or-reg -- f )

	New Forth-words:

        fth-stdout ( fmt :optional args -- ) prints to FILE *stdout
        fth-stderr ( fmt :optional args -- ) prints to FILE *stderr
        fth-debug  ( fmt :optional args -- ) prints to FILE *stderr

* src/utils.c:

	New public C-function for duplicating strings with length.
	This may be of use with ficlString which are not necessarily
	null-terminated.
	
        char *fth_strndup(const char *, size_t);

	New public C-function to replace popen(3).  If the global
	environment variable is set, this shell is used to exec.  If
	this variable isn't defined, the usual popen(3) function is
	used.

        FILE *fth_popen(const char *, const char *);
        FTH_POPEN_SHELL                      new environment variable

* examples/fth-lib/fth.fs:

	Some words moved from src/string.c to fth.fs.  Ficl output and
	FILE *stdout may differ if the Ficl output was changed.  The
	same with Ficl error output and FILE *stderr.  That's why those
	different words.

        warning ( str -- ) alias: warn       prints to Ficl output
        error   ( str -- )                   prints to Ficl error output
        die     ( str -- )                   prints to Ficl error output
        .stdout ( obj -- )                   prints to FILE *stdout
        .stderr ( obj -- )                   prints to FILE *stderr
        .debug  ( obj -- )                   prints to FILE *stderr

* examples/fth-lib/net.fs:

	New file net.fs added.

* examples/scripts/stevens.fs:

	New file stevens.fs added.

	File examples/scripts/stevens.fs contains four pairs of
	client/server examples taken from UNIX Network Programming by W.
	R. Stevens.  You can test these examples on the command line.
	You may also start the server in a different terminal without
	'&'.  On the client side put in some text which should be echoed
	back.  A dot '.' on an empty line closes the client session.
	The server must be killed.

        fth -e tcp-server stevens.fs &
        fth -e tcp-client stevens.fs

        fth -e udp-server stevens.fs &
        fth -e udp-client stevens.fs

        fth -e unix-str-server stevens.fs &
        fth -e unix-str-client stevens.fs

        fth -e unix-dg-server stevens.fs &
        fth -e unix-dg-client stevens.fs

2019-12-08: fth v1.4.1
======================

* log1p for log(x + 1) and expm1 for exp(x) - 1 (thanks to Sanjay Jain!)

        alias flog1p added for flogp1

* new fenv(3) words and corresponding constants:

        fegetround ( -- n )
        fesetround ( n -- )
        FE_TONEAREST
        FE_DOWNWARD
        FE_UPWARD
        FE_TOWARDZERO

2019-11-23: fth v1.4.0
======================

* libcrypto/openssl dependency removed

* bignum and ratio

	multi-precision library added from
	/usr/xsrc/external/mit/xedit/dist/lisp/mp/mp*.[ch] to ./lib/ for
	bignum and ratio numbers

* new bignum words in src/numbers.c and tests/numbers.fs

        bgcd  ( x y -- z )       z = gcd(x, y)
        blcm  ( x y -- z )       z = lcm(x, y)
        broot ( b1 u -- b2 n )   b2 = root(b1, u); n=1 if exact, n=0 otherwise
        bsqrt ( b1 -- b2 n )     b2 = sqrt(b1);  n=1 if exact, n=0 otherwise
        bmod  ( b1 b2 -- b3 )    b3 = b1 % b2
        b/mod ( b1 b2 -- b3 b4 ) b1 / b2;  b3 = reminder;  b4 = quotient 

# 2019-11-10: fth v1.3.9
# 2014-12-28: fth v1.3.8
# 2013-08-26: fth v1.3.7
# 2012-11-28: fth v1.3.6
# 2012-03-01: fth v1.3.1
# 2012-02-17: fth v1.3.0
# 2010-08-28: fth v1.2.9
# 2009-11-06: fth v1.2.8
# 2009-10-11: fth v1.2.7
# 2009-07-13: fth v1.2.6
# 2009-06-18: fth v1.2.5
# 2009-05-04: fth v1.2.4
# 2008-11-26: fth v1.2.2
# 2008-10-16: fth v1.2.1
# 2008-10-15: fth v1.2.0
# 2007-06-26: fth v1.1.0
# 2006-12-30: fth v1.0.4
# 2006-10-30: fth v1.0.0
# 2006-04-16: fth v0.8.9
# 2006-03-27: fth v0.8.8
