Commit Graph

195 Commits

Author SHA1 Message Date
florian
29a2c433f7 * -Sr option for iso mode: in case no command line parameter is passed, the file name for program parameters is derived from their variable name
git-svn-id: trunk@35257 -
2017-01-07 14:50:58 +00:00
marco
7ef8f00100 * more occured -> occurred spelling fixes.
git-svn-id: trunk@35130 -
2016-12-14 20:05:21 +00:00
michael
3b3d5ab8be * Undid last commit
git-svn-id: trunk@34479 -
2016-09-10 12:12:39 +00:00
michael
4fa2ec7740 * Patch from Karl-Michael Schindler to prepend TMP to temp filename../inc/iso7185.pp
git-svn-id: trunk@34478 -
2016-09-10 12:04:24 +00:00
yury
e1a0b1204a * Removed unused vars in RTL.
git-svn-id: trunk@31750 -
2015-09-17 16:48:53 +00:00
Jonas Maebe
2afd8eb802 - removed FPC_HAS_STR_CURRENCY-related code, FPC 2.6.4 has it
git-svn-id: trunk@31692 -
2015-09-15 11:51:48 +00:00
florian
590ec0f3e6 * more procedures excluded to avoid internalerrors on avr after the trgobj.conservative fix
git-svn-id: trunk@31440 -
2015-08-28 18:49:07 +00:00
florian
7dd1d6aa77 o fixes handling of iso i/o parameters/program parameters:
* explicit reset is needed
  * variable must be declared again

git-svn-id: trunk@30757 -
2015-05-01 20:58:31 +00:00
florian
886e3e8d02 * disable several complex procedures for avr with a newly introduced define: EXCLUDE_COMPLEX_PROCS. They
might compile with an improved register allocator in the future

