-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Swapped out <> in local headers for double quotes. * Call all the initialization bits from one place, and expect it to not be applied as a constructor. * All con4m non-static functions and exported symbols are now prefixed with c4m_ * All con4m data types that aren't private to a file are now prefixed with c4m_ * Any macro in the con4m dir other than the 3rd party vararg stuff also should start w/ C4M_ at this point. * Add in new initialization wrapper that should be called from a constructor. Note that con4m_ is no longer a prefix; it is always c4m_ now. Also, hatrack is fairly reasonably name-spaced; that was left alone, so you'll still see some hatrack_* and flexarray_* on the con4m side.
- Loading branch information
Showing
174 changed files
with
7,932 additions
and
8,364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
#pragma once | ||
|
||
#include <con4m.h> | ||
#include "con4m.h" | ||
|
||
extern void utf8_ansi_render(const utf8_t *s, stream_t *outstream); | ||
extern void utf32_ansi_render(const utf32_t *s, int32_t start_ix, int32_t end_ix, stream_t *outstream); | ||
extern void ansi_render(const any_str_t *s, stream_t *out); | ||
extern void ansi_render_to_width(const any_str_t *s, int32_t width, int32_t hang, stream_t *out); | ||
extern size_t ansi_render_len(const any_str_t *s); | ||
extern void c4m_utf8_ansi_render(const c4m_utf8_t *s, | ||
c4m_stream_t *outstream); | ||
extern void c4m_utf32_ansi_render(const c4m_utf32_t *s, | ||
int32_t start_ix, | ||
int32_t end_ix, | ||
c4m_stream_t *outstream); | ||
extern void c4m_ansi_render(const c4m_str_t *s, | ||
c4m_stream_t *out); | ||
extern void c4m_ansi_render_to_width(const c4m_str_t *s, | ||
int32_t width, | ||
int32_t hang, | ||
c4m_stream_t *out); | ||
extern size_t c4m_ansi_render_len(const c4m_str_t *s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,140 +1,140 @@ | ||
#include <con4m.h> | ||
#include "con4m.h" | ||
|
||
static inline i64_box * | ||
box_i64(int64_t n) | ||
c4m_box_i64(int64_t n) | ||
{ | ||
int64_t *result = con4m_new(tspec_i64()); | ||
int64_t *result = c4m_new(c4m_tspec_i64()); | ||
*result = n; | ||
|
||
return result; | ||
} | ||
|
||
static inline int64_t | ||
unbox_i64(i64_box *b) | ||
c4m_unbox_i64(i64_box *b) | ||
{ | ||
return *b; | ||
} | ||
|
||
static inline u64_box * | ||
box_u64(uint64_t n) | ||
c4m_box_u64(uint64_t n) | ||
{ | ||
uint64_t *result = con4m_new(tspec_u64()); | ||
uint64_t *result = c4m_new(c4m_tspec_u64()); | ||
*result = n; | ||
|
||
return result; | ||
} | ||
|
||
static inline uint64_t | ||
unbox_u64(u64_box *b) | ||
c4m_unbox_u64(u64_box *b) | ||
{ | ||
return *b; | ||
} | ||
|
||
static inline i32_box * | ||
box_i32(int32_t n) | ||
c4m_box_i32(int32_t n) | ||
{ | ||
int32_t *result = con4m_new(tspec_i32()); | ||
int32_t *result = c4m_new(c4m_tspec_i32()); | ||
*result = n; | ||
|
||
return result; | ||
} | ||
|
||
static inline int32_t | ||
unbox_i32(i32_box *b) | ||
c4m_unbox_i32(i32_box *b) | ||
{ | ||
return *b; | ||
} | ||
|
||
static inline u32_box * | ||
box_u32(uint32_t n) | ||
c4m_box_u32(uint32_t n) | ||
{ | ||
uint32_t *result = con4m_new(tspec_u32()); | ||
uint32_t *result = c4m_new(c4m_tspec_u32()); | ||
*result = n; | ||
|
||
return result; | ||
} | ||
|
||
static inline uint32_t | ||
unbox_u32(u32_box *b) | ||
c4m_unbox_u32(u32_box *b) | ||
{ | ||
return *b; | ||
} | ||
|
||
#if 0 // I somehow have missed u16 | ||
|
||
static inline i16_box * | ||
box_i16(int16_t n) | ||
c4m_box_i16(int16_t n) | ||
{ | ||
int16_t *result = con4m_new(tspec_i16()); | ||
int16_t *result = c4m_new(c4m_tspec_i16()); | ||
*result = n; | ||
|
||
return result; | ||
} | ||
|
||
static inline int16_t | ||
unbox_i16(i16_box *b) | ||
c4m_unbox_i16(i16_box *b) | ||
{ | ||
return *b; | ||
} | ||
|
||
static inline u16_box * | ||
box_u16(uint16_t n) | ||
c4m_box_u16(uint16_t n) | ||
{ | ||
uint16_t *result = con4m_new(tspec_u16()); | ||
uint16_t *result = c4m_new(c4m_tspec_u16()); | ||
*result = n; | ||
|
||
return result; | ||
} | ||
|
||
static inline uint16_t | ||
unbox_u16(u16_box *b) | ||
c4m_unbox_u16(u16_box *b) | ||
{ | ||
return *b; | ||
} | ||
|
||
#endif | ||
|
||
static inline i8_box * | ||
box_i8(int8_t n) | ||
c4m_box_i8(int8_t n) | ||
{ | ||
int8_t *result = con4m_new(tspec_i8()); | ||
int8_t *result = c4m_new(c4m_tspec_i8()); | ||
*result = n; | ||
|
||
return result; | ||
} | ||
|
||
static inline int8_t | ||
unbox_i8(i8_box *b) | ||
c4m_unbox_i8(i8_box *b) | ||
{ | ||
return *b; | ||
} | ||
|
||
static inline u8_box * | ||
box_u8(uint8_t n) | ||
c4m_box_u8(uint8_t n) | ||
{ | ||
uint8_t *result = con4m_new(tspec_u8()); | ||
uint8_t *result = c4m_new(c4m_tspec_u8()); | ||
*result = n; | ||
|
||
return result; | ||
} | ||
|
||
static inline uint8_t | ||
unbox_u8(u8_box *b) | ||
c4m_unbox_u8(u8_box *b) | ||
{ | ||
return *b; | ||
} | ||
|
||
static inline double_box * | ||
box_double(double d) | ||
c4m_box_double(double d) | ||
{ | ||
double *result = con4m_new(tspec_f64()); | ||
double *result = c4m_new(c4m_tspec_f64()); | ||
*result = d; | ||
|
||
return result; | ||
} | ||
|
||
static inline double | ||
unbox_double(double_box *b) | ||
c4m_unbox_double(double_box *b) | ||
{ | ||
return *b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.