geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

routines.h
Go to the documentation of this file.
1/*
2* Copyright (c) 2002, Darren Hiebert
3*
4* This source code is released for free distribution under the terms of the
5* GNU General Public License version 2 or (at your option) any later version.
6*
7* External interface to routines.c
8*/
9#ifndef CTAGS_MAIN_ROUTINES_H
10#define CTAGS_MAIN_ROUTINES_H
11
12/*
13* INCLUDE FILES
14*/
15#include "general.h" /* must always come first */
16
17#include <stdio.h>
18
19
20/*
21* MACROS
22*/
23#define xMalloc(n,Type) (Type *)eMalloc((size_t)(n) * sizeof (Type))
24#define xCalloc(n,Type) (Type *)eCalloc((size_t)(n), sizeof (Type))
25#define xRealloc(p,n,Type) (Type *)eRealloc((p), (n) * sizeof (Type))
26
27#define ARRAY_SIZE(X) (sizeof (X) / sizeof (X[0]))
28#define ARRAY_AND_SIZE(X) (X), ARRAY_SIZE(X)
29
30#define STRINGIFY(X) STRINGIFY_(X)
31#define STRINGIFY_(X) #X
32
33/*
34* DATA DECLARATIONS
35*/
36typedef int errorSelection;
37enum eErrorTypes { FATAL = 1, WARNING = 2, PERROR = 4 };
38
39/*
40* FUNCTION PROTOTYPES
41*/
42extern void error (const errorSelection selection, const char *const format, ...) CTAGS_ATTR_PRINTF (2, 3);
43
44/* Memory allocation functions */
45#ifdef NEED_PROTO_MALLOC
46extern void *malloc (size_t);
47extern void *realloc (void *ptr, size_t);
48#endif
49extern void *eMalloc (const size_t size);
50extern void *eCalloc (const size_t count, const size_t size);
51extern void *eRealloc (void *const ptr, const size_t size);
52extern void eFree (void *const ptr);
53extern void eFreeNoNullCheck (void *const ptr);
54extern void eFreeIndirect(void **ptr);
55
56/* String manipulation functions */
57extern int struppercmp (const char *s1, const char *s2);
58extern int strnuppercmp (const char *s1, const char *s2, size_t n);
59#ifndef HAVE_STRSTR
60extern char* strstr (const char *str, const char *substr);
61#endif
62extern char* strrstr (const char *str, const char *substr);
63extern char* eStrdup (const char* str);
64extern char* eStrndup (const char* str, size_t len);
65extern void toLowerString (char* str);
66extern void toUpperString (char* str);
67extern char* newLowerString (const char* str);
68extern char* newUpperString (const char* str);
69extern bool strToUInt(const char *const str, int base, unsigned int *value);
70extern bool strToULong(const char *const string, int base, unsigned long *value);
71extern bool strToInt(const char *const str, int base, int *value);
72extern bool strToLong(const char *const string, int base, long *value);
73
74/* File system functions */
75extern const char *baseFilename (const char *const filePath);
76extern const char *fileExtension (const char *const fileName);
77
78#endif /* CTAGS_MAIN_ROUTINES_H */
GeanyBuildCommand ** ptr
Definition: build.c:2679
#define CTAGS_ATTR_PRINTF(s, f)
Definition: gcc-attr.h:23
CobolFormat format
Definition: geany_cobol.c:137
unsigned int count
eErrorTypes
Definition: routines.h:37
@ PERROR
Definition: routines.h:37
@ FATAL
Definition: routines.h:37
@ WARNING
Definition: routines.h:37
char * eStrndup(const char *str, size_t len)
Definition: routines.c:334
void error(const errorSelection selection, const char *const format,...)
Definition: error.c:53
bool strToUInt(const char *const str, int base, unsigned int *value)
Definition: routines.c:412
bool strToInt(const char *const str, int base, int *value)
Definition: routines.c:423
int struppercmp(const char *s1, const char *s2)
Definition: routines.c:283
char * newLowerString(const char *str)
Definition: routines.c:362
int strnuppercmp(const char *s1, const char *s2, size_t n)
Definition: routines.c:293
bool strToULong(const char *const string, int base, unsigned long *value)
Definition: routines.c:389
void * eMalloc(const size_t size)
Definition: routines.c:218
void toLowerString(char *str)
Definition: routines.c:342
char * newUpperString(const char *str)
Definition: routines.c:374
void eFreeNoNullCheck(void *const ptr)
Definition: routines.c:258
const char * fileExtension(const char *const fileName)
Definition: routines.c:650
int errorSelection
Definition: routines.h:36
char * strstr(const char *str, const char *substr)
Definition: routines.c:304
void eFreeIndirect(void **ptr)
Definition: routines.c:263
bool strToLong(const char *const string, int base, long *value)
Definition: routines.c:403
void * eRealloc(void *const ptr, const size_t size)
Definition: routines.c:238
char * eStrdup(const char *str)
Definition: routines.c:327
void eFree(void *const ptr)
Definition: routines.c:252
const char * baseFilename(const char *const filePath)
Definition: routines.c:608
void toUpperString(char *str)
Definition: routines.c:351
char * strrstr(const char *str, const char *substr)
Definition: routines.c:316
void * eCalloc(const size_t count, const size_t size)
Definition: routines.c:228