Ignore:
File:
1 edited

Legend:

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

    rec72861 re3fea42  
    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 : Tue Feb  4 13:03:16 2020
     13// Update Count     : 11
    1414//
    1515
     
    2727
    2828extern "C" {
    29 
    30         void __cfaabi_dbg_bits_write( const char *in_buffer, int len ) {
     29        void __cfaabi_bits_write( int fd, const char in_buffer[], int len ) {
    3130                // ensure all data is written
    3231                for ( int count = 0, retcode; count < len; count += retcode ) {
     
    3433
    3534                        for ( ;; ) {
    36                                 retcode = write( STDERR_FILENO, in_buffer, len - count );
     35                                retcode = write( fd, in_buffer, len - count );
    3736
    3837                                // not a timer interrupt ?
     
    4443        }
    4544
    46         void __cfaabi_dbg_bits_acquire() __attribute__((__weak__)) {}
    47         void __cfaabi_dbg_bits_release() __attribute__((__weak__)) {}
     45        void __cfaabi_bits_acquire() __attribute__((__weak__)) {}
     46        void __cfaabi_bits_release() __attribute__((__weak__)) {}
    4847
    49         void __cfaabi_dbg_bits_print_safe  ( const char fmt[], ... ) __attribute__(( format(printf, 1, 2) )) {
     48        void __cfaabi_bits_print_safe  ( int fd, const char fmt[], ... ) __attribute__(( format(printf, 2, 3) )) {
    5049                va_list args;
    5150
    5251                va_start( args, fmt );
    53                 __cfaabi_dbg_bits_acquire();
     52                __cfaabi_bits_acquire();
    5453
    5554                int len = vsnprintf( buffer, buffer_size, fmt, args );
    56                 __cfaabi_dbg_bits_write( buffer, len );
     55                __cfaabi_bits_write( fd, buffer, len );
    5756
    58                 __cfaabi_dbg_bits_release();
     57                __cfaabi_bits_release();
    5958                va_end( args );
    6059        }
    6160
    62         void __cfaabi_dbg_bits_print_nolock( const char fmt[], ... ) __attribute__(( format(printf, 1, 2) )) {
     61        void __cfaabi_bits_print_nolock( int fd, const char fmt[], ... ) __attribute__(( format(printf, 2, 3) )) {
    6362                va_list args;
    6463
     
    6665
    6766                int len = vsnprintf( buffer, buffer_size, fmt, args );
    68                 __cfaabi_dbg_bits_write( buffer, len );
     67                __cfaabi_bits_write( fd, buffer, len );
    6968
    7069                va_end( args );
    7170        }
    7271
    73         void __cfaabi_dbg_bits_print_vararg( const char fmt[], va_list args ) {
     72        void __cfaabi_bits_print_vararg( int fd, const char fmt[], va_list args ) {
    7473                int len = vsnprintf( buffer, buffer_size, fmt, args );
    75                 __cfaabi_dbg_bits_write( buffer, len );
     74                __cfaabi_bits_write( fd, buffer, len );
    7675        }
    7776
    78         void __cfaabi_dbg_bits_print_buffer( char in_buffer[], int in_buffer_size, const char fmt[], ... ) __attribute__(( format(printf, 3, 4) )) {
     77        void __cfaabi_bits_print_buffer( int fd, char in_buffer[], int in_buffer_size, const char fmt[], ... ) __attribute__(( format(printf, 4, 5) )) {
    7978                va_list args;
    8079
     
    8281
    8382                int len = vsnprintf( in_buffer, in_buffer_size, fmt, args );
    84                 __cfaabi_dbg_bits_write( in_buffer, len );
     83                __cfaabi_bits_write( fd, in_buffer, len );
    8584
    8685                va_end( args );
Note: See TracChangeset for help on using the changeset viewer.