summaryrefslogtreecommitdiff
path: root/dynstr.h
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-10-25 10:26:42 +0100
committerLars Wirzenius <liw@liw.fi>2010-10-25 10:26:42 +0100
commit14f4689353217eb64d95228143f0a9e37bc1c00f (patch)
treec4210d60a0031634c4af4c8942f7338893da2c0d /dynstr.h
parentdc63cba068f760980e2249e2b932dc49cc1df41c (diff)
downloaddynstr-14f4689353217eb64d95228143f0a9e37bc1c00f.tar.gz
Implement dynstr_cmp.
Diffstat (limited to 'dynstr.h')
-rw-r--r--dynstr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/dynstr.h b/dynstr.h
index b532074..d0ac247 100644
--- a/dynstr.h
+++ b/dynstr.h
@@ -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,