hl7parse
bom.h
Go to the documentation of this file.
1 
48 #pragma once
49 
50 #include <stdio.h>
51 #include <stdlib.h>
52 #include <string.h>
53 
57 typedef enum {
63  BIG,
67 
72 typedef struct bom_t {
74  char *bom;
76  int length;
79 } bom_t;
80 
81 #ifdef __cplusplus
82 extern "C" {
83 #endif
84 
93 char * bom_to_string(int length, unsigned char *bom, bom_endianness_t endianness);
94 
100 void print_bom(bom_t* bom);
101 
119 bom_t* detect_bom(FILE *fd);
120 
121 #ifdef __cplusplus
122 }
123 #endif
Byte Order MArk (BOM) information of a file. This struct is created by detect_bom() ...
Definition: bom.h:72
int length
Definition: bom.h:76
struct bom_t bom_t
Byte Order MArk (BOM) information of a file. This struct is created by detect_bom() ...
bom_t * detect_bom(FILE *fd)
check if the file has a bom
Definition: bom.c:37
Definition: bom.h:65
Definition: bom.h:59
Definition: bom.h:63
Definition: bom.h:61
bom_endianness_t endianness
Definition: bom.h:78
bom_endianness_t
endianness detected in bom
Definition: bom.h:57
void print_bom(bom_t *bom)
debug function to print bom
Definition: bom.c:32
char * bom_to_string(int length, unsigned char *bom, bom_endianness_t endianness)
hex representation of the bom
Definition: bom.c:3
char * bom
Definition: bom.h:74