/****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <hashed_db.h>
#endif
-MODULE_ID("$Id: toe.c,v 1.72 2013/05/25 20:13:07 tom Exp $")
+MODULE_ID("$Id: toe.c,v 1.75 2017/04/05 23:19:24 tom Exp $")
#define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
static const char suffix[] = DBM_SUFFIX;
bool result = FALSE;
- unsigned lens = sizeof(suffix) - 1;
- unsigned size = strlen(src);
- unsigned need = lens + size;
+ size_t lens = sizeof(suffix) - 1;
+ size_t size = strlen(src);
+ size_t need = lens + size;
if (need <= limit) {
if (size >= lens
typedef void (DescHook) (int /* db_index */ ,
int /* db_limit */ ,
const char * /* term_name */ ,
- TERMTYPE * /* term */ );
+ TERMTYPE2 * /* term */ );
static const char *
-term_description(TERMTYPE *tp)
+term_description(TERMTYPE2 *tp)
{
const char *desc;
/* display a description for the type */
static void
-deschook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp)
+deschook(int db_index, int db_limit, const char *term_name, TERMTYPE2 *tp)
{
(void) db_index;
(void) db_limit;
}
static unsigned long
-checksum_of(TERMTYPE *tp)
+checksum_of(TERMTYPE2 *tp)
{
unsigned long result = string_sum(tp->term_names);
unsigned i;
/* collect data, to sort before display */
static void
-sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp)
+sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE2 *tp)
{
TERMDATA *data = new_termdata();
static void
show_termcap(int db_index, int db_limit, char *buffer, DescHook hook)
{
- TERMTYPE data;
+ TERMTYPE2 data;
char *next = strchr(buffer, ':');
char *last;
char *list = buffer;
static int
typelist(int eargc, char *eargv[],
- bool verbosity,
+ int verbosity,
DescHook hook)
/* apply a function to each entry in given terminfo directories */
{
}
while ((entry = readdir(entrydir)) != 0) {
char *name_2;
- TERMTYPE lterm;
+ TERMTYPE2 lterm;
char *cn;
int status;
/* apply the selected hook function */
hook(i, eargc, cn, <erm);
}
- _nc_free_termtype(<erm);
+ _nc_free_termtype2(<erm);
free(name_2);
}
closedir(entrydir);
code = _nc_db_first(capdbp, &key, &data);
while (code == 0) {
- TERMTYPE lterm;
+ TERMTYPE2 lterm;
int used;
char *have;
char *cn;
DBDIRS state;
int offset;
const char *path;
- char **eargv = allocArgv(2);
+ char **eargv = allocArgv((size_t) 2);
size_t count = 0;
if (eargv == 0)