aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/stringutils.h
blob: 2bc8795f4c40055422525a0a6f484a37ae19be7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*-------------------------------------------------------------------------
 *
 * stringutils.h--
 *
 *
 * Copyright (c) 1994, Regents of the University of California
 *
 * $Id: stringutils.h,v 1.5 1997/09/07 04:55:32 momjian Exp $
 *
 *-------------------------------------------------------------------------
 */
#ifndef STRINGUTILS_H
#define STRINGUTILS_H

/* use this for memory checking of alloc and free using Tcl's memory check
  package*/
#ifdef TCL_MEM_DEBUG
#include <tcl.h>
#define malloc(x) ckalloc(x)
#define free(x) ckfree(x)
#define realloc(x,y) ckrealloc(x,y)
#endif

/* string fiddling utilties */

/* all routines assume null-terminated strings! as arguments */

/* removes whitespaces from the left, right and both sides of a string */
/* MODIFIES the string passed in and returns the head of it */
extern char    *rightTrim(char *s);

#ifdef STRINGUTILS_TEST
extern void		testStringUtils();

#endif

#ifndef NULL_STR
#define NULL_STR (char*)0
#endif

#ifndef NULL
#define NULL 0
#endif

#endif							/* STRINGUTILS_H */