00001 /*- 00002 * See the file LICENSE for redistribution information. 00003 * 00004 * Copyright (c) 1999, 2000 00005 * Sleepycat Software. All rights reserved. 00006 */ 00007 00008 #include "config.h" 00009 00010 #ifndef lint 00011 static const char revid[] = "$Id: qam__method_8c-source.html,v 1.1 2008年06月08日 10:21:44 sebdiaz Exp $"; 00012 #endif /* not lint */ 00013 00014 #ifndef NO_SYSTEM_INCLUDES 00015 #include <sys/types.h> 00016 #endif 00017 00018 #include "db_int.h" 00019 #include "db_page.h" 00020 #include "qam.h" 00021 00022 /* 00023 * CDB___qam_db_create -- 00024 * Queue specific initialization of the DB structure. 00025 * 00026 * PUBLIC: int CDB___qam_db_create __P((DB *)); 00027 */ 00028 int 00029 CDB___qam_db_create(dbp) 00030 DB *dbp; 00031 { 00032 QUEUE *t; 00033 int ret; 00034 00035 /* Allocate and initialize the private queue structure. */ 00036 if ((ret = CDB___os_calloc(dbp->dbenv, 1, sizeof(QUEUE), &t)) != 0) 00037 return (ret); 00038 dbp->q_internal = t; 00039 00040 t->re_pad = ' '; 00041 00042 return (0); 00043 } 00044 00045 /* 00046 * CDB___qam_db_close -- 00047 * Queue specific discard of the DB structure. 00048 * 00049 * PUBLIC: int CDB___qam_db_close __P((DB *)); 00050 */ 00051 int 00052 CDB___qam_db_close(dbp) 00053 DB *dbp; 00054 { 00055 QUEUE *t; 00056 00057 t = dbp->q_internal; 00058 00059 CDB___os_free(t, sizeof(QUEUE)); 00060 dbp->q_internal = NULL; 00061 00062 return (0); 00063 }