cmEngine  0.1.1
A library for interpreting CMake code.
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Internals

Internal functions and declarations used within the library to implement the library interface. More...

Data Structures

struct  cmArgument
 
struct  cmArgumentToken
 
struct  cmArgumentLexer
 
struct  cmArgumentList
 
struct  cmCache
 
struct  cmCacheVariable
 
struct  cmCommand
 
struct  cmDiagnostic
 
struct  cmBuiltinFunction
 
struct  cmEngine
 
struct  cmExpansion
 
struct  cmExpansionEvaluator
 
struct  cmExpansionList
 
struct  cmExpansionParser
 
struct  cmExpansionVisitor
 
struct  cmFmtParser
 
struct  cmFunctionContext
 
struct  cmInterpreter
 
struct  cmLexer
 
struct  cmTokenSpec
 
struct  cmLoop
 
struct  cmLoopObject
 
struct  cmOptionParser
 
struct  cmWarningOption
 
struct  cmDefineOption
 
struct  cmParser
 
struct  cmPosition
 
struct  cmQuery
 
struct  cmQueryHandler
 
struct  cmReader
 
struct  cmScriptContext
 
struct  cmStringList
 
struct  cmSymbol
 
struct  cmScope
 
struct  cmToken
 
struct  cmWarningConfig
 

Macros

#define CM_TRUE   1
 
#define CM_FALSE   0
 

Typedefs

typedef unsigned short int cmChar16
 
typedef unsigned long int cmChar32
 
typedef unsigned char cmBool
 

Enumerations

enum  cmDiagnosticSeverity {
  CM_WARNING,
  CM_ERROR,
  CM_FATAL_ERROR
}
 
enum  cmDiagnosticID {
  CM_MISSING_LEFT_PARENTHESIS,
  CM_MISSING_RIGHT_PARENTHESIS,
  CM_UNEXPECTED_TOKEN,
  CM_UNKNOWN_COMMAND,
  CM_UNSUPPORTED_CODEC,
  CM_NO_ACTIVE_FILES,
  CM_FILE_OPEN_FAILURE,
  CM_COMMAND_DIAGNOSTIC,
  CM_UNKNOWN_OPTION,
  CM_UNKNOWN_EXTENSION,
  CM_MISSING_OPTION_ARGUMENT,
  CM_MISSING_EXTENSION,
  CM_UNTERMINATED_STRING,
  CM_UNSEPARATED_ARGUMENT,
  CM_ERRORS_ARE_FATAL_DIAGNOSTIC,
  CM_OUT_OF_MEMORY,
  CM_NOT_IMPLEMENTED
}
 
enum  cmArgumentTokenType {
  CM_LOCAL_REFERENCE_OPENER,
  CM_CACHE_REFERENCE_OPENER,
  CM_ENV_REFERENCE_OPENER,
  CM_REFERENCE_CLOSER,
  CM_SEMICOLON,
  CM_WHITESPACE,
  CM_ARGUMENT_CONTENT,
  CM_LEFT_PARENTHESIS_ARGUMENT,
  CM_RIGHT_PARENTHESIS_ARGUMENT
}
 
enum  cmExpansionEvaluatorMode {
  CM_EVALUATE_NONSTRING,
  CM_EVALUATE_STRING
}
 
enum  cmStdioFile {
  CM_STDIN,
  CM_STDOUT,
  CM_STDERR
}
 
enum  cmWarningID {
  CM_DEVELOPER_WARNINGS,
  CM_WARNINGS_ARE_ERRORS,
  CM_ERRORS_ARE_FATAL,
  CM_UNKNOWN_WARNING
}
 
enum  cmQueryType {
  CM_CACHE_QUERY,
  CM_ENV_QUERY,
  CM_LOCAL_QUERY
}
 
enum  cmBOM {
  CM_UTF_8,
  CM_UTF_16LE,
  CM_UTF_16BE,
  CM_UTF_32LE,
  CM_UTF_32BE
}
 
enum  cmReferenceExpansionType {
  CM_LOCAL_REFERENCE,
  CM_ENV_REFERENCE,
  CM_CACHE_REFERENCE
}
 
enum  cmScriptStatus {
  CM_SCRIPT_GOOD,
  CM_SCRIPT_FAILED,
  CM_SCRIPT_ABORTED
}
 
enum  cmTokenType {
  CM_BRACKET_ARGUMENT_TOKEN,
  CM_COMMENT,
  CM_BRACKET_COMMENT,
  CM_IDENTIFIER,
  CM_NUMBER,
  CM_LEFT_PARENTHESIS,
  CM_NEWLINE,
  CM_RIGHT_PARENTHESIS,
  CM_SPACE,
  CM_STRING_LITERAL,
  CM_ESCAPE_SEQUENCE,
  CM_UNKNOWN_SYMBOL
}
 

Functions

struct cmArgumentcmNewArgument (struct cmHost *host, size_t size)
 
void cmReleaseArgument (struct cmArgument *argument)
 
void cmResetArgument (struct cmArgument *argument)
 
struct cmArgumentcmCopyArgument (struct cmArgument *dst, const struct cmArgument *src)
 
void cmAddArgumentContent (struct cmArgument *argument, const char *content, size_t content_size)
 
struct cmArgumentcmResizeArgument (struct cmArgument *argument, size_t size)
 
void cmSetArgumentType (struct cmArgument *argument, enum cmArgumentType type)
 
struct cmArgumentLexercmNewArgumentLexer (struct cmHost *host)
 
void cmReleaseArgumentLexer (struct cmArgumentLexer *lexer)
 
cmBool cmArgumentLexerIsDone (const struct cmArgumentLexer *lexer)
 
void cmSetArgumentLexerInput (struct cmArgumentLexer *lexer, const struct cmStringView *input)
 
const struct cmArgumentTokencmPeekArgumentToken (struct cmArgumentLexer *lexer)
 
void cmConsumeArgumentToken (struct cmArgumentLexer *lexer)
 
struct cmArgumentListcmNewArgumentList (struct cmHost *host, size_t size)
 
void cmReleaseArgumentList (struct cmArgumentList *argument_list)
 
void cmResetArgumentList (struct cmArgumentList *argument_list)
 
struct cmArgumentListcmPushArgument (struct cmArgumentList *argument_list, const struct cmArgument *argument)
 
const struct cmArgumentcmGetArgument (const struct cmArgumentList *argument_list, size_t index)
 
size_t cmGetArgumentCount (const struct cmArgumentList *argument_list)
 
enum cmArgumentTokenType cmGetArgumentTokenType (const struct cmArgumentToken *token)
 
const struct cmStringViewcmGetArgumentTokenContentView (const struct cmArgumentToken *token)
 
const struct cmPositioncmGetArgumentTokenPosition (const struct cmArgumentToken *token)
 
struct cmCachecmNewCache (struct cmHost *host)
 
void cmReleaseCache (struct cmCache *cache)
 
const struct cmCacheVariablecmFindCacheVariable (const struct cmCache *cache, const struct cmStringView *name)
 
struct cmCacheVariablecmNewCacheVariable (struct cmHost *host)
 
void cmReleaseCacheVariable (struct cmCacheVariable *var)
 
struct cmCacheVariablecmCopyCacheVariable (const struct cmCacheVariable *other)
 
int CM_WARN_UNUSED_RESULT cmSetCacheVariableDoc (struct cmCacheVariable *var, const char *doc)
 
void cmSetCacheVariableType (struct cmCacheVariable *var, enum cmCacheType type)
 
int CM_WARN_UNUSED_RESULT cmSetCacheVariableName (struct cmCacheVariable *var, const char *name)
 
int CM_WARN_UNUSED_RESULT cmSetCacheVariableValue (struct cmCacheVariable *var, const char *value)
 
struct cmCommandcmNewCommand (struct cmHost *host)
 
void cmReleaseCommand (struct cmCommand *command)
 
const struct cmTokencmGetCommandIdentifier (const struct cmCommand *command)
 
int CM_WARN_UNUSED_RESULT cmSetCommandIdentifier (struct cmCommand *command, const struct cmToken *identifier)
 
int CM_WARN_UNUSED_RESULT cmPushCommandArgument (struct cmCommand *command, const struct cmArgument *argument)
 
const struct cmArgumentcmGetCommandArgument (const struct cmCommand *command, size_t index)
 
size_t cmGetCommandArgumentCount (const struct cmCommand *command)
 
const struct cmDiagnosticcmOutOfMemoryDiagnostic (void)
 
struct cmDiagnosticcmNewDiagnostic (struct cmHost *host)
 
void cmReleaseDiagnostic (struct cmDiagnostic *diagnostic)
 
void cmSetDiagnosticSeverity (struct cmDiagnostic *diagnostic, enum cmDiagnosticSeverity severity)
 
void cmSetDiagnosticID (struct cmDiagnostic *diagnostic, enum cmDiagnosticID id)
 
void cmSetDiagnosticFilename (struct cmDiagnostic *diagnostic, const char *filename)
 
void cmSetDiagnosticPosition (struct cmDiagnostic *diagnostic, const struct cmPosition *position)
 
void cmFormatDiagnostic (struct cmDiagnostic *diagnostic, const char *fmt,...) cmFormatDiagnostic_ATTRIBUTES
 
struct cmEnginecmNewEngine (struct cmHost *host)
 
void cmReleaseEngine (struct cmEngine *engine)
 
struct cmLoopcmGetLoop (struct cmEngine *engine)
 
const struct cmLoopcmGetConstLoop (const struct cmEngine *engine)
 
struct cmSymbolTablecmGetFunctionTable (struct cmEngine *engine)
 
struct cmSymbolTablecmGetVariableTable (struct cmEngine *engine)
 
const struct cmWarningConfigcmGetWarningConfig (const struct cmEngine *engine)
 
void cmSetWarningOption (struct cmEngine *engine, const struct cmWarningOption *warning_option)
 
void cmInitExpansion (struct cmExpansion *expansion)
 
void cmClearExpansion (struct cmExpansion *expansion)
 
void cmAcceptExpansionVisitor (const struct cmExpansion *expansion, struct cmExpansionVisitor *visitor)
 
struct cmExpansionEvaluatorcmNewExpansionEvaluator (struct cmHost *host)
 
void cmReleaseExpansionEvaluator (struct cmExpansionEvaluator *evaluator)
 
void cmResetExpansionEvaluator (struct cmExpansionEvaluator *evaluator)
 
cmBool cmExpansionEvaluatorAborted (const struct cmExpansionEvaluator *evaluator)
 
void cmSetExpansionEvaluatorMode (struct cmExpansionEvaluator *evaluator, enum cmExpansionEvaluatorMode mode)
 
void cmSetExpansionEvaluatorInput (struct cmExpansionEvaluator *evaluator, const struct cmStringView *input)
 
const struct cmArgumentcmEvaluateExpansions (struct cmExpansionEvaluator *evaluator)
 
void cmSetExpansionEvaluatorQueryHandler (struct cmExpansionEvaluator *evaluator, struct cmQueryHandler *query_handler)
 
struct cmExpansionListcmNewExpansionList (struct cmHost *host)
 
