net_data* -> net_buffer*

Remove some debug traces


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3324 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2003-05-26 00:27:18 +00:00
parent 0a936c017d
commit 5a52a89c28
2 changed files with 18 additions and 18 deletions

View File

@ -34,17 +34,17 @@ void my_free2(void * prompt, ...) // void * ptr)
free(ptr); free(ptr);
} }
int test_data() int test_buffer()
{ {
net_data *data; net_buffer *buffer;
char buffer[128]; char data[128];
size_t len; size_t len;
char *tata; char *tata;
char *titi; char *titi;
char *toto; char *toto;
char *tutu; char *tutu;
puts("test_data():"); puts("test_buffer():");
tata = (char *) malloc(16); tata = (char *) malloc(16);
strcpy(tata, "0123456789"); strcpy(tata, "0123456789");
@ -58,22 +58,22 @@ int test_data()
tutu = (char *) malloc(16); tutu = (char *) malloc(16);
strcpy(tutu, "hello there!"); strcpy(tutu, "hello there!");
data = g_stack->new_data(); buffer = g_stack->new_buffer();
g_stack->append_data(data, titi, 6, my_free); g_stack->add_to_buffer(buffer, BUFFER_END, titi, 6, my_free);
g_stack->prepend_data(data, tata, 10, my_free); g_stack->add_to_buffer(buffer, 0, tata, 10, my_free);
g_stack->add_data_free_node(data, tutu, (void *) "hello there", my_free2); g_stack->attach_buffer_free_element(buffer, tutu, (void *) "hello there", my_free2);
g_stack->insert_data(data, 5, toto, 26, my_free); g_stack->add_to_buffer(buffer, 5, toto, 26, my_free);
g_stack->prepend_data(data, "this is a net_data test: ", 25, NULL); g_stack->add_to_buffer(buffer, 0, "this is a net_buffer test: ", 27, NULL);
g_stack->dump_data(data); g_stack->dump_buffer(buffer);
len = g_stack->copy_from_data(data, 2, buffer, 128); len = g_stack->read_buffer(buffer, 2, data, sizeof(data));
buffer[len] = 0; data[len] = 0;
printf("buffer = [%s]\n", buffer); printf("data = [%s]\n", data);
g_stack->delete_data(data, false); g_stack->delete_buffer(buffer, false);
return 0; return 0;
} }
@ -99,7 +99,7 @@ int main(int argc, char **argv)
fflush(stdin); fflush(stdin);
fgetc(stdin);; fgetc(stdin);;
test_data(); test_buffer();
g_stack->stop(); g_stack->stop();
}; };

View File

@ -94,7 +94,7 @@ _EXPORT status_t get_module(const char * name, module_info ** mi)
status_t status; status_t status;
module * m; module * m;
printf("get_module(%s)\n", name); // printf("get_module(%s)\n", name);
m = find_loaded_module_by_name(name); m = find_loaded_module_by_name(name);
if (!m) if (!m)
@ -126,7 +126,7 @@ _EXPORT status_t put_module(const char * name)
{ {
module * m; module * m;
printf("put_module(%s)\n", name); // printf("put_module(%s)\n", name);
m = find_loaded_module_by_name(name); m = find_loaded_module_by_name(name);
if (!m) if (!m)