1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/gmyth/tests/http.c Fri Jan 12 11:58:01 2007 +0000
1.3 @@ -0,0 +1,26 @@
1.4 +#include <glib-object.h>
1.5 +#include "gmyth.h"
1.6 +
1.7 +int
1.8 +main (int args, const char **argv)
1.9 +{
1.10 + GMythBackendInfo *backend_info;
1.11 + g_type_init ();
1.12 + g_thread_init (NULL);
1.13 +
1.14 + backend_info = gmyth_backend_info_new ();
1.15 +
1.16 + gmyth_backend_info_set_hostname (backend_info, "localhost");
1.17 + gmyth_backend_info_set_port (backend_info, 6543);
1.18 +
1.19 + GMythHttp *gmyth_http = gmyth_http_new();
1.20 + gmyth_http->backend_info = backend_info;
1.21 +
1.22 + GString *command = g_string_new(argv[1]);
1.23 +
1.24 + GString *result = gmyth_http_request(gmyth_http, command);
1.25 +
1.26 + printf("%s", result->str);
1.27 +
1.28 + return 0;
1.29 +}