notcurses_stats_alloc() everywhere

This commit is contained in:
nick black 2020-10-07 04:24:10 -04:00
parent bf28170c61
commit c6c157a5ad
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
6 changed files with 7 additions and 6 deletions

View File

@ -9,7 +9,7 @@ rearrangements of Notcurses.
these processes. these processes.
* `notcurses_render_to_buffer()` has been added, allowing user control of * `notcurses_render_to_buffer()` has been added, allowing user control of
the process of writing frames out to the terminal. the process of writing frames out to the terminal.
* `notcurses_stats_create()` has been added, to allocate an `ncstats` object. * `notcurses_stats_alloc()` has been added, to allocate an `ncstats` object.
`notcurses_reset_stats()` has been renamed `notcurses_stats_reset()`. `notcurses_reset_stats()` has been renamed `notcurses_stats_reset()`.
* 1.7.5 (2020-09-29) * 1.7.5 (2020-09-29)

View File

@ -2851,7 +2851,7 @@ typedef struct ncstats {
// Allocate an ncstats object. Use this rather than allocating your own, since // Allocate an ncstats object. Use this rather than allocating your own, since
// future versions of Notcurses might enlarge this structure. // future versions of Notcurses might enlarge this structure.
ncstats* notcurses_stats_create(const struct notcurses* nc); ncstats* notcurses_stats_alloc(const struct notcurses* nc);
// Acquire an atomic snapshot of the notcurses object's stats. // Acquire an atomic snapshot of the notcurses object's stats.
void notcurses_stats(const struct notcurses* nc, ncstats* stats); void notcurses_stats(const struct notcurses* nc, ncstats* stats);

View File

@ -1121,7 +1121,7 @@ typedef struct ncstats {
// Allocate an ncstats object. Use this rather than allocating your own, since // Allocate an ncstats object. Use this rather than allocating your own, since
// future versions of Notcurses might enlarge this structure. // future versions of Notcurses might enlarge this structure.
API ncstats* notcurses_stats_create(const struct notcurses* nc); API ncstats* notcurses_stats_alloc(const struct notcurses* nc);
// Acquire an atomic snapshot of the notcurses object's stats. // Acquire an atomic snapshot of the notcurses object's stats.
API void notcurses_stats(const struct notcurses* nc, ncstats* stats); API void notcurses_stats(const struct notcurses* nc, ncstats* stats);

View File

@ -24,7 +24,8 @@
// notcurses_refresh // notcurses_refresh
// notcurses_render // notcurses_render
// notcurses_render_to_file // notcurses_render_to_file
// notcurses_reset_stats // notcurses_stats_alloc
// notcurses_stats_reset
// notcurses_stats // notcurses_stats
// notcurses_stdplane // notcurses_stdplane
// notcurses_stdplane_const // notcurses_stdplane_const

View File

@ -310,7 +310,7 @@ typedef struct notcurses {
int cursorx; // care, otherwise moved here after each render. int cursorx; // care, otherwise moved here after each render.
ncstats stats; // some statistics across the lifetime of the notcurses ctx ncstats stats; // some statistics across the lifetime of the notcurses ctx
ncstats stashstats; // cumulative stats, unaffected by notcurses_reset_stats() ncstats stashstats; // cumulative stats, unaffected by notcurses_stats_reset()
int truecols; // true number of columns in the physical rendering area. int truecols; // true number of columns in the physical rendering area.
// used only to see if output motion takes us to the next // used only to see if output motion takes us to the next

View File

@ -715,7 +715,7 @@ void notcurses_stats(const notcurses* nc, ncstats* stats){
memcpy(stats, &nc->stats, sizeof(*stats)); memcpy(stats, &nc->stats, sizeof(*stats));
} }
ncstats* notcurses_stats_create(const notcurses* nc __attribute__ ((unused))){ ncstats* notcurses_stats_alloc(const notcurses* nc __attribute__ ((unused))){
return malloc(sizeof(ncstats)); return malloc(sizeof(ncstats));
} }