mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 22:43:58 +00:00
Introduce nitems() and use it; use bsearch.
This commit is contained in:
5
tmux.h
5
tmux.h
@ -1,4 +1,4 @@
|
||||
/* $Id: tmux.h,v 1.208 2009-01-07 19:53:17 nicm Exp $ */
|
||||
/* $Id: tmux.h,v 1.209 2009-01-07 22:52:33 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -135,6 +135,9 @@ extern const char *__progname;
|
||||
#define printflike3 __attribute__ ((format (printf, 3, 4)))
|
||||
#define printflike4 __attribute__ ((format (printf, 4, 5)))
|
||||
|
||||
/* Number of items in array. */
|
||||
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
||||
|
||||
/* Buffer macros. */
|
||||
#define BUFFER_USED(b) ((b)->size)
|
||||
#define BUFFER_FREE(b) ((b)->space - (b)->off - (b)->size)
|
||||
|
Reference in New Issue
Block a user