Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
1010ae53
Commit
1010ae53
authored
Sep 02, 1998
by
Niels Möller
Browse files
Moved macros to this file.
Rev: src/lsh_types.h:1.4
parent
404545e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lsh_types.h
View file @
1010ae53
...
...
@@ -28,6 +28,26 @@
#define PRINTF_STYLE(f, a)
#endif
/* Some macros */
/* Reads a 32-bit integer, in network byte order */
#define READ_UINT32(p) \
((((UINT32) (p)[0]) << 24) \
| (((UINT32) (p)[0]) << 16) \
| (((UINT32) (p)[0]) << 8) \
| ((UINT32) (p)[0]))
#define WRITE_UINT32(p, i) \
do { \
(p)[0] = ((i) >> 24) & 0xff; \
(p)[0] = ((i) >> 16) & 0xff; \
(p)[0] = ((i) >> 8) & 0xff; \
(p)[0] = (i) & 0xff; \
} while(0)
#define MIN(a, b) (((a)>(b)) ? (b) : (a))
#define MAX(a, b) (((a)>(b)) ? (b) : (a))
/* Generic packet */
struct
lsh_string
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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