tui: move terminfo_is_term_family()

This commit is contained in:
Justin M. Keyes
2017-11-22 22:47:12 +01:00
parent 8c959be511
commit 51637f4256
2 changed files with 17 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@@ -61,20 +61,6 @@
#define UNIBI_SET_NUM_VAR(var, num) (var).i = (num); #define UNIBI_SET_NUM_VAR(var, num) (var).i = (num);
#endif #endif
// Per the commentary in terminfo, only a minus sign is a true suffix
// separator.
bool terminfo_is_term_family(const char *term, const char *family)
{
if (!term) {
return false;
}
size_t tlen = strlen(term);
size_t flen = strlen(family);
return tlen >= flen
&& 0 == memcmp(term, family, flen) \
&& ('\0' == term[flen] || '-' == term[flen]);
}
typedef struct { typedef struct {
int top, bot, left, right; int top, bot, left, right;
} Rect; } Rect;