Safe Strings Library Reference Manual
Safe Strings library, version 2.0.1
1. Safe Strings Overview
- What is this library good for?
- License
- What is new?
- Compiling the safe Strings library
- How to link
- Subversion Repository
- Main developers
- How to become a developer
I. What is this library good for? Top
Safe Strings is a small C library that handles C strings in a safe way. The functions of this library look at the necessary space for the operations and try to reserve that space (with malloc or realloc). The functions only begin working with their tasks when the memory allocation is successful.
I was tired having to implement in each project some functions that handle with C Strings in a safe way. It is not always easy when you have to use malloc/realloc all the time and you have always to check whether malloc/realloc return NULL or not. C newbies often don't know how to use C Strings or don't use malloc/realloc carefully. So that's why I decided to write this small library.
I was working with sstrings-1.3 for a long time. Then I realised that this library is not so easy to use as I thought first. Then I had to work with GTK+ and I was very impressed by the GString-object from the GLib. I decided then to rewrite sstrings using some ideas from the GLib such as creating a new string object rather than working with pointers to pointer of chars (char**).
NOTE: It is important to know that I am not trying to create a clone of the GLib library. SString does not contain code from the GLib nor implements GLib functions, and SString works only with strings.
II. License Top
SStrings is distributed under the terms of the GNU General Public License Verison 2 (GPL-2). SStrings uses The Boehm-Demers-Weiser conservative garbage collector, please take a look at its license.
III. What is new? Top
- The version 2.0.1 is the first version of sstrings which implements a string object.
- A garbage collector can be used if you don't want to free the memory by yourself.
IV. Compiling the safe Strings library Top
Download the latest sources from http://klingsor.informatik.uni-freiburg.de/projects/sstrings
You need The Boehm-Demers-Weiser conservative garbage collectorSString is mainly developed with a Pentium 4 computer running Gentoo Linux with GCC 3.4.4, hence I don't know if sstrings can be compiled with older version of GCC. Execute following code from a shell:
BASH: command line
V. How to link Top
The GCC Linker needs the
-lsstrings2
option. Please see: "Hello World" with SStrings
VI. Subversion Repository Top
You can download a daily snapshot of the sources from our repository. You can use the
svn
tool, too. You will only have read-rights. If you want to to get write-rights then read this: How to become a developer.
User: guest Password: Just press ENTER (no password) BASH: command line
Note: Do not forget to execute (twice) the
autogen.sh
script before you compile the library.Note: You have to accept the authenticity certificate from the server
Certificate information from https://klingsor.informatik.uni-freiburg.de
VII. Main developers Top
Pablo Yánez Trujillo (supertux) yanezp at informatik.uni-freiburg.de
Cong Wang (cong) xiyou.wangcong at gmail.com
VIII. How to become a developer Top
Everybody can join the developers team. You only have to know how to write ANSI C code. Please send me an email to yanezp at informatik.uni-freiburg.de and you will get write access to our repository.