Feature #514 ยป 0049-registry.-ch-Improve-coding-style.patch
| utility/registry.c | ||
|---|---|---|
| #include <libxml/parser.h> | ||
| #endif /* FREECIV_HAVE_XML_REGISTRY */ | ||
| /* utility */ | ||
| #include "registry_xml.h" | ||
| #include "registry.h" | ||
| ... | ... | |
| } | ||
| /*********************************************************************//** | ||
|   Create a section file from a file.  Returns NULL on error. | ||
|   Create a section file from a file. Returns nullptr on error. | ||
| *************************************************************************/ | ||
| struct section_file *secfile_load(const char *filename, | ||
|                                   bool allow_duplicates) | ||
| ... | ... | |
|   if (fc_stat(filename, &buf) == 0) { | ||
|     xmlDoc *sec_doc; | ||
|     sec_doc = xmlReadFile(filename, NULL, XML_PARSE_NOERROR); | ||
|     if (sec_doc != NULL) { | ||
|     sec_doc = xmlReadFile(filename, nullptr, XML_PARSE_NOERROR); | ||
|     if (sec_doc != nullptr) { | ||
|       return xmlfile_load(sec_doc, filename); | ||
|     } | ||
|   } | ||
| #endif /* FREECIV_HAVE_XML_REGISTRY */ | ||
|   return secfile_load_section(filename, NULL, allow_duplicates); | ||
|   return secfile_load_section(filename, nullptr, allow_duplicates); | ||
| } | ||
| utility/registry.h | ||
|---|---|---|
| /**********************************************************************  | ||
| /*********************************************************************** | ||
|  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold | ||
|    This program is free software; you can redistribute it and/or modify | ||
|    it under the terms of the GNU General Public License as published by | ||
| ... | ... | |
| extern "C" { | ||
| #endif /* __cplusplus */ | ||
| /* utility */ | ||
| #include "shared.h" | ||
| struct section; | ||
| ... | ... | |
| } | ||
| #endif /* __cplusplus */ | ||
| #endif  /* FC__REGISTRY_H */ | ||
| #endif /* FC__REGISTRY_H */ | ||