void cmReleaseExpansionList (struct cmExpansionList *expansion_list)
 
int cmAddExpansion (struct cmExpansionList *expansion_list, struct cmExpansion *expansion)
 
size_t cmGetExpansionCount (const struct cmExpansionList *expansion_list)
 
struct cmExpansionParsercmNewExpansionParser (struct cmHost *host)
 
void cmReleaseExpansionParser (struct cmExpansionParser *parser)
 
void cmSetExpansionParserInput (struct cmExpansionParser *parser, const struct cmStringView *input)
 
void cmAllowParsingExpansionSeparator (struct cmExpansionParser *parser, cmBool separator_flag)
 
struct cmExpansioncmParseExpansion (struct cmExpansionParser *parser)
 
void cmInitExpansionVisitor (struct cmExpansionVisitor *expansion_visitor)
 
void cmVisitLiteralExpansion (struct cmExpansionVisitor *expansion_visitor, const struct cmLiteralExpansion *literal_expansion)
 
void cmVisitReferenceExpansion (struct cmExpansionVisitor *expansion_visitor, const struct cmReferenceExpansion *reference_expansion)
 
void cmVisitSeparatorExpansion (struct cmExpansionVisitor *expansion_visitor, const struct cmSeparatorExpansion *separator_expansion)
 
char * cmFormatString (struct cmHost *host, const char *fmt,...) cmFormatString_ATTRIBUTES
 
char * cmFormatStringV (struct cmHost *host, const char *fmt, va_list args)
 
struct cmFunctionContextcmNewFunctionContext (struct cmHost *host)
 
void cmReleaseFunctionContext (struct cmFunctionContext *function_context)
 
void cmResetFunctionContext (struct cmFunctionContext *function_context)
 
int CM_WARN_UNUSED_RESULT cmEvaluateFunctionArguments (struct cmFunctionContext *function_context)
 
void cmSetFunctionCache (struct cmFunctionContext *function_context, struct cmCache *cache)
 
void cmSetFunctionVariableTable (struct cmFunctionContext *function_context, struct cmSymbolTable *variable_table)
 
int CM_WARN_UNUSED_RESULT cmPushFunctionArgument (struct cmFunctionContext *function_context, const struct cmArgument *argument)
 
void cmFunctionToSymbol (struct cmFunction *function, struct cmSymbol *symbol)
 
const char * cmGetExtensionOf (const char *path, size_t path_size)
 
void cmClearHost (struct cmHost *host)
 
void cmInitHostFile (struct cmHostFile *host_file)
 
void cmReleaseHostFile (struct cmHostFile *host_file)
 
size_t cmReadFromHostFile (struct cmHostFile *host_file, void *data, size_t size)
 
struct cmInterpretercmNewInterpreter (struct cmHost *host)
 
void cmReleaseInterpreter (struct cmInterpreter *interpreter)
 
int cmOpenForInterpretation (struct cmInterpreter *interpreter, const char *filename)
 
int cmImportVariableTable (struct cmInterpreter *interpreter, const struct cmSymbolTable *variable_table)
 
int cmImportFunctionTable (struct cmInterpreter *interpreter, const struct cmSymbolTable *function_table)
 
cmBool cmInterpreterIsDone (const struct cmInterpreter *interpreter)
 
int cmContinueInterpreter (struct cmInterpreter *interpreter)
 
void cmAbortInterpreter (struct cmInterpreter *interpreter)
 
int cmIsTTY (enum cmStdioFile file)
 
struct cmLexercmNewLexer (struct cmHost *host)
 
void cmReleaseLexer (struct cmLexer *lexer)
 
void cmAbortLexer (struct cmLexer *lexer)
 
cmBool cmLexerAborted (const struct cmLexer *lexer)
 
int cmOpenForScanning (struct cmLexer *lexer, const char *filename)
 
cmBool cmLexerIsDone (struct cmLexer *lexer)
 
const struct cmTokencmScanToken (struct cmLexer *lexer)
 
const struct cmTokencmPeekToken (struct cmLexer *lexer)
 
void cmConsumeToken (struct cmLexer *lexer)
 
struct cmLiteralExpansioncmNewLiteralExpansion (struct cmHost *host)
 
void cmReleaseLiteralExpansion (struct cmLiteralExpansion *literal_expansion)
 
int CM_WARN_UNUSED_RESULT cmAddLiteralExpansionContent (struct cmLiteralExpansion *literal_expansion, const struct cmStringView *content_view)
 
const char * cmGetLiteralExpansionContent (const struct cmLiteralExpansion *literal_expansion)
 
size_t cmGetLiteralExpansionSize (const struct cmLiteralExpansion *literal_expansion)
 
void cmLiteralExpansionToExpansion (struct cmLiteralExpansion *literal_expansion, struct cmExpansion *expansion)
 
struct cmLoopcmNewLoop (struct cmHost *host)
 
void cmReleaseLoop (struct cmLoop *loop)
 
int cmAddLoopObject (struct cmLoop *loop, struct cmLoopObject *loop_object) CM_WARN_UNUSED_RESULT
 
int cmRunOnce (struct cmLoop *loop)
 
int cmRunDefault (struct cmLoop *loop)
 
cmBool cmLoopIsEmpty (const struct cmLoop *loop)
 
struct cmOptionParsercmNewOptionParser (struct cmHost *host, int argc, char **argv)
 
void cmReleaseOptionParser (struct cmOptionParser *option_parser)
 
const struct cmDefineOptioncmParseDefineOption (struct cmOptionParser *parser)
 
const char * cmParseNonOption (struct cmOptionParser *parser)
 
cmBool cmOptionParserIsDone (const struct cmOptionParser *parser)
 
struct cmParsercmNewParser (struct cmHost *host)
 
void cmReleaseParser (struct cmParser *parser)
 
int cmOpenForParsing (struct cmParser *parser, const char *filename)
 
void cmAbortParser (struct cmParser *parser)
 
cmBool cmParserFailed (const struct cmParser *parser)
 
const struct cmCommandcmParse (struct cmParser *parser)
 
void cmInitPosition (struct cmPosition *position)
 
void cmMoveRight (struct cmPosition *position)
 
void cmMoveDown (struct cmPosition *position)
 
void cmInitQueryHandler (struct cmQueryHandler *query_handler)
 
const struct cmStringViewcmIssueQuery (struct cmQueryHandler *query_handler, const struct cmQuery *query)
 
struct cmReadercmNewReader (struct cmHost *host)
 
void cmReleaseReader (struct cmReader *reader)
 
void cmAbortReader (struct cmReader *reader)
 
cmBool cmReaderAborted (const struct cmReader *reader)
 
int CM_WARN_UNUSED_RESULT cmOpenForReading (struct cmReader *reader, const char *filename)
 
char cmCharAt (struct cmReader *reader, size_t offset)
 
int CM_WARN_UNUSED_RESULT cmFillReaderTo (struct cmReader *reader, size_t count)
 
void cmConsume (struct cmReader *reader, size_t count)
 
const char * cmGetReaderBuffer (const struct cmReader *reader)
 
size_t cmGetReaderBufferSize (const struct cmReader *reader)
 
struct cmReferenceExpansioncmNewReferenceExpansion (struct cmHost *host)
 
void cmReleaseReferenceExpansion (struct cmReferenceExpansion *reference_expansion)
 
int CM_WARN_UNUSED_RESULT cmAddReferenceExpansionLeaf (struct cmReferenceExpansion *reference_expansion, struct cmExpansion *leaf)
 
const struct cmExpansionListcmGetReferenceExpansionBody (const struct cmReferenceExpansion *reference_expansion)
 
enum cmReferenceExpansionType cmGetReferenceExpansionType (const struct cmReferenceExpansion *reference_expansion)
 
void cmSetReferenceExpansionType (struct cmReferenceExpansion *reference_expansion, enum cmReferenceExpansionType type)
 
void cmReferenceExpansionToExpansion (struct cmReferenceExpansion *reference_expansion, struct cmExpansion *expansion)
 
void cmReportDiagnostic (struct cmHost *host, const struct cmDiagnostic *diagnostic)
 
void cmReportMessage (struct cmHost *host, const struct cmMessage *message)
 
struct cmScriptContextcmNewScriptContext (struct cmHost *host)
 
void cmReleaseScriptContext (struct cmScriptContext *script_context)
 
void cmSetScriptWarningConfig (struct cmScriptContext *script_context, const struct cmWarningConfig *warning_config)
 
int cmOpenScriptFile (struct cmScriptContext *script_context, const char *filename) CM_WARN_UNUSED_RESULT
 
int cmCopyVariablesToScript (struct cmScriptContext *script_context, const struct cmSymbolTable *symbol_table) CM_WARN_UNUSED_RESULT
 
int cmCopyFunctionsToScript (struct cmScriptContext *script_context, const struct cmSymbolTable *symbol_table) CM_WARN_UNUSED_RESULT
 
cmBool cmScriptIsDone (const struct cmScriptContext *script_context)
 
int cmContinueScript (struct cmScriptContext *script_context)
 
void cmSeparatorExpansionToExpansion (struct cmSeparatorExpansion *separator_expansion, struct cmExpansion *expansion)
 
char * cmStrdupFromHost (struct cmHost *host, const char *str)
 
struct cmStringListcmNewStringList (struct cmHost *host)
 
void cmReleaseStringList (struct cmStringList *string_list)
 
int cmPushString (struct cmStringList *string_list, const char *str) CM_WARN_UNUSED_RESULT
 
const char * cmGetString (const struct cmStringList *string_list, size_t index)
 
size_t cmGetStringCount (const struct cmStringList *string_list)
 
char ** cmStringListToArgv (struct cmStringList *string_list)
 
void cmInitStringView (struct cmStringView *string_view)
 
void cmInitSymbol (struct cmSymbol *symbol, struct cmHost *host)
 
void cmClearSymbol (struct cmSymbol *symbol)
 
int cmCopySymbol (const struct cmSymbol *src, struct cmSymbol *dst)
 
void cmMoveSymbol (struct cmSymbol *src, struct cmSymbol *dst)
 
int CM_WARN_UNUSED_RESULT cmSetSymbolKey (struct cmSymbol *symbol, const char *key)
 
int cmCompareSymbols (const struct cmSymbol *a, const struct cmSymbol *b, cmBool ignore_case)
 
struct cmSymbolTablecmNewSymbolTable (struct cmHost *host, cmBool ignore_case)
 
struct cmSymbolTablecmCopySymbolTable (const struct cmSymbolTable *other)
 
void cmReleaseSymbolTable (struct cmSymbolTable *symbol_table)
 
cmBool cmSymbolTableHasParentScope (const struct cmSymbolTable *symbol_table)
 
int CM_WARN_UNUSED_RESULT cmAddSymbol (struct cmSymbolTable *symbol_table, struct cmSymbol *symbol)
 
void cmRemoveSymbol (struct cmSymbolTable *symbol_table, const char *key)
 
void cmRemoveSymbolFromParentScope (struct cmSymbolTable *symbol_table, const char *key)
 
