diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-07 22:52:33 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-07 22:52:33 +0000 |
commit | 4846ad16579f7fcf06fe01e03a56815b2d8c4a93 (patch) | |
tree | e5266f60bcd3e2fbdb203a10b26c67970ddc45a8 /tmux.h | |
parent | 4924d8e1e2c367b9593a6972e1bcb65ab0cb0a93 (diff) | |
download | rtmux-4846ad16579f7fcf06fe01e03a56815b2d8c4a93.tar.gz rtmux-4846ad16579f7fcf06fe01e03a56815b2d8c4a93.tar.bz2 rtmux-4846ad16579f7fcf06fe01e03a56815b2d8c4a93.zip |
Introduce nitems() and use it; use bsearch.
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |