xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

libiso_msgs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LIBISO_MSGS_H_INCLUDED   1
 
#define LIBISO_MSGS_SEV_ALL   0x00000000
 
#define LIBISO_MSGS_SEV_ERRFILE   0x08000000
 
#define LIBISO_MSGS_SEV_DEBUG   0x10000000
 
#define LIBISO_MSGS_SEV_UPDATE   0x20000000
 
#define LIBISO_MSGS_SEV_NOTE   0x30000000
 
#define LIBISO_MSGS_SEV_HINT   0x40000000
 
#define LIBISO_MSGS_SEV_WARNING   0x50000000
 
#define LIBISO_MSGS_SEV_SORRY   0x60000000
 
#define LIBISO_MSGS_SEV_MISHAP   0x64000000
 
#define LIBISO_MSGS_SEV_FAILURE   0x68000000
 
#define LIBISO_MSGS_SEV_FATAL   0x70000000
 
#define LIBISO_MSGS_SEV_ABORT   0x71000000
 
#define LIBISO_MSGS_SEV_NEVER   0x7fffffff
 
#define LIBISO_MSGS_PRIO_ZERO   0x00000000
 
#define LIBISO_MSGS_PRIO_LOW   0x10000000
 
#define LIBISO_MSGS_PRIO_MEDIUM   0x20000000
 
#define LIBISO_MSGS_PRIO_HIGH   0x30000000
 
#define LIBISO_MSGS_PRIO_TOP   0x7ffffffe
 
#define LIBISO_MSGS_PRIO_NEVER   0x7fffffff
 
#define LIBISO_MSGS_ORIGIN_DRIVE_BASE   0
 
#define LIBISO_MSGS_ORIGIN_DRIVE_TOP   0xfffff
 
#define LIBISO_MSGS_ORIGIN_IMAGE_BASE   0x100000
 
#define LIBISO_MSGS_ORIGIN_IMAGE_TOP   0x1fffff
 

Functions

int libiso_msgs_new (struct libiso_msgs **m, int flag)
 
int libiso_msgs_destroy (struct libiso_msgs **m, int flag)
 
int libiso_msgs_refer (struct libiso_msgs **pt, struct libiso_msgs *o, int flag)
 
int libiso_msgs_submit (struct libiso_msgs *m, int origin, int error_code, int severity, int priority, char *msg_text, int os_errno, int flag)
 
int libiso_msgs__sev_to_text (int severity, char **severity_name, int flag)
 
int libiso_msgs__text_to_sev (char *severity_name, int *severity, int flag)
 
int libiso_msgs_set_severities (struct libiso_msgs *m, int queue_severity, int print_severity, char *print_id, int flag)
 
int libiso_msgs_obtain (struct libiso_msgs *m, struct libiso_msgs_item **item, int severity, int priority, int flag)
 
int libiso_msgs_destroy_item (struct libiso_msgs *m, struct libiso_msgs_item **item, int flag)
 
int libiso_msgs_item_get_msg (struct libiso_msgs_item *item, int *error_code, char **msg_text, int *os_errno, int flag)
 
int libiso_msgs_item_get_origin (struct libiso_msgs_item *item, double *timestamp, pid_t *process_id, int *origin, int flag)
 
int libiso_msgs_item_get_rank (struct libiso_msgs_item *item, int *severity, int *priority, int flag)
 

Macro Definition Documentation

◆ LIBISO_MSGS_H_INCLUDED

#define LIBISO_MSGS_H_INCLUDED   1

Definition at line 72 of file libiso_msgs.h.

◆ LIBISO_MSGS_ORIGIN_DRIVE_BASE

#define LIBISO_MSGS_ORIGIN_DRIVE_BASE   0

Definition at line 250 of file libiso_msgs.h.

◆ LIBISO_MSGS_ORIGIN_DRIVE_TOP

#define LIBISO_MSGS_ORIGIN_DRIVE_TOP   0xfffff

Definition at line 251 of file libiso_msgs.h.

◆ LIBISO_MSGS_ORIGIN_IMAGE_BASE

#define LIBISO_MSGS_ORIGIN_IMAGE_BASE   0x100000

Definition at line 254 of file libiso_msgs.h.

◆ LIBISO_MSGS_ORIGIN_IMAGE_TOP

#define LIBISO_MSGS_ORIGIN_IMAGE_TOP   0x1fffff

