#define VG_MUST_USE_RESULT __attribute__((warn_unused_result))
#include <stdio.h>
-#include <dirent.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <math.h>
#include <assert.h>
+#include <setjmp.h>
+#include <sys/time.h>
+#include <math.h>
+#include <stdio.h>
+#include <errno.h>
enum strncpy_behaviour{
k_strncpy_always_add_null = 0,
VG_STATIC void vg_strnull( vg_str *str, char *buffer, u32 len )
{
str->buffer = buffer;
+ str->buffer[0] = '\0';
str->i = 0;
str->len = len;
}
return hash;
}
+VG_STATIC int vg_strdjb2_eq( const char *s1, u32 h1,
+ const char *s2, u32 h2 )
+{
+ if( h1 == h2 ){
+ if(!strcmp(s1, s2)) return 1;
+ else return 0;
+ } else return 0;
+}
+
+#define VG_STRDJB2_EQ( CS1, S2, H2 ) \
+ vg_strdjb2_eq( CS1, vg_strdjb2(CS1), S2, H2 )
+
+
#define VG_MIN( A, B ) ((A)<(B)?(A):(B))
#define VG_MAX( A, B ) ((A)>(B)?(A):(B))
#endif