mirror of
				https://github.com/sqlite/sqlite.git
				synced 2025-11-03 16:53:36 +03:00 
			
		
		
		
	The code is in place to replace GDBM with BTree. But I have not yet
attempted to compile it. I am sure the code contains bugs. (CVS 238) FossilOrigin-Name: 6ecc8b20d4f402f45f03d46d8d4fa40dea666e97
This commit is contained in:
		
							
								
								
									
										30
									
								
								src/util.c
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								src/util.c
									
									
									
									
									
								
							@@ -26,7 +26,7 @@
 | 
			
		||||
** This file contains functions for allocating memory, comparing
 | 
			
		||||
** strings, and stuff like that.
 | 
			
		||||
**
 | 
			
		||||
** $Id: util.c,v 1.21 2001/04/11 14:28:43 drh Exp $
 | 
			
		||||
** $Id: util.c,v 1.22 2001/09/13 13:46:57 drh Exp $
 | 
			
		||||
*/
 | 
			
		||||
#include "sqliteInt.h"
 | 
			
		||||
#include <stdarg.h>
 | 
			
		||||
@@ -972,3 +972,31 @@ sqliteLikeCompare(const unsigned char *zPattern, const unsigned char *zString){
 | 
			
		||||
  }
 | 
			
		||||
  return *zString==0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
** Return a static string that describes the kind of error specified in the
 | 
			
		||||
** argument.
 | 
			
		||||
*/
 | 
			
		||||
const char *sqliteErrStr(int rc){
 | 
			
		||||
  char *z = 0;
 | 
			
		||||
  switch( rc ){
 | 
			
		||||
    case SQLITE_OK:          z = "not an error";  break;
 | 
			
		||||
    case SQLITE_ERROR:       z = "SQL logic error or missing database"; break;
 | 
			
		||||
    case SQLITE_INTERNAL:    z = "internal SQLite implementation flaw"; break;
 | 
			
		||||
    case SQLITE_PERM:        z = "access permission denied"; break;
 | 
			
		||||
    case SQLITE_ABORT:       z = "callback requested query abort"; break;
 | 
			
		||||
    case SQLITE_BUSY:        z = "database in use by another process"; break;
 | 
			
		||||
    case SQLITE_NOMEM:       z = "out of memory"; break;
 | 
			
		||||
    case SQLITE_READONLY:    z = "attempt to write a readonly database"; break;
 | 
			
		||||
    case SQLITE_INTERRUPT:   z = "interrupted"; break;
 | 
			
		||||
    case SQLITE_IOERR:       z = "disk I/O error"; break;
 | 
			
		||||
    case SQLITE_CORRUPT:     z = "database disk image is malformed"; break;
 | 
			
		||||
    case SQLITE_NOTFOUND:    z = "table or record not found"; break;
 | 
			
		||||
    case SQLITE_FULL:        z = "database is full"; break;
 | 
			
		||||
    case SQLITE_CANTOPEN:    z = "unable to open database file"; break;
 | 
			
		||||
    case SQLITE_PROTOCOL:    z = "database locking protocol failure"; break;
 | 
			
		||||
    case SQLITE_EMPTY:       z = "table contains no data";
 | 
			
		||||
    default:
 | 
			
		||||
  }
 | 
			
		||||
  return z;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user