Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/debug.cfa

    rec72861 r1c40091  
    1010// Created On       : Thu Mar 30 12:30:01 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul 14 22:17:35 2019
    13 // Update Count     : 4
     12// Last Modified On : Thu Nov 21 17:16:30 2019
     13// Update Count     : 10
    1414//
    1515
     
    2828extern "C" {
    2929
    30         void __cfaabi_dbg_bits_write( const char *in_buffer, int len ) {
     30        void __cfaabi_bits_write( int fd, const char *in_buffer, int len ) {
    3131                // ensure all data is written
    3232                for ( int count = 0, retcode; count < len; count += retcode ) {
     
    3434
    3535                        for ( ;; ) {
    36                                 retcode = write( STDERR_FILENO, in_buffer, len - count );
     36                                retcode = write( fd, in_buffer, len - count );
    3737
    3838                                // not a timer interrupt ?
     
    4444        }
    4545
    46         void __cfaabi_dbg_bits_acquire() __attribute__((__weak__)) {}
    47         void __cfaabi_dbg_bits_release() __attribute__((__weak__)) {}
     46        void __cfaabi_bits_acquire() __attribute__((__weak__)) {}
     47        void __cfaabi_bits_release() __attribute__((__weak__)) {}
    4848
    49         void __cfaabi_dbg_bits_print_safe  ( const char fmt[], ... ) __attribute__(( format(printf, 1, 2) )) {
     49        void __cfaabi_bits_print_safe  ( int fd, const char fmt[], ... ) __attribute__(( format(printf, 2, 3) )) {
    5050                va_list args;
    5151
    5252                va_start( args, fmt );
    53                 __cfaabi_dbg_bits_acquire();
     53                __cfaabi_bits_acquire();
    5454
    5555                int len = vsnprintf( buffer, buffer_size, fmt, args );
    56                 __cfaabi_dbg_bits_write( buffer, len );
     56                __cfaabi_bits_write( fd, buffer, len );
    5757
    58                 __cfaabi_dbg_bits_release();
     58                __cfaabi_bits_release();
    5959                va_end( args );
    6060        }
    6161
    62         void __cfaabi_dbg_bits_print_nolock( const char fmt[], ... ) __attribute__(( format(printf, 1, 2) )) {
     62        void __cfaabi_bits_print_nolock( int fd, const char fmt[], ... ) __attribute__(( format(printf, 2, 3) )) {
    6363                va_list args;
    6464
     
    6666
    6767                int len = vsnprintf( buffer, buffer_size, fmt, args );
    68                 __cfaabi_dbg_bits_write( buffer, len );
     68                __cfaabi_bits_write( fd, buffer, len );
    6969
    7070                va_end( args );
    7171        }
    7272
    73         void __cfaabi_dbg_bits_print_vararg( const char fmt[], va_list args ) {
     73        void __cfaabi_bits_print_vararg( int fd, const char fmt[], va_list args ) {
    7474                int len = vsnprintf( buffer, buffer_size, fmt, args );
    75                 __cfaabi_dbg_bits_write( buffer, len );
     75                __cfaabi_bits_write( fd, buffer, len );
    7676        }
    7777
    78         void __cfaabi_dbg_bits_print_buffer( char in_buffer[], int in_buffer_size, const char fmt[], ... ) __attribute__(( format(printf, 3, 4) )) {
     78        void __cfaabi_bits_print_buffer( int fd, char in_buffer[], int in_buffer_size, const char fmt[], ... ) __attribute__(( format(printf, 4, 5) )) {
    7979                va_list args;
    8080
     
    8282
    8383                int len = vsnprintf( in_buffer, in_buffer_size, fmt, args );
    84                 __cfaabi_dbg_bits_write( in_buffer, len );
     84                __cfaabi_bits_write( fd, in_buffer, len );
    8585
    8686                va_end( args );
Note: See TracChangeset for help on using the changeset viewer.