-/* Copyright (c) 2006-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid_dtd.c"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF parsing module");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(platf_parse, ker_platform, "Logging specific to the parsing of platform files");
std::string surf_parsed_filename; // Currently parsed file (for the error messages)
-std::vector<simgrid::s4u::LinkInRoute> parsed_link_list; /* temporary store of current link list of a route */
+static std::vector<simgrid::s4u::LinkInRoute> parsed_link_list; /* temporary store of current link list of a route */
/* Helping functions */
void surf_parse_assert(bool cond, const std::string& msg)
/* make sure these symbols are defined as strong ones in this file so that the linker can resolve them */
-std::vector<std::unordered_map<std::string, std::string>> property_sets;
+static std::vector<std::unordered_map<std::string, std::string>> property_sets;
-FILE *surf_file_to_parse = nullptr;
+static FILE* surf_file_to_parse = nullptr;
/* Stuff relative to storage */
void STag_surfxml_storage()
"available in the tools/ directory of the source archive.\n"
"Please check also out the SURF section of the ChangeLog for "
- "the 3.1 version for more information. \n"
-
- "Last, do not forget to also update your values for "
- "the calls to MSG_task_create (if any).");
+ "the 3.1 version for more information.");
surf_parse_assert(version >= 300L, "******* BIG FAT WARNING *********\n "
"You're using an old XML file.\n"
"Use simgrid_update_xml to update your file automatically. "
void ETag_surfxml_model___prop(){/* Nothing to do */}
/* Open and Close parse file */
-YY_BUFFER_STATE surf_input_buffer;
+static YY_BUFFER_STATE surf_input_buffer;
void surf_parse_open(const std::string& file)
{
surf_parsed_filename = file;
std::string dir = simgrid::xbt::Path(file).get_dir_name();
- surf_path.push_back(dir);
+ simgrid::xbt::path_push(dir);
- surf_file_to_parse = surf_fopen(file, "r");
+ surf_file_to_parse = simgrid::xbt::path_fopen(file, "r");
if (surf_file_to_parse == nullptr)
throw std::invalid_argument("Unable to open '" + file + "' from '" + simgrid::xbt::Path().get_name() +
"'. Does this file exist?");
void surf_parse_close()
{
- surf_path.pop_back(); // remove the dirname of the opened file, that was added in surf_parse_open()
+ simgrid::xbt::path_pop(); // remove the dirname of the opened file, that was added in surf_parse_open()
if (surf_file_to_parse) {
surf_parse__delete_buffer(surf_input_buffer);