warnings.c File Reference

Functions, enumerations and other private parts of the warning subsystem. More...

#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include "warnings.h"
#include "interface.h"
#include "global.h"
Include dependency graph for warnings.c:

Go to the source code of this file.

Functions

int wa__split_process (char *warn, int prio)
 -.
int wa__set_warn_option (char *stg, enum opt__prio_e prio)
 -.
int wa__warn (warning_e index, int stat, char *format,...)
 -.
int wa__summary (void)
 -.

Variables

const char * wa__warn_action_text [_WA__LAST_INDEX]
 The texts that are used for input/output of the warning actions.
static struct wa__warnings wa___warn_options [_WRN__LAST_INDEX]
 Names for warnings; actions default to WARN_ONCE.
static FILE * warn_out
 The filehandle to print the warnings to.

Detailed Description

Functions, enumerations and other private parts of the warning subsystem.

Definition in file warnings.c.


Function Documentation

int wa__set_warn_option ( char *  stg,
enum opt__prio_e  prio 
)

-.

Set the action of one or warnings.

The given string is of the format warning=action.

action can be any of the wa__warn_action_text[] strings; warning is the startstring of any of the wa___warn_options. If more than one warnings matches this string, all are set to the given action. The command line option looks like this: -Wmeta-mtime=ignore.

Definition at line 102 of file warnings.c.

References _WA__LAST_INDEX, _WRN__LAST_INDEX, wa__warnings::action, action, DEBUGP, wa__warnings::prio, STOPIF_CODE_ERR, wa__warnings::text, and wa__warn_action_text.

Referenced by main(), and wa__split_process().

Here is the caller graph for this function:

int wa__split_process ( char *  warn,
int  prio 
)

-.

Splits a string on whitespace, and sets warning options.

Definition at line 69 of file warnings.c.

References STOPIF, and wa__set_warn_option().

Referenced by opt___parse_warnings().

Here is the call graph for this function:

Here is the caller graph for this function:

int wa__summary ( void   ) 

-.

Print the warning summary as debug messages.

Warnings set to WA__IGNORE are not printed.

Definition at line 218 of file warnings.c.

References _WRN__LAST_INDEX, action, wa__warnings::count, DEBUGP, STOPIF_CODE_EPIPE, STOPIF_CODE_ERR, wa__warnings::text, WA__IGNORE, and warn_out.

Referenced by main().

Here is the caller graph for this function:

int wa__warn ( warning_e  index,
int  stat,
char *  format,
  ... 
)

-.

Parameters:
index The definition from warning_e.
stat The error code that could be used for stopping.
format printf()-style message.

Definition at line 163 of file warnings.c.

References wa__warnings::action, action, BUG, wa__warnings::count, opt__is_verbose(), STOPIF_CODE_ERR, wa__warnings::text, WA__COUNT, WA__IGNORE, WA__STOP, WA__WARN_ALWAYS, WA__WARN_ONCE, and warn_out.

Referenced by df__do_diff(), ign__compile_pattern(), info__work(), main(), prp__s_work(), rev__work(), up__parse_prop(), and up__set_meta_data().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

struct wa__warnings wa___warn_options[_WRN__LAST_INDEX] [static]
Initial value:
{
  [WRN__META_MTIME_INVALID]     = { "meta-mtime" },
  [WRN__META_USER_INVALID]      = { "meta-user" },
  [WRN__META_GROUP_INVALID]     = { "meta-group" },
  [WRN__META_UMASK_INVALID]     = { "meta-umask" },

    [WRN__NO_URLLIST]                       =   { "no-urllist" },

    [WRN__CHARSET_INVALID]          =   { "charset-invalid" },

    [WRN__CHMOD_EPERM]                  =   { "chmod-eperm", WA__WARN_ONCE},
    [WRN__CHOWN_EPERM]                  =   { "chown-eperm", WA__WARN_ONCE},
    [WRN__CHMOD_OTHER]                  =   { "chmod-other", WA__STOP },
    [WRN__CHOWN_OTHER]                  =   { "chown-other", WA__STOP },

    [WRN__MIXED_REV_WC]                 =   { "mixed-rev-wc", WA__WARN_ALWAYS },

    [WRN__PROP_NAME_RESERVED]       =   { "propname-reserved", WA__STOP },

    [WRN__DIFF_EXIT_STATUS]         =   { "diff-status", WA__IGNORE },

    [WRN__IGNPAT_WCBASE]                =   { "ignpat-wcbase", WA__WARN_ALWAYS },

    [WRN__TEST_WARNING]                 =   { "_test-warning", WA__IGNORE },
}

Names for warnings; actions default to WARN_ONCE.

Definition at line 35 of file warnings.c.

const char* wa__warn_action_text[_WA__LAST_INDEX]
Initial value:
{
  [WA__WARN_ONCE]   = "once",
  [WA__WARN_ALWAYS] = "always",
  [WA__IGNORE]          = "ignore",
  [WA__STOP]                = "stop",
  [WA__COUNT]           = "count",
}

The texts that are used for input/output of the warning actions.

Definition at line 25 of file warnings.c.

Referenced by wa__set_warn_option().

FILE* warn_out [static]

The filehandle to print the warnings to.

Currently always stderr.

Definition at line 64 of file warnings.c.

Referenced by wa__summary(), and wa__warn().


Generated for fsvs by  doxygen 1.6.1