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 File Reference
#include "general.h"
#include <stdio.h>
Include dependency graph for routines.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define xMalloc(n, Type)   (Type *)eMalloc((size_t)(n) * sizeof (Type))
#define xCalloc(n, Type)   (Type *)eCalloc((size_t)(n), sizeof (Type))
#define xRealloc(p, n, Type)   (Type *)eRealloc((p), (n) * sizeof (Type))
#define ARRAY_SIZE(X)   (sizeof (X) / sizeof (X[0]))
#define STRINGIFY_(X)   #X


typedef int errorSelection


enum  eErrorTypes { FATAL = 1 , WARNING = 2 , PERROR = 4 }


void error (const errorSelection selection, const char *const format,...)
void * eMalloc (const size_t size)
void * eCalloc (const size_t count, const size_t size)
void * eRealloc (void *const ptr, const size_t size)
void eFree (void *const ptr)
void eFreeNoNullCheck (void *const ptr)
void eFreeIndirect (void **ptr)
int struppercmp (const char *s1, const char *s2)
int strnuppercmp (const char *s1, const char *s2, size_t n)
char * strstr (const char *str, const char *substr)
char * strrstr (const char *str, const char *substr)
char * eStrdup (const char *str)
char * eStrndup (const char *str, size_t len)
void toLowerString (char *str)
void toUpperString (char *str)
char * newLowerString (const char *str)
char * newUpperString (const char *str)
bool strToUInt (const char *const str, int base, unsigned int *value)
bool strToULong (const char *const string, int base, unsigned long *value)
bool strToInt (const char *const str, int base, int *value)
bool strToLong (const char *const string, int base, long *value)
const char * baseFilename (const char *const filePath)
const char * fileExtension (const char *const fileName)

Macro Definition Documentation


#define ARRAY_AND_SIZE (   X)    (X), ARRAY_SIZE(X)

Definition at line 28 of file routines.h.


#define ARRAY_SIZE (   X)    (sizeof (X) / sizeof (X[0]))

Definition at line 27 of file routines.h.


#define STRINGIFY (   X)    STRINGIFY_(X)

Definition at line 30 of file routines.h.


#define STRINGIFY_ (   X)    #X

Definition at line 31 of file routines.h.

◆ xCalloc

#define xCalloc (   n,
)    (Type *)eCalloc((size_t)(n), sizeof (Type))

Definition at line 24 of file routines.h.

◆ xMalloc

#define xMalloc (   n,
)    (Type *)eMalloc((size_t)(n) * sizeof (Type))

Definition at line 23 of file routines.h.

◆ xRealloc

#define xRealloc (   p,
)    (Type *)eRealloc((p), (n) * sizeof (Type))

Definition at line 25 of file routines.h.

Typedef Documentation

◆ errorSelection

typedef int errorSelection

Definition at line 36 of file routines.h.

Enumeration Type Documentation

◆ eErrorTypes


Definition at line 37 of file routines.h.

Function Documentation

◆ baseFilename()

◆ eCalloc()