Definition at line 255 of file libiso_msgs.h.

◆ LIBISO_MSGS_PRIO_HIGH

#define LIBISO_MSGS_PRIO_HIGH   0x30000000

Definition at line 242 of file libiso_msgs.h.

◆ LIBISO_MSGS_PRIO_LOW

#define LIBISO_MSGS_PRIO_LOW   0x10000000

Definition at line 240 of file libiso_msgs.h.

◆ LIBISO_MSGS_PRIO_MEDIUM

#define LIBISO_MSGS_PRIO_MEDIUM   0x20000000

Definition at line 241 of file libiso_msgs.h.

◆ LIBISO_MSGS_PRIO_NEVER

#define LIBISO_MSGS_PRIO_NEVER   0x7fffffff

Definition at line 246 of file libiso_msgs.h.

◆ LIBISO_MSGS_PRIO_TOP

#define LIBISO_MSGS_PRIO_TOP   0x7ffffffe

Definition at line 243 of file libiso_msgs.h.

◆ LIBISO_MSGS_PRIO_ZERO

#define LIBISO_MSGS_PRIO_ZERO   0x00000000

Definition at line 239 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_ABORT

#define LIBISO_MSGS_SEV_ABORT   0x71000000

A message from an abort handler which will finally finish libburn

Definition at line 227 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_ALL

#define LIBISO_MSGS_SEV_ALL   0x00000000

Use this to get messages of any severity. Do not use for submitting.

Definition at line 126 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_DEBUG

#define LIBISO_MSGS_SEV_DEBUG   0x10000000

Debugging messages not to be visible to normal users by default

Definition at line 143 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_ERRFILE

#define LIBISO_MSGS_SEV_ERRFILE   0x08000000

Messages of this severity shall transport plain disk file paths whenever an event of severity SORRY or above is related with an individual disk file. No message text shall be added to the file path. The ERRFILE message shall be issued before the human readable message which carries the true event severity. That message should contain the file path so it can be found by strstr(message, path)!=NULL. The error code shall be the same as with the human readable message.

Definition at line 138 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_FAILURE

#define LIBISO_MSGS_SEV_FAILURE   0x68000000

Non-fatal error indicating that an important part of an action failed and that only a new setup of preconditions will give hope for sufficient success.

E.g.: No media is inserted in the output drive. No write mode can be found for inserted media. A libisofs input file is inaccessible during grafting.

After FAILURE a function should end with a return value indicating failure. It is at the discretion of the function whether it ends immediately in any case or whether it tries to go on if the eventual threshold allows.

Definition at line 210 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_FATAL

#define LIBISO_MSGS_SEV_FATAL   0x70000000

An error message which puts the whole operation of the program in question

E.g.: Not enough memory for essential temporary objects. Irregular errors from resources. Programming errors (soft assert).

After FATAL a function should end very soon with a return value indicating severe failure.

Definition at line 222 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_HINT

#define LIBISO_MSGS_SEV_HINT   0x40000000

Possibilities to achieve a better result

Definition at line 155 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_MISHAP

#define LIBISO_MSGS_SEV_MISHAP   0x64000000

A FAILURE (see below) which can be tolerated during long lasting operations just because they cannot simply be stopped or revoked.

xorriso converts libisofs SORRY messages issued during image generation into MISHAP messages in order to allow its evaluators to distinguish image generation problems from minor image composition problems. E.g.: A libisofs input file is inaccessible during image generation.

After a MISHAP a function should behave like after SORRY.

Definition at line 195 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_NEVER

#define LIBISO_MSGS_SEV_NEVER   0x7fffffff

A severity to exclude or discard any possible message. Do not use this severity for submitting.

Definition at line 232 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_NOTE

#define LIBISO_MSGS_SEV_NOTE   0x30000000

Not so usual events which were gracefully handled

Definition at line 151 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_SORRY

#define LIBISO_MSGS_SEV_SORRY   0x60000000

Non-fatal error messages indicating that parts of an action failed but processing may go on if one accepts deviations from the desired result.

SORRY may also be the severity for incidents which are severe enough for FAILURE but happen within already started irrevocable actions, like ISO image generation. A precondition for such a severity ease is that the action can be continued after the incident. See below MISHAP for what xorriso would need instead of this kind of SORRY and generates for itself in case of libisofs image generation.

E.g.: A pattern yields no result. A speed setting cannot be made. A libisofs input file is inaccessible during image generation.

After SORRY a function should try to go on if that makes any sense and if no threshold prescribes abort on SORRY. The function should nevertheless indicate some failure in its return value. It should - but it does not have to.

Definition at line 181 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_UPDATE

#define LIBISO_MSGS_SEV_UPDATE   0x20000000

Update of a progress report about long running actions

Definition at line 147 of file libiso_msgs.h.

◆ LIBISO_MSGS_SEV_WARNING

#define LIBISO_MSGS_SEV_WARNING   0x50000000

Warnings about problems which could not be handled optimally

Definition at line 159 of file libiso_msgs.h.

Function Documentation

◆ libiso_msgs__sev_to_text()

int libiso_msgs__sev_to_text ( int  severity,
char **  severity_name,
int  flag 
)

Convert a registered severity number into a severity name

Parameters
flagBitfield for control purposes: bit0= list all severity names in a blank separated string
Returns
>0 success, <=0 failure

Definition at line 286 of file libiso_msgs.c.

References LIBISO_MSGS_SEV_ABORT, LIBISO_MSGS_SEV_ALL, LIBISO_MSGS_SEV_DEBUG, LIBISO_MSGS_SEV_ERRFILE, LIBISO_MSGS_SEV_FAILURE, LIBISO_MSGS_SEV_FATAL, LIBISO_MSGS_SEV_HINT, LIBISO_MSGS_SEV_MISHAP, LIBISO_MSGS_SEV_NEVER, LIBISO_MSGS_SEV_NOTE, LIBISO_MSGS_SEV_SORRY, LIBISO_MSGS_SEV_UPDATE, and LIBISO_MSGS_SEV_WARNING.

Referenced by iso_obtain_msgs(), iso_sev_to_text(), and libiso_msgs_submit().

◆ libiso_msgs__text_to_sev()

int libiso_msgs__text_to_sev ( char *  severity_name,
int *  severity,
int  flag 
)

◆ libiso_msgs_destroy()

int libiso_msgs_destroy ( struct libiso_msgs **  m,
int  flag 
)

Destroy a message handling facility and all its eventual messages. The submitted pointer gets set to NULL. Actually only the last destroy call of all official references to the object will really dispose it. All others just decrement the reference counter. Call this function only with official reference pointers obtained by libiso_msgs_new() or libiso_msgs_refer(), and only once per such pointer.

Parameters
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 for success, 0 for pointer to NULL, -1 for fatal error

Definition at line 190 of file libiso_msgs.c.

References libiso_msgs_item_destroy(), libiso_msgs_lock(), and libiso_msgs_unlock().

Referenced by iso_finish().

◆ libiso_msgs_destroy_item()

int libiso_msgs_destroy_item ( struct libiso_msgs *  m,
struct libiso_msgs_item **  item,
int  flag 
)

Destroy a message item obtained by libiso_msgs_obtain(). The submitted pointer gets set to NULL. Caution: Copy eventually obtained msg_text before destroying the item, if you want to use it further.

Parameters
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 for success, 0 for pointer to NULL, <0 for severe errors

Definition at line 430 of file libiso_msgs.c.

References libiso_msgs_item_destroy(), libiso_msgs_lock(), and libiso_msgs_unlock().

Referenced by iso_obtain_msgs().

◆ libiso_msgs_item_get_msg()

int libiso_msgs_item_get_msg ( struct libiso_msgs_item *  item,
int *  error_code,
char **  msg_text,
int *  os_errno,
int  flag 
)

Obtain from a message item the three application oriented components as submitted with the originating call of libiso_msgs_submit(). Caution: msg_text becomes a pointer into item, not a copy.

Parameters
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 on success, 0 on invalid item, <0 for servere errors

Definition at line 103 of file libiso_msgs.c.

Referenced by iso_obtain_msgs().

◆ libiso_msgs_item_get_origin()

int libiso_msgs_item_get_origin ( struct libiso_msgs_item *  item,
double *  timestamp,
pid_t *  process_id,
int *  origin,
int  flag 
)

Obtain from a message item the submitter identification submitted with the originating call of libiso_msgs_submit().

Parameters
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 on success, 0 on invalid item, <0 for servere errors

Definition at line 114 of file libiso_msgs.c.

Referenced by iso_obtain_msgs().

