OS4 DepotLogo by Liksmaskaren 
(anonymous IP: 54.158.194.80,0) 
 HomeRecentStatsSearchMirrorsContactInfoDisclaimerConfigAdmin
 Menu

 Features
   Crashlogs
   Bug tracker
   Locale browser
 
 Categories

   o Audio (328)
   o Datatype (47)
   o Demo (180)
   o Development (533)
   o Document (21)
   o Driver (88)
   o Emulation (141)
   o Game (858)
   o Graphics (457)
   o Library (93)
   o Network (201)
   o Office (56)
   o Utility (807)
   o Video (61)

Total files: 3871

Full index file. Download
Recent index file. Download




 Links

  Amigans.net
  OpenAmiga
  Aminet
  UtilityBase
  IntuitionBase
  AmigaBounty


Support the site


 Readme for:  Development » Utility » txt2char.lha

Txt2char

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
 
Images:
 
Videos:
Comments: 1
Snapshots: 0
Videos: 0
Downloads:  (Current version)
 (Accumulated)

[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.


Example
-------

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);
  //..


Changes
-------
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.

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



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