~ubuntu-branches/ubuntu/saucy/exuberant-ctags/saucy

« back to all changes in this revision

Viewing changes to vstring.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2007-09-08 09:16:38 UTC
  • mto: (3.1.2 gutsy)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20070908091638-x1f76ehtnqg3q1pr
Tags: upstream-5.7
ImportĀ upstreamĀ versionĀ 5.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
*   $Id: vstring.h,v 1.7 2006/05/30 04:37:13 darren Exp $
 
2
*   $Id: vstring.h 550 2007-06-07 05:50:32Z dhiebert $
3
3
*
4
4
*   Copyright (c) 1998-2002, Darren Hiebert
5
5
*
23
23
/*
24
24
*   MACROS
25
25
*/
 
26
#ifndef DEBUG
 
27
# define VSTRING_PUTC_MACRO 1
 
28
#endif
 
29
#ifdef VSTRING_PUTC_MACRO
 
30
#define vStringPut(s,c) \
 
31
        (void)(((s)->length + 1 == (s)->size ? vStringAutoResize (s) : 0), \
 
32
        ((s)->buffer [(s)->length] = (c)), \
 
33
        ((c) == '\0' ? 0 : ((s)->buffer [++(s)->length] = '\0')))
 
34
#endif
 
35
 
26
36
#define vStringValue(vs)      ((vs)->buffer)
27
37
#define vStringItem(vs,i)     ((vs)->buffer[i])
28
38
#define vStringLength(vs)     ((vs)->length)
36
46
#define vStringLower(vs)      toLowerString((vs)->buffer)
37
47
#define vStringUpper(vs)      toUpperString((vs)->buffer)
38
48
 
39
 
#ifndef DEBUG
40
 
# define VSTRING_PUTC_MACRO 1
41
 
#endif
42
 
#ifdef VSTRING_PUTC_MACRO
43
 
#define vStringPut(s,c) \
44
 
        (void)(((s)->length == (s)->size ? vStringAutoResize (s) : 0), \
45
 
        ((s)->buffer [(s)->length++] = (c)), \
46
 
        ((c) == '\0' ? (s)->length-- : 0))
47
 
#endif
48
 
 
49
49
/*
50
50
*   DATA DECLARATIONS
51
51
*/
72
72
extern void vStringStripTrailing (vString *const string);
73
73
extern void vStringCatS (vString *const string, const char *const s);
74
74
extern void vStringNCatS (vString *const string, const char *const s, const size_t length);
75
 
extern vString *vStringNewCopy (vString *const string);
 
75
extern vString *vStringNewCopy (const vString *const string);
76
76
extern vString *vStringNewInit (const char *const s);
77
77
extern void vStringCopyS (vString *const string, const char *const s);
78
78
extern void vStringNCopyS (vString *const string, const char *const s, const size_t length);