read morphism body definitions from morphism-base file and generate instantiations based on type-variable substitutions
This commit is contained in:
parent
3f4a99ad79
commit
cea1f36e63
8 changed files with 244 additions and 255 deletions
morphisms/include/array
65
morphisms/include/array/length-prefix.h
Normal file
65
morphisms/include/array/length-prefix.h
Normal file
|
@ -0,0 +1,65 @@
|
|||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
/* UInt8 */
|
||||
|
||||
struct LengthPrefixUInt8Array {
|
||||
uint64_t len;
|
||||
uint8_t items[];
|
||||
};
|
||||
|
||||
void length_prefix_uint8_array_clear(
|
||||
struct LengthPrefixUInt8Array * data
|
||||
);
|
||||
void length_prefix_uint8_array_push(
|
||||
struct LengthPrefixUInt8Array * data,
|
||||
uint8_t value
|
||||
);
|
||||
int length_prefix_uint8_array_reverse(
|
||||
struct LengthPrefixUInt8Array const * restrict src,
|
||||
struct LengthPrefixUInt8Array * restrict dst
|
||||
);
|
||||
void length_prefix_uint8_array_dump(
|
||||
struct LengthPrefixUInt8Array const * data
|
||||
);
|
||||
|
||||
/* UInt64 */
|
||||
|
||||
struct LengthPrefixUInt64Array {
|
||||
uint64_t len;
|
||||
uint64_t items[];
|
||||
};
|
||||
|
||||
void length_prefix_uint64_array_clear(
|
||||
struct LengthPrefixUInt64Array * data
|
||||
);
|
||||
void length_prefix_uint64_array_push(
|
||||
struct LengthPrefixUInt64Array * data,
|
||||
uint64_t value
|
||||
);
|
||||
int length_prefix_uint64_array_reverse(
|
||||
struct LengthPrefixUInt64Array const * restrict src,
|
||||
struct LengthPrefixUInt64Array * restrict dst
|
||||
);
|
||||
void length_prefix_uint64_array_dump(
|
||||
struct LengthPrefixUInt64Array const * data
|
||||
);
|
||||
|
||||
/*
|
||||
* Map
|
||||
*/
|
||||
int length_prefix_array_map_64_to_64(
|
||||
int (*f) ( uint64_t const * restrict, uint64_t * restrict ),
|
||||
struct LengthPrefixUInt64Array const * restrict src,
|
||||
struct LengthPrefixUInt64Array * restrict dst
|
||||
);
|
||||
int length_prefix_array_map_8_to_64(
|
||||
int (*f) ( uint8_t const * restrict, uint64_t * restrict ),
|
||||
struct LengthPrefixUInt8Array const * restrict src,
|
||||
struct LengthPrefixUInt64Array * restrict dst
|
||||
);
|
||||
int length_prefix_array_map_64_to_8(
|
||||
int (*f) ( uint64_t const * restrict, uint8_t * restrict ),
|
||||
struct LengthPrefixUInt64Array const * restrict src,
|
||||
struct LengthPrefixUInt8Array * restrict dst
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue