Cleaned up licensing
[jigit.git] / endian.h
1 /*
2  * endian.h
3  *
4  * Simple helper functions for reading and writing BE and LE numbers
5  *
6  * Copyright (c) 2004 Steve McIntyre <steve@einval.com>
7  *
8  * GPL v2 - see COPYING
9  */
10
11 void                  write_be64  (unsigned long long in, unsigned char *out);
12 unsigned long long    read_be64   (unsigned char *in);
13 void                  write_le64  (unsigned long long in, unsigned char *out);
14 unsigned long long    read_le64   (unsigned char *in);
15
16 void                  write_le48  (unsigned long long in, unsigned char *out);
17 unsigned long long    read_le48   (unsigned char *in);
18
19 void                  write_be32  (unsigned long in, unsigned char *out);
20 unsigned long         read_be32   (unsigned char *in);
21 void                  write_le32  (unsigned long in, unsigned char *out);
22 unsigned long         read_le32   (unsigned char *in);
23
24 void                  write_be16  (unsigned short in, unsigned char *out);
25 unsigned short        read_be16   (unsigned char *in);
26 void                  write_le16  (unsigned short in, unsigned char *out);
27 unsigned short        read_le16   (unsigned char *in);