forked from theZiz/ev3c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ev3c_core.h
75 lines (67 loc) · 2.13 KB
/
ev3c_core.h
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* This file is part of ev3c.
* Ev3c is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Ev3c is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ev3c. If not, see <http://www.gnu.org/licenses/>
*
* For feedback and questions about my Files and Projects please mail me,
* Alexander Matthes (Ziz) , ziz_at_mailbox.org, http://github.com/theZiz */
/* Title: ev3c_core
*
* Some basic defines.*/
#ifndef __EV3C_CORE
#define __EV3C_CORE
#include <stdint.h>
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
/* Define: EV3_STRING_LENGTH
*
* length (magic number) for all strings of modes, commands and similar */
#define EV3_STRING_LENGTH 64
/* type: ev3_string
*
* type used for all strings used from the driver lile mode names,
* commands and similar. The max length is <EV3_STRING_LENGTH>.*/
typedef char ev3_string[EV3_STRING_LENGTH];
/* Function ev3_read_file
*
* Reads the whole file if enough space is available in the buffer
*
* Parameter:
* file - (char*) file to read
* buffer - (char*) buffer to write to
* size - (int32_t) size of the buffer
*
* Returns:
* int32_t - 0 on sucess, else the error fd*/
int32_t ev3_read_file(char* file,char* buffer,int32_t size);
/* Function ev3_write_file
*
* Writes the whole buffer to the file.
*
* Parameter:
* file - (char*) file to write to
* buffer - (char*) buffer to read from
* size - (int32_t) size to write
*
* Returns:
* int32_t - 0 on sucess, else the error fd*/
int32_t ev3_write_file(char* file,char* buffer,int32_t size);
#endif