<commit_before>//////////////////////////////////////////////////////////////////////
// config.hpp -- XML Config Data
// Date: Thu Nov 28 08:04:02 2013   (C) datablocks.net
///////////////////////////////////////////////////////////////////////

#ifndef CONFIG_HPP
#define CONFIG_HPP

#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>

struct s_config {
	std::unordered_set<std::string>		builtins;

	struct s_macro_set {
		int				genset;
		std::string			type;
		std::string			format;
		std::vector<std::string>	includes;
		std::vector<std::string> 	macros;
		std::unordered_map<std::string,std::string> alternates;
		std::unordered_map<std::string,long> values;
	};
	std::vector<s_macro_set> macro_sets;

	struct s_basic_types {
		struct s_basic_type {
			unsigned		size;		// Size in bytes of the type
			std::string		ada;		// Ada name for the type
		};
		int				genset;
		std::unordered_map<std::string,s_basic_type> info;
	} basic_types;

	struct s_sys_types {
		struct s_sys_type {
			unsigned		size;		// Size in bytes of the type
			bool			is_unsigned;	// True if the type is unsigned
		};
		int				genset;
		std::vector<std::string>	includes;
		std::unordered_map<std::string,s_sys_type> info;
	} sys_types;

	struct s_section2 {
		int				genset;		

		struct s_func {
			std::string			c_name;		// name=
			std::string			alt_name;	// Alternate Ada name (internal)
			std::string			ada_name;	// ada_name=
			std::string			rname;		// rname=
			std::string			type;		// type="procedure"
			std::string			returns;	// returns=
			bool				finline;	// inline=
			std::vector<std::string>	includes;

			struct s_carg {
				std::string		name;		// name=
				std::string		type;		// type=
				std::string		from;		// src=
			};
			struct s_aarg {
				std::string		name;		// name=
				std::string		type;		// type=
				std::string		io;		// io={in|out|inout}
				std::string		temp;		// temp= (temp var name)
				std::string		tempval;	// tempval= (temp val expression)
				std::string		from;		// from=
				unsigned		argno;
			};
			struct s_temp {
				std::string		name;		// name=
				std::string		type;		// type=
				std::string		init;		// init=
			};
			std::vector<s_carg>		cargs;
			std::vector<s_aarg>		aargs;
			std::vector<s_temp>		temps;
		};
		std::vector<s_func>		funcs;
	} section2;
	
	struct s_structs {
		struct s_member {
			std::string		name;			// Member name
			unsigned		msize;			// Member size
			int			union_struct;		// 1==struct
			unsigned		moffset;		// Member offset
			bool			msigned;		// Member is signed
			unsigned		array;			// Member is array [n]
		};
		struct s_struct {
			int			genset;			// Struct genset #
			std::string		c_name;			// C structure name
			std::string		a_name;			// Name to use in Ada
			std::vector<std::string> includes;
			unsigned		size;			// Struct size in bytes
			std::vector<s_member>	members;
		};
		std::vector<s_struct>		structvec;
	} structs;
};

extern s_config config;

#endif // CONFIG_HPP

// End config.hpp
<commit_msg>Added mtype member to hold struct/union name<commit_after>//////////////////////////////////////////////////////////////////////
// config.hpp -- XML Config Data
// Date: Thu Nov 28 08:04:02 2013   (C) datablocks.net
///////////////////////////////////////////////////////////////////////

#ifndef CONFIG_HPP
#define CONFIG_HPP

#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>

struct s_config {
	std::unordered_set<std::string>		builtins;

	struct s_macro_set {
		int				genset;
		std::string			type;
		std::string			format;
		std::vector<std::string>	includes;
		std::vector<std::string> 	macros;
		std::unordered_map<std::string,std::string> alternates;
		std::unordered_map<std::string,long> values;
	};
	std::vector<s_macro_set> macro_sets;

	struct s_basic_types {
		struct s_basic_type {
			unsigned		size;		// Size in bytes of the type
			std::string		ada;		// Ada name for the type
		};
		int				genset;
		std::unordered_map<std::string,s_basic_type> info;
	} basic_types;

	struct s_sys_types {
		struct s_sys_type {
			unsigned		size;		// Size in bytes of the type
			bool			is_unsigned;	// True if the type is unsigned
		};
		int				genset;
		std::vector<std::string>	includes;
		std::unordered_map<std::string,s_sys_type> info;
	} sys_types;

	struct s_section2 {
		int				genset;		

		struct s_func {
			std::string			c_name;		// name=
			std::string			alt_name;	// Alternate Ada name (internal)
			std::string			ada_name;	// ada_name=
			std::string			rname;		// rname=
			std::string			type;		// type="procedure"
			std::string			returns;	// returns=
			bool				finline;	// inline=
			std::vector<std::string>	includes;

			struct s_carg {
				std::string		name;		// name=
				std::string		type;		// type=
				std::string		from;		// src=
			};
			struct s_aarg {
				std::string		name;		// name=
				std::string		type;		// type=
				std::string		io;		// io={in|out|inout}
				std::string		temp;		// temp= (temp var name)
				std::string		tempval;	// tempval= (temp val expression)
				std::string		from;		// from=
				unsigned		argno;
			};
			struct s_temp {
				std::string		name;		// name=
				std::string		type;		// type=
				std::string		init;		// init=
			};
			std::vector<s_carg>		cargs;
			std::vector<s_aarg>		aargs;
			std::vector<s_temp>		temps;
		};
		std::vector<s_func>		funcs;
	} section2;
	
	struct s_structs {
		struct s_member {
			std::string		tname;			// Type name (if any)
			std::string		name;			// Member name
			unsigned		msize;			// Member size
			int			union_struct;		// 1==struct
			unsigned		moffset;		// Member offset
			bool			msigned;		// Member is signed
			unsigned		array;			// Member is array [n]
		};
		struct s_struct {
			int			genset;			// Struct genset #
			std::string		c_name;			// C structure name
			std::string		a_name;			// Name to use in Ada
			std::vector<std::string> includes;
			unsigned		size;			// Struct size in bytes
			std::vector<s_member>	members;
		};
		std::vector<s_struct>		structvec;
	} structs;
};

extern s_config config;

#endif // CONFIG_HPP

// End config.hpp

{'fraction_non_alphanumeric': 0.1721419185282523, 'fraction_numerical': 0.00492772667542707, 'mean_word_length': 2.4188658057271195, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '40868', 'n_tokens_mistral': 2650, 'n_tokens_neox': 2264, 'n_words': 526}