Merge branch 'fastpath' of git://git.bro-ids.org/bro into fastpath

This commit is contained in:
Jon Siwek 2012-07-24 11:27:05 -05:00
commit d6da8365f5
3 changed files with 13 additions and 2 deletions

View file

@ -74,7 +74,7 @@ public:
struct ReaderInfo struct ReaderInfo
{ {
// Structure takes ownership of the strings. // Structure takes ownership of the strings.
typedef std::map<const char*, const char*> config_map; typedef std::map<const char*, const char*, CompareString> config_map;
/** /**
* A string left to the interpretation of the reader * A string left to the interpretation of the reader

View file

@ -49,7 +49,7 @@ public:
struct WriterInfo struct WriterInfo
{ {
// Structure takes ownership of these strings. // Structure takes ownership of these strings.
typedef std::map<const char*, const char*> config_map; typedef std::map<const char*, const char*, CompareString> config_map;
/** /**
* A string left to the interpretation of the writer * A string left to the interpretation of the writer

View file

@ -345,4 +345,15 @@ inline int safe_vsnprintf(char* str, size_t size, const char* format, va_list al
extern void get_memory_usage(unsigned int* total, extern void get_memory_usage(unsigned int* total,
unsigned int* malloced); unsigned int* malloced);
// class to be used as a third argument for stl maps to be able to use
// char*'s as keys. Otherwise the pointer values will be compared instead
// of the actual string values.
struct CompareString
{
bool operator()(char const *a, char const *b) const
{
return std::strcmp(a, b) < 0;
}
};
#endif #endif