* need space for two seperate filenames */ n = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2;  if ((dirname = malloc((unsigned) n)) == NULL) return errno = ENOMEM, (DBM *) NULL;
sdbm_open(file, flags, mode)register char *file;register int flags;register int mode;{	register DBM *db;	register char *dirname;	register char *pagname;	register int n;	if (file == NULL || !*file)		return errno = EINVAL, (DBM *) NULL;/* * need space for two seperate filenames */	n = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2;	if ((dirname = malloc((unsigned) n)) == NULL)		return errno = ENOMEM, (DBM *) NULL;/* * build the file names */	dirname = strcat(strcpy(dirname, file), DIRFEXT);	pagname = strcpy(dirname + strlen(dirname) + 1, file);	pagname = strcat(pagname, PAGFEXT);#ifdef NETWARE	locking_sem = OpenLocalSemaphore (1);#endif	db = sdbm_prep(dirname, pagname, flags, mode);	free((char *) dirname);	return db;}