Ignore:
Timestamp:
12/29/06 15:21:35 (18 years ago)
Author:
r2d
Message:
  • moved libmpcdec includes in /mpc
  • removed mppdec.h and mpp.h
  • mpcenc defines cleanup
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/branches/r2d/mpcenc/stderr.c

    r46 r195  
    22 *  stderr - Message output system
    33 *
    4  *  (C) Frank Klemm, Janne Hyvärinen 2002. All rights reserved.
     4 *  (C) Frank Klemm, Janne Hyvï¿œinen 2002. All rights reserved.
    55 *
    66 *  Principles:
     
    2020 */
    2121
    22 #include "mppdec.h"
     22#include <mpc/mpc_types.h>
     23
    2324#ifdef _WIN32
    2425# include <windows.h>
    2526#endif
    2627
     28#include <stdio.h>
     29#include <stdarg.h>
     30// #include "mpcenc.h"
    2731
    28 static Bool_t  stderr_silent = 0;
     32#define WRITE(fp,ptr,len)      fwrite (ptr, 1, len, fp)     // WRITE   returns -1 or 0 on error/EOF, otherwise > 0
     33
     34static mpc_bool_t  stderr_silent = 0;
    2935
    3036
    3137void
    32 SetStderrSilent ( Bool_t state )
     38SetStderrSilent ( mpc_bool_t state )
    3339{
    3440    stderr_silent = state;
     
    3642
    3743
    38 Bool_t
     44mpc_bool_t
    3945GetStderrSilent ( void )
    4046{
     
    4349
    4450
    45 int Cdecl
     51int mpc_cdecl
    4652stderr_printf ( const char* format, ... )
    4753{
    48     char     buff [2 * PATHLEN_MAX + 3072];
     54    char     buff [2 * 1024 + 3072];
    4955    char*    p = buff;
    5056    char*    q;
     
    6167#if   defined __unix__  ||  defined __UNIX__
    6268
    63         WRITE ( STDERR, buff, ret );
     69        WRITE ( stderr, buff, ret );
    6470
    6571#elif defined _WIN32
     
    8995        if ( hSTDERR == INVALID_HANDLE_VALUE ) {
    9096            while ( ( q = strchr (p, '\n')) != NULL ) {
    91                 WRITE ( STDERR, p, q-p );
    92                 WRITE ( STDERR, "\r\n", 2 );
     97                WRITE ( stderr, p, q-p );
     98                WRITE ( stderr, "\r\n", 2 );
    9399                p = q+1;
    94100            }
    95             WRITE ( STDERR, p, strlen (p) );
     101            WRITE ( stderr, p, strlen (p) );
    96102        }
    97103        else {
     
    165171        // for non-Unix systems we must merge carriage returns into the stream to avoid staircases
    166172        while ( ( q = strchr (p, '\n')) != NULL ) {
    167             WRITE ( STDERR, p, q-p );
    168             WRITE ( STDERR, "\r\n", 2 );
     173            WRITE ( stderr, p, q-p );
     174            WRITE ( stderr, "\r\n", 2 );
    169175            p = q+1;
    170176        }
    171         WRITE ( STDERR, p, strlen (p) );
     177        WRITE ( stderr, p, strlen (p) );
    172178
    173179#endif
Note: See TracChangeset for help on using the changeset viewer.