openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/text-utils/more.c
static int check_magic(FILE* f, char* fs)
{
    signed char twobytes[2];

    /* don't try to look ahead if the input is unseekable */
    if (fseek(f, 0L, SEEK_SET))
        return 0;

    if (fread(twobytes, 2, 1, f) == 1)
    {
        switch (twobytes[0] + (twobytes[1] << 8))
        {
            case 0407: /* a.out obj */
            case 0410: /* a.out exec */
            case 0413: /* a.out demand exec */
            case 0405:
            case 0411:
            case 0177545:
            case 0x457f: /* simple ELF detection */
                printf(_("\n******** %s: Not a text file ********\n\n"), fs);
                return 1;
        }
    }
    fseek(f, 0L, SEEK_SET); /* rewind() not necessary */
    return 0;
}
/* magic --
 *	check for file magic numbers.  This code would best be shared
 *	with the file(1) program or, perhaps, more should not try to be
 *	so smart. */
magic
check for file magic numbers.  This code would best be shared
with the file(1) program or, perhaps, more should not try to be
so smart.
magic check for file magic numbers . This code would best be shared with the file ( 1 ) program or perhaps more should not try to be so smart .
static int check_magic(FILE* f, char* fs)
{
    signed char twobytes[2];
    if (fseek(f, 0L, SEEK_SET))
        return 0;
    if (fread(twobytes, 2, 1, f) == 1)
    {
        switch (twobytes[0] + (twobytes[1] << 8))
        {
            case 0407: 
            case 0410: 
            case 0413: 
            case 0405:
            case 0411:
            case 0177545:
            case 0x457f: 
                printf(_("\n******** %s: Not a text file ********\n\n"), fs);
                return 1;
        }
    }
    fseek(f, 0L, SEEK_SET); 
    return 0;
}
static int check_magic ( FILE * f , char * fs ) { signed char twobytes [ 2 ] ; if ( fseek ( f , 0L , SEEK_SET ) ) return 0 ; if ( fread ( twobytes , 2 , 1 , f ) == 1 ) { switch ( twobytes [ 0 ] + ( twobytes [ 1 ] << 8 ) ) { case 0407 : case 0410 : case 0413 : case 0405 : case 0411 : case 0177545 : case 0x457f : printf ( _ ( " \n \n \n " ) , fs ) ; return 1 ; } } fseek ( f , 0L , SEEK_SET ) ; return 0 ; }
magic
      check for file magic numbers.
magic check for file magic numbers .
/* don't try to look ahead if the input is unseekable */ /* a.out obj */ /* a.out exec */ /* a.out demand exec */ /* simple ELF detection */ /* rewind() not necessary */