Reuse, not rework

License Awareness

Highly Reusable Software

By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Integer, Floating point, Matrix, Statistics, Boolean, ...

Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...


librock_wordcmp - compare two strings up until the first blank character
librock_wordcasecmp - compare two strings up until the first blank character, ignore case.

#License - #Source code - #Example Use -


#include <librock/parse.h>

librock_wordcmp(const char *w1,char *w2);


Compare two strings up until the first blank character. Returns > 0 if (w1 > w2) 0 if (w1 == w2) < 0 if (w1 < w2) This is a straight character by character compare, and is not affected by LOCALE. It is suitable for comparing words with characters in the range 0x21-0x7f.

Typical use is similar to strcmp(), with the difference that any character <= ' ' is taken as a string terminator.

For example:

#ifdef librock_TYPICAL_USE_wordcmp
    const char *ptr = "keyword test";
    if (!librock_wordcmp(ptr,"keyword")) {
        /* Process here */


   // [Makes no calls]


  Copyright 1998-2002 Forrest J. Cavalier III,
  Open-source under MIT license. NO WARRANTY. Copies must retain this block.
  License text in <librock/license/mit.txt> librock_LIDESC_HC=cc598307414a9997b32b60a2e7a8e7c6a13d6438

Source Code

./text/compsearch/strfn.c (implementation, plus source of this manual page)

This software is part of Librock

Rapid reuse, without rework. Details
This page copyright (C) 2002-2004 Forrest J. Cavalier III, d-b-a Mib Software, Saylorsburg PA 18353, USA

Verbatim copying and distribution of this generated page is permitted in any medium provided that no changes are made.
(The source of this manual page may be covered by a more permissive license which allows modifications.)

Want to help? We welcome comments, patches. -- Need help? Request paid support.