void * cmFindSymbol (const struct cmSymbolTable *symbol_table, const struct cmStringView *key_view)
 
int CM_WARN_UNUSED_RESULT cmPushScope (struct cmSymbolTable *symbol_table)
 
int CM_WARN_UNUSED_RESULT cmPopScope (struct cmSymbolTable *symbol_table)
 
struct cmTokencmNewToken (struct cmHost *host, size_t size)
 
void cmReleaseToken (struct cmToken *token)
 
struct cmTokencmCopyToken (struct cmToken *token, const struct cmToken *other)
 
const char * cmGetTokenContent (const struct cmToken *token)
 
size_t cmGetTokenSize (const struct cmToken *token)
 
enum cmTokenType cmGetTokenType (const struct cmToken *token)
 
const struct cmPositioncmGetTokenPosition (const struct cmToken *token)
 
struct cmTokencmResizeToken (struct cmToken *token, size_t size)
 
void cmSetTokenContent (struct cmToken *token, const char *content, size_t size)
 
void cmSetTokenPosition (struct cmToken *token, const struct cmPosition *position)
 
void cmSetTokenType (struct cmToken *token, enum cmTokenType type)
 
void cmPushTokenChar (struct cmToken *token, char c)
 
int CM_WARN_UNUSED_RESULT cmVariableToSymbol (const char *value, struct cmSymbol *symbol)
 
void cmInitWarningConfig (struct cmWarningConfig *warning_config)
 
void cmTestCache (struct cmTestDriver *test_driver)
 
void cmTestExpansionEvaluator (struct cmTestDriver *test_driver)
 
void cmTestGetExtensionOf (struct cmTestDriver *test_driver)
 

Variables

const struct cmBuiltinFunction builtin_function_table []
 

Detailed Description

Internal functions and declarations used within the library to implement the library interface.

Macro Definition Documentation

§ CM_FALSE

#define CM_FALSE   0

This is the value for false in boolean types.

§ CM_TRUE

#define CM_TRUE   1

This is the value for true in boolean types.

Typedef Documentation

§ cmBool

typedef unsigned char cmBool

A type definition for a boolean variable. This type definition uses 'unsigned char' as the underlying type.

§ cmChar16

typedef unsigned short int cmChar16

A type definition for a 16-bit character. This type definition uses 'unsigned short int' as the underlying type.

§ cmChar32

typedef unsigned long int cmChar32

A type definition of a 32-bit character. This type definition uses an 'unsigned long int' as the underlying type.

Enumeration Type Documentation

§ cmArgumentTokenType

Enumerates the several types of tokens.

Enumerator
CM_LOCAL_REFERENCE_OPENER 

The start of a local variable reference.

CM_CACHE_REFERENCE_OPENER 

The start of a cache variable reference.

CM_ENV_REFERENCE_OPENER 

The start of an environment variable reference.

CM_REFERENCE_CLOSER 

The end of a variable reference.

CM_SEMICOLON 

A single semicolon.

CM_WHITESPACE 

Newline and space characters.

CM_ARGUMENT_CONTENT 

An argument character.

CM_LEFT_PARENTHESIS_ARGUMENT 

A left parenthesis argument.

CM_RIGHT_PARENTHESIS_ARGUMENT 

A right parenthesis argument.

§ cmBOM

enum cmBOM

Enumerates several types of byte order marks that may be found.

Enumerator
CM_UTF_8 

UTF-8 signature

CM_UTF_16LE 

UTF-16 (little endian) signature

CM_UTF_16BE 

UTF-16 (big endian) signature

CM_UTF_32LE 

UTF-32 (little endian) signature

CM_UTF_32BE 

UTF-32 (big endian) signature

§ cmDiagnosticID

Identifiers the diagnostic that is being issued.

Enumerator
CM_MISSING_LEFT_PARENTHESIS 

A '(' is missing from a command.

CM_MISSING_RIGHT_PARENTHESIS 

A ')' is missing from a command.

CM_UNEXPECTED_TOKEN 

An unexpected token was found.

CM_UNKNOWN_COMMAND 

The command found in a script was not found.

CM_UNSUPPORTED_CODEC 

An unsupported character codec was detected.

CM_NO_ACTIVE_FILES 

The interpreter was ran without any scripts to execute.

CM_FILE_OPEN_FAILURE 

The interpreter was unable to open a script file.

CM_COMMAND_DIAGNOSTIC 

A diagnostic emitted from a command.

CM_UNKNOWN_OPTION 

An unrecognized option was passed to the interpreter.

CM_UNKNOWN_EXTENSION 

A file extension was not recognized by the library.

CM_MISSING_OPTION_ARGUMENT 

An option that requires a value is missing the value.

CM_MISSING_EXTENSION 

A script path was missing a file extension.

CM_UNTERMINATED_STRING 

A string literal was not terminated.

CM_UNSEPARATED_ARGUMENT 

An argument was found that did not have proper separation from the previous one.

CM_ERRORS_ARE_FATAL_DIAGNOSTIC 

A script is aborted because all errors are considered fatal.

CM_OUT_OF_MEMORY 

The library ran out of usable memory.

CM_NOT_IMPLEMENTED 

Indicates that an existing CMake behavior is not yet implemented.

§ cmDiagnosticSeverity

Enumerates the severity of the diagnostic.

Enumerator
CM_WARNING 

The diagnostic is just a warning.

CM_ERROR 

The diagnostic is an error.

CM_FATAL_ERROR 

The diagnostic is a fatal error. Execution of the script should abort.

§ cmExpansionEvaluatorMode

Enumerates the evaluator modes.

Enumerator
CM_EVALUATE_NONSTRING 

In this mode, finding whitespace or semicolons will separate arguments.

CM_EVALUATE_STRING 

In this mode, all whitespace or semicolons are preserved.

§ cmQueryType

Enumerates the type of queries that can be issued.

Enumerator
CM_CACHE_QUERY 

Queries the value of a cache variable.

CM_ENV_QUERY 

Queries the value of an environment variable.

CM_LOCAL_QUERY 

Queries the value of a local variable.

§ cmReferenceExpansionType

Enumerates the several types of variable references.

Enumerator
CM_LOCAL_REFERENCE 

A local variable reference.

CM_ENV_REFERENCE 

An environment variable reference.

CM_CACHE_REFERENCE 

A cache variable reference.

§ cmScriptStatus

Enumerates the possible status values of a script.

Enumerator
CM_SCRIPT_GOOD 

The script is okay.

CM_SCRIPT_FAILED 

The script encountered an error. The exit status should indicate a failure.

CM_SCRIPT_ABORTED 

The script encountered a fatal error. The exit status should indicate a failure and the script should be aborted.

§ cmStdioFile

Enumerates the several standard IO files.

Enumerator
CM_STDIN 

The standard input file.

CM_STDOUT 

The standard output file.

CM_STDERR 

The standard error file.

§ cmTokenType

Enumerates the several types of tokens.

Enumerator
CM_BRACKET_ARGUMENT_TOKEN 

A bracket argument.

CM_COMMENT 

A comment token.

CM_BRACKET_COMMENT 

A bracket comment.

CM_IDENTIFIER 

An identifier token.

CM_NUMBER 

A number token.

CM_LEFT_PARENTHESIS 

A single left parenthesis.

CM_NEWLINE 

A newline sequence.

CM_RIGHT_PARENTHESIS 

A single right parenthesis.

CM_SPACE 

A single space.

CM_STRING_LITERAL 

A double quoted string literal.

CM_ESCAPE_SEQUENCE 

