"Fossies" - the Fresh Open Source Software Archive

Member "opendnssec-2.1.4/enforcer/src/db/database_version_ext.c" (16 May 2019, 2195 Bytes) of package /linux/misc/dns/opendnssec-2.1.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "database_version_ext.c" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (c) 2014 Jerry Lundström <lundstrom.jerry@gmail.com>
    3  * Copyright (c) 2014 .SE (The Internet Infrastructure Foundation).
    4  * Copyright (c) 2014 OpenDNSSEC AB (svb)
    5  * All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions
    9  * are met:
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  * 2. Redistributions in binary form must reproduce the above copyright
   13  *    notice, this list of conditions and the following disclaimer in the
   14  *    documentation and/or other materials provided with the distribution.
   15  *
   16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   19  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
   20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
   22  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
   24  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
   25  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
   26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   27  *
   28  */
   29 
   30 #include "database_version.h"
   31 
   32 int database_version_get_version(db_connection_t* connection) {
   33     database_version_list_t* database_version_list;
   34     const database_version_t* database_version;
   35     int ret;
   36 
   37     if (!(database_version_list = database_version_list_new_get(connection))
   38         || !(database_version = database_version_list_next(database_version_list)))
   39     {
   40         database_version_list_free(database_version_list);
   41         return 0;
   42     }
   43     ret = database_version_version(database_version);
   44     if (database_version_list_next(database_version_list)) {
   45         database_version_list_free(database_version_list);
   46         return 0;
   47     }
   48     database_version_list_free(database_version_list);
   49     return ret;
   50 }