~ubuntu-branches/ubuntu/lucid/codelite/lucid

« back to all changes in this revision

Viewing changes to sdk/codelite_indexer/libctags/vstring.h

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-02-10 02:27:55 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090210022755-m5692nfc1t5uf1w9
Tags: 1.0.2759+dfsg-0ubuntu1
* New upstream release (LP: #327216).
* debian/patches/series, debian/patches/00_fix-ia64-build.patch:
  + Dropped, applied upstream already.
* debian/patches/02_fix-desktop.patch,
  debian/patches/03_fix-sh.patch:
  + Refreshed to patch cleanly.
* debian/rules:
  + Make get-orig-source honour UPSTREAM_VERSION if set.
* debian/ctags-le.1,
  debian/codelite_indexer.1,
  debian/codelite.manpages:
  + Dropped ctags-le manpage, since ctags-le was replaced by
    codelite_indexer.
  + Added codelite_indexer manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
*   $Id: vstring.h,v 1.7 2006/05/30 04:37:13 darren Exp $
 
3
*
 
4
*   Copyright (c) 1998-2002, Darren Hiebert
 
5
*
 
6
*   This source code is released for free distribution under the terms of the
 
7
*   GNU General Public License.
 
8
*
 
9
*   Provides the external interface for resizeable strings.
 
10
*/
 
11
#ifndef _VSTRING_H
 
12
#define _VSTRING_H
 
13
 
 
14
/*
 
15
*   INCLUDE FILES
 
16
*/
 
17
#include "general.h"  /* must always come first */
 
18
 
 
19
#if defined(HAVE_STDLIB_H)
 
20
# include <stdlib.h>  /* to define size_t */
 
21
#endif
 
22
 
 
23
/*
 
24
*   MACROS
 
25
*/
 
26
#define vStringValue(vs)      ((vs)->buffer)
 
27
#define vStringItem(vs,i)     ((vs)->buffer[i])
 
28
#define vStringLength(vs)     ((vs)->length)
 
29
#define vStringSize(vs)       ((vs)->size)
 
30
#define vStringCat(vs,s)      vStringCatS((vs), vStringValue((s)))
 
31
#define vStringNCat(vs,s,l)   vStringNCatS((vs), vStringValue((s)), (l))
 
32
#define vStringCopy(vs,s)     vStringCopyS((vs), vStringValue((s)))
 
33
#define vStringNCopy(vs,s,l)  vStringNCopyS((vs), vStringValue((s)), (l))
 
34
#define vStringChar(vs,i)     ((vs)->buffer[i])
 
35
#define vStringTerminate(vs)  vStringPut(vs, '\0')
 
36
#define vStringLower(vs)      toLowerString((vs)->buffer)
 
37
#define vStringUpper(vs)      toUpperString((vs)->buffer)
 
38
 
 
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
/*
 
50
*   DATA DECLARATIONS
 
51
*/
 
52
 
 
53
typedef struct sVString {
 
54
        size_t  length;  /* size of buffer used */
 
55
        size_t  size;    /* allocated size of buffer */
 
56
        char   *buffer;  /* location of buffer */
 
57
} vString;
 
58
 
 
59
/*
 
60
*   FUNCTION PROTOTYPES
 
61
*/
 
62
extern boolean vStringAutoResize (vString *const string);
 
63
extern void vStringClear (vString *const string);
 
64
extern vString *vStringNew (void);
 
65
extern void vStringDelete (vString *const string);
 
66
#ifndef VSTRING_PUTC_MACRO
 
67
extern void vStringPut (vString *const string, const int c);
 
68
#endif
 
69
extern void vStringStripNewline (vString *const string);
 
70
extern void vStringStripLeading (vString *const string);
 
71
extern void vStringChop (vString *const string);
 
72
extern void vStringStripTrailing (vString *const string);
 
73
extern void vStringCatS (vString *const string, const char *const s);
 
74
extern void vStringNCatS (vString *const string, const char *const s, const size_t length);
 
75
extern vString *vStringNewCopy (vString *const string);
 
76
extern vString *vStringNewInit (const char *const s);
 
77
extern void vStringCopyS (vString *const string, const char *const s);
 
78
extern void vStringNCopyS (vString *const string, const char *const s, const size_t length);
 
79
extern void vStringCopyToLower (vString *const dest, const vString *const src);
 
80
extern void vStringSetLength (vString *const string);
 
81
 
 
82
#endif  /* _VSTRING_H */
 
83
 
 
84
/* vi:set tabstop=4 shiftwidth=4: */