+struct libustd_callbacks *new_callbacks()
+{
+ struct libustd_callbacks *callbacks =
+ zmalloc(sizeof(struct libustd_callbacks));
+
+ if(!callbacks)
+ return NULL;
+
+ callbacks->on_open_buffer = on_open_buffer;
+ callbacks->on_close_buffer = on_close_buffer;
+ callbacks->on_read_subbuffer = on_read_subbuffer;
+ callbacks->on_read_partial_subbuffer = on_read_partial_subbuffer;
+ callbacks->on_put_error = on_put_error;
+ callbacks->on_new_thread = NULL;
+ callbacks->on_close_thread = NULL;
+ callbacks->on_trace_end = NULL;
+
+ return callbacks;
+
+}
+
+int is_directory(const char *dir)