Skip to content

Commit a226736

Browse files
committed
Add Doxygen configuration
Signed-off-by: Michael Steinert <mike.steinert@gmail.com>
1 parent b152dc6 commit a226736

9 files changed

Lines changed: 2791 additions & 936 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
Doxyfile
2222
Makefile
2323
Makefile.in
24+
_build
2425
aclocal.m4
2526
autom4te.cache
2627
bstring-*.sha256sum

COPYING

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
Copyright 2002-2010 Paul Hsieh
2-
31
Redistribution and use in source and binary forms, with or without
42
modification, are permitted provided that the following conditions are met:
53

Doxyfile.in

Lines changed: 1871 additions & 0 deletions
Large diffs are not rendered by default.

Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ pkgconfig_DATA = bstring.pc
4747

4848
release: dist
4949
$(AM_V_GEN)sha256sum $(DIST_ARCHIVES) > $(PACKAGE)-$(VERSION).sha256sum
50+
51+
EXTRA_DIST = doc README.md

README.md

Lines changed: 41 additions & 895 deletions
Large diffs are not rendered by default.

configure.ac

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ AC_PREREQ([2.59])
1212
# interface_age = 0
1313
m4_define([major_version], [0])
1414
m4_define([minor_version], [1])
15-
m4_define([micro_version], [0])
16-
m4_define([interface_age], [0])
15+
m4_define([micro_version], [1])
16+
m4_define([interface_age], [1])
1717

