version 1.42, 2020/05/16 15:35:19 |
version 1.43, 2022/06/04 07:42:07 |
|
|
return (RB_NEXT(paste_time_tree, &paste_by_time, pb)); |
return (RB_NEXT(paste_time_tree, &paste_by_time, pb)); |
} |
} |
|
|
|
int |
|
paste_is_empty(void) |
|
{ |
|
return RB_ROOT(&paste_by_time) == NULL; |
|
} |
|
|
/* Get the most recent automatic buffer. */ |
/* Get the most recent automatic buffer. */ |
struct paste_buffer * |
struct paste_buffer * |
paste_get_top(const char **name) |
paste_get_top(const char **name) |
|
|
struct paste_buffer *pb; |
struct paste_buffer *pb; |
|
|
pb = RB_MIN(paste_time_tree, &paste_by_time); |
pb = RB_MIN(paste_time_tree, &paste_by_time); |
|
while (pb != NULL && !pb->automatic) |
|
pb = RB_NEXT(paste_time_tree, &paste_by_time, pb); |
if (pb == NULL) |
if (pb == NULL) |
return (NULL); |
return (NULL); |
if (name != NULL) |
if (name != NULL) |