src/gedlib/dbcontext.c
/*===================================================
 * describe_dberror -- Describe database opening error
 * dberr:  [in] error whose description is sought
 * buffer: [out] buffer for description
 * buflen: [in]  size of buffer
 *=================================================*/
- Describe database opening error
dberr:  [in] error whose description is sought
buffer: [out] buffer for description
buflen: [in]  size of buffer
- Describe database opening error dberr : [ in ] error whose description is sought buffer : [ out ] buffer for description buflen : [ in ] size of buffer
void
describe_dberror (INT dberr, STRING buffer, INT buflen)
{
	STRING b=buffer;
	INT n=buflen, u8=uu8;
	buffer[0]=0;
	if (dberr != BTERR_WRITER)
		llstrncpy(buffer, _("Database error: -- "), buflen, 0);
	switch (dberr) {
	case BTERR_NODB:
		llstrapps(b, n, u8, _("requested database does not exist."));
		break;
	case BTERR_DBBLOCKEDBYFILE:
		llstrapps(b, n, u8, _("db directory is file, not directory."));
		break;
	case BTERR_DBCREATEFAILED:
		llstrapps(b, n, u8, _("creation of new database failed."));
		break;
	case BTERR_DBACCESS:
		llstrapps(b, n, u8, _("error accessing database directory."));
		break;
	case BTERR_NOKEY:
		llstrapps(b, n, u8, _("no keyfile (directory does not appear to be a database)."));
		break;
	case BTERR_INDEX:
		llstrapps(b, n, u8,  _("could not open, read or write an index file."));
		break;
	case BTERR_KFILE:
		llstrapps(b, n, u8,  _("could not open, read or write the key file."));
		break;
	case BTERR_KFILE_ALTERDB:
		llstrapps(b, n, u8,  _("could not open, read or write the key file (to alter database)."));
		break;
	case BTERR_BLOCK:
		llstrapps(b, n, u8,  _("could not open, read or write a block file."));
		break;
	case BTERR_LNGDIR:
		llstrapps(b, n, u8,  _("name of database is too long."));
		break;
	case BTERR_WRITER:
		llstrapps(b, n, u8,  _("The database is already open for writing."));
		break;
	case BTERR_LOCKED:
		llstrapps(b, n, u8,  _("The database is locked (no readwrite access)."));
		break;
	case BTERR_UNLOCKED:
		llstrapps(b, n, u8,  _("The database is unlocked."));
		break;
	case BTERR_ILLEGKF:
		llstrapps(b, n, u8,  _("keyfile is corrupt."));
		break;
	case BTERR_ALIGNKF:
		llstrapps(b, n, u8,  _("keyfile is wrong alignment."));
		break;
	case BTERR_VERKF:
		llstrapps(b, n, u8,  _("keyfile is wrong version."));
		break;
	case BTERR_EXISTS:
		llstrapps(b, n, u8,  _("Existing database found."));
		break;
	case BTERR_READERS:
		llstrappf(b, n, u8
			, _pl("The database is already opened for read access by %d user."
				, "The database is already opened for read access by %d users."
				, rdr_count)
			, rdr_count);
		break;
	case BTERR_BADPROPS:
		llstrapps(b, n, u8,  _("Invalid properties set for new database"));
		break;
	default:
		llstrapps(b, n, u8,  _("Undefined database error -- fix program."));
		break;
	}
}
void describe_dberror ( INT dberr , STRING buffer , INT buflen ) { STRING b = buffer ; INT n = buflen , u8 = uu8 ; buffer [ 0 ] = 0 ; if ( dberr != BTERR_WRITER ) llstrncpy ( buffer , _ ( " " ) , buflen , 0 ) ; switch ( dberr ) { case BTERR_NODB : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_DBBLOCKEDBYFILE : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_DBCREATEFAILED : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_DBACCESS : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_NOKEY : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_INDEX : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_KFILE : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_KFILE_ALTERDB : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_BLOCK : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_LNGDIR : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_WRITER : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_LOCKED : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_UNLOCKED : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_ILLEGKF : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_ALIGNKF : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_VERKF : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_EXISTS : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; case BTERR_READERS : llstrappf ( b , n , u8 , _pl ( " " , " " , rdr_count ) , rdr_count ) ; break ; case BTERR_BADPROPS : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; default : llstrapps ( b , n , u8 , _ ( " " ) ) ; break ; } }
describe_dberror -- Describe database opening error
 dberr:  [in] error whose description is sought
 buffer: [out] buffer for description
 buflen: [in]  size of buffer
describe_dberror -- Describe database opening error dberr : [ in ] error whose description is sought buffer : [ out ] buffer for description buflen : [ in ] size of buffer