◆ libiso_msgs_item_get_rank()

int libiso_msgs_item_get_rank ( struct libiso_msgs_item *  item,
int *  severity,
int *  priority,
int  flag 
)

Obtain from a message item severity and priority as submitted with the originating call of libiso_msgs_submit().

Parameters
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 on success, 0 on invalid item, <0 for servere errors

Definition at line 125 of file libiso_msgs.c.

Referenced by iso_obtain_msgs().

◆ libiso_msgs_new()

int libiso_msgs_new ( struct libiso_msgs **  m,
int  flag 
)

Create new empty message handling facility with queue and issue a first official reference to it.

Parameters
flagBitfield for control purposes (unused yet, submit 0)
Returns
>0 success, <=0 failure

Definition at line 137 of file libiso_msgs.c.

References LIBISO_MSGS_SEV_ALL, and LIBISO_MSGS_SEV_NEVER.

Referenced by iso_init_with_flag().

◆ libiso_msgs_obtain()

int libiso_msgs_obtain ( struct libiso_msgs *  m,
struct libiso_msgs_item **  item,
int  severity,
int  priority,
int  flag 
)

Obtain a message item that has at least the given severity and priority. Usually all older messages of lower severity are discarded then. If no item of sufficient severity was found, all others are discarded from the queue.

Parameters
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 if a matching item was found, 0 if not, <0 for severe errors

Definition at line 396 of file libiso_msgs.c.

References libiso_msgs_item_destroy(), libiso_msgs_item_unlink(), libiso_msgs_lock(), and libiso_msgs_unlock().

Referenced by iso_obtain_msgs().

◆ libiso_msgs_refer()

int libiso_msgs_refer ( struct libiso_msgs **  pt,
struct libiso_msgs *  o,
int  flag 
)

Create an official reference to an existing libiso_msgs object. The references keep the object alive at least until it is released by a matching number of destroy calls. So each reference MUST be revoked by exactly one call to libiso_msgs_destroy().

Parameters
ptThe pointer to be set and registered
mA pointer to the existing object
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 for success, 0 for failure

Definition at line 224 of file libiso_msgs.c.

References libiso_msgs_lock(), and libiso_msgs_unlock().

◆ libiso_msgs_set_severities()

int libiso_msgs_set_severities ( struct libiso_msgs *  m,
int  queue_severity,
int  print_severity,
char *  print_id,
int  flag 
)

Set minimum severity for messages to be queued (default LIBISO_MSGS_SEV_ALL) and for messages to be printed directly to stderr (default LIBISO_MSGS_SEV_NEVER).

Parameters
print_idA text of at most 80 characters to be printed before any eventually printed message (default is "libiso: ").
flagBitfield for control purposes (unused yet, submit 0)
Returns
always 1 for now

Definition at line 235 of file libiso_msgs.c.

References libiso_msgs_lock(), and libiso_msgs_unlock().

Referenced by iso_init_with_flag(), and iso_set_msgs_severities().

◆ libiso_msgs_submit()

int libiso_msgs_submit ( struct libiso_msgs *  m,
int  origin,
int  error_code,
int  severity,
int  priority,
char *  msg_text,
int  os_errno,
int  flag 
)

Submit a message to a message handling facility.

Parameters
originprogram specific identification number of the originator of a message. E.g. drive number. Programs should have an own range of origin numbers. See above LIBISO_MSGS_ORIGIN_*_BASE Use -1 if no number is known.
error_codeUnique error code. Use only registered codes. See below. The same unique error_code may be issued at different occasions but those should be equivalent out of the view of a libiso_msgs application. (E.g. "cannot open ATA drive" versus "cannot open SCSI drive" would be equivalent.)
severityThe LIBISO_MSGS_SEV_* of the event.
priorityThe LIBISO_MSGS_PRIO_* number of the event.
msg_textPrintable and human readable message text.
os_errnoEventual error code from operating system (0 if none)
flagBitfield for control purposes (unused yet, submit 0)
Returns
1 on success, 0 on rejection, <0 for severe errors

Definition at line 328 of file libiso_msgs.c.

References libiso_msgs__sev_to_text(), libiso_msgs_item_destroy(), libiso_msgs_item_new(), libiso_msgs_lock(), and libiso_msgs_unlock().

Referenced by iso_msg_debug(), iso_msg_submit(), iso_msgs_submit(), and iso_report_errfile().