plptools
Loading...
Searching...
No Matches
sistypes.h
Go to the documentation of this file.
1
/*
2
* This file is part of plptools.
3
*
4
* Copyright (C) 2002 Daniel Brahneborg <basic.chello@se>
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* along with this program; if not, see <https://www.gnu.org/licenses/>.
18
*/
19
#pragma once
20
21
#include <stdint.h>
22
#include <sys/types.h>
23
27
enum
SisRC
{
28
SIS_OK
= 0,
29
SIS_TRUNCATED
,
30
SIS_TRUNCATEDDATA
,
31
SIS_CORRUPTED
,
32
SIS_FAILED
,
33
SIS_ABORTED
,
34
SIS_DIFFERENT_APP
,
35
SIS_VER_EARLIER
,
36
SIS_SAME_OR_LATER
,
37
SIS_OTHER_VARIANT
38
};
39
40
extern
uint16_t
read16
(uint8_t* p);
41
42
extern
uint32_t
read32
(uint8_t* p);
43
44
extern
void
write16
(uint8_t* p,
int
val);
45
46
extern
void
createCRCTable
();
47
48
extern
uint16_t
updateCrc
(uint16_t crc, uint8_t value);
49
50
extern
int
logLevel
;
51
56
struct
LangTableEntry
{
57
uint16_t
m_no
;
58
char
m_code
[3];
59
const
char
*
m_name
;
60
};
61
62
extern
LangTableEntry
langTable
[];
createCRCTable
void createCRCTable()
Definition:
sistypes.cpp:27
SisRC
SisRC
Return Codes.
Definition:
sistypes.h:27
SIS_OK
@ SIS_OK
Definition:
sistypes.h:28
SIS_ABORTED
@ SIS_ABORTED
Definition:
sistypes.h:33
SIS_TRUNCATEDDATA
@ SIS_TRUNCATEDDATA
Definition:
sistypes.h:30
SIS_VER_EARLIER
@ SIS_VER_EARLIER
Definition:
sistypes.h:35
SIS_DIFFERENT_APP
@ SIS_DIFFERENT_APP
Definition:
sistypes.h:34
SIS_TRUNCATED
@ SIS_TRUNCATED
Definition:
sistypes.h:29
SIS_CORRUPTED
@ SIS_CORRUPTED
Definition:
sistypes.h:31
SIS_FAILED
@ SIS_FAILED
Definition:
sistypes.h:32
SIS_SAME_OR_LATER
@ SIS_SAME_OR_LATER
Definition:
sistypes.h:36
SIS_OTHER_VARIANT
@ SIS_OTHER_VARIANT
Definition:
sistypes.h:37
updateCrc
uint16_t updateCrc(uint16_t crc, uint8_t value)
Definition:
sistypes.cpp:39
langTable
LangTableEntry langTable[]
Definition:
sistypes.cpp:65
read32
uint32_t read32(uint8_t *p)
Definition:
sistypes.cpp:56
write16
void write16(uint8_t *p, int val)
Definition:
sistypes.cpp:60
logLevel
int logLevel
Definition:
sistypes.cpp:25
read16
uint16_t read16(uint8_t *p)
Definition:
sistypes.cpp:52
LangTableEntry
Holder of a language entry, translating from language numbers to names.
Definition:
sistypes.h:56
LangTableEntry::m_name
const char * m_name
Definition:
sistypes.h:59
LangTableEntry::m_no
uint16_t m_no
Definition:
sistypes.h:57
LangTableEntry::m_code
char m_code[3]
Definition:
sistypes.h:58
lib
sistypes.h
Generated by
1.9.5