home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- TextEngine/--background--
- TextEngine/--compiling--
- TextEngine/--history--
- TextEngine/--todo--
- TextEngine/TextEngine
- TextEngine/TextEngineJD
- TextEngine/--background-- TextEngine/--background--
-
- NAME
- TextEngine -- This module helps you with text features (V33)
-
- FUNCTION
- This module handles strings with different % commands
-
- NOTES
- None.
-
- COPYRIGHT
- This software is copyrighted 1994-95 by Kai Hofmann.
- All rights reserved!
-
- - Permission for COMMERCIAL USE is only given by an extra available
- commercial license that must be validated!
- Contact me directly for this license, because it will be
- individually handed out per your needs!
-
- - Permission is hereby granted, without written agreement and without
- license, to USE this software and its documentation for any
- NON-COMMERCIAL purpose, provided that the above copyright notice
- and the following paragraph appear in all copies of this software
- (Non-commercial includes Giftware and Shareware!).
-
- You *must* include the following notice in your product and in your
- documentation:
- "This software uses the textengine that is copyrighted 1994-95 by
- Kai Hofmann"
-
- You "must" send me a full version of your product at no cost
- including free updates!
- Extra money is welcome (For Bank Account see below - but *ONLY*
- send in DM to this Bank Account!).
-
- - THERE IS *NO PERMISSION* GIVEN TO MODIFY THIS SOFTWARE!
-
- If you need only parts of this software, you should not worry,
- because it's the job of the optimizer from your C compiler to
- include only the needed parts in your executable!
-
- DISCLAIMER
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
- HOLDER AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
- WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
- PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
- DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
- CORRECTION.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY REDISTRIBUTE
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
- ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING
- BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
- LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
- TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
- PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
- THE AUTHOR HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
- UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
- DISTRIBUTION
- Permission is hereby granted, without written agreement and without
- license or royalty fees, to copy and distribute this software and its
- documentation for any purpose, provided that the above copyright
- notice and the following paragraphs appear in all copies of this
- software, to:
- - All who will distribute this software for free!
- - All free accessible INTERNET servers and PHONE boxes!
- - All Aminet sites
- - All SimTel sites
- - Fred Fish for his great Amiga-Software-Library
- - The German SAAR AG PD-Library
- - All others who do NOT take more than $5.- for one disk that
- includes this software!
- - ALL others who do NOT take more than $40.- for one CD that includes
- this software!
-
- ADDITIONAL INFORMATIONS
- I have tried to make portable/useful and I hope bugfree software
- for eternity!
- So I hope very much that to some extend I will be compensated for my
- hard work - monetarily or otherwise:-)
-
- Kindly send US - dollars to a friend of mine in the USA who will
- forward it to me in a timely manner. Please send checks or money
- orders only.
- Contact me via email for more!
-
- AUTHOR
- Kai Hofmann
- Arberger Heerstraße 92
- 28307 Bremen
- Germany
-
- Phone: (+49)-(0)421/480780
- (Remember that my parents don't speak english!)
- EMail: i07m@zfn.uni-bremen.de
- i07m@informatik.uni-bremen.de
- IRC : PowerStat@#AmigaGer
- WWW : http://www.informatik.uni-bremen.de/~i07m
-
- Bank account : 1203 7503
- Account owner: Kai Hofmann
- Bank code : 290 501 01
- Bank name : Sparkasse in Bremen/Germany
-
- THANKS
- Thank you's are going to the following people:
- Rita Reichl - For correcting my bad english (very often)
- Christian Schaefer - For spending time on this code with his
- Borland C++ 4.5 compiler
- Jacco van Weert &
- Frans Slothouber - For the 'Robodoc' utility
-
- TextEngine/--compiling-- TextEngine/--compiling--
-
- NAME
- compiling -- Specials for compiling the textengine.
-
- COMPILING
- - You could compile this code as normal C or as C++
-
- TextEngine/--history-- TextEngine/--history--
-
- NAME
- history -- TextEngine is a module to help with text features
-
- VERSION
- $VER: TextEngine 33.071 (28.07.95)
-
- HISTORY
- 22.02.1994 - DateString() initiated.
- 23.02.1994 - Continuation of DateString(), making FormatStr() and
- copying max from old Datum.mod
- TimeString() Initiated.
- 24.02.1994 - Inserting %w command in DateString()
- 04.03.1994 - Starting translation into C
- 21.01.1995 - Continuation of translation to C,
- using new date library functions.
- Internal procedures: FormatStr(), strdel(),
- strinspos()
- TimeString() completly rewritten.
- 04.02.1995 - TimeString() completly rewritten.
- Bug fixes in strinspos().
- 05.02.1995 - DateString() completly rewritten.
- Eliminating FormatStr(), because there is no need for
- it, at the moment.
- TextEngine(), TextEngineJD() initiated.
- 06.02.1995 - Small changes in the autodocs
- 16.02.1995 - Fixing bugs found with C++
- Adding C++ overloading to TextEngine() &
- TextEngineJD()
- 24.02.1995 - Rita Reichl corrects my bad English - again.
- 16.03.1995 - Corrections and changes in the autodocs.
- 22.03.1995 - Introducing DiffDateString().
- Changing interface!!!
- 02.04.1995 - More C++ Support! Adding To-Do list.
- Adding NOTES to autodocs. Fixing some things.
- Introducing DiffTimeString(),StringString().
- 07.04.1995 - Fixing two bugs.
- 17.04.1995 - Integrating StringString()
- 22.04.1995 - Rita Reichl corrects my bad English - again.
- 14.05.1995 - New copyright notice!
- 16.05.1995 - Fixing two small bugs.
- 19.05.1995 - Rita corrects my English.
- 24.05.1995 - Changing interface of TextEngine(), TextEngineJD(),
- StringString()
- Rewriting StringString() to support additional insert
- strings.
- 25.05.1995 - Writing test program
- 08.06.1995 - Writing --compiling-- autodoc and some other small
- fixes in the autodocs.
- 18.06.1995 - Fixing C++ warnings/errors in textenginetest.c
- 18.07.1995 - Replacing abs() with labs() to avoid problems!
- Changing header from *strarr[] to **stararr
- 28.07.1995 - Shortening the year of the version-string to 95,
- because the Amiga 'version' command is buggy!
-
- TextEngine/--todo-- TextEngine/--todo--
-
- NAME
- todo -- This is the 'To-Do' list of the TextEngine module
-
- TODO
- Find out about the Borland C++ 4.5 report about lines 140/150 in
- textenginetest.c 'suspicious pointer conversion' / 'could not match
- TextEngine()' :
- void TextEngine(char *const string, double jd, const Languages lang,
- double jd2, const char *const *const strarr);
- ----- (That's what the compiler does not like!)
-
- TextEngine/TextEngine TextEngine/TextEngine
-
- NAME
- TextEngine -- Fills up %-commands (V33)
-
- SYNOPSIS
- TextEngine(string,day,month,year,hour,min,sec,lang,day2,month2,
- year2,hour2,min2,sec2,strarr);
- TextEngine(string,jd,lang,jd2,strarr)
-
- void TextEngine(char *const string, const unsigned short day,
- const unsigned short month, const int year = 0,
- const unsigned short hour = 0, const unsigned short min = 0,
- const unsigned short sec = 0, const Languages lang = English,
- const unsigned short day2 = 0, const unsigned short month2 = 0,
- const int year2 = 0, const unsigned short hour2 = 0,
- const unsigned short min2 = 0, const unsigned short sec2 = 0,
- const char *const *const strarr = NULL);
-
- void TextEngine(char *const string, double jd,
- const Languages lang = English, double jd2 = 0.0.
- const char *const *const strarr = NULL);
-
- FUNCTION
- Finds and replaces % commands with real values.
-
- INPUTS
- string - String with % commands
- day - The day to fill in for % command
- month - The month to fill in for % command
- year - The year to fill in for % command, if this is 0 it will not
- filled in!
- hour - The hour to use
- min - The minute to use
- sec - The sec to use
- lang - The language to use for texts
- day2 - The diff. day
- month2 - The diff. month
- year2 - The diff. year, if you use 0, this will mean: use the same
- as year!
- hour2 - The diff. hour
- min2 - The diff. minute
- sec2 - The diff. second
- strarr - Stringarray with the strings to insert, terminated by NULL
-
- RESULT
- string - String without % commands, but with real values
-
- EXAMPLE
- ...
- string = "Only a test!";
- TextEngine(string,18,9,1970,14,44,0,English,22,3,1995,15,14,0,NULL);
- ...
-
- SYNTAX
- Syntax of % commands:
- %% : %
- %+DTj : JD.JD date+time
- %+DTJ : MJD.JD date+time
-
- %D1[2][3]
- 1 : d : day
- m : month
- M : month text
- y : year
- w : weekday
- W : week
- s : scaliger year
- j : JD
- J : MJD
- 2 : v : variable length
- f : fixed length
- s : short text
- l : long text
- 3 : 2 : short year
- 4 : full year
-
- %Ddv - supported: d[d]
- %Ddf - supported: dd
- %Dmv - supported: m[m]
- %Dmf - supported: mm
- %DMs - supported: MMM
- %DMl - supported: M..M
- %Dyv2 - supported: y[y]
- %Dyv4 - supported: y[y[y[y]]]
- %Dyf2 - supported: yy
- %Dyf4 - supported: yyyy
- %Dws - supported: ww[w]
- %Dwl - supported: w..w
- %DWv - supported: W[W]
- %DWf - supported: WW
- %Dsv - supported: s[s[s[s]]]
- %Dsf - supported: ssss
- %Dj - supported: j..
- %DJ - supported: J..
-
- %T1[2]
- T : time identifier
- 1 : h : hour 24h format
- H : hour 12h format without "am/pm" text
- M : "am/pm" text
- m : minute
- s : second
- j : jd time
- 2 : v : variable length
- f : fixed length
-
- %Thv - supported: h[h]
- %Thf - supported: hh
- %THv - supported: h[h]
- %THf - supported: hh
- %TM - supported: am|pm
- %Tmv - supported: m[m]
- %Tmf - supported: mm
- %Tsv - supported: s[s]
- %Tsf - supported: ss
- %Tj - supported: j
-
- %AD1
- 1 : d : Difference from the given date to the actual date in days.
- y : Difference from the given date to the actual date in years.
-
- %ADd - supported: d[d..]
- %ADy - supported: y[y..]
-
- %AT1
- 1 : h : full hours
- m : full minutes
- s : full seconds
- H : all in hours
- M : all in minutes
- S : all in seconds
- j : as JD time difference
-
- %ATh - supported: h[h..]
- %ATm - supported: m[m]
- %ATs - supported: s[s]
- %ATH - supported: h[h..][.h[h..]]
- %ATM - supported: m[m..][.m[m..]]
- %ATS - supported: s[s..]
- %ATj - supported: j
-
- %S
- S : string identifier
-
- %S - supported: s
-
- NOTES
- If day2 and month2 are both 0 only year2-year will be calculated
- for %ADy, don't use %ADd in this situation!
- Think before using:
- TextEngine(str,18,9,1970,0,0,0,English,18,9,1995,0,0,0) or
- TextEngine(str,18,9,1995,0,0,0,English,18,9,1970,0,0,0)
-
- BUGS
- Keep care that in string is enought space to expand it - if not
- unknown effects may occur!
-
- SEE ALSO
- DateString(), TimeString()
-
- TextEngine/TextEngineJD TextEngine/TextEngineJD
-
- NAME
- TextEngineJD -- Fills up %-commands (V33)
-
- SYNOPSIS
- TextEngineJD(string,jd,lang,jd2,strarr);
-
- void TextEngineJD(char *const string, double jd,
- const Languages lang = English, double jd2 = 0.0,
- const char *const *const strarr);
-
- FUNCTION
- Finds and replaces % commands with real values.
-
- INPUTS
- string - String with % commands.
- jd - The JD including time information.
- lang - The language to use for texts.
- jd2 - The diff. JD.
- strarr - Stringarray with the strings to insert, terminated by NULL
-
- RESULT
- string - String without % commands, but with real values.
-
- EXAMPLE
- ...
- string = "Only a test!";
- TextEngineJD(string,2449754.630556,English,2449700,NULL);
- ...
-
- SYNTAX
- Syntax of % commands:
- See TextEngine()
-
- NOTES
- See TextEngine().
-
- BUGS
- Unknown.
-
- SEE ALSO
- TextEngine()
-
-