From: Chris La Mantia <lamantia@gte.net>
To: Allegro Mailing List <allegro@canvaslink.com>
Subject: ANNOUNCE: Textdata 2.0 beta
Date: Thursday, July 16, 1998 1:53 AM

I've added some functions to the TEXTDATA library; for those of you who are
using this library and would like to help test it, please download the new
source code at http://home1.gte.net/lamantia/gameprog/allegro/td2beta.zip.
Copy the textdata.c and textdata.h over the ones on
\djgpp\allegro\addons\textdata\src, and re-run MAKE.  The following
functions will now be available:

char **create_textdata(void);
Creates an empty text data object.

char **add_textdata_string(char ** tdo, char *string);
Adds a string to the end of a text data object.

char **delete_textdata_string(char ** tdo, int s);
Removes string s from the specified text data object.

char **replace_textdata_string(char ** tdo, int s, char *string);
Replaces string s with string in the specified text data object.

int  save_textdata(char **tdo, char *filename, int method);
Saves a text data object to a file.  "Method" can be one of the following:
 TD_ZERO    Strings will be zero delimited
 TD_NEWLINE Strings will be newline delimited
 TD_COMMA   Strings will be enclosed in quotes and comma delimited

void **sort_textdata(char ** tdo, int method);
Sorts the text data object.  "Method" can be one of the following:
 SORT_ASCENDING          Sorts in ascending order by ASCII codes
 SORT_DESCENDING         Sorts in descending order by ASCII codes
 SORT_ASCENDING_NOCASE   Sorts in ascending order, ignoring case
 SORT_DESCENDING_NOCASE  Sorts in descending order, ignoring case

char **concatenate_textdata(char ** tdo1, char ** tdo2);
Concatenates tdo2 to tdo1, destroying tdo1.

void destroy_textdata(void *data);
Destroys a text data object.

char **load_textdata(char *filename);
Creates and loads a text data object, as created by MAKETEXT, from a file.

void *load_textdata_object(PACKFILE *f, long size);
Loads a text data object from an open file (used when loading datafiles)

char **insert_textdata_string(char **tdo, char *string, int s);
Inserts a string in a text data object at position s, moving all higher
strings up.

Manipulating text data objects may cause their locations to change, hence
you should always update the pointer for the text data object for functions
that return a pointer, like so:

tdo=add_textdata_string(tdo,"I'm a little teapot, short and stout.");

If any of this doesn't make any sense, please forgive me; it's 2am and I'm
rapidly reaching the "blithering idiot" stage.

For those of you who are just tuning in and have no idea what I'm talking
about, please see
http://members.home.com/celamantia/gameprog/allegro/textdata.htm.

Thanks!

--Chris

Chris La Mantia
celamantia@home.com


