Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.332.469 Times

ustr 1.0.1

  Date Added: April 11, 2010  |  Visits: 731

ustr

Report Broken Link
Printer Friendly Version


Product Homepage
Download (100 downloads)



ustr (Micro string library) is a string API for C. A few years ago now I wrote a very extensive String API for C, called Vstr, it was designed to perform extremely well for IO like patterns as that was my planned usage (for instance And-httpd, my Web server). It works very well, for that usage. Also due to the extensivness of the API I basically used it everywhere, even though there are some things it is somewhat "overkill" for, and I wanted other people to use it so I didnt have to resort to using string.h when creating patches for their code. However more than a few C coders I speak to have one of a few reasons why they dont want to use Vstr. The ustr API should solve all of these problems, and hopefully fill in all the gaps where Vstr is the 500lb hammer. A Significant example of usage, with comments: Ustr *s1 = USTR(""); /* == "", always works */ Ustr *s2 = ustr_dup(s1); /* == "", always works */ Ustr *s3 = ustr_dup_cstr(""); /* == "", always works */ ustr_cmp_eq(s1, s2); /* == TRUE */ ustr_cmp_eq(s1, s3); /* == TRUE */ if (ustr_shared(s2)) /* This is TRUE, as a constant/read-only string cannot be freed */ /* whatever */ ; if (ustr_ro(s2)) /* This is TRUE */ /* whatever */ ; if (!ustr_add_fmt(&s2, "%s %d %c%d", "x", 4, 0, 8)) /* error */ ; if (ustr_owner(s1)) /* This will return FALSE, as noone owns the "" read-only string */ /* whatever */ ; if (ustr_owner(s2)) /* This will return TRUE, as weve now got allocated memory for s2 */ /* whatever */ ; foo_API(ustr_cstr(s1), ustr_len(s1)); /* == "", 0 */ foo_API(ustr_cstr(s2), ustr_len(s2)); /* == "x 4 008", 6 */ s3 = ustr_dup(s2); /* dont need to free s3 as its empty */ /* dont need to check for errors as s2 == s3 */ if (ustr_owner(s2)) /* This will now return FALSE, weve got two references: s2 and s3 */ /* whatever */ ; if (ustr_shared(s2)) /* This is FALSE, its a non-shared string referenced by both s2 and s3 */ /* whatever */ ; ustr_free(s2); /* freed one reference to the data pointed to by both s2 and s3 */ ustr_set_share(s2); /* Make s2/s3 "shared" data, so it always has infinite references */ if (ustr_shared(s2)) /* This is TRUE */ /* whatever */ ; if (ustr_ro(s2)) /* This is FALSE */ /* whatever */ ; s3 = ustr_dup(s2); /* This is the same as s3 = s2; */ ustr_free(s2); /* These do nothing */ ustr_free(s2); ustr_free(s2); ustr_free(s2); if (!ustr_add_cstr(&s3, "abcd")) /* error */ ; ustr_add_cstr(&s3, "1234"); ustr_add_cstr(&s3, "xyz"); if (ustr_enomem(s3)) /* check for errors on the last 2 ustr_add_cstr() functions at once ustr_owner(x) has to be true for this to be reliable, hence the explicit first check */ /* error */ ; ustr_set_owner(s2); /* Make s2 be "non-shared" and have a single owner */ ustr_set_owner(s1); /* This fails, as you cant make a read-only string be "non-shared" */ ustr_sc_del(&s2); /* freed s2 and set s2 = USTR("") */ ustr_cmp_eq(s1, s2); /* == TRUE */ s2 = USTR1(x0b, "Hello world"); /* Constant string with data */ if (ustr_shared(s2)) /* This is TRUE */ /* whatever */ ; if (ustr_ro(s2)) /* This is TRUE */ /* whatever */ ; /* dont need to "free" anything else */ Whats New in This Release: - A lot of new functions were added, such as insert, replace, split, substitute, and io_getdelim. - Documentation improvements were made. - Build fixes were made for Win32..

Requirements: No special requirements
Platforms: Linux
Keyword: Api False Libraries Programming String True Ustr Whatever
Users rating: 0/10

License: Freeware Size: 819.2 KB
USER REVIEWS
More Reviews or Write Review


USTR RELATED
Science  -  Java API for NMEA Programming. 1.0
Java API for NMEA programming. Java Parser for NMEA Streams.
47.59 KB  
Libraries  -  B::Deparse 5.8.8
B::Deparse is a Perl compiler backend to produce perl code. SYNOPSIS perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l] [,-sLETTERS][,-xLEVEL] prog.pl B::Deparse is a backend module for the Perl compiler that generates perl source code, based on...
12.2 MB  
Development Tools  -  uapi 1.0
unified API (uAPI) provide an object oriented API for some programming language with the target to support implements same algorithm with same steps in different languages. It allows the programmers to use the favorit and best language without...
 
Libraries  -  Jifty::Client 0.60912
Jifty::Client is a subclass of WWW::Mechanize with extra Jifty features. This module is a base for building robots to interact with Jifty applications. It currently contains much overlapping code with Jifty::Test::WWW::Mechanize, except that it...
532.48 KB  
Libraries  -  Class::Method::hash 2.08
Class::Method::hash is a Perl module that helps you create methods for handling a hash value. SYNOPSIS use Class::MethodMaker [ hash => [qw/ x /] ]; $instance->x; # empty $instance->x(a => 1, b => 2, c => 3); $instance->x_count == 3; #...
89.09 KB  
Libraries  -  LBC Libraries 0.0.7
LBC Libraries is a set of easy C libraries that provide classical data types and structures (string, hash, queue, stack, tree). LBC Libraries package is focused on simplicity and portability. It uses ANSI C (C98 standard not required), and...
57.34 KB  
Libraries  -  Inline-API 0.44
Inline-API is a Perl module that teach you how to bind a programming language to Perl using Inline.pm. SYNOPSIS #!/usr/bin/perl use Inline Foo; say_it(foo); # Use Foo to print "Hello, Foo" __Foo__ foo-sub say_it { foo-my $foo =...
91.14 KB  
Code Management Tools  -  2E Programming Language 0.8.2
2E Programming Language (two es, as in ee, or expression evaluator) is a simple algebraic syntax language. It natively supports expressions (composed of operators and operands), and function definitions, and basically nothing else. Therefore, it...
31.74 KB  
Libraries  -  Regular Statement String 2.5.7
Regular Statement String (RSS) provides several libraries in C, Java, and COM to implement and demonstrate the key-value development method using well-designed "strings" (RSS) as the media. Regular Statement String also shows a way to write...
337.92 KB  
Libraries  -  LSF 0.9
LSF is a Perl API built on top of the LSF command line tools. SYNOPSIS use LSF; use LSF RaiseError => 1, PrintError => 1, PrintOutput => 1; NOTE: FOR THESE MODULES TO WORK IT IS ESSENTIAL THAT YOU INCLUDE THE LSF COMMAND LINES IN YOUR PATH....
12.29 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB