OS4 DepotLogo by Browallia 
(anonymous IP:,0) 

   Bug tracker
   Locale browser

   o Audio (333)
   o Datatype (50)
   o Demo (196)
   o Development (566)
   o Document (21)
   o Driver (96)
   o Emulation (143)
   o Game (936)
   o Graphics (485)
   o Library (105)
   o Network (221)
   o Office (61)
   o Utility (868)
   o Video (65)

Total files: 4146

Full index file. Download
Recent index file. Download



Support the site

 Readme for:  Development » Utility » txt2char.lha


Description: Transforms textfile to 1-dim char array (char[])
Download: txt2char.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 9kb
Version: 1.20
Date: 20 Feb 11
Author: angel bitch / candle (CDL) & slut nancy / broke ass hoes (BAH)
Submitter: Marko Seppänen
Homepage: http://www.m4rko.com/candle
Category: development/utility
Replaces: development/utility/txt2char.lha
License: Other
Distribute: yes
Min OS Version: 4.0
FileID: 6251
Comments: 1
Snapshots: 0
Videos: 0
Downloads:  (Current version)

[Show comments] [Show snapshots] [Show videos] [Show content] [Show crashlogs] 
txt2char - 1.20

Transforms an Amiga-ASCII compatible textfile (including any tabs and
newlines) to a one-dimensional char array (char[]) ready to be included
and printed in C.

Usage: txt2char <filename> [variable_name]

C source code (with some comments) and a makefile is included in the package.


Let's say you have a textfile named "test.txt".

Then will the following in Shell:

  txt2char test.txt some_var > test.h

Transform it to another file called "test.h". This can then in C be included
and printed straight out like:

#include "test.h"
printf("%s", some_var);

1.20: (Feb 2011)
  - Now compiled with the speed optimization flag on, whereas the test is
    compiled with the size optimization.
  - Increased path/name buffers from 256 to 2048 bytes.
  - Added checks for buffer overflows.
  - Simplified things, the test file is now an own source file.
  - Changed so that the return codes are included rather than hard coded.
  - Added a make file for convenience.
1.11: (Feb 2011)
  - Fixed correct return codes.
  - Added Amiga-version string.
  - Expanded the test text file with an ASCII-image...
  - Included a ready-made test_txt2char executable for your convenience.
1.10: (Feb 2011)
  - Added a TEST_MODE with test code to check for correctness.
  - Fixed issue, "warning: unknown escape sequence '\^'".
  - Fixed issue, "instructions in usage text not quite right". 
  - Fixed bug, "% got tranformed to %%".
  - Fixed bug, "each line gets an extra trailing space".
  - Fixed bug, "one extra space gets added to the top of string".
  - Added instructions and fixed a lot of typos, etc. in readme file.
1.00: (2011)
  - Changed tranformation so it produces a one-dimensional char array instead.
  - Added a VARIABLE_NAME option so it's possible to name the variable.
  - Changed code formatting to another one.
  - Added a few more checks, etc.
  - New version named to txt2char.
0.50: (Sep 2008)
  - txt2c version 0.5.

txt2char by angel bitch / candle (CDL)
derives from txt2c 0.5 (sep 2008) by slut nancy / broke ass hoes (BAH).

Copyright (c) 2004-2021 by Björn Hagström All Rights Reserved
Amiga OS and its logos are registered trademarks of Hyperion Entertainment