git-svn-id: trunk@30546 -
2015-04-11 14:43:39 +00:00
Jonas Maebe
60dbce940a * converted readstr/writestr to use system.Utf8CodePointLen()
git-svn-id: trunk@30049 -
2015-03-01 17:12:24 +00:00
florian
714901ce45 * fixes feature defines after recent changes
git-svn-id: trunk@28743 -
2014-10-04 18:12:09 +00:00
Jonas Maebe
8ac4a770a9 * check whether file/text is assigned in erase/rename (mantis #25932)
git-svn-id: trunk@27694 -
2014-04-30 18:31:22 +00:00
Jeppe Johansen
9b79f2f68d Added support for 8-bit CPU's in RTL. Mostly for missing implementations of int<->string conversion and console/text output.
git-svn-id: trunk@26958 -
2014-03-04 20:00:03 +00:00
florian
15df4a4f80 + support iso pascal like program parameters in iso mode
git-svn-id: trunk@26437 -
2014-01-12 20:17:51 +00:00
florian
e841027a48 * fixes handling of typed files in iso mode
git-svn-id: trunk@26436 -
2014-01-12 20:17:48 +00:00
Jonas Maebe
de59d6ac11 * prevent endless loop when writing an invalid utf-8 sequence longer than
32 bytes using writestr to a unicode/widestring

git-svn-id: trunk@26326 -
2013-12-30 14:30:56 +00:00
Jonas Maebe
d2b8275b99 + support for arbitrary encodings in readstr/writestr
o set the code page of the temporary "text" file to utf-8 for writestr with
     unicodestring/widestring as destination, so that no data loss can occur
     (+ properly deal with cases whereby part of an utf-8 character is
      written to the textbuf in this case)
   o explicitly pass the code page of the destination ansistring for writestr
     with ansistring as destination and set it for the temporary "text" file
   o set the code page of the text file for readstr

git-svn-id: trunk@26317 -
2013-12-29 19:18:49 +00:00
Jonas Maebe
ddf08b4eb7 * call TranslatePlaceholderCP() when comparing code pages to avoid
unnecessary conversions between CP_ACP and the current actual
    DefaultSystemCodePage
  * call TranslatePlaceholderCP() when changing the code page of a
    text file because in some cases this code page is passed directly
    to widestringmanager.Wide2AnsiMoveProc() (which does not perform any
    translation itself)

git-svn-id: trunk@26316 -
2013-12-29 19:18:36 +00:00
Jonas Maebe
df6a2dce00 + unicodestring support for assign/erase/rename
+ codepage support for textrec/filerec and the above routines
  * textrec/filerec now store the filename by default using widechar. It is
    possible to switch back to ansichars using the FPC_ANSI_TEXTFILEREC define.
    In that case, from now on the filename will always be stored in
    DefaultFileSystemEncoding
  * fixed potential buffer overflows and non-null-terminated file names in
    textrec/filerec
  + dodirseparators(pwidechar), changed the dodirseparators(pchar/pwidechar)
    parameters into var-parameters and gave those routines an extra parameter
    that indicates whether the p(wide)char can be changed in place if
    necessary or whether a copy must be made first (avoids us having to make
    all strings always unique everywhere, because they might be changed on
    some platforms via a pchar)
  * do_open/do_erase/do_rename got extra boolean parameters indicating whether
    the passed pchars point to data that can be freely changed (to pass on to
    dodirseparators() if applicable)
  * objects.pp: force assign(pchar) to be called, because
    assign(array[0..255]) cannot choose between pchar and rawbytestring
    versions (and removing the pchar version means that assign(pchar) will
    be mapped to assign(shortstring) in {$h-})
  * fixed up some routines in other units that depend on the format of
    the textrec/filerec.name field

git-svn-id: branches/cpstrrtl@25137 -
2013-07-19 16:30:51 +00:00
Jonas Maebe
a5273abc9c + support for CP_OEMCP
* changed all mappings from CP_ACP to DefaultSystemCodePage to calls to the
    new TranslatePlaceholderCP() routine (which also handles CP_OEMCP)
  * removed unnecessary CP_ACP adaptations in fpc_AnsiStr_Concat_multi()
    for JVM target (now handled in the ansistring to unicodestring conversion
    routine)

git-svn-id: branches/cpstrrtl@25091 -
2013-07-12 17:18:24 +00:00
florian
0e41df598e * merge i8086 branch by Nikolay Nikolov
git-svn-id: trunk@24324 -
2013-04-25 20:23:51 +00:00
nickysn
8b6b832677 + added helper functions for read/readln longint/longword on 16/8-bit cpus
git-svn-id: branches/i8086@24047 -
2013-03-28 23:56:47 +00:00
nickysn
697de721ef + added write/writeln helpers in the RTL for writing longints/longwords on 16/8-bit CPUs
git-svn-id: branches/i8086@24006 -
2013-03-25 23:21:42 +00:00
Jonas Maebe
e1e11f81e3 * fixed using readstr/writestr inside routines called from the parameter
list of another readstr/writestr expression (mantis #23912)

git-svn-id: trunk@23888 -
2013-03-17 14:23:33 +00:00
florian
d5985b4f0e * patch by Christophe Staïesse to implement more ISO-like read behaviour in iso mode, resolves #24060
git-svn-id: trunk@23884 -
2013-03-17 08:27:21 +00:00
florian
81e0e3114c * throw an error if threadvars are used but not supported
* fix building for arm-embedded

git-svn-id: trunk@23452 -
2013-01-19 15:17:47 +00:00
florian
420cd9bd27 + support for <text>^ in iso mode
git-svn-id: trunk@22512 -
2012-10-01 17:18:51 +00:00
florian
088a7229aa * use ValSInt parameter as code parameter in val calls to make the code cross platform
git-svn-id: trunk@22148 -
2012-08-20 20:12:04 +00:00
paul
1af45d7ec0 rtl: don't perform unneeded string conversions if string codepage matches codepage to convert (thanks to Sergey)
git-svn-id: trunk@21987 -
2012-07-31 01:24:36 +00:00
Jonas Maebe
aa9aeeada0 * fixed compilation on platforms without ansistring support since assigning
one ansistring to another requires a helper (mantis #21260, patch by
    Koenraad Lelong)

git-svn-id: trunk@20369 -
2012-02-17 13:16:32 +00:00
florian
6a1a2d3464 * get rid of some feature checks, probably the whole feature stuff is plainly the wrong way, embedded rtl compiles again, resolves #20913
git-svn-id: trunk@19907 -
2011-12-29 14:06:30 +00:00
Jonas Maebe
f67d7f08fc * use temporary location to construct writestr() string, because the
final destination may also be used in the other arguments
    (mantis #20744)

git-svn-id: trunk@19678 -
2011-11-24 19:56:21 +00:00
paul
60de075ebe rtl: initialize CodePage field of ReadStr/WriteStr Text variables
git-svn-id: trunk@19567 -
2011-10-31 07:07:24 +00:00
paul
5c00cdf40d rtl: correct ifdef for a code which assigns a codepage to textrec to use FPC_HAS_CPSTRING
git-svn-id: trunk@19548 -
2011-10-27 01:24:00 +00:00
florian
72425b49c9 * fixes bootstrapping with upcoming 2.6.x
git-svn-id: trunk@19547 -
2011-10-26 19:26:10 +00:00
paul
b7185a554c rtl:
- replace ifndef ver2_4 with ifdef FPC_HAS_CPSTRING for places with TextRec.CodePage access
  - convert codepages for Read and Write text file operations

git-svn-id: trunk@19545 -
2011-10-25 08:40:49 +00:00
paul
e08c68f308 rtl: set codepages for TextRec field when Text file is opened + update this field for standard IO files when cwstring is used
git-svn-id: trunk@19543 -
2011-10-25 06:27:54 +00:00
paul
2254dad68a rtl: add SetTextCodePage, GetTextCodePage functions which set/get TTextRec.CodePage field
git-svn-id: trunk@19541 -
2011-10-25 02:16:34 +00:00
paul
7a998aec3a compiler, rtl: add a codepage argument fpc_Read_Text_AnsiStr to create new AnsiString with the codepage of passed AnsiString argument
git-svn-id: trunk@19210 -
2011-09-24 17:43:30 +00:00
paul
9e0ad7baae merge r17318 from cpstrnew branch by florian:
* compilation fix by Inoussa OUEDRAOGO, resolves #19160

git-svn-id: trunk@19104 -
2011-09-17 13:01:20 +00:00
paul
2023b618ac merge r14131 from cpstrnew branch by paul:
rtl: do WriteStr without codepage conversion

git-svn-id: trunk@19092 -
2011-09-17 11:36:44 +00:00
Jonas Maebe
f4c31ecf3c + widestringmanager.codepointlengthproc added, which can be used to
determine the length of a multi-byte character. The return values
    are defined to be the same as those of POSIX' mblen: -1 =
    invalid/incomplete sequence, 0 = #0, > 0 = length of sequence in
    bytes.
  + default implementation for widestringmanager.codepointlengthproc
    (assumes all code points have length 1) and Unix implementation
    (based on mb(r)len); Windows implementation is still required
  * replaced default implementation of
    widestringmanager.CharLengthPCharProc with strlen() of the input
    instead of an error (correct if all code points have length 1,
    still needs Windows implementation)
  + implemented fpc_text_read_{wide,unicode}str() and
    fpc_text_read_widechar() (mantis #18163); fpc_text_read_widechar()
    uses the new widestringmanager.codepointlengthproc()
  + unicodestring support for readstr/writestr
  * fixed declaration of fpc_Write_Text_UnicodeStr (unicodestring
    instead of widestring parameter)
  * extended test/twide*.pp tests to test the new/fixed functionality

git-svn-id: trunk@16533 -
2010-12-10 14:10:01 +00:00
florian
18011b99cc o patch by Sven Barth, resolves #17827
* text.inc used Std*Handle without checking if the feature CONSOLEIO is present, fixed
  * OpenStdIO should use the type THandle for the hdl parameter, fixed

git-svn-id: trunk@16309 -
2010-11-06 19:47:17 +00:00
tom_at_work
19baf7d3e0 * changes to alignment for enumeration rtti record members: we need a Tconstptrint alignment before the MinValue/MaxValue members because the entire record needs that alignment due to some pointers inside
* changes to alignment for ordinal enumeration value to string accelerator tables so that we can define a single Pascal record to describe them for cleaner code
* some warnings in enumeration rtti generation indicating that if you change the code, you also have to change that in the RTL
* call fpc_shortstr_enum_intern in fpc_write_text_enum instead of copy&paste
* clean up code in fpc_shortstr_enum_intern:
  * unify data structures for lookup/search accelerator tables made possible by alignment changes in ncgrtti.pas
  * make clear that this is a partial copy&paste of the typinfo unit, also fix some alignment issues by introducing a fake inner record of Tenum_typedata
  * temporarily disable range checking for accesses to array[0..0] members of internal data structures
  * some documentation

git-svn-id: trunk@16229 -
2010-10-26 22:00:15 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
florian
9e053edf2e * fix iso i/o with unix style line feeds
git-svn-id: trunk@15706 -
2010-08-03 21:43:36 +00:00
florian
79fa2eb539 * support of iso pascal like i/o in iso mode
git-svn-id: trunk@15685 -
2010-07-31 20:46:27 +00:00
florian
c506913e9b * iso conformant writing of floats (using e instead of E) in iso mode
git-svn-id: trunk@15684 -
2010-07-31 20:45:55 +00:00
florian
d0ea23f39e * write false/true lower case in iso mode
git-svn-id: trunk@15678 -
2010-07-31 20:40:43 +00:00
Jonas Maebe
ab8b32dafb - removed PARAOUTFILE define and ifdefs
git-svn-id: trunk@12898 -
2009-03-15 12:31:02 +00:00