1818
# Initialize autoconf & automake
1919
AC_INIT([Bstring], [major_version.minor_version.micro_version],
@@ -72,6 +72,7 @@ AM_CONDITIONAL([HAVE_CHECK], [test "x$have_check" = "xyes"])
7272
AC_CONFIG_HEADERS([config.h])
7373
AC_CONFIG_FILES([
7474
bstring.pc
75+
Doxyfile
7576
Makefile
7677
])
7778
AC_OUTPUT

doc/comparisons.md

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ The bstring library has significant advantages over CString:
1818

1919
Thus it is compatible with more programming environments and available to
2020
a wider population of programmers.
21-
2221
2. The internal structure of a bstring is considered exposed
2322

2423
A single contiguous block of data can be cut into read-only pieces by
@@ -28,12 +27,10 @@ The bstring library has significant advantages over CString:
2827
In this way, using bstrings in a totally abstracted way becomes a choice
2928
rather than an imposition. Further this choice can be made differently
3029
at different layers of applications that use it.
31-
3230
3. Static declaration support precludes the need for constructor invocation
3331

3432
Allows for static declarations of constant strings that has no additional
3533
constructor overhead.
36-
3734
4. Bstrlib is not attached to another library
3835

3936
Bstrlib is designed to be easily plugged into any other library collection,
@@ -88,18 +85,13 @@ Comparison With C++'s `std::string`
8885
This is the C++ language's STL based string class.
8986

9087
1. There is no C implementation.
91-
9288
2. The `[]` operator is not bounds checked.
93-
9489
3. Missing a lot of useful functions like `printf`-like formatting.
95-
9690
4. Some sub-standard `std::string` implementations (SGI) are necessarily
9791
unsafe to use with multithreading.
98-
9992
5. Limited by STL's std::iostream which in turn is limited by ifstream which
10093
can only take input from files. (Compare to CBStream's API which can take
10194
abstracted input.)
102-
10395
6. Extremely uneven performance across implementations.
10496

10597
Comparison With ISO C TR 24731 Proposal
@@ -123,13 +115,9 @@ few non-reenterable functions (`asctime`, `ctime`, and `strtok`).
123115

124116
1. Still based solely on `char *` buffers (and therefore `strlen` and `strcat`
125117
is still O(n), and there are no faster `streq` comparison functions.)
126-
127118
2. No growable string semantics.
128-
129119
3. Requires manual buffer length synchronization in the source code.
130-
131120
4. No attempt to enhance functionality of the C library.
132-
133121
5. Introduces a new error scenario (strings exceeding `RSIZE_MAX` length).
134122

135123
The hope is that by exposing the buffer length requirements there will be
@@ -294,23 +282,19 @@ This library is [available online](http://www.annexia.org/freeware/c2lib).
294282
Their suggestion that alternatives which wrap the string data type (such as
295283
bstring does) imposes a difficulty in interoperating with the C langauge's
296284
ordinary C string library is not founded.
297-
298285
2. Introduction of memory (and vector?) abstractions imposes a learning
299286
curve, and some kind of memory usage policy that is outside of the strings
300287
themselves (and therefore must be maintained by the developer.)
301-
302288
3. The API is massive, and filled with all sorts of trivial (`pjoin`) and
303289
controvertial (`pmatch` -- regular expression are not sufficiently
304290
standardized, and there is a very large difference in performance between
305291
compiled and non-compiled, REs) functions. Bstrlib takes a decidely
306292
minimal approach -- none of the functionality in c2lib is difficult or
307293
challenging to implement on top of Bstrlib (except the regex stuff, which
308294
is going to be difficult, and controvertial no matter what.)
309-
310295
4. Understanding why c2lib is the way it is pretty much requires a working
311296
knowledge of Perl. bstrlib requires only knowledge of the C string library
312297
while providing just a very select few worthwhile extras.
313-
314298
5. It is attached to a lot of cruft like a matrix math library (that doesn't
315299
include any functions for getting the determinant, eigenvectors,
316300
eigenvalues, the matrix inverse, test for singularity, test for
@@ -330,9 +314,7 @@ Comparison With stralloc/qmail
330314
More information about this library can be [found](http://www.canonical.org/~kragen/stralloc.html) [online](http://cr.yp.to/lib/stralloc.html).
331315

332316
1. Library is very very minimal. A little too minimal.
333-
334317
2. Untargetted source parameters are not declared const.
335-
336318
3. Slightly different expected emphasis (like `_cats` function which takes an
337319
ordinary C string char buffer as a parameter). It's clear that the
338320
remainder of the C string library is still required to perform more
@@ -357,13 +339,11 @@ wxString Class
357339
This is the string class used in the [wxWindows project](http://www.wxwindows.org/manuals/2.4.2/wx368.htm#wxstring).
358340

359341
1. There is no C implementation.
360-
361342
2. The memory management strategy is to allocate a bounded fixed amount of
362343
additional space on each resize, meaning that it does not have the
363344
`log2(n)` property that Bstrlib has (it will thrash very easily, cause
364345
massive fragmentation in common heap implementations, and can easily be a
365346
common source of performance problems).
366-
367347
3. The library uses a "copy on write" strategy, meaning that it has to deal
368348
with multithreading problems.
369349

@@ -375,12 +355,9 @@ networking/realtime programming. It can be found [online](http://www.and.org/vst
375355

376356
1. The convoluted internal structure does not contain a `'\0'` `char *`
377357
compatible buffer, so interoperability with the C library a non-starter.
378-
379358
2. The API and implementation is very large (owing to its orthogonality) and
380359
can lead to difficulty in understanding its exact functionality.
381-
382360
3. An obvious dependency on gnu tools (confusing make configure step)
383-
384361
4. Uses a reference counting system, meaning that it is not likely to be
385362
thread safe.
386363

@@ -427,7 +404,6 @@ MFC and STL. The architecture, similarly to MFC's CStrings, is a copy on write
427404
reference counting mechanism.
428405

429406
1. Commercial
430-
431407
2. C++ only
432408

433409
This library, like Vstr, uses a reference counting system. There is only so
@@ -511,9 +487,7 @@ functions.
511487

512488
1. Uses standard `char *` buffer, and adopts C 99's usage of `restrict` to
513489
pass the responsibility to guard against aliasing to the programmer.
514-
515490
2. Adds no safety or memory management whatsoever.
516-
517491
3. Most of the supplied string functions are completely trivial.
518492

519493
The goals of libclc and Bstrlib are clearly quite different.
@@ -525,7 +499,6 @@ More information is [available online](http://firestuff.org/).
525499

526500
1. Uses standard `char *` buffer, and adopts C 99's usage of `restrict` to
527501
pass the responsibility to guard against aliasing to the programmer.
528-
529502
2. Mixes `char *` and length wrapped buffers (estr) functions, doubling the
530503
API size, with safety limited to only half of the functions.
531504

@@ -542,13 +515,10 @@ of increasing safety and power to C's string handling capabilities.
542515

543516
1. While the `safestr_*` functions are safe in of themselves, interoperating
544517
with `char *` string has dangerous unsafe modes of operation.
545-
546518
2. The architecture of safestr's causes the base pointer to change. Thus,
547519
its not practical/safe to store a safestr in multiple locations if any
548520
single instance can be manipulated.
549-
550521
3. Dependent on an additional error handling library.
551-
552522
4. Uses reference counting, meaning that it is either not thread safe or
553523
slow and not portable.
554524

@@ -584,6 +554,3 @@ essence, would allow the compiler to enforce trust propogation at compile
584554
time rather than run time. Non-resizability is also interesting, however,
585555
it seems marginal, i.e., to want a string that cannot be resized, yet can be
586556
modified and yet where a fixed sized buffer is undesirable.
587-
588-
<!-- vim: et:sw=4:ts=4
589-
-->

0 commit comments

Comments
 (0)