mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-05 21:57:39 +08:00
b654714 has reworked the way trailing CR/LF characters are removed from strings. This commit introduces a new routine in common/string.c and refactors the code so as the logic is in a single place, mostly. Author: Michael Paquier Reviewed-by: Bruce Momjian Discussion: https://postgr.es/m/20190801031820.GF29334@paquier.xyz
20 lines
546 B
C
20 lines
546 B
C
/*
|
|
* string.h
|
|
* string handling helpers
|
|
*
|
|
* Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/common/string.h
|
|
*/
|
|
#ifndef COMMON_STRING_H
|
|
#define COMMON_STRING_H
|
|
|
|
extern bool pg_str_endswith(const char *str, const char *end);
|
|
extern int strtoint(const char *pg_restrict str, char **pg_restrict endptr,
|
|
int base);
|
|
extern void pg_clean_ascii(char *str);
|
|
extern int pg_strip_crlf(char *str);
|
|
|
|
#endif /* COMMON_STRING_H */
|