diff options
author | Lars Wirzenius <liw@liw.fi> | 2010-10-25 10:26:42 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2010-10-25 10:26:42 +0100 |
commit | 14f4689353217eb64d95228143f0a9e37bc1c00f (patch) | |
tree | c4210d60a0031634c4af4c8942f7338893da2c0d /dynstr.h | |
parent | dc63cba068f760980e2249e2b932dc49cc1df41c (diff) | |
download | dynstr-14f4689353217eb64d95228143f0a9e37bc1c00f.tar.gz |
Implement dynstr_cmp.
Diffstat (limited to 'dynstr.h')
-rw-r--r-- | dynstr.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -131,6 +131,11 @@ size_t dynstr_last_byte(Dynstr *dynstr, size_t offset, int byte); size_t dynstr_first_string(Dynstr *dynstr, size_t offset, Dynstr *pattern); size_t dynstr_last_string(Dynstr *dynstr, size_t offset, Dynstr *pattern); +/* Compare two strings, return 0 if they are equal, negative if the + * first comes before the second, and positive if second comes first. + * Comparisons are done byte-by-byte using unsigned values. */ +int dynstr_cmp(Dynstr *dynstr1, Dynstr *dynstr2); + /* Write a dynamic string into an open file, either FILE or a Unix file * handle. Return value is number of bytes written, just like for fwrite(3). * If an error occurs, the size is less than the length of the string, |