File: endian.h

package info (click to toggle)
jigit 1.20-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,796 kB
  • ctags: 624
  • sloc: sh: 10,437; ansic: 5,866; perl: 566; makefile: 129
file content (27 lines) | stat: -rw-r--r-- 1,101 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * endian.h
 *
 * Simple helper functions for reading and writing BE and LE numbers
 *
 * Copyright (c) 2004 Steve McIntyre <steve@einval.com>
 *
 * GPL v2 - see COPYING
 */

void                  write_be64  (unsigned long long in, unsigned char *out);
unsigned long long    read_be64   (unsigned char *in);
void                  write_le64  (unsigned long long in, unsigned char *out);
unsigned long long    read_le64   (unsigned char *in);

void                  write_le48  (unsigned long long in, unsigned char *out);
unsigned long long    read_le48   (unsigned char *in);

void                  write_be32  (unsigned long in, unsigned char *out);
unsigned long         read_be32   (unsigned char *in);
void                  write_le32  (unsigned long in, unsigned char *out);
unsigned long         read_le32   (unsigned char *in);

void                  write_be16  (unsigned short in, unsigned char *out);
unsigned short        read_be16   (unsigned char *in);
void                  write_le16  (unsigned short in, unsigned char *out);
unsigned short        read_le16   (unsigned char *in);