Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ML
lib
Binary Storage
Commits
598ffd98
Commit
598ffd98
authored
Feb 26, 2020
by
Zhukov, Alexander P
Browse files
added byteswap implementation for Mac to work
parent
c1be3ccd
Changes
2
Hide whitespace changes
Inline
Side-by-side
c-code/binary_storage.c
View file @
598ffd98
#include
<stdio.h>
#include
<string.h>
#include
<stdlib.h>
#include
<byteswap.h>
/*
#include <byteswap.h>
*/
#include
<sys/time.h>
#include
"binary_storage.h"
...
...
c-code/binary_storage.h
View file @
598ffd98
#include
<stdint.h>
#if HAVE_BYTESWAP_H
#include
<byteswap.h>
#else
#define bswap_16(value) \
((((value) & 0xff) << 8) | ((value) >> 8))
#define bswap_32(value) \
(((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \
(uint32_t)bswap_16((uint16_t)((value) >> 16)))
#define bswap_64(value) \
(((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) \
<< 32) | \
(uint64_t)bswap_32((uint32_t)((value) >> 32)))
#endif
typedef
struct
tagset
{
char
**
data
;
size_t
num
;
...
...
@@ -19,6 +36,3 @@ typedef struct storage {
BinaryStorage
bs_open
(
char
*
filename
);
int
write_record
(
BinaryStorage
*
bs
,
char
*
name
,
TSTMP
timestamp
,
double
value
,
TAGS
*
tags
);
void
bs_close
(
BinaryStorage
*
bs
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment