chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version bump.
[mLib]
/
str.h
diff --git
a/str.h
b/str.h
index ee33d112d14df1825ee8bcfee5828b0cc3c02b38..1581e500111aef150acf758a14b3b41d90d50a53 100644
(file)
--- a/
str.h
+++ b/
str.h
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: str.h,v 1.
1 1999/05/17 20:37:01
mdw Exp $
+ * $Id: str.h,v 1.
3 1999/12/10 23:42:04
mdw Exp $
*
* Functions for hacking with strings
*
*
* Functions for hacking with strings
*
@@
-30,13
+30,19
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: str.h,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: str.h,v $
+ * Revision 1.3 1999/12/10 23:42:04 mdw
+ * Change header file guard names.
+ *
+ * Revision 1.2 1999/05/26 20:52:57 mdw
+ * Add new `rest' argument for `str_split'.
+ *
* Revision 1.1 1999/05/17 20:37:01 mdw
* Some trivial string hacks.
*
*/
* Revision 1.1 1999/05/17 20:37:01 mdw
* Some trivial string hacks.
*
*/
-#ifndef STR_H
-#define STR_H
+#ifndef
MLIB_
STR_H
+#define
MLIB_
STR_H
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
@@
-65,6
+71,7
@@
extern char *str_getword(char **/*pp*/);
* Arguments: @char *p@ = pointer to string
* @char *v[]@ = pointer to array to fill in
* @size_t c@ = count of strings to fill in
* Arguments: @char *p@ = pointer to string
* @char *v[]@ = pointer to array to fill in
* @size_t c@ = count of strings to fill in
+ * @char **rest@ = where to store the remainder of the string
*
* Returns: Number of strings filled in.
*
*
* Returns: Number of strings filled in.
*
@@
-74,10
+81,13
@@
extern char *str_getword(char **/*pp*/);
* and trailing space stripped off. No more than @c@ words
* are read; the actual number is returned as the value of the
* function. Unused slots in the array are populated with
* and trailing space stripped off. No more than @c@ words
* are read; the actual number is returned as the value of the
* function. Unused slots in the array are populated with
- * null bytes.
+ * null bytes. If there's any string left, the address of the
+ * remainder is stored in @rest@ (if it's non-null); otherwise
+ * @rest@ is set to a null pointer.
*/
*/
-extern size_t str_split(char */*p*/, char */*v*/[], size_t /*c*/);
+extern size_t str_split(char */*p*/, char */*v*/[],
+ size_t /*c*/, char **/*rest*/);
/* --- @str_sanitize@ --- *
*
/* --- @str_sanitize@ --- *
*