rust: improve info headers for maximum consistency

and implement 1 palette fuction
pull/875/head
joseLuís 4 years ago
parent 70adc5645b
commit 8b01f26730

@ -1,5 +1,5 @@
// Already exported by bindgen: 6 // functions already exported by bindgen : 6
// // -----------------------------------------
// - cell_duplicate // - cell_duplicate
// - cell_extended_gcluster // - cell_extended_gcluster
// - cell_load // - cell_load
@ -7,15 +7,11 @@
// - cells_double_box // - cells_double_box
// - cells_rounded_box // - cells_rounded_box
// //
// FUNCTIONS TO REIMPLEMENT: // static inline functions to reimplement: 45
// - from notcurses.h: 45 // ------------------------------------------
// - done: ±2 // - finished : ±2
// - remaining: 43 // - remaining: 43
// // --------------- (+) implemented (#) + unit test (x) wont implement
// ---------------
// + reimplemented
// # and unit test
// --------------
// cell_bchannel // cell_bchannel
// cell_bg // cell_bg
// cell_bg_alpha // cell_bg_alpha

@ -1,37 +1,34 @@
// NOTE: There are several differences from the original functions in C: // ---------------------------------------------------------------------------------------
// - NOTE: The channel components are u8 instead of u32.
// Because of type enforcing, some runtime checks are now unnecessary.
// //
// - The channel components are u8 instead of u32. Because of type enforcing by the // - NOTE: These functions now can't fail and don't have to return an error:
// compiler, some runtime checks are now unnecessary.
//
// - These functions now can't fail and doesn't have to return an error:
// - `channel_set_rgb()` // - `channel_set_rgb()`
// - `channels_set_fg_rgb()` // - `channels_set_fg_rgb()`
// - `channels_set_bg_rgb()` // - `channels_set_bg_rgb()`
// //
// - These functions were therefore deemed unnecessary to implement: // - NOTE: These functions were therefore deemed unnecessary to implement:
// - `channel_set_rgb_clipped()` // - `channel_set_rgb_clipped()`
// - `channels_set_fg_rgb_clipped()` // - `channels_set_fg_rgb_clipped()`
// - `channels_set_bg_rgb_clipped()` // - `channels_set_bg_rgb_clipped()`
// //
// - These functions return an integer error result: // - These functions still return an integer error result:
// - `channel_set_alpha()` // - `channel_set_alpha()`
// - `channel_set_rgb()` // - `channel_set_rgb()`
// - `channels_set_fg()` // - `channels_set_fg()`
// - `channels_set_bg()` // - `channels_set_bg()`
// - `channels_set_fg_alpha()` // - `channels_set_fg_alpha()`
// - `channels_set_bg_alpha()` // - `channels_set_bg_alpha()`
// ---------------------------------------------------------------------------------------
// //
// functions already exported by bindgen : 0
// ------------------------------------------
// //
// FUNCTIONS TO REIMPLEMENT: // static inline functions to reimplement: 38
// - from notcurses.h: 38 // ------------------------------------------
// - done: ±37 // - finished : 37
// - remaining: 1 // - remaining: 1
// // --------------- (+) implemented (#) + unit test (x) wont implement
// ---------------
// + reimplemented
// # and unit test
// x not needed
// --------------
//#channel_alpha //#channel_alpha
//#channel_b //#channel_b
//#channel_default_p // FIXME TEST //#channel_default_p // FIXME TEST

@ -1,13 +1,9 @@
// Functions already exported by bindgen: 0 // functions already exported by bindgen : 0
// static inline functions to reimplement: 2
// - done: 2
// - remaining: 0
// //
// Function list // static inline functions to reimplement: 2
// --------------- // - finished : 2
// + reimplemented // - remaining: 0
// # and unit test // --------------- (+) implemented (#) + unit test (x) wont implement
// --------------
//+nckey_mouse_p //+nckey_mouse_p
//+nckey_supppuab_p //+nckey_supppuab_p

@ -1,5 +1,5 @@
// Already exported by bindgen: 35 // functions already exported by bindgen : 35
// // ------------------------------------------
// notcurses_at_yx // notcurses_at_yx
// notcurses_canchangecolor // notcurses_canchangecolor
// notcurses_canfade // notcurses_canfade
@ -36,15 +36,11 @@
// notcurses_version // notcurses_version
// notcurses_version_components // notcurses_version_components
// //
// FUNCTIONS TO REIMPLEMENT: // static inline functions to reimplement: 4
// - from notcurses.h: 4 // -----------------------------------------
// - done: 0 // - finished : 0
// - remaining: 4 // - remaining: 4
// // --------------- (+) implemented (#) + unit test (x) wont implement
// ---------------
// + reimplemented
// # and unit test
// --------------
// notcurses_getc_blocking // notcurses_getc_blocking
// notcurses_getc_nblock // notcurses_getc_nblock
// notcurses_stddim_yx // notcurses_stddim_yx

@ -1,32 +1,32 @@
// Already exported by bindgen: 3 // ---------------------------------------------------------------------------------------
// NOTE: These functions now can't fail and dont't have to return an error:
// - `palette256_set_rgb()`
// ---------------------------------------------------------------------------------------
// //
// functions already exported by bindgen : 3
// -----------------------------------------
// palette256_free // palette256_free
// palette256_new // palette256_new
// palette256_use // palette256_use
// //
// FUNCTIONS TO REIMPLEMENT: // static inline functions to reimplement: 3
// - from notcurses.h: 3 // -----------------------------------------
// - done: 0 // - finished : 1
// - remaining: 3 // - remaining: 2
// // --------------- (+) implemented (#) + unit test (x) wont implement
// --------------- //+palette256_get_rgb
// + reimplemented
// # and unit test
// --------------
// palette256_get_rgb
// palette256_set // palette256_set
// palette256_set_rgb // palette256_set_rgb
use crate as ffi;
use crate::types::Color;
// // Manipulate entries in the palette store 'p'. These are *not* locked. /// Manipulate entries in the palette store 'p'. These are *not* locked.
// static inline int pub fn palette256_set_rgb(palette: &mut ffi::palette256, idx: usize, r: Color, g: Color, b: Color) {
// palette256_set_rgb(palette256* p, int idx, int r, int g, int b){ ffi::channel_set_rgb(&mut palette.chans[idx], r, g, b)
// if(idx < 0 || (size_t)idx > sizeof(p->chans) / sizeof(*p->chans)){ }
// return -1;
// } // XXX: what is the return type?
// return channel_set_rgb(&p->chans[idx], r, g, b);
// }
//
// static inline int // static inline int
// palette256_set(palette256* p, int idx, unsigned rgb){ // palette256_set(palette256* p, int idx, unsigned rgb){
// if(idx < 0 || (size_t)idx > sizeof(p->chans) / sizeof(*p->chans)){ // if(idx < 0 || (size_t)idx > sizeof(p->chans) / sizeof(*p->chans)){
@ -34,7 +34,7 @@
// } // }
// return channel_set(&p->chans[idx], rgb); // return channel_set(&p->chans[idx], rgb);
// } // }
//
// static inline int // static inline int
// palette256_get_rgb(const palette256* p, int idx, unsigned* RESTRICT r, unsigned* RESTRICT g, unsigned* RESTRICT b){ // palette256_get_rgb(const palette256* p, int idx, unsigned* RESTRICT r, unsigned* RESTRICT g, unsigned* RESTRICT b){
// if(idx < 0 || (size_t)idx > sizeof(p->chans) / sizeof(*p->chans)){ // if(idx < 0 || (size_t)idx > sizeof(p->chans) / sizeof(*p->chans)){

@ -1,15 +1,11 @@
// Already exported by bindgen: 0 // functions already exported by bindgen : 0
// // -----------------------------------------
// FUNCTIONS TO REIMPLEMENT:
// - from notcurses.h: 10
// - done: 0
// - remaining: 10
//
// ---------------
// + reimplemented
// # and unit test
// --------------
// //
// static inline functions to reimplement: 3
// -----------------------------------------
// - finished : 0
// - remaining: 10
// --------------- (+) implemented (#) + unit test (x) wont implement
// ncpixel // ncpixel
// ncpixel_a // ncpixel_a
// ncpixel_b // ncpixel_b

@ -1,5 +1,5 @@
// Already exported by bindgen: 86 // functions already exported by bindgen : 86
// // ------------------------------------------
// ncplane_aligned // ncplane_aligned
// ncplane_at_cursor // ncplane_at_cursor
// ncplane_attr // ncplane_attr
@ -87,16 +87,11 @@
// ncplane_vprintf_yx // ncplane_vprintf_yx
// ncplane_yx // ncplane_yx
// //
// // static inline functions to reimplement: 42
// FUNCTIONS TO REIMPLEMENT: // ------------------------------------------
// - from notcurses.h: 42 // - finished : ±4
// - done: ±4 // - remaining: 38
// - remaining: 38 // --------------- (+) implemented (#) + unit test (x) wont implement
//
// ---------------
// + reimplemented
// # and unit test
// --------------
// ncplane_align // ncplane_align
// ncplane_at_cursor_cell // ncplane_at_cursor_cell
// ncplane_at_yx_cell // ncplane_at_yx_cell

Loading…
Cancel
Save