coan 4.2.4
The Contradiction component internals
Collaboration diagram for The Contradiction component internals:

Modules

 Macro-generated code

Files

file  contradiction.c

Defines

#define CONTRADICTION_PENDING   (GET_STATE(contradiction,err_msg_buf)[ERR_MSG_BUF] != 0)

Enumerations

enum  { ERR_MSG_BUF, OUT_MSG_BUF }

Functions

static void compose_contradiction_insert_format (heap_str *buf, const char *sub_format)
static void forget_pending_contradiction (void)
static void insert_pending_contradiction (void)

Define Documentation

#define CONTRADICTION_PENDING   (GET_STATE(contradiction,err_msg_buf)[ERR_MSG_BUF] != 0)

Is there an undischarged conflict between an input hash-undef and a --define option? The macro tests whether any memory is allocated for our stderr buffer.

Definition at line 109 of file contradiction.c.


Enumeration Type Documentation

anonymous enum

Labels for output buffers associated with standard streams.

Enumerator:
ERR_MSG_BUF 

Buffer for stderr

OUT_MSG_BUF 

Buffer for stdout

Definition at line 113 of file contradiction.c.


Function Documentation

static void compose_contradiction_insert_format ( heap_str buf,
const char *  sub_format 
) [static]

Compose a standard printf format for inserting error diagnostics on output.

Parameters:
bufAddress of a pointer at which storage shall be allocated to hold the composed format.
sub_formatA printf format that is to be embedded in within the one we are constructing.

The function partially completes a format for diagnostics that may be inserted in output in place of an hash-undef or hash-define directive that contradicts a --define option. It resolves the prefix of the diagnostic, depending on the specified or default --conflict policy.

sub_format varies depending on whether we want to complain of an hash-undef that contradicts a --define option, or of a hash-define that conflicts with a --define option by differently redfining a symbol.

The constructed format is stored in storage allocated at a pointer that is stored at buf on return. It is the caller's responsibility to free this storage.

Definition at line 145 of file contradiction.c.

References format_output(), GET_PUBLIC, and GET_STATE.

Referenced by save_contradiction().

Here is the call graph for this function:

static void forget_pending_contradiction ( void  ) [static]

Erase the stored information that represents a pending diagnostic for a contradiction.

We will call this function either when it turns out that there is no real contradiction to complain of, or when there is a contradiction and the diagnostic is discharged.

There will be a diagnostic message at least for stderr, and also for stdout unless --conflict delete is in force. The diagnostics are allocated in heap blocks, and we will have stored the line number of the conflicting hash-undef directive to which the diagnostics refer. These data are deleted.

Definition at line 172 of file contradiction.c.

References ERR_MSG_BUF, GET_STATE, OUT_MSG_BUF, release(), and SET_PUBLIC.

Referenced by forget_contradiction(), and insert_pending_contradiction().

Here is the call graph for this function:

static void insert_pending_contradiction ( void  ) [static]

Insert a stored error diagnostic into the output as an hash-error directive or a comment (depending on the --conflict policy) to replace an hash-undef or hash-define directive that conflicts with a --define option. Reiterate the diagnostic on stderr.

If the --conflict delete is in force, there will be no diagnostic to insert in output, but the diagnostic is still written to stderr.

Definition at line 190 of file contradiction.c.

References ERR_MSG_BUF, EVENT_SUMMARY_ERROR_OUTPUT, EVENT_SUMMARY_ERRORED_LINES, forget_pending_contradiction(), GET_STATE, GRIPE_ERRORED_CONTRADICTION, GRIPE_UNCONDITIONAL_ERROR_INPUT, is_unconditional_line(), OUT_MSG_BUF, report(), set_exit_flags(), and substitute().

Referenced by flush_contradiction(), and insert_contradiction().

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines