aboutsummaryrefslogblamecommitdiffstats
path: root/man3/libsimple_vweprintf.3
blob: bd11957fbecdd85ff89fa021e186b444761759bb (plain) (tree)
1
2
3
4
5
6
7
8
9
                                   

                                             
 



                      
                                          

                                                 
 
                                                                  




                                                                                           



                                                                                            


















                                      











                                        



               
 





































                                                    
                                       






















                                                












                                               











                                               

   













                                               




                           



                            
   
                         
              
                             



                                             
                              


            
                             
   
                              









                                        



                            
  
                         
                    
                             
  
                              
          
 

                
 

          
 


















                                                         








                            











                                               








                            











                                       








                            

                                       
 

            
 

                     
 

             
 

                     
 

         
 

        
 
            


                
.TH LIBSIMPLE_VWEPRINTF 3 libsimple
.SH NAME
libsimple_vweprintf \- print an error message

.SH SYNOPSIS
.nf
#include <libsimple.h>

extern int libsimple_default_failure_exit;
extern void (*libsimple_eprintf_preprint)(void);
extern void (*libsimple_eprintf_postprint)(void);

void libsimple_vweprintf(const char *\fIfmt\fP, va_list \fIap\fP);
inline void libsimple_weprintf(const char *\fIfmt\fP, ...);
inline void libsimple_venprintf(int \fIstatus\fP, const char *\fIfmt\fP, va_list \fIap\fP);
inline void libsimple_enprintf(int \fIstatus\fP, const char *\fIfmt\fP, ...);
inline void libsimple_veprintf(const char *\fIfmt\fP, va_list \fIap\fP);
inline void libsimple_eprintf(const char *\fIfmt\fP, ...);
inline void libsimple__venprintf(int \fIstatus\fP, const char *\fIfmt\fP, va_list \fIap\fP);
inline void libsimple__enprintf(int \fIstatus\fP, const char *\fIfmt\fP, ...);
inline void libsimple__veprintf(const char *\fIfmt\fP, va_list \fIap\fP);
inline void libsimple__eprintf(const char *\fIfmt\fP, ...);

#ifndef vweprintf
# define vweprintf libsimple_vweprintf
#endif
#ifndef weprintf
# define weprintf libsimple_weprintf
#endif
#ifndef venprintf
# define venprintf libsimple_venprintf
#endif
#ifndef enprintf
# define enprintf libsimple_enprintf
#endif
#ifndef veprintf
# define veprintf libsimple_veprintf
#endif
#ifndef eprintf
# define eprintf libsimple_eprintf
#endif
#ifndef _venprintf
# define _venprintf libsimple__venprintf
#endif
#ifndef _enprintf
# define _enprintf libsimple__enprintf
#endif
#ifndef _veprintf
# define _veprintf libsimple__veprintf
#endif
#ifndef _eprintf
# define _eprintf libsimple__eprintf
#endif
.fi
.PP
Link with
.IR \-lsimple .

.SH DESCRIPTION
The
.BR libsimple_vweprintf ()
function is a version of the
.BR printf (3)
function. It prints the string to the standard error
(rather than the standard output), and attempts to
avoid output mangling in case multiple processes are
writting. Additionally, the output is suffixed with
.nf

	\fB\(dq %s\en\(dq, \fP<\fIerror message\fP>

.fi
if
.I fmt
ends with a colon
.RB ( : ),
otherwise it is suffixed with a <newline> if
.I fmt
does not end with a <newline>; otherwise, if
.I fmt
is the empty string, the output is suffixed with
.nf

	\fB\(dq%s\en\(dq, \fP<\fIerror message\fP>

.fi
Furthermore, if
.I argv0
.RB ( "char *" )
is non-null and
.I fmt
does not start with
.RB \(dq "usage :" \(dq,
the output is preffixed with
.nf

	\fB\(dq%s: \(dq, \fP\fIargv0\fP
.fi
.PP
The
.BR libsimple_weprintf ()
function is a version of the
.BR libsimple_vweprintf ()
function that uses variadic arguments instead of
.BR va_list .
.PP
The
.BR libsimple_venprintf ()
and
.BR libsimple_enprintf ()
functions are versions of the
.BR libsimple_vweprintf ()
and
.BR libsimple_weprintf ()
functions that terminate the process by calling
.BR exit (3),
the exit value of the process will be
.IR status .
.PP
The
.BR libsimple__venprintf ()
and
.BR libsimple__enprintf ()
functions are versions of the
.BR libsimple_vweprintf ()
and
.BR libsimple_weprintf ()
functions that terminate the process by calling
.BR _exit (3),
the exit value of the process will be
.IR status .
.PP
The
.BR libsimple_veprintf ()
and
.BR libsimple_eprintf ()
functions are versions of the
.BR libsimple_vweprintf ()
and
.BR libsimple_weprintf ()
functions that terminate the process by calling
.BR exit (3),
the exit value of the process will be
.IR libsimple_default_failure_exit (3),
which is 1 by default.
.PP
The
.BR libsimple__veprintf ()
and
.BR libsimple__eprintf ()
functions are versions of the
.BR libsimple_vweprintf ()
and
.BR libsimple_weprintf ()
functions that terminate the process by calling
.BR _exit (3),
the exit value of the process will be
.IR libsimple_default_failure_exit (3),
which is 1 by default.
.PP
The
.BR libsimple_vweprintf (),
.BR libsimple_weprintf (),
.BR libsimple_venprintf (),
.BR libsimple_enprintf (),
.BR libsimple_veprintf (),
.BR libsimple_eprintf (),
.BR libsimple__venprintf (),
.BR libsimple__enprintf (),
.BR libsimple__veprintf (),
and
.BR libsimple__eprintf ()
functions call
.I libsimple_eprintf_preprint
unless it is
.B NULL
before they print the message, after printing
the message they call
.I libsimple_eprintf_postprint
unless it is
.BR NULL .
The
.I libsimple_eprintf_preprint
and
.I libsimple_eprintf_postprint
variables are
.B NULL
byte default.
.I errno
may have a different value from when the
.BR libsimple_vweprintf (),
.BR libsimple_weprintf (),
.BR libsimple_venprintf (),
.BR libsimple_enprintf (),
.BR libsimple_veprintf (),
.BR libsimple_eprintf (),
.BR libsimple__venprintf (),
.BR libsimple__enprintf (),
.BR libsimple__veprintf (),
or
.BR libsimple__eprintf ()
function called when
.I libsimple_eprintf_preprint
or
.I libsimple_eprintf_postprint
is called.

.SH RETURN VALUE
None.

.SH ERRORS
None.

.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
.TS
allbox;
lb lb lb
l l l.
Interface	Attribute	Value
T{
.BR libsimple_vweprintf (),
.br
.BR libsimple_weprintf (),
.br
.BR libsimple_venprintf (),
.br
.BR libsimple_enprintf (),
.br
.BR libsimple_veprintf (),
.br
.BR libsimple_eprintf (),
.br
.BR libsimple__venprintf (),
.br
.BR libsimple__enprintf (),
.br
.BR libsimple__veprintf (),
.br
.BR libsimple__eprintf ()
T}	Thread safety	MT-Unsafe race:strerror
T{
.BR libsimple_vweprintf (),
.br
.BR libsimple_weprintf (),
.br
.BR libsimple_venprintf (),
.br
.BR libsimple_enprintf (),
.br
.BR libsimple_veprintf (),
.br
.BR libsimple_eprintf (),
.br
.BR libsimple__venprintf (),
.br
.BR libsimple__enprintf (),
.br
.BR libsimple__veprintf (),
.br
.BR libsimple__eprintf ()
T}	Async-signal safety	AS-Safe
T{
.BR libsimple_vweprintf (),
.br
.BR libsimple_weprintf (),
.br
.BR libsimple_venprintf (),
.br
.BR libsimple_enprintf (),
.br
.BR libsimple_veprintf (),
.br
.BR libsimple_eprintf (),
.br
.BR libsimple__venprintf (),
.br
.BR libsimple__enprintf (),
.br
.BR libsimple__veprintf (),
.br
.BR libsimple__eprintf ()
T}	Async-cancel safety	AC-Safe
.TE

.SH EXAMPLES
None.

.SH APPLICATION USAGE
None.

.SH RATIONALE
None.

.SH FUTURE DIRECTIONS
None.

.SH NOTES
None.

.SH BUGS
None.

.SH SEE ALSO
.BR perror (3),
.BR fprintf (3),
.BR exit (3)