-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile.h
More file actions
24 lines (16 loc) · 646 Bytes
/
file.h
File metadata and controls
24 lines (16 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef _FILE_H_
#define _FILE_H_
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "util.h"
#include "codeword.h"
FILE* OpenFileWithMode(char* filename, char* mode);
FILE* CloseFile(FILE* fp);
int GetOneBit(FILE* fp, int* buffer_p, int* unread_num_p, int* buffer_next_p);
int GetOneByte(FILE* fp, int* buffer_p, int* unread_num_p, int* buffer_next_p);
int GetOneByteSimple(FILE* fp); // getc
void PrintOneBit(FILE* fp, int* buffer_p, int* buffer_len_p, int this_bit);
void PrintOneByte(FILE* fp, int* buffer_p, int* buffer_len_p, int this_byte);
int PadByte(FILE* fp, int* buffer_p, int* buffer_len_p);
#endif