Safe Strings Library Reference Manual

Safe Strings library, version 2.0.1
Home  Next

1. Safe Strings Overview

  1. What is this library good for?
  2. License
  3. What is new?
  4. Compiling the safe Strings library
  5. How to link
  6. Subversion Repository
  7. Main developers
  8. How to become a developer

I. What is this library good for? top 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 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 Top

IV. Compiling the safe Strings library top Top

Download the latest sources from http://klingsor.informatik.uni-freiburg.de/projects/sstrings
You need The Boehm-Demers-Weiser conservative garbage collector

SString 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
$ tar xjpf sstrings-2.0.1.tar.bz2
$ cd sstrings-2.0.1
# installing withou testing
$ ./configure --prefix=/usr && make && make install
# type 'make test' for a test of the library

V. How to link top Top

The GCC Linker needs the -lsstrings2 option. Please see: "Hello World" with SStrings

VI. Subversion Repository top 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
$ svn co --username guest https://klingsor.informatik.uni-freiburg.de/svn/sstrings
Authentication realm: <https://klingsor.informatik.uni-freiburg.de:443> sstrings repository
Password for 'guest': 
A  sstrings/trunk
A  sstrings/trunk/mkinstalldirs
A  sstrings/trunk/AUTHORS
A  sstrings/trunk/depcomp
A  sstrings/trunk/ChangeLog
...

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
Certificate information:
 - Hostname: klingsor.informatik.uni-freiburg.de
 - Valid: from Nov  6 01:59:09 2005 GMT until Nov  6 01:59:09 2007 GMT
 - Issuer: Poolmgr, Poolmgr, Freiburg, Baden-Wuerttenberg, DE
 - Fingerprint: f9:25:db:d4:b5:5a:1f:af:fc:f6:83:af:0b:96:e9:7c:8a:67:9b:03

VII. Main developers top 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 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.

Valid XHTML 1.0 Strict   Valid CSS! This document is release under the terms of the GPL-2. Written by Pablo Yanez Trujillo