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

« back to all changes in this revision

Viewing changes to sdk/codelite_indexer/libctags/routines.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: routines.h,v 1.11 2006/05/30 04:37:12 darren Exp $
 
3
*
 
4
*   Copyright (c) 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
*   External interface to routines.c
 
10
*/
 
11
#ifndef _ROUTINES_H
 
12
#define _ROUTINES_H
 
13
 
 
14
/*
 
15
*   INCLUDE FILES
 
16
*/
 
17
#include "general.h"  /* must always come first */
 
18
 
 
19
/*
 
20
*   MACROS
 
21
*/
 
22
#define xMalloc(n,Type)    (Type *)eMalloc((size_t)(n) * sizeof (Type))
 
23
#define xCalloc(n,Type)    (Type *)eCalloc((size_t)(n), sizeof (Type))
 
24
#define xRealloc(p,n,Type) (Type *)eRealloc((p), (n) * sizeof (Type))
 
25
 
 
26
/*
 
27
 *  Portability macros
 
28
 */
 
29
#ifndef PATH_SEPARATOR
 
30
# if defined (MSDOS_STYLE_PATH)
 
31
#  define PATH_SEPARATOR '\\'
 
32
# elif defined (QDOS)
 
33
#  define PATH_SEPARATOR '_'
 
34
# else
 
35
#  define PATH_SEPARATOR '/'
 
36
# endif
 
37
#endif
 
38
 
 
39
#if defined (MSDOS_STYLE_PATH) && defined (UNIX_PATH_SEPARATOR)
 
40
# define OUTPUT_PATH_SEPARATOR  '/'
 
41
#else
 
42
# define OUTPUT_PATH_SEPARATOR  PATH_SEPARATOR
 
43
#endif
 
44
 
 
45
/*
 
46
*   DATA DECLARATIONS
 
47
*/
 
48
#if defined (MSDOS_STYLE_PATH) || defined (VMS)
 
49
extern const char *const PathDelimiters;
 
50
#endif
 
51
extern char *CurrentDirectory;
 
52
typedef int errorSelection;
 
53
enum eErrorTypes { FATAL = 1, WARNING = 2, PERROR = 4 };
 
54
 
 
55
typedef struct {
 
56
                /* Name of file for which status is valid */
 
57
        char* name;
 
58
 
 
59
                /* Does file exist? If not, members below do not contain valid data. */
 
60
        boolean exists;
 
61
 
 
62
                /* is file path a symbolic link to another file? */
 
63
        boolean isSymbolicLink;
 
64
 
 
65
                /* Is file (pointed to) a directory? */
 
66
        boolean isDirectory;
 
67
 
 
68
                /* Is file (pointed to) a normal file? */
 
69
        boolean isNormalFile;
 
70
 
 
71
                /* Is file (pointed to) executable? */
 
72
        boolean isExecutable;
 
73
 
 
74
                /* Is file (pointed to) setuid? */
 
75
        boolean isSetuid;
 
76
 
 
77
                /* Size of file (pointed to) */
 
78
        unsigned long size;
 
79
} fileStatus; 
 
80
 
 
81
/*
 
82
*   FUNCTION PROTOTYPES
 
83
*/
 
84
extern void freeRoutineResources (void);
 
85
extern void setExecutableName (const char *const path);
 
86
extern const char *getExecutableName (void);
 
87
extern void error (const errorSelection selection, const char *const format, ...) __printf__ (2, 3);
 
88
 
 
89
/* Memory allocation functions */
 
90
#ifdef NEED_PROTO_MALLOC
 
91
extern void *malloc (size_t);
 
92
extern void *realloc (void *ptr, size_t);
 
93
#endif
 
94
extern void *eMalloc (const size_t size);
 
95
extern void *eCalloc (const size_t count, const size_t size);
 
96
extern void *eRealloc (void *const ptr, const size_t size);
 
97
extern void eFree (void *const ptr);
 
98
 
 
99
/* String manipulation functions */
 
100
extern int struppercmp (const char *s1, const char *s2);
 
101
extern int strnuppercmp (const char *s1, const char *s2, size_t n);
 
102
#ifndef HAVE_STRSTR
 
103
extern char* strstr (const char *str, const char *substr);
 
104
#endif
 
105
extern char* eStrdup (const char* str);
 
106
extern void toLowerString (char* str);
 
107
extern void toUpperString (char* str);
 
108
extern char* newLowerString (const char* str);
 
109
extern char* newUpperString (const char* str);
 
110
 
 
111
/* File system functions */
 
112
extern void setCurrentDirectory (void);
 
113
extern fileStatus *eStat (const char *const fileName);
 
114
extern boolean doesFileExist (const char *const fileName);
 
115
extern boolean isRecursiveLink (const char* const dirName);
 
116
extern boolean isSameFile (const char *const name1, const char *const name2);
 
117
#if defined(NEED_PROTO_FGETPOS)
 
118
extern int fgetpos  (FILE *stream, fpos_t *pos);
 
119
extern int fsetpos  (FILE *stream, fpos_t *pos);
 
120
#endif
 
121
extern const char *baseFilename (const char *const filePath);
 
122
extern const char *fileExtension (const char *const fileName);
 
123
extern boolean isAbsolutePath (const char *const path);
 
124
extern vString *combinePathAndFile (const char *const path, const char *const file);
 
125
extern char* absoluteFilename (const char *file);
 
126
extern char* absoluteDirname (char *file);
 
127
extern char* relativeFilename (const char *file, const char *dir);
 
128
extern FILE *tempFile (const char *const mode, char **const pName);
 
129
 
 
130
#endif  /* _ROUTINES_H */
 
131
 
 
132
/* vi:set tabstop=4 shiftwidth=4: */