One of ), (, ", or \

CM_UNKNOWN_SYMBOL 

An unknown symbol. This is also the type that is used when a token is first initialized.

§ cmWarningID

Enumerates the several warnings that can be specified from command line arguments.

Enumerator
CM_DEVELOPER_WARNINGS 

All warnings pertaining specifically to CMake developers.

CM_WARNINGS_ARE_ERRORS 

Warnings are treated as errors.

CM_ERRORS_ARE_FATAL 

All errors are fatal.

CM_UNKNOWN_WARNING 

An option specified with -W that is unknown to the option parser.

Function Documentation

§ cmAbortInterpreter()

void cmAbortInterpreter ( struct cmInterpreter interpreter)

Aborts the interpreter. The interpreter will no longer execute code after this function is called.

Parameters
interpreterThe interpreter to abort.

§ cmAbortLexer()

void cmAbortLexer ( struct cmLexer lexer)

Aborts the lexer. After calling this function, no more tokens can be scanned. This is used after encountering a fatal error, to ensure that the script can no longer be executed.

Parameters
lexerThe lexer to abort.

§ cmAbortParser()

void cmAbortParser ( struct cmParser parser)

Ensures that the parser stops parsing commands. This function is used when a script encounters a fatal error and can't be executed anymore.

Parameters
parserThe parser to abort.

§ cmAbortReader()

void cmAbortReader ( struct cmReader reader)

Aborts the reader. After calling this function, the file can no longer be read from. This is used when a fatal error is encountered, to ensure that the script can no longer be executed.

Parameters
readerThe reader to abort.

§ cmAcceptExpansionVisitor()

void cmAcceptExpansionVisitor ( const struct cmExpansion expansion,
struct cmExpansionVisitor visitor 
)

Accepts an expansion visitor.

Parameters
expansionThe expansion to visit.
visitorThe visitor that is visiting the expansion type.

§ cmAddArgumentContent()

void cmAddArgumentContent ( struct cmArgument argument,
const char *  content,
size_t  content_size 
)

Appends content to an argument. If the content is too large, then it is truncated to fit.

Parameters
argumentThe argument to append content to.
contentThe content to append.
content_sizeThe number of characters to append.

§ cmAddExpansion()

int cmAddExpansion ( struct cmExpansionList expansion_list,
struct cmExpansion expansion 
)

Adds an expansion to the expansion list.

Parameters
expansion_listThe expansion list to add an expansion to.
expansionThe expansion to add. After calling this function, the list has ownership of the expansion data.
Returns
Zero on success, an errno value on failure.

§ cmAddLiteralExpansionContent()

int CM_WARN_UNUSED_RESULT cmAddLiteralExpansionContent ( struct cmLiteralExpansion literal_expansion,
const struct cmStringView content_view 
)

Adds content to the literal expansion.

Parameters
literal_expansionThe literal expansion to receive the content.
content_viewA view of the content to be added.
Returns
Zero on success, a non-zero error code on failure.

§ cmAddLoopObject()

int cmAddLoopObject ( struct cmLoop loop,
struct cmLoopObject loop_object 
)

Adds an object to the loop.

Parameters
loopThe loop to add the object to.
loop_objectThe object to add.
Returns
Zero on success, a non-zero error code on failure.

§ cmAddReferenceExpansionLeaf()

int CM_WARN_UNUSED_RESULT cmAddReferenceExpansionLeaf ( struct cmReferenceExpansion reference_expansion,
struct cmExpansion leaf 
)

Adds an expansion leaf to the reference expansion. An expansion leaf is considered to be nested expansion within the brackets of the reference expansion.

Parameters
reference_expansionThe reference expansion to receive the content.
leafThe expansion leaf to add to the reference expansion body.
Returns
Zero on success, a non-zero error code on failure.

§ cmAddSymbol()

int CM_WARN_UNUSED_RESULT cmAddSymbol ( struct cmSymbolTable symbol_table,
struct cmSymbol symbol 
)

Adds a object to the symbol table.

Parameters
symbol_tableThe symbol table to add the object to.
symbolThe object to add to the symbol table.
Returns
Zero on success, a non-zero error code on failure.

§ cmAllowParsingExpansionSeparator()

void cmAllowParsingExpansionSeparator ( struct cmExpansionParser parser,
cmBool  separator_flag 
)

Indicates to the expansion parser whether or not to parse expansion separators. Expansion separators are parsed by default and cause the evaluator to separate arguments. If no expansion separators are parsed, and instead passed as expansion literals, then the evaluator will concatenate all expansions into a single argument.

Parameters
parserThe parser to modify.
separator_flagIf set to CM_TRUE, separators will be parsed. If set to CM_FALSE separators are instead parsed as literals.

§ cmArgumentLexerIsDone()

cmBool cmArgumentLexerIsDone ( const struct cmArgumentLexer lexer)

Indicates whether or not the argument lexer is done scanning tokens.

Parameters
lexerThe argument lexer to check.
Returns
If the lexer is done, CM_TRUE is returned. If the lexer is not done, then CM_FALSE is returned instead.

§ cmCharAt()

char cmCharAt ( struct cmReader reader,
size_t  offset 
)

Accesses a character at a specified location within the reader's buffer.

Parameters
readerThe reader to read from.
offsetThe offset within the current position of the reader.
Returns
The character at the specified location. If the location is out of bounds, then zero is returned.

§ cmClearExpansion()

void cmClearExpansion ( struct cmExpansion expansion)

Releases memory allocated by an expansion.

Parameters
expansionThe expansion to release the memory of.

§ cmClearHost()

void cmClearHost ( struct cmHost host)

Releases memory allocated by the host interface.

Parameters
hostThe host to release the memory for.

§ cmClearSymbol()

void cmClearSymbol ( struct cmSymbol symbol)

Releases memory allocated by the symbol.

Parameters
symbolThe symbol to release the memory of.

§ cmCompareSymbols()

int cmCompareSymbols ( const struct cmSymbol a,
const struct cmSymbol b,
cmBool  ignore_case 
)

Compares two symbols.

Parameters
aThe left hand symbol.
bThe right hand symbol.
ignore_caseWhether or not to ignore the case.
Returns
Zero if the symbols are the same. One if a is greater than b. Negative one if a is less than b.

§ cmConsume()

void cmConsume ( struct cmReader reader,
size_t  count 
)

Erases characters within the reader's buffer and moves the reader postiion forward. This is used when the lexer finishes scanning a token, and the characters in the reader no longer need to be used.

Parameters
readerThe reader to consume characters.
countThe number of characters to consume.

§ cmConsumeArgumentToken()

void cmConsumeArgumentToken ( struct cmArgumentLexer lexer)

When the last scanned token is no longer needed, this function discards it from the lexer. After calling this function, then next call to cmPeekArgumentToken will return a newly scanned token.

Parameters
lexerThe lexer to scan with.

§ cmConsumeToken()

void cmConsumeToken ( struct cmLexer lexer)

When the last scanned token no longer needs to be used, this function discards it from the lexer. After calling this function, the next call to cmPeekToken will produce a new token.

Parameters
lexerThe lexer to consume the token of.

§ cmContinueInterpreter()

int cmContinueInterpreter ( struct cmInterpreter interpreter)

Executes a command within the file that the interpreter is currently on.

Parameters
interpreterThe interpreter to continue running.
Returns
Zero on success, a non-zero error code on failure.

Don't bother parsing if the parser has already failed.

§ cmContinueScript()

int cmContinueScript ( struct cmScriptContext script_context)

Executes another command within the script.

Parameters
script_contextThe script to continue executing.
Returns
Zero on success, non-zero on error.

§ cmCopyArgument()

struct cmArgument* cmCopyArgument ( struct cmArgument dst,
const struct cmArgument src 
)

Makes a copy of an argument.

Parameters
dstIf the argument already exists in memory, passing it to this parameter may avoid allocating extra memory. Otherwise, it may be a null pointer.
srcThe argument to copy the data from.
Returns
A pointer to the copied argument.

§ cmCopyCacheVariable()

struct cmCacheVariable* cmCopyCacheVariable ( const struct cmCacheVariable other)

Makes a copy of the specified cache variable.

Parameters
otherThe cache variable to copy.
Returns
A pointer to the copied cache variable.

§ cmCopyFunctionsToScript()

int cmCopyFunctionsToScript ( struct cmScriptContext script_context,
const struct cmSymbolTable symbol_table 
)

Copies a function table to a script context. This allows the script to receive all functions defined in another symbol table. It is used to copy the function table defined in cmEngine so that functions defined by the end user get seen by the script context.

Parameters
script_contextThe script context to receive the symbol table.
symbol_tableThe function table to copy.
Returns
Zero on success, a non-zero error code on failure.

§ cmCopySymbol()

int cmCopySymbol ( const struct cmSymbol src,
struct cmSymbol dst 
)

Creates a copy of the symbol.

Parameters
srcThe symbol to copy.
dstThe symbol to put the copy into. This structure must already be initialized with cmInitSymbol
Returns
Zero on success, a non-zero error code on failure.

§ cmCopySymbolTable()

struct cmSymbolTable* cmCopySymbolTable ( const struct cmSymbolTable other)

Creates a copy of a symbol table.

Parameters
otherThe symbol table to copy.
Returns
A pointer to a copy of other.

§ cmCopyToken()

struct cmToken* cmCopyToken ( struct cmToken token,
const struct cmToken other 
)

Makes a copy of the token.

Parameters
tokenAn existing token to receive the data. This parameter may be null, in which case a new token is allocated.
otherThe token to copy.
Returns
A copy of other.

§ cmCopyVariablesToScript()

int cmCopyVariablesToScript ( struct cmScriptContext script_context,
const struct cmSymbolTable symbol_table 
)

Copies a variable table to a script context. This allows the script to receive all variables defined in another symbol table. It is used to copy the variable table defined in cmEngine so that variables defined by the end user get seen by the script context.

Parameters
script_contextThe script context to receive the symbol table.
symbol_tableThe variable table to copy.
Returns
Zero on success, a non-zero error code on failure.

§ cmEvaluateExpansions()

const struct cmArgument* cmEvaluateExpansions ( struct cmExpansionEvaluator evaluator)

Evaluates expansions, until an argument is completed.

Parameters
evaluatorThe expansion evaluator to use.
Returns
On success, a pointer to the argument that was generated. On failure or at the end of the input, this function will return a null pointer.

§ cmEvaluateFunctionArguments()

int CM_WARN_UNUSED_RESULT cmEvaluateFunctionArguments ( struct cmFunctionContext function_context)

Evaluates the arguments passed to the function.

Parameters
function_contextThe function context containing the arguments to evaluate.
Returns
Zero on success, a non-zero error code on failure.

§ cmExpansionEvaluatorAborted()

cmBool cmExpansionEvaluatorAborted ( const struct cmExpansionEvaluator evaluator)

Indicates whether or not the expansion evaluator has aborted.

Parameters
evaluatorThe evaluator to check.
Returns
If the evaluator aborted, CM_TRUE is returned. If it was not aborted, CM_FALSE is returned.

§ cmFillReaderTo()

int CM_WARN_UNUSED_RESULT cmFillReaderTo ( struct cmReader reader,
size_t  count 
)

Fills the reader's buffer to a specified number of characters.

Parameters
readerThe reader to fill.
countThe number of characters to fill.
Returns
Zero on success, a non-zero error code on failure.

§ cmFindCacheVariable()

const struct cmCacheVariable* cmFindCacheVariable ( const struct cmCache cache,
const struct cmStringView name 
)

Attempts to locate a cache variable.

Parameters
cacheThe cache to search the variable for.
nameThe name of the variable to search for.
Returns
A pointer to the variable, if it's found. If it is not found, then a null pointer is returned instead.

§ cmFindSymbol()

void* cmFindSymbol ( const struct cmSymbolTable symbol_table,
const struct cmStringView key_view 
)

Locates an object within the symbol table by searching its key.

Parameters
symbol_tableThe symbol table to search.
key_viewThe key to search for within the symbol table.
Returns
A pointer to the symbol's data, if it is found. If it is not found, then a null pointer is returned instead.

§ cmFormatDiagnostic()

void cmFormatDiagnostic ( struct cmDiagnostic diagnostic,
const char *  fmt,
  ... 
)

Formats the diagnostic message.

Parameters
diagnosticThe diagnostic to format.
fmtThe format specifier for the message.

§ cmFormatString()

char* cmFormatString ( struct cmHost host,
const char *  fmt,
  ... 
)

Formats a string, dynamically allocating the required memory for it.

Parameters
hostThe host used to allocate the memory.
fmtThe string format specification.
Returns
A pointer to a dynamically allocated string. Use cmFree to release the memory for this string.

§ cmFormatStringV()

char* cmFormatStringV ( struct cmHost host,
const char *  fmt,
va_list  args 
)

Formats a string, dynamically allocating the required memory for it.

Parameters
hostThe host used to allocate the memory.
fmtThe format specification of the string.
argsThe arguments to pass to the format function.
Returns
A pointer to a dynamically allocated string. Use cmFree to release the memory for this string.

§ cmFunctionToSymbol()

void cmFunctionToSymbol ( struct cmFunction function,
struct cmSymbol symbol 
)

Converts a function to a symbol structure. This can be used to add a new function to a symbol table.

Parameters
functionA pointer to the function callbacks.
symbolThe symbol structure to put the function into.

§ cmGetArgument()

const struct cmArgument* cmGetArgument ( const struct cmArgumentList argument_list,
size_t  index 
)

Accesses an argument from the argument list.

Parameters
argument_listThe argument list to get the argument from.
indexThe index of the argument to get.
Returns
A pointer to the argument. If the index is out of bounds, a null pointer is returned here.

§ cmGetArgumentCount()

size_t cmGetArgumentCount ( const struct cmArgumentList argument_list)

Accesses the number of arguments in the argument list.

Parameters
argument_listThe list to get the argument count of.
Returns
The number of arguments in the argument list.

§ cmGetArgumentTokenContentView()

const struct cmStringView* cmGetArgumentTokenContentView ( const struct cmArgumentToken token)

Accesses the content view of an argument token.

Parameters
tokenThe token to get the content view of.
Returns
A pointer ot the argument token's content view.

§ cmGetArgumentTokenPosition()

const struct cmPosition* cmGetArgumentTokenPosition ( const struct cmArgumentToken token)

Accesses the position of an argument token.

Parameters
tokenThe token to get the position of.
Returns
A pointer to the token's position.

§ cmGetArgumentTokenType()

enum cmArgumentTokenType cmGetArgumentTokenType ( const struct cmArgumentToken token)

Accesses the type of an argument token.

Parameters
tokenThe argument token to get the type of.
Returns
The type of an argument token.

§ cmGetCommandArgument()

const struct cmArgument* cmGetCommandArgument ( const struct cmCommand command,
size_t  index 
)

Accesses an argument at a specified location.

Parameters
commandThe command to get the argument from.
indexThe index of the argument to get.
Returns
A pointer to the argument at the specified location.

§ cmGetCommandArgumentCount()

size_t cmGetCommandArgumentCount ( const struct cmCommand command)

Accesses the number of arguments in the command.

Parameters
commandThe command to get the argument count from.
Returns
The number of arguments in this command.

§ cmGetCommandIdentifier()

const struct cmToken* cmGetCommandIdentifier ( const struct cmCommand command)

Accesses the identifier of a command.

Parameters
commandThe command to get the identifier of.
Returns
A pointer to the command's identifier. This function does not return null pointers.

§ cmGetConstLoop()

const struct cmLoop* cmGetConstLoop ( const struct cmEngine engine)

Accesses a constant pointer to the engine's loop.

Parameters
engineThe engine to get the loop from.
Returns
A constant pointer to the engine's loop.

§ cmGetExpansionCount()

size_t cmGetExpansionCount ( const struct cmExpansionList expansion_list)

Accesses the number of expansions in an expansion list.

Parameters
expansion_listThe list to get the size of.
Returns
The number of expansions in this list.

§ cmGetExtensionOf()

const char* cmGetExtensionOf ( const char *  path,
size_t  path_size 
)

Gets the extension of a path.

Parameters
pathThe path to get the extension of.
path_sizeThe number of characters in the path.
Returns
The extension of the specified path, not including the dot. If the path has no extension, then a null pointer is returned.

§ cmGetFunctionTable()

struct cmSymbolTable* cmGetFunctionTable ( struct cmEngine engine)

Accesses the function table of the engine.

Parameters
engineThe engine to get the function table from.
Returns
A pointer to the function table.

§ cmGetLiteralExpansionContent()

const char* cmGetLiteralExpansionContent ( const struct cmLiteralExpansion literal_expansion)

Accesses the string containing the literal expansion content.

Parameters
literal_expansionThe literal expansion to get the content of.
Returns
A null terminated string containing the expansion content.

§ cmGetLiteralExpansionSize()

size_t cmGetLiteralExpansionSize ( const struct cmLiteralExpansion literal_expansion)

Accesses the size of a literal expansion.

Parameters
literal_expansionThe literal expansion to get the size of.
Returns
The number of characters in the literal expansion.

§ cmGetLoop()

struct cmLoop* cmGetLoop ( struct cmEngine engine)

Accesses the loop from the engine structure.

Parameters
engineThe engine to get the loop from.
Returns
A pointer to the engine's loop.

§ cmGetReaderBuffer()

const char* cmGetReaderBuffer ( const struct cmReader reader)

Accesses the reader buffer. This is useful in some cases for faster scanning when used with cmFillReaderTo.

Parameters
readerThe reader to get the buffer from.
Returns
A pointer to the reader buffer.

§ cmGetReaderBufferSize()

size_t cmGetReaderBufferSize ( const struct cmReader reader)

Accesses the size of the reader's buffer.

Parameters
readerThe reader to get the buffer size of.
Returns
The reader's buffer size.

§ cmGetReferenceExpansionBody()

const struct cmExpansionList* cmGetReferenceExpansionBody ( const struct cmReferenceExpansion reference_expansion)

Accesses the body of the reference expansion.

Parameters
reference_expansionThe reference expansion to get the body of.
Returns
A pointer to the body of the reference expansion.

§ cmGetReferenceExpansionType()

enum cmReferenceExpansionType cmGetReferenceExpansionType ( const struct cmReferenceExpansion reference_expansion)

Accesses the type of a reference expansion.

Parameters
reference_expansionThe type to get the expansion of.
Returns
The type of the specified expansion.

§ cmGetString()

const char* cmGetString ( const struct cmStringList string_list,
size_t  index 
)

Accesses a string from a string list.

Parameters
string_listThe string list to get the string from.
indexThe index of the string to get.
Returns
A pointer to the string at the specified location. If the index is out of bounds, then an empty string is returned. This function never returns a null pointer.

§ cmGetStringCount()

size_t cmGetStringCount ( const struct cmStringList string_list)

Accesses the number of strings in a string list.

Parameters
string_listThe string list to get the count of.
Returns
The number of strings in this string list.

§ cmGetTokenContent()

const char* cmGetTokenContent ( const struct cmToken token)

Accesses the string content of the token.

Parameters
tokenThe token to get the content of.
Returns
A null-terminated string containing the token content.

§ cmGetTokenPosition()

const struct cmPosition* cmGetTokenPosition ( const struct cmToken token)

Accesses the token position.

Parameters
tokenThe token to get the position of.
Returns
A pointer to the token's position. This pointer is never null.

§ cmGetTokenSize()

size_t cmGetTokenSize ( const struct cmToken token)

Accesses the token size. In other words, returns the number of characters in the token (not including the null terminator.)

Parameters
tokenThe token to get the size of.
Returns
The number of characters in the token.

§ cmGetTokenType()

enum cmTokenType cmGetTokenType ( const struct cmToken token)

Accesses the type of the token.

Parameters
tokenThe token to get the type of.
Returns
The type of the specified token.

§ cmGetVariableTable()

struct cmSymbolTable* cmGetVariableTable ( struct cmEngine engine)

Accesses the variable table of the engine.

Parameters
engineThe engine to get the variable table from.
Returns
A pointer to the variable table.

§ cmGetWarningConfig()

const struct cmWarningConfig* cmGetWarningConfig ( const struct cmEngine engine)

Accesses the warning configuration for the engine.

Parameters
engineThe engine to get the warning config from.
Returns
A pointer to the warning configuration.

§ cmImportFunctionTable()

int cmImportFunctionTable ( struct cmInterpreter interpreter,
const struct cmSymbolTable function_table 
)

Copies a function symbol table and puts it into the interpreter.

Parameters
interpreterThe interpreter to receive the function symbols.
function_tableThe function table to import.
Returns
Zero on success, a non-zero error code on failure.

§ cmImportVariableTable()

int cmImportVariableTable ( struct cmInterpreter interpreter,
const struct cmSymbolTable variable_table 
)

Copies a variable symbol table and puts it into the interpreter.

Parameters
interpreterThe interpreter to receive the variable symbols.
variable_tableThe variable table to import.
Returns
Zero on success, a non-zero error code on failure.

§ cmInitExpansion()

void cmInitExpansion ( struct cmExpansion expansion)

Initializes the expansion.

Parameters
expansionThe expansion to initialize.

§ cmInitExpansionVisitor()

void cmInitExpansionVisitor ( struct cmExpansionVisitor expansion_visitor)

Initializes an expansion visitor.

Parameters
expansion_visitorThe expansion visitor to initialize.

§ cmInitHostFile()

void cmInitHostFile ( struct cmHostFile host_file)

Initializes members of the host file structure.

Parameters
host_fileThe host file structure to initialize.

§ cmInitPosition()

void cmInitPosition ( struct cmPosition position)

Initializes a position structure. After calling this function, the line and column members have a value of one.

Parameters
positionThe position structure to initialize.

§ cmInitQueryHandler()

void cmInitQueryHandler ( struct cmQueryHandler query_handler)

Initializes the interface of the query handler to its default values.

Parameters
query_handlerThe query handler to initialize.

§ cmInitStringView()

void cmInitStringView ( struct cmStringView string_view)

Initializes a string view.

Parameters
string_viewThe string view to initialize.

§ cmInitSymbol()

void cmInitSymbol ( struct cmSymbol symbol,
struct cmHost host 
)

Initializes the symbol for use.

Parameters
hostThe host used for memory allocation.
symbolThe symbol to initialize.

§ cmInitWarningConfig()

void cmInitWarningConfig ( struct cmWarningConfig warning_config)

Initializes the warning config to default values.

Parameters
warning_configThe warning config to initialize.

§ cmInterpreterIsDone()

cmBool cmInterpreterIsDone ( const struct cmInterpreter interpreter)

Indicates whether or not the interpreter is done executing.

Parameters
interpreterThe interpreter to check.
Returns
If the interpreter is done executing, then CM_TRUE is returned. Otherwise, if the interpreter has more commands to execute, then CM_FALSE is returned.

§ cmIssueQuery()

const struct cmStringView* cmIssueQuery ( struct cmQueryHandler query_handler,
const struct cmQuery query 
)

Issues a query.

Parameters
query_handlerThe query handler responding to the request.
queryThe query being issued.
Returns
A pointer to the string view containing the value of the query response. A null pointer should be interpreted as an empty string.

§ cmIsTTY()

int cmIsTTY ( enum cmStdioFile  file)

Indicates whether or not a certain standard IO file is a TTY. This is used to determine if color can be printed or not.

Parameters
fileThe file to check.
Returns
Non-zero if the file is a TTY, zero if it is not.

§ cmLexerAborted()

cmBool cmLexerAborted ( const struct cmLexer lexer)

Indicates whether or not the lexer has failed. It's good to check this function when a null pointer is returned from cmScanToken. Note that if this function returns CM_TRUE, then a diagnostic has already been issued.

Parameters
lexerThe lexer to check.
Returns
If the lexer has failed, CM_TRUE is returned. If the lexer has not failed, CM_FALSE is returned.

§ cmLexerIsDone()

cmBool cmLexerIsDone ( struct cmLexer lexer)

Indicates whether or not the lexer is done scanning tokens from the input.

Parameters
lexerA lexer returned by cmNewLexer.
Returns
If the lexer is done, CM_TRUE is returned. If the lexer is not done, CM_FALSE is returned instead.

If the buffer can't be filled to a size of one, then EOF must have been reached.

§ cmLiteralExpansionToExpansion()

void cmLiteralExpansionToExpansion ( struct cmLiteralExpansion literal_expansion,
struct cmExpansion expansion 
)

Converts the literal expansion to an expansion structure.

Parameters
literal_expansionThe literal expansion to convert.
expansionThe expansion structure to contain the literal expansion.

§ cmLoopIsEmpty()

cmBool cmLoopIsEmpty ( const struct cmLoop loop)

Indicates whether or not the loop has any objects in it.

Parameters
loopThe loop to check.
Returns
If the loop is empty, CM_TRUE is returned. If it is not, CM_FALSE is returned instead.

§ cmMoveDown()

void cmMoveDown ( struct cmPosition position)

Moves the position down by one line.

Parameters
positionThe position to move.

§ cmMoveRight()

void cmMoveRight ( struct cmPosition position)

Moves the position right by one character.

Parameters
positionThe position to move right.

§ cmMoveSymbol()

void cmMoveSymbol ( struct cmSymbol src,
struct cmSymbol dst 
)

Moves a symbol from one location to another.

Parameters
srcThe symbol structure to move.
dstThe destination to move the symbol to.

§ cmNewArgument()

struct cmArgument* cmNewArgument ( struct cmHost host,
size_t  size 
)

Creates a new argument type.

Parameters
hostThe host used to allocate the memory.
sizeThe number of characters to reserve space for in the argument. This can be changed after calling this function.
Returns
A pointer to the new argument.

§ cmNewArgumentLexer()

struct cmArgumentLexer* cmNewArgumentLexer ( struct cmHost host)

Creates a new argument lexer.

Parameters
hostThe host to allocate memory with.
Returns
A pointer to a new argument lexer.

§ cmNewArgumentList()

struct cmArgumentList* cmNewArgumentList ( struct cmHost host,
size_t  size 
)

Creates a new argument list instance.

Parameters
hostA pointer to the host to allocate memory with.
sizeThe number of arguments to put into the list.
Returns
A pointer to a new argument list.

§ cmNewCache()

struct cmCache* cmNewCache ( struct cmHost host)

Creates a new cache.

Parameters
hostThe host to allocate memory with.
Returns
A pointer to a new cache.

§ cmNewCacheVariable()

struct cmCacheVariable* cmNewCacheVariable ( struct cmHost host)

Creates a new cache variable.

Parameters
hostThe host to allocate memory with.
Returns
A pointer to a new cache variable.

§ cmNewCommand()

struct cmCommand* cmNewCommand ( struct cmHost host)

Creates a new command.

Parameters
hostA pointer to the host for memory allocations.
Returns
A pointer to a new command.

§ cmNewDiagnostic()

struct cmDiagnostic* cmNewDiagnostic ( struct cmHost host)

Allocates a new diagnostic structure.

Parameters
hostA pointer to the host to allocate the memory from.
Returns
A pointer the a newly allocated diagnostic.

§ cmNewEngine()

struct cmEngine* cmNewEngine ( struct cmHost host)

Creates a new engine structure.

Parameters
hostA pointer to the host interface, which may be a null.
Returns
A pointer to a new engine structure.

§ cmNewExpansionEvaluator()

struct cmExpansionEvaluator* cmNewExpansionEvaluator ( struct cmHost host)

Creates a new expansion evaluator.

Parameters
hostThe host used to allocate memory.
Returns
A pointer to a new expansion evaluator.

§ cmNewExpansionList()

struct cmExpansionList* cmNewExpansionList ( struct cmHost host)

Creates a new expansion list.

Parameters
hostA pointer to the host to allocate memory with.
Returns
A pointer to a new expansion list.

§ cmNewExpansionParser()

struct cmExpansionParser* cmNewExpansionParser ( struct cmHost host)

Creates a new expansion parser.

Parameters
hostThe host used to allocate memory.
Returns
A pointer to a new expansion parser.

§ cmNewFunctionContext()

struct cmFunctionContext* cmNewFunctionContext ( struct cmHost host)

Creates a new function context.

Parameters
hostThe interface to the host system.
Returns
A pointer to a new function context.

§ cmNewInterpreter()

struct cmInterpreter* cmNewInterpreter ( struct cmHost host)

Creates a new interpreter instance.

Parameters
hostThe host used to allocate memory.
Returns
A pointer to a new interpreter.

§ cmNewLexer()

struct cmLexer* cmNewLexer ( struct cmHost host)

Allocates a new lexer.

Parameters
hostA pointer to the host interface. This parameter is optional and may be null.
Returns
A pointer to a new lexer instance.

§ cmNewLiteralExpansion()

struct cmLiteralExpansion* cmNewLiteralExpansion ( struct cmHost host)

Creates a new literal expansion.

Parameters
hostThe host used to allocate memory.
Returns
A pointer to a new literal expansion.

§ cmNewLoop()

struct cmLoop* cmNewLoop ( struct cmHost host)

Creates an event loop.

Parameters
hostA pointer to the host interface, used to allocate memory for the loop.
Returns
A pointer to a new event loop.

§ cmNewOptionParser()

struct cmOptionParser* cmNewOptionParser ( struct cmHost host,
int  argc,
char **  argv 
)

Creates a new option parser.

Parameters
hostA pointer to the host interface.
argcThe number of arguments to parse.
argvThe argument array. Ensure that the first argument to this parameter is not the first argument of the parameter in main. In other words, make sure the first argument isn't the program name.
Returns
A pointer to a new option parser instance.

§ cmNewParser()

struct cmParser* cmNewParser ( struct cmHost host)

Creates a new parser instance.

Parameters
hostA pointer to the host interface. This parameter may be a null pointer.
Returns
A pointer to a new parser.

§ cmNewReader()

struct cmReader* cmNewReader ( struct cmHost host)

Allocates a new reader.

Parameters
hostA pointer to the host interface. This parameter may be a null pointer.
Returns
A pointer to a new reader.

§ cmNewReferenceExpansion()

struct cmReferenceExpansion* cmNewReferenceExpansion ( struct cmHost host)

Creates a new reference expansion.

Parameters
hostThe host used to allocate memory.
Returns
A pointer to a new reference expansion.

§ cmNewScriptContext()

struct cmScriptContext* cmNewScriptContext ( struct cmHost host)

Creates a new script context.

Parameters
hostA pointer to the host interface. This parameter may be a null pointer.
Returns
A pointer to a new script context.

§ cmNewStringList()

struct cmStringList* cmNewStringList ( struct cmHost host)

Creates a new string list.

Parameters
hostA pointer to the host interface, which is used to allocate memory for the string list. This parameter may be a null pointer.
Returns
A pointer to a new string list.

§ cmNewSymbolTable()

struct cmSymbolTable* cmNewSymbolTable ( struct cmHost host,
cmBool  ignore_case 
)

Creates a new symbol table instance.

Parameters
hostThe host to allocate the memory with.
ignore_caseWhether or not to ignore case when comparing symbol keys.
Returns
A pointer to a new symbol table instance.

§ cmNewToken()

struct cmToken* cmNewToken ( struct cmHost host,
size_t  size 
)

Creates a new token.

Parameters
hostA pointer to the host to allocate memory with.
sizeThe size, in terms of characters, of the token to create.
Returns
An instance to a new token.

§ cmOpenForInterpretation()

int cmOpenForInterpretation ( struct cmInterpreter interpreter,
const char *  filename 
)

Opens a file for interpretation.

Parameters
interpreterThe interpreter to run the file.
filenameThe filename to open.
Returns
Zero on success, a non-zero error code on failure.

§ cmOpenForParsing()

int cmOpenForParsing ( struct cmParser parser,
const char *  filename 
)

Opens a file for parsing.

Parameters
parserThe parser to open the file with.
filenameThe name of the file to open.
Returns
Zero on success, a non-zero error code on failure.

§ cmOpenForReading()

int CM_WARN_UNUSED_RESULT cmOpenForReading ( struct cmReader reader,
const char *  filename 
)

Opens a file for reading.

Parameters
readerA reader returned by cmNewReader.
filenameThe name of the file to read.
Returns
Zero on success, a non-zero error code on failure.

§ cmOpenForScanning()

int cmOpenForScanning ( struct cmLexer lexer,
const char *  filename 
)

Opens a file for the lexer to read.

Parameters
lexerThe lexer to scan the file with.
filenameThe name of the file to open.
Returns
Zero on success, a non-zero error code on failure.

§ cmOpenScriptFile()

int cmOpenScriptFile ( struct cmScriptContext script_context,
const char *  filename 
)

Opens the script file to be executed.

Parameters
script_contextThe script context returned by cmNewScriptContext.
filenameThe filename of the script to execute.
Returns
Zero on success, a non-zero error code on failure.

§ cmOptionParserIsDone()

cmBool cmOptionParserIsDone ( const struct cmOptionParser parser)

Indicates whether or not an option parser is done parsing the command line arguments.

Parameters
parserThe option parser to check on.
Returns
If the parser is done CM_TRUE is returned. If the parser is not done, CM_FALSE is returned instead.

§ cmOutOfMemoryDiagnostic()

const struct cmDiagnostic* cmOutOfMemoryDiagnostic ( void  )

Returns a pointer to the diagnostic that indicates an out of memory condition. This is a special diagnostic because it does not allocate memory when it is returned.

Returns
A pointer to the constant, out of memory diagnostic.

§ cmParse()

const struct cmCommand* cmParse ( struct cmParser parser)

Parses a single command.

Parameters
parserA parser created with cmNewParser.
Returns
A pointer to a command, if one is found.

§ cmParseDefineOption()

const struct cmDefineOption* cmParseDefineOption ( struct cmOptionParser parser)

Parses a define option. In other words, an option that starts with '-D'.

Parameters
parserThe parser containing the arguments to parse.
Returns
If a define option is found, then it is returned by this function. Otherwise, a null pointer is returned instead.

§ cmParseExpansion()

struct cmExpansion* cmParseExpansion ( struct cmExpansionParser parser)

Parses an expansion.

Parameters
parserThe parser to parse the expansion with.
Returns
A pointer to a newly allocated expansion.

§ cmParseNonOption()

const char* cmParseNonOption ( struct cmOptionParser parser)

Parses an argument that is not considered to be an option. This function should be called only after all other options have been parsed. If the next argument is an option, an unknown option diagnostic is passed and this function returns a null pointer.

Parameters
parserThe parser to parse the non-option with.
Returns
If a non-option was found, then it is returned by this function. If a non-option was not found, then a null pointer is returned instead and a diagnostic is issued.

§ cmParserFailed()

cmBool cmParserFailed ( const struct cmParser parser)

Indicates whether or not the parser encountered a fatal error.

Parameters
parserThe parser returned by cmNewParser.
Returns
If the parser encountered an error, CM_TRUE is returned. If the parser did not encounter any errors, CM_FALSE is returned instead.

§ cmPeekArgumentToken()

const struct cmArgumentToken* cmPeekArgumentToken ( struct cmArgumentLexer lexer)

Attempts to scan a token, unless one has been scanned already. Successive calls to this function will return the same token.

Parameters
lexerThe lexer to scan with.
Returns
A pointer to the token that was scanned.

§ cmPeekToken()

const struct cmToken* cmPeekToken ( struct cmLexer lexer)

Attempts to scan a token, unless one has been scanned already. If one has been scanned already, then it is returned by this function.

Parameters
lexerThe lexer to scan with.
Returns
A pointer to the token that was scanned.

§ cmPopScope()

int CM_WARN_UNUSED_RESULT cmPopScope ( struct cmSymbolTable symbol_table)

Pops a scope from the symbol table. This function has no effect if there is only the global scope left.

Parameters
symbol_tableThe symbol table to pop the scope from.
Returns
Zero on success, a non-zero error code on failure.

§ cmPushArgument()

struct cmArgumentList* cmPushArgument ( struct cmArgumentList argument_list,
const struct cmArgument argument 
)

Pushes an argument to the argument list.

Parameters
argument_listThe argument list to receive the argument.
argumentThe argument to push to the list.
Returns
A pointer to the argument list. This is used incase the argument list has to be resized to fit the argument.

§ cmPushCommandArgument()

int CM_WARN_UNUSED_RESULT cmPushCommandArgument ( struct cmCommand command,
const struct cmArgument argument 
)

Adds an argument to the commands argument list.

Parameters
commandThe command to add the argument to.
argumentThe argument to add to the command.
Returns
Zero on success, a non-zero error code on failure.

§ cmPushFunctionArgument()

int CM_WARN_UNUSED_RESULT cmPushFunctionArgument ( struct cmFunctionContext function_context,
const struct cmArgument argument 
)

Pushes an argument to the function context.

Parameters
function_contextThe function context to push the argument to.
argumentThe argument to push to the function call.
Returns
Zero on success, a non-zero error code on failure.

§ cmPushScope()

int CM_WARN_UNUSED_RESULT cmPushScope ( struct cmSymbolTable symbol_table)

Pushes a new scope to the symbol table.

Parameters
symbol_tableThe symbol table to push a scope to.
Returns
Zero on success, a non-zero error code on failure.

§ cmPushString()

int cmPushString ( struct cmStringList string_list,
const char *  str 
)

Adds a string to the string list.

Parameters
string_listThe string list to add the string to.
strThe string to add to the list.
Returns
Zero on success, a non-zero error code on failure.

§ cmPushTokenChar()

void cmPushTokenChar ( struct cmToken token,
char  c 
)

Adds a character to the end of the token content.

Parameters
tokenThe token to add the character to.
cThe character to add.

§ cmReaderAborted()

cmBool cmReaderAborted ( const struct cmReader reader)

Indicates whether or not the reader has failed.

Parameters
readerThe reader to check.
Returns
If the reader failed, CM_TRUE is returned. If the reader has not failed, CM_FALSE is returned instead.

§ cmReadFromHostFile()

size_t cmReadFromHostFile ( struct cmHostFile host_file,
void *  data,
size_t  size 
)

Reads data from a host file.

Parameters
host_fileThe host file to read from.
dataThe variable to put the data into.
sizeThe number of bytes to read.
Returns
The number of bytes that were read from the file. A return value of zero indicates that the end of the file was reached.

§ cmReferenceExpansionToExpansion()

void cmReferenceExpansionToExpansion ( struct cmReferenceExpansion reference_expansion,
struct cmExpansion expansion 
)

Converts the reference expansion to an expansion structure.

Parameters
reference_expansionThe reference expansion to convert.
expansionThe expansion structure to contain the reference expansion.

§ cmReleaseArgument()

void cmReleaseArgument ( struct cmArgument argument)

Releases memory allocated by an argument.

Parameters
argumentThe argument to release the memory for.

§ cmReleaseArgumentLexer()

void cmReleaseArgumentLexer ( struct cmArgumentLexer lexer)

Releases memory allocated by the argument lexer.

Parameters
lexerThe lexer to release the memory of.

§ cmReleaseArgumentList()

void cmReleaseArgumentList ( struct cmArgumentList argument_list)

Releases memory allocated by an argument list.

Parameters
argument_listThe argument list to release.

§ cmReleaseCache()

void cmReleaseCache ( struct cmCache cache)

Releases memory allocated by a cache.

Parameters
cacheThe cache to release the memory for.

§ cmReleaseCacheVariable()

void cmReleaseCacheVariable ( struct cmCacheVariable var)

Releases memory allocated by a cache variable.

Parameters
varThe variable to release the memory for.

§ cmReleaseCommand()

void cmReleaseCommand ( struct cmCommand command)

Releases memory allocated by cmNewCommand.

Parameters
commandThe command to release the memory of.

§ cmReleaseDiagnostic()

void cmReleaseDiagnostic ( struct cmDiagnostic diagnostic)

Releases memory allocated by a diagnostic.

Parameters
diagnosticThe diagnostic to release the memory for.

§ cmReleaseEngine()

void cmReleaseEngine ( struct cmEngine engine)

Releases the engine structure.

Parameters
engineThe engine to release the resources for.

§ cmReleaseExpansionEvaluator()

void cmReleaseExpansionEvaluator ( struct cmExpansionEvaluator evaluator)

Releases memory allocated by an expansion evaluator.

Parameters
evaluatorThe evaluator to release the memory for.

§ cmReleaseExpansionList()

void cmReleaseExpansionList ( struct cmExpansionList expansion_list)

Releases an expansion list.

Parameters
expansion_listThe expansion list to release.

§ cmReleaseExpansionParser()

void cmReleaseExpansionParser ( struct cmExpansionParser parser)

Releases memory allocated by an expansion parser.

Parameters
parserThe parser to release the memory of.

§ cmReleaseFunctionContext()

void cmReleaseFunctionContext ( struct cmFunctionContext function_context)

Releases memory allocated by the function context.

Parameters
function_contextThe function to release the memory of.

§ cmReleaseHostFile()

void cmReleaseHostFile ( struct cmHostFile host_file)

Releases memory allocated by a host file.

Parameters
host_fileThe host file to release the memory for.

§ cmReleaseInterpreter()

void cmReleaseInterpreter ( struct cmInterpreter interpreter)

Releases memory allocated by an interpreter.

Parameters
interpreterThe interpreter to release the memory for.

§ cmReleaseLexer()

void cmReleaseLexer ( struct cmLexer lexer)

Releases memory allocated by a lexer.

Parameters
lexerThe lexer to release the memory of.

§ cmReleaseLiteralExpansion()

void cmReleaseLiteralExpansion ( struct cmLiteralExpansion literal_expansion)

Releases memory allocated by the literal expansion.

Parameters
literal_expansionThe expansion to release the memory for.

§ cmReleaseLoop()

void cmReleaseLoop ( struct cmLoop loop)

Releases an event loop.

Parameters
loopThe event loop to release.

§ cmReleaseOptionParser()

void cmReleaseOptionParser ( struct cmOptionParser option_parser)

Releases memory allocated by an option parser.

Parameters
option_parserThe option parser to release the memory for.

§ cmReleaseParser()

void cmReleaseParser ( struct cmParser parser)

Releases memory allocated by a parser.

Parameters
parserThe parser to release the memory for. This structure should have been returned by cmNewParser.

§ cmReleaseReader()

void cmReleaseReader ( struct cmReader reader)

Releases memory allocated by a reader.

Parameters
readerA reader returned by cmNewReader.

§ cmReleaseReferenceExpansion()

void cmReleaseReferenceExpansion ( struct cmReferenceExpansion reference_expansion)

Releases memory allocated by the reference expansion.

Parameters
reference_expansionThe expansion to release the memory for.

§ cmReleaseScriptContext()

void cmReleaseScriptContext ( struct cmScriptContext script_context)

Releases memory allocated by a script context.

Parameters
script_contextThe script context to release.

§ cmReleaseStringList()

void cmReleaseStringList ( struct cmStringList string_list)

Releases memory allocated by a string list.

Parameters
string_listThe string list to release the memory of.

§ cmReleaseSymbolTable()

void cmReleaseSymbolTable ( struct cmSymbolTable symbol_table)

Releases memory allocated by a symbol table.

Parameters
symbol_tableThe symbol table to release the memory for. This should be an instance returned by cmNewSymbolTable.

§ cmReleaseToken()

void cmReleaseToken ( struct cmToken token)

Releases memory allocated by cmNewToken.

Parameters
tokenA token created by cmNewToken.

§ cmRemoveSymbol()

void cmRemoveSymbol ( struct cmSymbolTable symbol_table,
const char *  key 
)

Removes a symbol from a symbol table, specified by the name of the symbol.

Parameters
symbol_tableThe symbol table to remove the variable from.
keyThe name given to the symbol.

§ cmRemoveSymbolFromParentScope()

void cmRemoveSymbolFromParentScope ( struct cmSymbolTable symbol_table,
const char *  key 
)

Removes a symbol from the parent scope.

Parameters
symbol_tableThe symbol table to remove the variable from.
keyThe name of the variable.

§ cmReportDiagnostic()

void cmReportDiagnostic ( struct cmHost host,
const struct cmDiagnostic diagnostic 
)

Reports a diagnostic to the user.

Parameters
hostA pointer to the host interface, which may be null.
diagnosticA pointer to the diagnostic to print.

§ cmReportMessage()

void cmReportMessage ( struct cmHost host,
const struct cmMessage message 
)

Reports a message to the user.

Parameters
hostA pointer to the host interface, which may be null.
messageA pointer to the message to print.

§ cmResetArgument()

void cmResetArgument ( struct cmArgument argument)

Erases the argument content so that the argument can be reused without allocating new memory.

Parameters
argumentThe argument to reset.

§ cmResetArgumentList()

void cmResetArgumentList ( struct cmArgumentList argument_list)

Resets the argument list. Calling this function clears the argument list without releasing the memory. This way the argument list can be reused without allocating memory again.

Parameters
argument_listThe argument list to reset.

§ cmResetExpansionEvaluator()

void cmResetExpansionEvaluator ( struct cmExpansionEvaluator evaluator)

Resets the expansion evaluator, so that the memory doesn't have to be allocated again.

Parameters
evaluatorThe evaluator to reset.

§ cmResetFunctionContext()

void cmResetFunctionContext ( struct cmFunctionContext function_context)

Resets the function context. This is for reusing function contexts without allocating memory all over again.

Parameters
function_contextThe function context to release.

§ cmResizeArgument()

struct cmArgument* cmResizeArgument ( struct cmArgument argument,
size_t  size 
)

Resizes an argument.

Parameters
argumentThe argument to resize.
sizeThe size to give the argument.
Returns
A pointer to the newly allocated argument.

§ cmResizeToken()

struct cmToken* cmResizeToken ( struct cmToken token,
size_t  size 
)

Resizes token content. If the token size is reduced, the existing content is truncated to fit. current character content.

Parameters
tokenThe token to resize. If this parameter is null then a new token is created from scratch.
sizeThe new size of the token.
Returns
A pointer to a reallocated token.

§ cmRunDefault()

int cmRunDefault ( struct cmLoop loop)

Runs the loop until all loop entries are completed.

Parameters
loopThe loop to run.
Returns
Zero on success, a negative one on failure.

§ cmRunOnce()

int cmRunOnce ( struct cmLoop loop)

Runs the loop once.

Parameters
loopThe loop to run once.
Returns
Zero on success, negative one on failure.

§ cmScanToken()

const struct cmToken* cmScanToken ( struct cmLexer lexer)

Attempts to scan a token from the input buffer.

Parameters
lexerThe lexer structure returned by cmNewLexer.
Returns
A pointer to a token, if one was scanned properly.

§ cmScriptIsDone()

cmBool cmScriptIsDone ( const struct cmScriptContext script_context)

Indicates whether or not the script is done executing.

Parameters
script_contextThe script context to check.
Returns
If the script is done executing, then CM_TRUE is returned. If the script is not done executing, CM_FALSE is returned instead.

This happens if a file is never opened.

§ cmSeparatorExpansionToExpansion()

void cmSeparatorExpansionToExpansion ( struct cmSeparatorExpansion *  separator_expansion,
struct cmExpansion expansion 
)

Converts a separator expansion to an expansion. The separator expansion has no actual data, but the callback functions are set appropriately to call the right visitor function.

Parameters
separator_expansionThe expansion to convert.
expansionThe expansion structure to fill.

§ cmSetArgumentLexerInput()

void cmSetArgumentLexerInput ( struct cmArgumentLexer lexer,
const struct cmStringView input 
)

Assigns the input to the argument lexer.

Parameters
lexerThe lexer to set the input of.
inputThe input to assign the lexer.

§ cmSetArgumentType()

void cmSetArgumentType ( struct cmArgument argument,
enum cmArgumentType  type 
)

Assigns the type of the argument.

Parameters
argumentThe argument to assign the type of.
typeThe type to assign the argument.

§ cmSetCacheVariableDoc()

int CM_WARN_UNUSED_RESULT cmSetCacheVariableDoc ( struct cmCacheVariable var,
const char *  doc 
)

Assigns the documentation string to the cache variable.

Parameters
varThe variable to assign the documentation string to.
docThe documentation string to assign.
Returns
Zero on success, non-zero on failure.

§ cmSetCacheVariableName()

int CM_WARN_UNUSED_RESULT cmSetCacheVariableName ( struct cmCacheVariable var,
const char *  name 
)

Assigns the name of the variable.

Parameters
varThe variable to set the name of.
nameThe name to give the cache variable.
Returns
Zero on success, an error code on failure.

§ cmSetCacheVariableType()

void cmSetCacheVariableType ( struct cmCacheVariable var,
enum cmCacheType  type 
)

Assigns the type of a cache variable.

Parameters
varThe variable to set the type of.
typeThe type to assign the variable.

§ cmSetCacheVariableValue()

int CM_WARN_UNUSED_RESULT cmSetCacheVariableValue ( struct cmCacheVariable var,
const char *  value 
)

Assigns the value of the variable.

Parameters
varThe variable to set the value of.
valueThe value to give the cache variable.
Returns
Zero on success, an error code on failure.

§ cmSetCommandIdentifier()

int CM_WARN_UNUSED_RESULT cmSetCommandIdentifier ( struct cmCommand command,
const struct cmToken identifier 
)

Assigns the command identifier.

Parameters
commandThe command to set the identifier of.
identifierThe identifier to assign to the command.
Returns
Zero on success, a non-zero error code on failure.

§ cmSetDiagnosticFilename()

void cmSetDiagnosticFilename ( struct cmDiagnostic diagnostic,
const char *  filename 
)

Assigns the filename of the diagnostic.

Parameters
diagnosticThe diagnostic to assign the filename to.
filenameThe filename to assign the diagnostic. If this parameter is null, then it is replaced by an empty string.

§ cmSetDiagnosticID()

void cmSetDiagnosticID ( struct cmDiagnostic diagnostic,
enum cmDiagnosticID  id 
)

Assigns the ID of the diagnostic.

Parameters
diagnosticThe diagnostic to assign the ID to.
idThe ID to assign the diagnostic.

§ cmSetDiagnosticPosition()

void cmSetDiagnosticPosition ( struct cmDiagnostic diagnostic,
const struct cmPosition position 
)

Assigns the position of the diagnostic. If the diagnostic has no position, then this function does not have to be called.

Parameters
diagnosticThe diagnostic to set the position for.
positionThe position to give the diagnostic.

§ cmSetDiagnosticSeverity()

void cmSetDiagnosticSeverity ( struct cmDiagnostic diagnostic,
enum cmDiagnosticSeverity  severity 
)

Assigns the severity of the diagnostic.

Parameters
diagnosticThe diagnostic to assign the severity to.
severityThe severity to assign the diagnostic.

§ cmSetExpansionEvaluatorInput()

void cmSetExpansionEvaluatorInput ( struct cmExpansionEvaluator evaluator,
const struct cmStringView input 
)

Assigns the input to the expansion evaluator.

Parameters
evaluatorThe evaluator to assign the input to.
inputThe input to assign the evaluator.

§ cmSetExpansionEvaluatorMode()

void cmSetExpansionEvaluatorMode ( struct cmExpansionEvaluator evaluator,
enum cmExpansionEvaluatorMode  mode 
)

Assigns the mode of the expansion evaluator.

Parameters
evaluatorThe evaluator to set the mode of.
modeThe mode to assign the evaluator.

§ cmSetExpansionEvaluatorQueryHandler()

void cmSetExpansionEvaluatorQueryHandler ( struct cmExpansionEvaluator evaluator,
struct cmQueryHandler query_handler 
)

Assigns the query handler to the expansion evaluator.

Parameters
evaluatorThe evaluator to assign the query handler to.
query_handlerThe query handler to assign.

§ cmSetExpansionParserInput()

void cmSetExpansionParserInput ( struct cmExpansionParser parser,
const struct cmStringView input 
)

Assigns the input string to the expansion parser.

Parameters
parserThe parser to assign the input to.
inputThe input string to assign the parser.

§ cmSetFunctionCache()

void cmSetFunctionCache ( struct cmFunctionContext function_context,
struct cmCache cache 
)

Assigns the cache to be used by the function context.

Parameters
function_contextThe function context to give the cache pointer to.
cacheThe cache pointer to give the function context.

§ cmSetFunctionVariableTable()

void cmSetFunctionVariableTable ( struct cmFunctionContext function_context,
struct cmSymbolTable variable_table 
)

Assigns the variable table to be used by the function.

Parameters
function_contextThe function context to assign the variable table to.
variable_tableThe variable table to assign.

§ cmSetReferenceExpansionType()

void cmSetReferenceExpansionType ( struct cmReferenceExpansion reference_expansion,
enum cmReferenceExpansionType  type 
)

Assigns the reference expansion type to the expansion.

Parameters
reference_expansionThe reference expansion to set the type of.
typeThe type to assign the reference expansion.

§ cmSetScriptWarningConfig()

void cmSetScriptWarningConfig ( struct cmScriptContext script_context,
const struct cmWarningConfig warning_config 
)

Assigns the warning configuration to the script.

Parameters
script_contextThe script context to set the warning configuration for.
warning_configThe warning configuration to assign.

§ cmSetSymbolKey()

int CM_WARN_UNUSED_RESULT cmSetSymbolKey ( struct cmSymbol symbol,
const char *  key 
)

Assigns the key of the symbol.

Parameters
symbolThe symbol to set the key of.
keyThe key to give the symbol.
Returns
Zero on success, a non-zero error code on failure.

§ cmSetTokenContent()

void cmSetTokenContent ( struct cmToken token,
const char *  content,
size_t  size 
)

Assigns the content to the token.

Parameters
tokenThe token to assign the content to.
contentThe content to assign.
sizeThe size of the content to assign. This is truncated to fit, based on the size in cmNewToken or cmResizeToken.

§ cmSetTokenPosition()

void cmSetTokenPosition ( struct cmToken token,
const struct cmPosition position 
)

Assigns the token position.

Parameters
tokenThe token to assign the position of.
positionThe position to assign the token.

§ cmSetTokenType()

void cmSetTokenType ( struct cmToken token,
enum cmTokenType  type 
)

Assigns the type of the token.

Parameters
tokenThe token to assign the size of.
typeThe type to give the token.

§ cmSetWarningOption()

void cmSetWarningOption ( struct cmEngine engine,
const struct cmWarningOption warning_option 
)

Sets a warning option.

Parameters
engineThe engine to set the warning option for.
warning_optionThe warning option to assign.

§ cmStrdupFromHost()

char* cmStrdupFromHost ( struct cmHost host,
const char *  str 
)

Creates a dynamically allocated copy of a string, using the memory allocating functions provided by the host interface.

Parameters
hostThe host containing the memory allocation functions.
strThe string to copy.
Returns
A pointer to the newly allocated string.

§ cmStringListToArgv()

char** cmStringListToArgv ( struct cmStringList string_list)

Returns a compatible function to argv-like parsers.

Parameters
string_listThe string list to get the argv-like pointer to.
Returns
A pointer to the strings in the string list. The string list is terminated by a null string pointer.

§ cmSymbolTableHasParentScope()

cmBool cmSymbolTableHasParentScope ( const struct cmSymbolTable symbol_table)

Indicates whether or not the symbol table has a parent scope.

Parameters
symbol_tableThe symbol table to check.
Returns
If the symbol table has a parent scope, then CM_TRUE is returned. Otherwise, CM_FALSE is returned.

§ cmTestCache()

void cmTestCache ( struct cmTestDriver *  test_driver)

Tests to ensure that the cache is working as expected.

Parameters
test_driverThe test driver to report failures to.

§ cmTestExpansionEvaluator()

void cmTestExpansionEvaluator ( struct cmTestDriver *  test_driver)

Tests for correct functionality of the expansion evaluator.

Parameters
test_driverThe test driver to report failures to.

§ cmTestGetExtensionOf()

void cmTestGetExtensionOf ( struct cmTestDriver *  test_driver)

Tests to ensure that cmGetExtensionOf is working as expected.

Parameters
test_driverThe test driver to report failures with.

§ cmVariableToSymbol()

int CM_WARN_UNUSED_RESULT cmVariableToSymbol ( const char *  value,
struct cmSymbol symbol 
)

Converts a variable to a symbol structure. This can be used to add a new variable to a symbol table.

Parameters
valueThe value to give the variable.
symbolThe symbol structure to put the variable into.
Returns
Zero on success, a non-zero error code on failure.

§ cmVisitLiteralExpansion()

void cmVisitLiteralExpansion ( struct cmExpansionVisitor expansion_visitor,
const struct cmLiteralExpansion literal_expansion 
)

Visits a literal expansion.

Parameters
expansion_visitorThe visitor to visit the literal expansion.
literal_expansionThe literal expansion to visit.

§ cmVisitReferenceExpansion()

void cmVisitReferenceExpansion ( struct cmExpansionVisitor expansion_visitor,
const struct cmReferenceExpansion reference_expansion 
)

Visits a reference expansion.

Parameters
expansion_visitorThe expansion visitor to visit the reference expansion.
reference_expansionThe reference expansion to visit.

§ cmVisitSeparatorExpansion()

void cmVisitSeparatorExpansion ( struct cmExpansionVisitor expansion_visitor,
const struct cmSeparatorExpansion *  separator_expansion 
)

Visits a separator expansion. A separator expansion is a pseudo expansion, it doesn't actually contain any data. It represents the space or semicolon between two arguments.

Parameters
expansion_visitorThe visitor to give the expansion to.
separator_expansionThe separator expansion to pass to the visitor. This can be a null pointer, since the separator expansion isn't a defined structure.

Variable Documentation

§ builtin_function_table

const struct cmBuiltinFunction builtin_function_table[]
Initial value:
= {
{ "message", cmInitMessageFunction },
{ "set", cmInitSetFunction },
{ "unset", cmInitUnsetFunction },
{ NULL, NULL }
}
int cmInitSetFunction(struct cmHost *host, struct cmFunction *function)
Definition: cmSetFunction.c:282
int cmInitUnsetFunction(struct cmHost *host, struct cmFunction *function)
Definition: cmUnsetFunction.c:29
int cmInitMessageFunction(struct cmHost *host, struct cmFunction *function)
Definition: cmMessageFunction.c:224

Contains the names and initialization functions of all builtin functions.