Home | History | Annotate | Download | only in server
      1 /* Copyright 2017 The Chromium OS Authors. All rights reserved.
      2  * Use of this source code is governed by a BSD-style license that can be
      3  * found in the LICENSE file.
      4  */
      5 #ifndef INIPARSER_WRAPPER_H_
      6 #define INIPARSER_WRAPPER_H_
      7 
      8 #include <iniparser.h>
      9 #include <sys/stat.h>
     10 #include <sys/types.h>
     11 #include <unistd.h>
     12 
     13 static inline dictionary *iniparser_load_wrapper(const char *ini_name)
     14 {
     15 	struct stat st;
     16 	int rc = stat(ini_name, &st);
     17 	if (rc < 0)
     18 		return NULL;
     19 	return iniparser_load(ini_name);
     20 }
     21 
     22 #endif /* INIPARSER_WRAPPER_H_ */
     23