d_finddb.c

Go to the documentation of this file.
00001 #include <stdlib.h>
00002 #include <grass/dbmi.h>
00003 #include "macros.h"
00004 #include "dbstubs.h"
00005 
00012 int
00013 db_d_find_database()
00014 {
00015     dbHandle handle;
00016     int found;
00017     int stat;
00018 
00019 /* get the arg(s) */
00020     db_init_handle (&handle);
00021     DB_RECV_HANDLE(&handle);
00022     
00023 /* call the procedure */
00024     stat = db_driver_find_database (&handle, &found);
00025 
00026 
00027 /* send the return code */
00028     if (stat != DB_OK)
00029     {
00030         db_free_handle (&handle);
00031         DB_SEND_FAILURE();
00032         return DB_OK;
00033     }
00034     DB_SEND_SUCCESS();
00035 
00036 /* send results */
00037     DB_SEND_INT(found);
00038     if (found)
00039     {
00040         DB_SEND_HANDLE (&handle);
00041     }
00042     db_free_handle (&handle);
00043     return DB_OK;
00044 }

Generated on Sun Apr 6 17:31:38 2008 for GRASS by  doxygen 1.5.5