Initial skeleton of new Broxygen infrastructure.

Doesn't generate any docs, but it's hooked in to all places needed to
gather the necessary stuff w/ significantly less coupling than before.

The gathering now always occurs unconditionally to make documentation
available at runtime and a command line switch (-X) only toggles whether
to output docs to disk (reST format).

Should also improve the treatment of type name aliasing which wasn't a
big problem in practice before, but I think it's more correct now:
there's now a distinct BroType for each alias, but extensible types
(record/enum) will automatically update the types for aliases on redef.

Other misc refactoring of note:

    - Removed a redundant/unused way of declaring event types.

    - Changed type serialization format/process to preserve type name
      information and remove compatibility code (since broccoli will
      have be updated anyway).
This commit is contained in:
Jon Siwek 2013-10-03 10:42:04 -05:00
parent eeaf3e9baf
commit 5a857a6dfc
18 changed files with 393 additions and 838 deletions

View file

@ -1060,11 +1060,9 @@ void get_script_subpath(const std::string& full_filename, const char** subpath)
*subpath = normalize_path(my_subpath.c_str());
}
extern string current_scanned_file_path;
FILE* search_for_file(const char* filename, const char* ext,
const char** full_filename, bool load_pkgs,
const char** bropath_subpath)
const char** bropath_subpath, string prepend_to_search_path)
{
// If the file is a literal absolute path we don't have to search,
// just return the result of trying to open it. If the file is
@ -1088,9 +1086,9 @@ FILE* search_for_file(const char* filename, const char* ext,
// Prepend the currently loading script's path to BROPATH so that
// @loads can be referenced relatively.
if ( current_scanned_file_path != "" && filename[0] == '.' )
if ( ! prepend_to_search_path.empty() && filename[0] == '.' )
safe_snprintf(path, sizeof(path), "%s:%s",
current_scanned_file_path.c_str(), bro_path());
prepend_to_search_path.c_str(), bro_path());
else
safe_strncpy(path, bro_path(), sizeof(path));