#define vg_list_size( A ) (sizeof(A)/sizeof(A[0]))
#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>
+
enum strncpy_behaviour{
k_strncpy_always_add_null = 0,
k_strncpy_allow_cutoff = 1,
if( str->buffer[str->i -1] == '\0' ) return 1;
else return 0;
}
- else{
- str->buffer[ str->i ++ ] = '\0';
- return 1;
+ else return 1;
+}
+
+VG_STATIC char *vg_strch( vg_str *str, char c )
+{
+ char *ptr = NULL;
+ for( u32 i=0; i<str->i; i++ ){
+ if( str->buffer[i] == c )
+ ptr = str->buffer+i;
}
+
+ return ptr;
}
VG_STATIC u32 vg_strdjb2( const char *str )
return hash;
}
-#include <stdio.h>
-#include <dirent.h>
-#include <string.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <math.h>
-#include <assert.h>
-
#define VG_MIN( A, B ) ((A)<(B)?(A):(B))
#define VG_MAX( A, B ) ((A)>(B)?(A):(B))
#endif