void * eCalloc ( const size_t  count,
const size_t  size 

Definition at line 228 of file routines.c.

References count, error(), FATAL, and NULL.

Referenced by createToken().

◆ eFree()

void eFree ( void *const  ptr)

Definition at line 252 of file routines.c.

References Assert, NULL, and ptr.

Referenced by absoluteFilename(), addLanguageMap(), addTagRegexInternal(), addTagRegexOption(), ancestorClear(), argDelete(), argForth(), cArgDelete(), cArgForth(), clearParserFields(), closeTagFile(), colprintHeaderColumnDelete(), colprintTableDelete(), common_flag_field_long(), compileRegex(), copyBytes(), defineField(), defineScopeSeparator(), deleteChar(), deletePattern(), deletePoolToken(), deleteStatement(), deleteTable(), deleteTableEntry(), deleteTagEnry(), deleteToken(), eFreeIndirect(), endEtagsFile(), entry_destroy(), eStatFree(), expandOnSearchPathList(), fieldDefinitionDestroy(), fieldPatternDelete(), fileNameMatched(), fillGuestRequest(), finalizeDependencies(), findPascalTags(), findPythonTags(), flagsEval(), fmtDelete(), freeKdef(), freeKeywordTable(), freeKindControlBlock(), freeLineFposMap(), freeLregexControlBlock(), freeModifier(), freeParserResources(), freeRdef(), freeRoleControlBlock(), freeRoutineResources(), freeSlaveControlBlock(), freeString(), freeTagFileResources(), getFileLanguageForRequestInternal(), getMio(), getSpecLanguageCommon(), guestRequestDelete(), hashTableDelete(), initFieldObjects(), isCtagsLine(), isPodWord(), isRecursiveLink(), isSameFile(), isValidTagAddress(), kindFree(), makeDefineTag(), makePromise(), markTagExtraBitFull(), mio_new_file_full(), mio_new_mio(), mio_unref(), nestingLevelsFree(), nextFileLineSkippingComments(), objPoolDelete(), optlibFreeDep(), parseArglist(), parseFunction(), pickLanguageBySelection(), pre_ptrn_flag_advanceTo_long(), pre_ptrn_flag_mtable_long(), preload(), printLanguageList(), processKindsOption(), processLangDefineKind(), processLangDefineRole(), processLangKindRoleDefinition(), processLanguageDefineOption(), processLanguageMapOption(), processLanguageMultitableExtendingOption(), processLanguagesOption(), processMapOption(), processRolesOption(), ptrArrayDelete(), readIgnoreList(), relativeFilename(), removeLanguageMap(), renderFieldPattern(), replacementTruncate(), scopeSeparatorDelete(), tagFieldDelete(), testEtagsInvocation(), trashBoxDelete(), trashMakeEmpty(), trashPut(), trashTakeBack0(), uwiDeactivate(), vStringDelete(), vStringDeleteUnwrap(), vStringNewOwn(), and xtagDefinitionDestroy().

◆ eFreeIndirect()

void eFreeIndirect ( void **  ptr)

Definition at line 263 of file routines.c.

References eFree(), NULL, and ptr.

Referenced by initFieldObjects(), initXtagObjects(), and langStackInit().

◆ eFreeNoNullCheck()

void eFreeNoNullCheck ( void *const  ptr)

Definition at line 258 of file routines.c.

References ptr.

Referenced by freeRoleControlBlock(), getMio(), mio_new_mio(), and openTagFile().

◆ eMalloc()

void * eMalloc ( const size_t  size)

Definition at line 218 of file routines.c.

References error(), FATAL, and NULL.

Referenced by defineField(), eRealloc(), getMio(), initFieldObjects(), and isPodWord().

◆ eRealloc()

void * eRealloc ( void *const  ptr,
const size_t  size 

Definition at line 238 of file routines.c.

References eMalloc(), error(), FATAL, NULL, and ptr.

Referenced by getMio(), mio_new_mio(), nestingLevelsPush(), and openTagFile().

◆ error()

void error ( const errorSelection  selection,
const char *const  format,

Definition at line 53 of file error.c.

References errorPrinterData, and format.

Referenced by abort_if_ferror(), addIgnoreListFromFile(), addLanguageMap(), addRegexTable(), addTagMultiTableRegex(), addTagRegexInternal(), addTagRegexOption(), applyParameter(), backupcopy_create_dir_parts(), batchMakeTags(), build_create_shellscript(), build_run_cmd(), build_spawn_cmd(), checkCtagsOptions(), checkOptionOrder(), checkOptions(), checkRegex(), closeTagFile(), common_flag_anonymous_long(), common_flag_extra_long(), common_flag_field_long(), common_flag_msg_long(), common_flag_role_long(), compile_regex(), compileRegex(), configuration_load_session_files(), copyBytes(), copyFile(), createTagsForEntry(), createTagsFromListFile(), defineRole(), defineScopeSeparator(), eCalloc(), eMalloc(), enableField(), enableLanguageField(), enableLanguageXtag(), eRealloc(), extendRegexTable(), extractMapFromParameter(), failedSort(), flagsEval(), fmtNew(), get_mtime(), getFileLanguageForRequest(), getLanguageComponentInOptionFull(), isAbsolutePath(), isCtagsLine(), isTagWritable(), kill_process(), load_css_theme(), load_system_keyfile(), makeTagEntry(), matchMultilineRegexPattern(), matchMultitableRegex(), matchMultitableRegexTable(), matchTagPattern(), on_context_action1_activate(), open_external(), openInputFile(), openTagFile(), parameterEnablingAllOrFileKind(), paramParserBool(), parse_command_line_options(), parseEnvironmentOptions(), parseFileOptions(), parseHeredoc(), parseTagRegex(), pre_lang_def_flag_base_long(), pre_ptrn_flag_advanceTo_long(), pre_ptrn_flag_guest_long(), pre_ptrn_flag_mgroup_long(), pre_ptrn_flag_mtable_long(), prepare_run_cmd(), print_external(), printing_print_gtk(), printMessage(), printMultitableMessage(), processAliasOption(), processAnonHashOption(), processBooleanOption(), processEchoOption(), processEtagsInclude(), processExcludeOptionCommon(), processExcmdOption(), processExtraTagsOption(), processFieldsOption(), processFormatOption(), processHeaderListOption(), processKindsOption(), processLangDefineExtra(), processLangDefineField(), processLangDefineKind(), processLangDefineRole(), processLangDefineScopesep(), processLangKindDefinition(), processLangKindRoleDefinition(), processLangSpecificExtraOption(), processLangSpecificFieldsOption(), processLanguageDefineOption(), processLanguageForceOption(), processLanguageMapOption(), processLanguageMultitableExtendingOption(), processLanguagesOption(), processListAliasesOption(), processListExtrasOption(), processListFieldsOption(), processListKindsOption(), processListMapsOptionForType(), processListParametersOption(), processListRolesOptions(), processListSubparsersOptions(), processLongOption(), processMapOption(), processMaxRecursionDepthOption(), processOptionFileCommon(), processOutputFormat(), processParametricOption(), processParamOption(), processPatternLengthLimit(), processPretendOption(), processPseudoTags(), processRoledefOption(), processRolesOption(), processShortOption(), processSortOption(), processTabledefOption(), processTagRegexOption(), processTagRelative(), processTotals(), pushNarrowedInputStream(), queueTagEntry(), queueTagField(), readLine(), readLineRaw(), regex_compile(), register_named_icon(), removeLanguageMap(), resumeCharacter(), ResumeString(), roleColprintAddRoles(), run_command(), sanitizeEnviron(), ScanNHexas(), ScanNumber(), scope_ptrn_flag_eval(), search_find_in_files(), search_get_argv(), setBooleanToXtagWithWarning(), setKind(), setTagFilePosition(), spawn_async(), spawn_async_with_pipes(), spawn_check_command(), spawn_get_program_name(), spawn_kill_process(), spawn_parse_argv(), spawn_sync(), spawn_with_callbacks(), tagFilePosition(), tb_editor_parse_ui(), tempFile(), toolbar_reload(), tools_execute_custom_command(), ui_init_builder(), updateSortedFlag(), utils_get_file_list(), utils_get_file_list_full(), utils_get_setting_boolean(), utils_get_setting_integer(), utils_spawn_async(), utils_spawn_sync(), utils_write_file(), uwiPopMarker(), uwiPushMarker(), and write_data_to_disk().

◆ eStrdup()

◆ eStrndup()

◆ fileExtension()

const char * fileExtension ( const char *const  fileName)

Definition at line 650 of file routines.c.

References baseFilename(), and NULL.

Referenced by getPatternLanguageAndSpec(), and isIncludeFile().

◆ newLowerString()

char * newLowerString ( const char *  str)

Definition at line 362 of file routines.c.

References xMalloc.

◆ newUpperString()

char * newUpperString ( const char *  str)

Definition at line 374 of file routines.c.

References xMalloc.

Referenced by fileNameMatched().

◆ strnuppercmp()

int strnuppercmp ( const char *  s1,
const char *  s2,
size_t  n 

Definition at line 293 of file routines.c.

◆ strrstr()

char * strrstr ( const char *  str,
const char *  substr 

Definition at line 316 of file routines.c.

References NULL.

Referenced by determineVimFileType().

◆ strstr()

◆ strToInt()

bool strToInt ( const char *const  str,
int  base,
int *  value 

◆ strToLong()

bool strToLong ( const char *const  string,
int  base,
long *  value 

Definition at line 403 of file routines.c.

References errno.

Referenced by fmtNew(), processShortOption(), and strToInt().

◆ strToUInt()

bool strToUInt ( const char *const  str,
int  base,
unsigned int *  value 

Definition at line 412 of file routines.c.

References strToULong().

Referenced by processPatternLengthLimit().

◆ strToULong()

bool strToULong ( const char *const  string,
int  base,
unsigned long *  value 

Definition at line 389 of file routines.c.

References errno.

Referenced by strToUInt().

◆ struppercmp()

int struppercmp ( const char *  s1,
const char *  s2 

Definition at line 283 of file routines.c.

Referenced by compareTagsFolded().

◆ toLowerString()

void toLowerString ( char *  str)

Definition at line 342 of file routines.c.

Referenced by testEtagsInvocation().

◆ toUpperString()

void toUpperString ( char *  str)

Definition at line 351 of file routines.c.