“dba” 0.2.1

Nothing special, added “install” targets to the CMake-generated Makefiles.

http://www.kfs.org/~oliver/dba/

3 Comments

From main.cpp:
// Make sure what we got back looks sensible.
ATTEMPT( indexedValue != NULL && strcmp(indexedValue, “42”) == 0 ) ;

Ermm, lets see if I understood that right, I have not to much experience with cpp.

1. Is an empty database field == NULL? If yes this would mean you cant return something like (‘1’, ”, ‘2’).

2. Why is 42 forbidden?

Attempt fails if any of the conditions aren’t true, and “strcmp” is a little weird in that a successful strcmp returns 0, a value that is ordinary considered false.

So:

ATTEMPT( indexedValue != NULL )

checks that the value *isn’t* null — if it was, it would cause strcmp to crash.

ATTEMPT( strcmp(indexedValue, “42”) == 0 )

means check that what’s in indexedValue matches the string “42” :)

told you, “42” is the answer to all questions!

Leave a Reply

Name and email address are required. Your email address will not be published.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

You may use these HTML tags and attributes:

<a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <pre> <q cite=""> <s> <strike> <strong> 

%d bloggers like this: