ennaf/src/files.c
static void open_input_file(void)
{
    assert(IN == NULL);
    assert(in_buffer == NULL);

    if (in_file_path == NULL)
    {
#ifdef __MINGW32__
        if (_setmode(_fileno(stdin), O_BINARY) == -1) { die("can't read input in binary mode\n"); }
#else
        if (!freopen(NULL, "rb", stdin)) { die("can't read input in binary mode\n"); }
#endif
        IN = stdin;
    }
    else
    {
        IN = fopen(in_file_path, "rb");
        if (IN == NULL) { die("can't open input file\n"); }
    }

    in_buffer = (unsigned char *) malloc_or_die(in_buffer_size);
}
/*
 * NAF compressor
 * Copyright (c) 2018-2021 Kirill Kryukov
 * See README.md and LICENSE files of this repository
 */
NAF compressor
Copyright (c) 2018-2021 Kirill Kryukov
See README.md and LICENSE files of this repository
NAF compressor Copyright ( c ) 2018 - 2021 Kirill Kryukov See README . md and LICENSE files of this repository
static void open_input_file(void)
{
    assert(IN == NULL);
    assert(in_buffer == NULL);
    if (in_file_path == NULL)
    {
#ifdef __MINGW32__
        if (_setmode(_fileno(stdin), O_BINARY) == -1) { die("can't read input in binary mode\n"); }
#else
        if (!freopen(NULL, "rb", stdin)) { die("can't read input in binary mode\n"); }
#endif
        IN = stdin;
    }
    else
    {
        IN = fopen(in_file_path, "rb");
        if (IN == NULL) { die("can't open input file\n"); }
    }
    in_buffer = (unsigned char *) malloc_or_die(in_buffer_size);
}
static void open_input_file ( void ) { assert ( IN == NULL ) ; assert ( in_buffer == NULL ) ; if ( in_file_path == NULL ) { #ifdef __MINGW32__ if ( _setmode ( _fileno ( stdin ) , O_BINARY ) == -1 ) { die ( " \n " ) ; } #else if ( ! freopen ( NULL , " " , stdin ) ) { die ( " \n " ) ; } #endif IN = stdin ; } else { IN = fopen ( in_file_path , " " ) ; if ( IN == NULL ) { die ( " \n " ) ; } } in_buffer = ( unsigned char * ) malloc_or_die ( in_buffer_size ) ; }
NAF compressor
 Copyright (c) 2018-2021 Kirill Kryukov
 See README.md and LICENSE files of this repository
NAF compressor Copyright ( c ) 2018 - 2021 Kirill Kryukov See README . md and LICENSE files of this repository