"Fossies" - the Fresh Open Source Software Archive

Member "libisofs-1.5.4/libisofs/libiso_msgs.h" (8 Jul 2020, 29645 Bytes) of package /linux/misc/libisofs-1.5.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "libiso_msgs.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.5.2_vs_1.5.4.

    1 
    2 /* libiso_msgs   (generated from libdax_msgs : Fri Feb 22 19:42:52 CET 2008)
    3    Message handling facility of libisofs.
    4    Copyright (C) 2006-2016 Thomas Schmitt <scdbackup@gmx.net>,
    5 
    6    This file is part of the libisofs project; you can redistribute it and/or
    7    modify it under the terms of the GNU General Public License version 2
    8    or later as published by the Free Software Foundation.
    9    See COPYING file for details.
   10 
   11 */
   12 
   13 
   14 /*
   15   *Never* set this macro outside libiso_msgs.c !
   16   The entrails of the message handling facility are not to be seen by
   17   the other library components or the applications.
   18 */
   19 #ifdef LIBISO_MSGS_H_INTERNAL
   20 
   21 
   22 #ifndef LIBISO_MSGS_SINGLE_THREADED
   23 #include <pthread.h>
   24 #endif
   25 
   26 
   27 struct libiso_msgs_item {
   28 
   29  double timestamp;
   30  pid_t process_id;
   31  int origin;
   32 
   33  int severity;
   34  int priority;
   35 
   36  /* Apply for your developer's error code range at
   37       libburn-hackers@pykix.org
   38     Report introduced codes in the list below. */
   39  int error_code;
   40 
   41  char *msg_text;
   42  int os_errno;
   43   
   44  struct libiso_msgs_item *prev,*next;
   45 
   46 };
   47 
   48 
   49 struct libiso_msgs {
   50 
   51  int refcount;
   52 
   53  struct libiso_msgs_item *oldest;
   54  struct libiso_msgs_item *youngest;
   55  int count;
   56 
   57  int queue_severity;
   58  int print_severity;
   59  char print_id[81];
   60  
   61 #ifndef LIBISO_MSGS_SINGLE_THREADED
   62  pthread_mutex_t lock_mutex;
   63 #endif
   64 
   65 
   66 };
   67 
   68 #endif /* LIBISO_MSGS_H_INTERNAL */
   69 
   70 
   71 #ifndef LIBISO_MSGS_H_INCLUDED
   72 #define LIBISO_MSGS_H_INCLUDED 1
   73 
   74 
   75 #ifndef LIBISO_MSGS_H_INTERNAL
   76 
   77 
   78                           /* Architectural aspects */
   79 /* 
   80   libdax_msgs is designed to serve in libraries which want to offer their
   81   applications a way to control the output of library messages. It shall be
   82   incorporated by an owner, i.e. a software entity which encloses the code
   83   of the .c file.
   84 
   85   Owner of libdax_msgs is libburn. A fully compatible variant named libiso_msgs
   86   is owned by libisofs and can get generated by a script of the libburn
   87   project: libburn/libiso_msgs_to_xyz_msgs.sh .
   88 
   89   Reason: One cannot link two owners of the same variant together because
   90   both would offer the same functions to the linker. For that situation one
   91   has to create a compatible variant as it is done for libisofs.
   92 
   93   Compatible variants may get plugged together by call combinations like
   94     burn_set_messenger(iso_get_messenger());
   95   A new variant would demand a _set_messenger() function if it has to work
   96   with libisofs. If only libburn is planned as link partner then a simple
   97   _get_messenger() does suffice.
   98   Take care to shutdown libburn before its provider of the *_msgs object
   99   gets shut down.
  100 
  101 */
  102 
  103                           /* Public Opaque Handles */
  104 
  105 /** A pointer to this is a opaque handle to a message handling facility */
  106 struct libiso_msgs;
  107 
  108 /** A pointer to this is a opaque handle to a single message item */
  109 struct libiso_msgs_item;
  110 
  111 #endif /* ! LIBISO_MSGS_H_INTERNAL */
  112 
  113 
  114                             /* Public Macros */
  115 
  116 
  117 /* Registered Severities */
  118 
  119 /* It is well advisable to let applications select severities via strings and
  120    forwarded functions libiso_msgs__text_to_sev(), libiso_msgs__sev_to_text().
  121    These macros are for use by the owner of libiso_msgs.
  122 */
  123 
  124 /** Use this to get messages of any severity. Do not use for submitting.
  125 */
  126 #define LIBISO_MSGS_SEV_ALL                                          0x00000000
  127 
  128 
  129 /** Messages of this severity shall transport plain disk file paths
  130     whenever an event of severity SORRY or above is related with an
  131     individual disk file.
  132     No message text shall be added to the file path. The ERRFILE message
  133     shall be issued before the human readable message which carries the
  134     true event severity. That message should contain the file path so it
  135     can be found by strstr(message, path)!=NULL.
  136     The error code shall be the same as with the human readable message.
  137 */ 
  138 #define LIBISO_MSGS_SEV_ERRFILE                                      0x08000000
  139 
  140 
  141 /** Debugging messages not to be visible to normal users by default
  142 */
  143 #define LIBISO_MSGS_SEV_DEBUG                                        0x10000000
  144 
  145 /** Update of a progress report about long running actions
  146 */
  147 #define LIBISO_MSGS_SEV_UPDATE                                       0x20000000
  148 
  149 /** Not so usual events which were gracefully handled
  150 */
  151 #define LIBISO_MSGS_SEV_NOTE                                         0x30000000
  152 
  153 /** Possibilities to achieve a better result
  154 */
  155 #define LIBISO_MSGS_SEV_HINT                                         0x40000000
  156 
  157 /** Warnings about problems which could not be handled optimally
  158 */
  159 #define LIBISO_MSGS_SEV_WARNING                                      0x50000000
  160 
  161 
  162 /** Non-fatal error messages indicating that parts of an action failed but
  163     processing may go on if one accepts deviations from the desired result.
  164 
  165     SORRY may also be the severity for incidents which are severe enough
  166     for FAILURE but happen within already started irrevocable actions,
  167     like ISO image generation. A precondition for such a severity ease is
  168     that the action can be continued after the incident.
  169     See below MISHAP for what xorriso would need instead of this kind of SORRY
  170     and generates for itself in case of libisofs image generation.
  171 
  172     E.g.: A pattern yields no result.
  173           A speed setting cannot be made.
  174           A libisofs input file is inaccessible during image generation.
  175 
  176     After SORRY a function should try to go on if that makes any sense
  177     and if no threshold prescribes abort on SORRY. The function should
  178     nevertheless indicate some failure in its return value. 
  179     It should - but it does not have to.
  180 */
  181 #define LIBISO_MSGS_SEV_SORRY                                        0x60000000
  182 
  183 
  184 /** A FAILURE (see below) which can be tolerated during long lasting
  185     operations just because they cannot simply be stopped or revoked.
  186 
  187     xorriso converts libisofs SORRY messages issued during image generation
  188     into MISHAP messages in order to allow its evaluators to distinguish
  189     image generation problems from minor image composition problems.
  190     E.g.:
  191       A libisofs input file is inaccessible during image generation.
  192 
  193     After a MISHAP a function should behave like after SORRY.
  194 */
  195 #define LIBISO_MSGS_SEV_MISHAP                                       0x64000000
  196 
  197 
  198 /** Non-fatal error indicating that an important part of an action failed and
  199     that only a new setup of preconditions will give hope for sufficient
  200     success.
  201 
  202     E.g.: No media is inserted in the output drive.
  203           No write mode can be found for inserted media.
  204           A libisofs input file is inaccessible during grafting.
  205 
  206     After FAILURE a function should end with a return value indicating failure.
  207     It is at the discretion of the function whether it ends immediately in any
  208     case or whether it tries to go on if the eventual threshold allows.
  209 */
  210 #define LIBISO_MSGS_SEV_FAILURE                                      0x68000000
  211 
  212 
  213 /** An error message which puts the whole operation of the program in question
  214 
  215     E.g.: Not enough memory for essential temporary objects.
  216           Irregular errors from resources.
  217           Programming errors (soft assert).
  218 
  219     After FATAL a function should end very soon with a return value
  220     indicating severe failure.
  221 */
  222 #define LIBISO_MSGS_SEV_FATAL                                        0x70000000
  223 
  224 
  225 /** A message from an abort handler which will finally finish libburn
  226 */
  227 #define LIBISO_MSGS_SEV_ABORT                                        0x71000000
  228 
  229 /** A severity to exclude or discard any possible message.
  230     Do not use this severity for submitting.
  231 */
  232 #define LIBISO_MSGS_SEV_NEVER                                        0x7fffffff
  233 
  234 
  235 /* Registered Priorities */
  236 
  237 /* Priorities are to be selected by the programmers and not by the user. */
  238 
  239 #define LIBISO_MSGS_PRIO_ZERO                                        0x00000000 
  240 #define LIBISO_MSGS_PRIO_LOW                                         0x10000000 
  241 #define LIBISO_MSGS_PRIO_MEDIUM                                      0x20000000
  242 #define LIBISO_MSGS_PRIO_HIGH                                        0x30000000
  243 #define LIBISO_MSGS_PRIO_TOP                                         0x7ffffffe
  244 
  245 /* Do not use this priority for submitting */
  246 #define LIBISO_MSGS_PRIO_NEVER                                       0x7fffffff
  247 
  248 
  249 /* Origin numbers of libburn drives may range from 0 to 1048575 */
  250 #define LIBISO_MSGS_ORIGIN_DRIVE_BASE          0
  251 #define LIBISO_MSGS_ORIGIN_DRIVE_TOP     0xfffff
  252 
  253 /* Origin numbers of libisofs images may range from 1048575 to 2097152 */
  254 #define LIBISO_MSGS_ORIGIN_IMAGE_BASE   0x100000
  255 #define LIBISO_MSGS_ORIGIN_IMAGE_TOP    0x1fffff
  256 
  257 
  258 
  259                             /* Public Functions */
  260 
  261        /* Calls initiated from inside the direct owner (e.g. from libburn) */
  262 
  263 
  264 /** Create new empty message handling facility with queue and issue a first
  265     official reference to it.
  266     @param flag Bitfield for control purposes (unused yet, submit 0)
  267     @return >0 success, <=0 failure
  268 */
  269 int libiso_msgs_new(struct libiso_msgs **m, int flag);
  270 
  271 
  272 /** Destroy a message handling facility and all its eventual messages.
  273     The submitted pointer gets set to NULL.
  274     Actually only the last destroy call of all official references to the
  275     object will really dispose it. All others just decrement the reference
  276     counter.
  277     Call this function only with official reference pointers obtained by
  278     libiso_msgs_new() or libiso_msgs_refer(), and only once per such pointer.
  279     @param flag Bitfield for control purposes (unused yet, submit 0)
  280     @return 1 for success, 0 for pointer to NULL, -1 for fatal error
  281 */
  282 int libiso_msgs_destroy(struct libiso_msgs **m, int flag);
  283 
  284 
  285 /** Create an official reference to an existing libiso_msgs object. The
  286     references keep the object alive at least until it is released by
  287     a matching number of destroy calls. So each reference MUST be revoked
  288     by exactly one call to libiso_msgs_destroy().
  289     @param pt The pointer to be set and registered
  290     @param m  A pointer to the existing object
  291     @param flag Bitfield for control purposes (unused yet, submit 0)
  292     @return 1 for success, 0 for failure
  293 */
  294 int libiso_msgs_refer(struct libiso_msgs **pt, struct libiso_msgs *o, int flag);
  295 
  296 
  297 /** Submit a message to a message handling facility.
  298     @param origin  program specific identification number of the originator of
  299                    a message. E.g. drive number. Programs should have an own
  300                    range of origin numbers. See above LIBISO_MSGS_ORIGIN_*_BASE
  301                    Use -1 if no number is known.
  302     @param error_code  Unique error code. Use only registered codes. See below.
  303                    The same unique error_code may be issued at different
  304                    occasions but those should be equivalent out of the view
  305                    of a libiso_msgs application. (E.g. "cannot open ATA drive"
  306                    versus "cannot open SCSI drive" would be equivalent.)
  307     @param severity The LIBISO_MSGS_SEV_* of the event.
  308     @param priority The LIBISO_MSGS_PRIO_* number of the event.
  309     @param msg_text Printable and human readable message text.
  310     @param os_errno Eventual error code from operating system (0 if none)
  311     @param flag Bitfield for control purposes (unused yet, submit 0)
  312     @return 1 on success, 0 on rejection, <0 for severe errors
  313 */
  314 int libiso_msgs_submit(struct libiso_msgs *m, int origin, int error_code,
  315                        int severity, int priority, char *msg_text, 
  316                        int os_errno, int flag);
  317 
  318 
  319 
  320      /* Calls from applications (to be forwarded by direct owner) */
  321 
  322 
  323 /** Convert a registered severity number into a severity name
  324     @param flag Bitfield for control purposes:
  325       bit0= list all severity names in a blank separated string
  326     @return >0 success, <=0 failure
  327 */
  328 int libiso_msgs__sev_to_text(int severity, char **severity_name,
  329                              int flag);
  330 
  331 
  332 /** Convert a severity name into a severity number,
  333     @param flag Bitfield for control purposes (unused yet, submit 0)
  334     @return >0 success, <=0 failure
  335 */
  336 int libiso_msgs__text_to_sev(char *severity_name, int *severity,
  337                              int flag);
  338 
  339 
  340 /** Set minimum severity for messages to be queued (default
  341     LIBISO_MSGS_SEV_ALL) and for messages to be printed directly to stderr
  342     (default LIBISO_MSGS_SEV_NEVER).
  343     @param print_id A text of at most 80 characters to be printed before
  344                     any eventually printed message (default is "libiso: ").
  345     @param flag Bitfield for control purposes (unused yet, submit 0)
  346     @return always 1 for now
  347 */
  348 int libiso_msgs_set_severities(struct libiso_msgs *m, int queue_severity,
  349                                int print_severity, char *print_id, int flag);
  350 
  351 
  352 /** Obtain a message item that has at least the given severity and priority.
  353     Usually all older messages of lower severity are discarded then. If no
  354     item of sufficient severity was found, all others are discarded from the
  355     queue.
  356     @param flag Bitfield for control purposes (unused yet, submit 0)
  357     @return 1 if a matching item was found, 0 if not, <0 for severe errors
  358 */
  359 int libiso_msgs_obtain(struct libiso_msgs *m, struct libiso_msgs_item **item,
  360                        int severity, int priority, int flag);
  361 
  362 
  363 /** Destroy a message item obtained by libiso_msgs_obtain(). The submitted
  364     pointer gets set to NULL.
  365     Caution: Copy eventually obtained msg_text before destroying the item,
  366              if you want to use it further.
  367     @param flag Bitfield for control purposes (unused yet, submit 0)
  368     @return 1 for success, 0 for pointer to NULL, <0 for severe errors
  369 */
  370 int libiso_msgs_destroy_item(struct libiso_msgs *m,
  371                              struct libiso_msgs_item **item, int flag);
  372 
  373 
  374 /** Obtain from a message item the three application oriented components as
  375     submitted with the originating call of libiso_msgs_submit().
  376     Caution: msg_text becomes a pointer into item, not a copy.
  377     @param flag Bitfield for control purposes (unused yet, submit 0)
  378     @return 1 on success, 0 on invalid item, <0 for servere errors
  379 */
  380 int libiso_msgs_item_get_msg(struct libiso_msgs_item *item, 
  381                              int *error_code, char **msg_text, int *os_errno,
  382                              int flag);
  383 
  384 
  385 /** Obtain from a message item the submitter identification submitted
  386     with the originating call of libiso_msgs_submit().
  387     @param flag Bitfield for control purposes (unused yet, submit 0)
  388     @return 1 on success, 0 on invalid item, <0 for servere errors
  389 */
  390 int libiso_msgs_item_get_origin(struct libiso_msgs_item *item, 
  391                             double *timestamp, pid_t *process_id, int *origin,
  392                             int flag);
  393 
  394 
  395 /** Obtain from a message item severity and priority as submitted
  396     with the originating call of libiso_msgs_submit().
  397     @param flag Bitfield for control purposes (unused yet, submit 0)
  398     @return 1 on success, 0 on invalid item, <0 for servere errors
  399 */
  400 int libiso_msgs_item_get_rank(struct libiso_msgs_item *item, 
  401                               int *severity, int *priority, int flag);
  402 
  403 
  404 #ifdef LIDBAX_MSGS_________________
  405 
  406 
  407                       /* Registered Error Codes */
  408 
  409 
  410 Format: error_code  (LIBISO_MSGS_SEV_*,LIBISO_MSGS_PRIO_*) = explanation
  411 If no severity or priority are fixely associated, use "(,)".
  412 
  413 ------------------------------------------------------------------------------
  414 Range "libiso_msgs"        :  0x00000000 to 0x0000ffff
  415 
  416  0x00000000 (ALL,ZERO)     = Initial setting in new libiso_msgs_item
  417  0x00000001 (DEBUG,ZERO)   = Test error message
  418  0x00000002 (DEBUG,ZERO)   = Debugging message
  419  0x00000003 (FATAL,HIGH)   = Out of virtual memory
  420 
  421 
  422 ------------------------------------------------------------------------------
  423 Range "elmom"              :  0x00010000 to 0x0001ffff
  424 
  425 
  426 
  427 ------------------------------------------------------------------------------
  428 Range "scdbackup"          :  0x00020000 to 0x0002ffff
  429 
  430  Accessing and defending drives:
  431 
  432  0x00020001 (SORRY,LOW)    = Cannot open busy device
  433  0x00020002 (SORRY,HIGH)   = Encountered error when closing drive
  434  0x00020003 (SORRY,HIGH)   = Could not grab drive
  435  0x00020004 (NOTE,HIGH)    = Opened O_EXCL scsi sibling
  436  0x00020005 (SORRY,HIGH)   = Failed to open device
  437  0x00020006 (FATAL,HIGH)   = Too many scsi siblings
  438  0x00020007 (NOTE,HIGH)    = Closed O_EXCL scsi siblings
  439  0x00020008 (SORRY,HIGH)   = Device busy. Failed to fcntl-lock
  440  0x00020009 (SORRY,HIGH)   = Neither stdio-path nor its directory exist
  441            
  442  General library operations:
  443 
  444  0x00020101 (WARNING,HIGH) = Cannot find given worker item
  445  0x00020102 (SORRY,HIGH)   = A drive operation is still going on
  446  0x00020103 (WARNING,HIGH) = After scan a drive operation is still going on
  447  0x00020104 (SORRY,HIGH)   = NULL pointer caught
  448  0x00020105 (SORRY,HIGH)   = Drive is already released
  449  0x00020106 (SORRY,HIGH)   = Drive is busy on attempt to close
  450  0x00020107 (WARNING,HIGH) = A drive is still busy on shutdown of library
  451  0x00020108 (SORRY,HIGH)   = Drive is not grabbed on disc status inquiry
  452  0x00020108 (FATAL,HIGH)   = Could not allocate new drive object
  453  0x00020109 (FATAL,HIGH)   = Library not running
  454  0x0002010a (FATAL,HIGH)   = Unsuitable track mode
  455  0x0002010b (FATAL,HIGH)   = Burn run failed
  456  0x0002010c (FATAL,HIGH)   = Failed to transfer command to drive
  457  0x0002010d (DEBUG,HIGH)   = Could not inquire TOC
  458  0x0002010e (FATAL,HIGH)   = Attempt to read ATIP from ungrabbed drive
  459  0x0002010f (DEBUG,HIGH)   = SCSI error condition on command
  460  0x00020110 (FATAL,HIGH)   = Persistent drive address too long
  461  0x00020111 (FATAL,HIGH)   = Could not allocate new auxiliary object
  462  0x00020112 (SORRY,HIGH)   = Bad combination of write_type and block_type
  463  0x00020113 (FATAL,HIGH)   = Drive capabilities not inquired yet
  464  0x00020114 (SORRY,HIGH)   = Attempt to set ISRC with bad data
  465  0x00020115 (SORRY,HIGH)   = Attempt to set track mode to unusable value
  466  0x00020116 (FATAL,HIGH)   = Track mode has unusable value
  467  0x00020117 (FATAL,HIGH)   = toc_entry of drive is already in use
  468  0x00020118 (DEBUG,HIGH)   = Closing track
  469  0x00020119 (DEBUG,HIGH)   = Closing session
  470  0x0002011a (NOTE,HIGH)    = Padding up track to minimum size
  471  0x0002011b (FATAL,HIGH)   = Attempt to read track info from ungrabbed drive
  472  0x0002011c (FATAL,HIGH)   = Attempt to read track info from busy drive
  473  0x0002011d (FATAL,HIGH)   = SCSI error on write
  474  0x0002011e (SORRY,HIGH)   = Unsuitable media detected
  475  0x0002011f (SORRY,HIGH)   = Burning is restricted to a single track
  476  0x00020120 (NOTE,HIGH)    = FORMAT UNIT ignored
  477  0x00020121 (FATAL,HIGH)   = Write preparation setup failed
  478  0x00020122 (FATAL,HIGH)   = SCSI error on format_unit
  479  0x00020123 (SORRY,HIGH)   = DVD Media are unsuitable for desired track type
  480  0x00020124 (SORRY,HIGH)   = SCSI error on set_streaming
  481  0x00020125 (SORRY,HIGH)   = Write start address not supported
  482  0x00020126 (SORRY,HIGH)   = Write start address not properly aligned
  483  0x00020127 (NOTE,HIGH)    = Write start address is ...
  484  0x00020128 (FATAL,HIGH)   = Unsupported inquiry_type with mmc_get_performance
  485  0x00020129 (SORRY,HIGH)   = Will not format media type
  486  0x0002012a (FATAL,HIGH)   = Cannot inquire write mode capabilities
  487  0x0002012b (FATAL,HIGH)   = Drive offers no suitable write mode with this job
  488  0x0002012c (SORRY,HIGH)   = Too many logical tracks recorded
  489  0x0002012d (FATAL,HIGH)   = Exceeding range of permissible write addresses
  490  0x0002012e (NOTE,HIGH)    = Activated track default size
  491  0x0002012f (SORRY,HIGH)   = SAO is restricted to single fixed size session
  492  0x00020130 (SORRY,HIGH)   = Drive and media state unsuitable for blanking
  493  0x00020131 (SORRY,HIGH)   = No suitable formatting type offered by drive
  494  0x00020132 (SORRY,HIGH)   = Selected format is not suitable for libburn
  495  0x00020133 (SORRY,HIGH)   = Cannot mix data and audio in SAO mode
  496  0x00020134 (NOTE,HIGH)    = Defaulted TAO to DAO
  497  0x00020135 (SORRY,HIGH)   = Cannot perform TAO, job unsuitable for DAO
  498  0x00020136 (SORRY,HIGH)   = DAO burning restricted to single fixed size track
  499  0x00020137 (HINT,HIGH)    = TAO would be possible
  500  0x00020138 (FATAL,HIGH)   = Cannot reserve track
  501  0x00020139 (SORRY,HIGH)   = Write job parameters are unsuitable
  502  0x0002013a (FATAL,HIGH)   = No suitable media detected
  503  0x0002013b (DEBUG,HIGH)   = SCSI command indicates host or driver error
  504  0x0002013c (SORRY,HIGH)   = Malformed capabilities page 2Ah received
  505  0x0002013d (DEBUG,LOW)    = Waiting for free buffer space takes long time
  506  0x0002013e (SORRY,HIGH)   = Timeout with waiting for free buffer. Now disabled
  507  0x0002013f (DEBUG,LOW)    = Reporting total time spent with waiting for buffer
  508  0x00020140 (FATAL,HIGH)   = Drive is busy on attempt to write random access
  509  0x00020141 (SORRY,HIGH)   = Write data count not properly aligned
  510  0x00020142 (FATAL,HIGH)   = Drive is not grabbed on random access write
  511  0x00020143 (SORRY,HIGH)   = Read start address not properly aligned
  512  0x00020144 (SORRY,HIGH)   = SCSI error on read
  513  0x00020145 (FATAL,HIGH)   = Drive is busy on attempt to read data
  514  0x00020146 (FATAL,HIGH)   = Drive is a virtual placeholder
  515  0x00020147 (SORRY,HIGH)   = Cannot address start byte
  516  0x00020148 (SORRY,HIGH)   = Cannot write desired amount of data
  517  0x00020149 (SORRY,HIGH)   = Unsuitable filetype for pseudo-drive
  518  0x0002014a (SORRY,HIGH)   = Cannot read desired amount of data
  519  0x0002014b (SORRY,HIGH)   = Drive is already registered and scanned
  520  0x0002014c (FATAL,HIGH)   = Emulated drive caught in SCSI function
  521  0x0002014d (SORRY,HIGH)   = Asynchromous SCSI error
  522  0x0002014f (SORRY,HIGH)   = Timeout with asynchromous SCSI command
  523  0x00020150 (DEBUG,LOW)    = Reporting asynchronous waiting time
  524  0x00020151 (FATAL,HIGH)   = Read attempt on write-only drive
  525  0x00020152 (FATAL,HIGH)   = Cannot start fifo thread
  526  0x00020153 (SORRY,HIGH)   = Read error on fifo input
  527  0x00020154 (NOTE,HIGH)    = Forwarded input error ends output
  528  0x00020155 (SORRY,HIGH)   = Desired fifo buffer too large
  529  0x00020156 (SORRY,HIGH)   = Desired fifo buffer too small
  530  0x00020157 (FATAL,HIGH)   = burn_source is not a fifo object
  531  0x00020158 (DEBUG,LOW)    = Reporting thread disposal precautions
  532  0x00020159 (DEBUG,HIGH)   = TOC Format 0 returns inconsistent data
  533 
  534  libiso_audioxtr:
  535  0x00020200 (SORRY,HIGH)   = Cannot open audio source file
  536  0x00020201 (SORRY,HIGH)   = Audio source file has unsuitable format
  537  0x00020202 (SORRY,HIGH)   = Failed to prepare reading of audio data
  538 
  539 
  540 
  541 ------------------------------------------------------------------------------
  542 Range "vreixo"              :  0x00030000 to 0x0003ffff
  543 
  544  0x0003ffff (FAILURE,HIGH) = Operation canceled
  545  0x0003fffe (FATAL,HIGH)   = Unknown or unexpected fatal error
  546  0x0003fffd (FAILURE,HIGH) = Unknown or unexpected error
  547  0x0003fffc (FATAL,HIGH)   = Internal programming error
  548  0x0003fffb (FAILURE,HIGH) = NULL pointer where NULL not allowed
  549  0x0003fffa (FATAL,HIGH)   = Memory allocation error
  550  0x0003fff9 (FATAL,HIGH)   = Interrupted by a signal
  551  0x0003fff8 (FAILURE,HIGH) = Invalid parameter value
  552  0x0003fff7 (FATAL,HIGH)   = Cannot create a needed thread
  553  0x0003fff6 (FAILURE,HIGH) = Write error
  554  0x0003fff5 (FAILURE,HIGH) = Buffer read error
  555  0x0003ffc0 (FAILURE,HIGH) = Trying to add a node already added to another dir
  556  0x0003ffbf (FAILURE,HIGH) = Node with same name already exist
  557  0x0003ffbe (FAILURE,HIGH) = Trying to remove a node that was not added to dir
  558  0x0003ffbd (FAILURE,HIGH) = A requested node does not exist
  559  0x0003ffbc (FAILURE,HIGH) = Image already bootable
  560  0x0003ffbb (FAILURE,HIGH) = Trying to use an invalid file as boot image
  561  0x0003ff80 (FAILURE,HIGH) = Error on file operation
  562  0x0003ff7f (FAILURE,HIGH) = Trying to open an already opened file
  563  0x0003ff7e (FAILURE,HIGH) = Access to file is not allowed
  564  0x0003ff7d (FAILURE,HIGH) = Incorrect path to file
  565  0x0003ff7c (FAILURE,HIGH) = The file does not exist in the filesystem
  566  0x0003ff7b (FAILURE,HIGH) = Trying to read or close a file not opened
  567  0x0003ff7a (FAILURE,HIGH) = Directory used where no dir is expected
  568  0x0003ff79 (FAILURE,HIGH) = File read error
  569  0x0003ff78 (FAILURE,HIGH) = Not dir used where a dir is expected
  570  0x0003ff77 (FAILURE,HIGH) = Not symlink used where a symlink is expected
  571  0x0003ff76 (FAILURE,HIGH) = Cannot seek to specified location
  572  0x0003ff75 (HINT,MEDIUM)  = File not supported in ECMA-119 tree and ignored
  573  0x0003ff74 (HINT,MEDIUM)  = File bigger than supported by used standard
  574  0x0003ff73 (MISHAP,HIGH)  = File read error during image creation
  575  0x0003ff72 (HINT,MEDIUM)  = Cannot convert filename to requested charset
  576  0x0003ff71 (SORRY,HIGH)   = File cannot be added to the tree
  577  0x0003ff70 (HINT,MEDIUM)  = File path breaks specification constraints
  578  0x0003ff00 (FAILURE,HIGH) = Charset conversion error
  579  0x0003feff (FAILURE,HIGH) = Too much files to mangle
  580  0x0003fec0 (FAILURE,HIGH) = Wrong or damaged Primary Volume Descriptor
  581  0x0003febf (SORRY,HIGH)   = Wrong or damaged RR entry
  582  0x0003febe (SORRY,HIGH)   = Unsupported RR feature
  583  0x0003febd (FAILURE,HIGH) = Wrong or damaged ECMA-119
  584  0x0003febc (FAILURE,HIGH) = Unsupported ECMA-119 feature
  585  0x0003febb (SORRY,HIGH)   = Wrong or damaged El-Torito catalog
  586  0x0003feba (SORRY,HIGH)   = Unsupported El-Torito feature
  587  0x0003feb9 (SORRY,HIGH)   = Cannot patch isolinux boot image
  588  0x0003feb8 (SORRY,HIGH)   = Unsupported SUSP feature
  589  0x0003feb7 (WARNING,HIGH) = Error on a RR entry that can be ignored
  590  0x0003feb6 (HINT,MEDIUM)  = Error on a RR entry that can be ignored
  591  0x0003feb5 (WARNING,HIGH) = Multiple ER SUSP entries found
  592  0x0003feb4 (HINT,MEDIUM)  = Unsupported volume descriptor found
  593  0x0003feb3 (WARNING,HIGH) = El-Torito related warning
  594  0x0003feb2 (MISHAP,HIGH)  = Image write cancelled
  595  0x0003feb1 (WARNING,HIGH) = El-Torito image is hidden
  596 
  597 Outdated codes which may not be re-used for other purposes than
  598 re-instating them, if ever:
  599 
  600 X 0x00031001 (SORRY,HIGH)    = Cannot read file (ignored)
  601 X 0x00031002 (FATAL,HIGH)    = Cannot read file (operation canceled)
  602 X 0x00031000 (FATAL,HIGH)    = Unsupported ISO-9660 image
  603 X 0x00031001 (HINT,MEDIUM)   = Unsupported Vol Desc that will be ignored
  604 X 0x00031002 (FATAL,HIGH)    = Damaged ISO-9660 image
  605 X 0x00031003 (SORRY,HIGH)    = Cannot read previous image file
  606 X 0x00030101 (HINT,MEDIUM)   = Unsupported SUSP entry that will be ignored
  607 X 0x00030102 (SORRY,HIGH)    = Wrong/damaged SUSP entry
  608 X 0x00030103 (WARNING,MEDIUM)= Multiple SUSP ER entries where found
  609 X 0x00030111 (SORRY,HIGH)    = Unsupported RR feature
  610 X 0x00030112 (SORRY,HIGH)    = Error in a Rock Ridge entry
  611 X 0x00030201 (HINT,MEDIUM)   = Unsupported Boot Vol Desc that will be ignored
  612 X 0x00030202 (SORRY,HIGH)    = Wrong El-Torito catalog
  613 X 0x00030203 (HINT,MEDIUM)   = Unsupported El-Torito feature
  614 X 0x00030204 (SORRY,HIGH)    = Invalid file to be an El-Torito image
  615 X 0x00030205 (WARNING,MEDIUM)= Cannot properly patch isolinux image
  616 X 0x00030206 (WARNING,MEDIUM)= Copying El-Torito from a previous image without
  617 X                              enough info about it
  618 X 0x00030301 (NOTE,MEDIUM)   = Unsupported file type for Joliet tree
  619 
  620 
  621 ------------------------------------------------------------------------------
  622 Range "application"         :  0x00040000 to 0x0004ffff
  623 
  624  0x00040000 (ABORT,HIGH)    : Application supplied message
  625  0x00040001 (FATAL,HIGH)    : Application supplied message
  626  0x00040002 (SORRY,HIGH)    : Application supplied message
  627  0x00040003 (WARNING,HIGH)  : Application supplied message
  628  0x00040004 (HINT,HIGH)     : Application supplied message
  629  0x00040005 (NOTE,HIGH)     : Application supplied message
  630  0x00040006 (UPDATE,HIGH)   : Application supplied message
  631  0x00040007 (DEBUG,HIGH)    : Application supplied message
  632  0x00040008 (*,HIGH)        : Application supplied message
  633 
  634 
  635 ------------------------------------------------------------------------------
  636 Range "libisofs-xorriso"    :  0x00050000 to 0x0005ffff
  637 
  638 This is an alternative representation of libisofs.so.6 error codes in xorriso.
  639 If values returned by iso_error_get_code() do not fit into 0x30000 to 0x3ffff
  640 then they get truncated to 16 bit and mapped into this range.
  641 (This should never need to happen, of course.)
  642 
  643 ------------------------------------------------------------------------------
  644 Range "libisoburn"          :  0x00060000 to 0x00006ffff
  645 
  646  0x00060000 (*,*)           : Message which shall be attributed to libisoburn
  647 
  648  >>> the messages of libisoburn need to be registered individually
  649 
  650 
  651 ------------------------------------------------------------------------------
  652 
  653 #endif /* LIDBAX_MSGS_________________ */
  654 
  655 
  656 
  657 #ifdef LIBISO_MSGS_H_INTERNAL
  658 
  659                              /* Internal Functions */
  660 
  661 
  662 /** Lock before doing side effect operations on m */
  663 static int libiso_msgs_lock(struct libiso_msgs *m, int flag);
  664 
  665 /** Unlock after effect operations on m are done */
  666 static int libiso_msgs_unlock(struct libiso_msgs *m, int flag);
  667 
  668 
  669 /** Create new empty message item.
  670     @param link Previous item in queue
  671     @param flag Bitfield for control purposes (unused yet, submit 0)
  672     @return >0 success, <=0 failure
  673 */
  674 static int libiso_msgs_item_new(struct libiso_msgs_item **item, 
  675                                 struct libiso_msgs_item *link, int flag);
  676 
  677 /** Destroy a message item obtained by libiso_msgs_obtain(). The submitted
  678     pointer gets set to NULL.
  679     @param flag Bitfield for control purposes (unused yet, submit 0)
  680     @return 1 for success, 0 for pointer to NULL
  681 */
  682 static int libiso_msgs_item_destroy(struct libiso_msgs_item **item, int flag);
  683 
  684 
  685 #endif /* LIBISO_MSGS_H_INTERNAL */
  686 
  687 
  688 #endif /* ! LIBISO_MSGS_H_INCLUDED */