NETWORK ATTACKS FRAMEWORK  1.0.0
A NETwork Attacks framework. Making network attacks impact evaluation easier!
endian.c File Reference
#include <stdio.h>

Go to the source code of this file.

Functions

int litend (void)
int bigend (void)
int main (int argc, char **argv)

Function Documentation

int bigend ( void  )

Definition at line 43 of file endian.c.

{
    return !litend();
}
int litend ( void  )

Definition at line 36 of file endian.c.

{
    int i = 0;
    ((char *) (&i))[0] = 1;
    return (i == 1);
}
int main ( int  argc,
char **  argv 
)

Definition at line 48 of file endian.c.

{
    printf("#ifndef ENDIAN_H\n");
    printf("#define ENDIAN_H\n");
    printf("#define __LITTLE_ENDIAN 1234\n");
    printf("#define __BIG_ENDIAN    4321\n");
    printf("#define __BYTE_ORDER __%s_ENDIAN\n", litend()? "LITTLE" : "BIG");
    printf("#endif\n");
    return 0;
}
 All Classes Files Functions Variables Typedefs Enumerator Defines