24 return fwrite(ptr, size, nmemb, stream);
29 return fread(ptr, size, nmemb, stream);
40 gtk_progress_set_value(GTK_PROGRESS(Bar), d*100.0/t);
55 outfile = fopen(
"test.curl",
"w");
75 int main(
int argc,
char **argv)
77 GtkWidget *Window, *Frame, *Frame2;
83 gtk_init(&argc, &argv);
84 Window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
85 Frame = gtk_frame_new(
NULL);
86 gtk_frame_set_shadow_type(GTK_FRAME(Frame), GTK_SHADOW_OUT);
87 gtk_container_add(GTK_CONTAINER(Window), Frame);
88 Frame2 = gtk_frame_new(
NULL);
89 gtk_frame_set_shadow_type(GTK_FRAME(Frame2), GTK_SHADOW_IN);
90 gtk_container_add(GTK_CONTAINER(Frame), Frame2);
91 gtk_container_set_border_width(GTK_CONTAINER(Frame2), 5);
92 adj = (GtkAdjustment*)gtk_adjustment_new(0, 0, 100, 0, 0, 0);
93 Bar = gtk_progress_bar_new_with_adjustment(adj);
94 gtk_container_add(GTK_CONTAINER(Frame2),
Bar);
95 gtk_widget_show_all(Window);
98 g_warning(
"can't create the thread");
int main(int argc, char **argv)
size_t my_write_func(void *ptr, size_t size, size_t nmemb, FILE *stream)
CURLcode curl_easy_perform(CURL *curl)
CURLcode curl_easy_setopt(CURL *curl, CURLoption option,...)
void * curl_thread(void *ptr)
size_t my_read_func(void *ptr, size_t size, size_t nmemb, FILE *stream)
int my_progress_func(GtkWidget *Bar, double t, double d, double ultotal, double ulnow)
void curl_easy_cleanup(CURL *curl)
#define CURLOPT_WRITEDATA
CURL * curl_easy_init(void)