coan 4.2.4
The Hash Include component interface.
Collaboration diagram for The Hash Include component interface.:

Files

file  hash_include.c
file  hash_include.h

Defines

#define hash_include_dispose   symbol_dispose
#define hash_include_copy   symbol_copy
#define hash_include_swap   symbol_swap
#define hash_include_assign   symbol_assign
#define hash_include_definition   symbol_definition
#define hash_include_undefine   symbol_undefine
#define hash_include_str(inc_arg)   symbol_name(inc_arg)
#define hash_include_seen   symbol_seen
#define hash_include_memorise   symbol_memorise
#define hash_include_forget   symbol_forget

Typedefs

typedef symbol_h hash_include_h
typedef symbol_const_h hash_include_const_h

Functions

hash_include_h hash_include_new (char const *arg, size_t arglen)
void hash_include_define (hash_include_h hi, canonical_string_const_h def)
int hash_include_compare (hash_include_const_h lhs, void const *rhs, size_t namelen)
char const * hash_include_parse (char const *cp, char const **pdiagnostic, canonical_string_h *presolved_val)
bool hash_include_changed (hash_include_const_h inc_arg)
void hash_include_commit_evaluation (hash_include_h inc_arg)
bool hash_include_valid (hash_include_const_h inc_arg)

Define Documentation

#define hash_include_assign   symbol_assign

Assign one hash_include object to another. The function is the same as for symbol_h

Definition at line 84 of file hash_include.h.

#define hash_include_copy   symbol_copy

Construct a copy of an hash_include object The function is the same as for symbol_h

Definition at line 74 of file hash_include.h.

#define hash_include_definition   symbol_definition

Get the definition of an hash_include. The function is the same as for symbol_h

Definition at line 89 of file hash_include.h.

Referenced by hash_include_tally(), and report_include().

#define hash_include_dispose   symbol_dispose

Destroy an hash_include object. The destructor is the same as for symbol_h

Definition at line 69 of file hash_include.h.

#define hash_include_forget   symbol_forget

Forget that a hash-include argument has been seen. The function is the same as for symbol_h.

Definition at line 115 of file hash_include.h.

#define hash_include_memorise   symbol_memorise

Mark a hash-include argument as seen. The function is the same as for symbol_h.

Definition at line 110 of file hash_include.h.

#define hash_include_seen   symbol_seen

Say whether a hash-include argument has been seen before The function is the same as for symbol_h.

Definition at line 105 of file hash_include.h.

#define hash_include_str (   inc_arg)    symbol_name(inc_arg)

Get the argument string from a hash-include argument.

Parameters:
inc_argThe hash-include argument to be queried.
Returns:
Pointer to the 0-terminated argument string.

Definition at line 100 of file hash_include.h.

Referenced by report_include().

#define hash_include_swap   symbol_swap

Exchange two hash_include objects The function is the same as for symbol_h

Definition at line 79 of file hash_include.h.

#define hash_include_undefine   symbol_undefine

Undefine an hash_include. The function is the same as for symbol_h

Definition at line 94 of file hash_include.h.

Referenced by hash_include_tally().


Typedef Documentation

Abstract type of const argument to hash-include directive

Definition at line 57 of file hash_include.h.

Abstract type of argument to a hash-include directive.

Because the argument of an hash-include may be a defined preprocessor symbol we just make this type an alias for symbol_h

Definition at line 54 of file hash_include.h.


Function Documentation

bool hash_include_changed ( hash_include_const_h  inc_arg)

Say whether an hash-include argument has evaluated differently from its last evaluation.

Parameters:
inc_argThe hash-include argument to evaluate.
Returns:
True if the most recent evaluation of inc_arg has flagged it as evaluating differently from the evaluation before that, provided that hash_include_update_status() has not been called since the latest evaluation. The first evaluation of inc_arg will always flag it as having a new evaluation.
void hash_include_commit_evaluation ( hash_include_h  inc_arg)

Accept the most recent evaluation of an hash-include argument as the baseline evaluation.

Parameters:
inc_argThe hash-include argument to be updated.

The function clears the flag evaluated by hash_include_changed(), so that the last evaluation becomes the basis of comparision for subsequent ones.

int hash_include_compare ( hash_include_const_h  lhs,
void const *  rhs,
size_t  namelen 
)

Compare an hash_include_h with another one or with a hash-include argument.

Parameters:
lhsFirst hash_include_h to be compared.
rhsSecond hash_include_h or hash-include argument to compare.
namelenIf 0 then rhs addresses a second hash_include_h to be compared by name with lhs. Otherwise rhs addresses a hash-include argument of length namelen to be compared with the name of lhs.
Returns:
A negative value if lhs is less than rhs; 0 if lhs is equal to rhs; a positive value if lhs is greater than rhs.

Definition at line 57 of file hash_include.c.

References STRICMP, and STRNICMP.

void hash_include_define ( hash_include_h  hi,
canonical_string_const_h  def 
)

Assign a definition to a hash_include.

Parameters:
hiThe hash-include to which the definition shall be assigned.
defA canonical string containing the definition to assign.

Definition at line 76 of file hash_include.c.

References canonical_string_assign(), canonical_string_copy(), and eval_result::sym_def.

Referenced by hash_include_tally().

Here is the call graph for this function:

hash_include_h hash_include_new ( char const *  arg,
size_t  arglen 
)

Construct a new hash-include argument object.

Parameters:
argThe start of the hash-include argument
arglenThe length of arg.

Definition at line 47 of file hash_include.c.

References symbol_new().

Referenced by hash_include_tally().

Here is the call graph for this function:

char const* hash_include_parse ( char const *  cp,
char const **  pdiagnostic,
canonical_string_h presolved_val 
)

Parse the argument of a hash-include directive.

Parameters:
cpThe start of the hash-include argument.
pdiagnosticPointer at which will be stored on return either NULL or the address of a diagnostic. If NULL is stored then the argument of the hash-include directive is valid; otherwise the stored diagnostic says why it is problematic.
presolved_valOn entry, a pointer to NULL. Onn return either NULL or a canonical string will be stored here. NULL is stored if the argument of the directive is not a symbol, or is a -U configured symbol or an unknown symbol. If a canonical string is stored then the argument is a -D-configured symbol and the stored canonical string holds the definition of that symbol, which may be an empty string.
Returns:
The address of the first unparsed character.

It is the caller's responsibility to destroy any canonical strings stored at presolved_val.

bool hash_include_valid ( hash_include_const_h  inc_arg)

Say whether an hash-include argument is valid.

Parameters:
inc_argThe hash-include argument to be queried.

inc_arg is valid if it represents either a valid header name or a preprocessor symbol that finally evaluates to a valid header name.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines