mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
notcurses_stats_alloc() everywhere
This commit is contained in:
parent
bf28170c61
commit
c6c157a5ad
2
NEWS.md
2
NEWS.md
@ -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)
|
||||||
|
2
USAGE.md
2
USAGE.md
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user