Plan 9 from Bell Labs’s /usr/web/sources/contrib/de0u/root/sys/src/cmd/divergefs/string.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



/** 
 * converts the escaped sequence in string form into its corresponding
 * character 
 */ 
char *string_convert_escaped(char *str);

/**
 * only converts the given escaped character.
 * converts only the escaped sequence of character escaped to replace.
 */
char *string_convert_single_escaped(char *str, char escaped, char replace);

/** 
 * removes the leading character of str if it equals to leading.
 * @return updated position pointing to beginning of string.
 */
char *string_skip_leading(char *str, char leading);

/**
 * finds the first character ch in str and then set it to null, or do nothing if
 * ch is not found.
 * @return position where ch was found or nil if not found.
 */
char *string_nullify_if_found(char *str, char ch);

uint string_hash(void *p);

bool string_isequal(void *p1, void *p2);


/**
 * @return starting of a string after the last occurance of character last, or
 * null if char last was not found.
 */
char *string_after_last(char *str, char last);


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.