2 * Copyright (C) 2012-2013 Toni Gundogdu <legatvs@gmail.com>
4 * This file is part of libquvi <http://quvi.sourceforge.net/>.
6 * This library is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Affero General Public
8 * License as published by the Free Software Foundation, either
9 * version 3 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General
17 * Public License along with this library. If not, see
18 * <http://www.gnu.org/licenses/>.
25 #include <glib/gi18n-lib.h>
34 static gpointer
_quvi_new()
36 _quvi_t q
= g_new0(struct _quvi_s
, 1);
37 q
->opt
.user_agent
= g_string_new(NULL
);
38 q
->status
.errmsg
= g_string_new(NULL
);
43 extern QuviError
m_scan_scripts(_quvi_t q
);
44 extern QuviError
l_init(_quvi_t q
);
45 extern QuviError
c_init(_quvi_t q
);
46 extern QuviError
g_init();
49 /** @brief Create a new library handle
50 @return New handle, @ref quvi_free it when done using it
51 @note Use @ref quvi_ok for checking if an error occurred
52 @sa @ref getting_started
59 bindtextdomain(GETTEXT_PACKAGE
, LOCALEDIR
);
62 q
->status
.rc
= l_init(q
);
64 if (q
->status
.rc
== QUVI_OK
)
65 q
->status
.rc
= m_scan_scripts(q
);
67 if (q
->status
.rc
== QUVI_OK
)
68 q
->status
.rc
= c_init(q
);
70 if (q
->status
.rc
== QUVI_OK
)
71 q
->status
.rc
= g_init();
73 if (q
->status
.rc
== QUVI_OK
)
75 q
->handle
.proxy
= px_proxy_factory_new();
76 if (q
->handle
.proxy
== NULL
)
77 q
->status
.rc
= QUVI_ERROR_PROXY_INIT
;
82 /* vim: set ts=2 sw=2 tw=72 expandtab: */