2 * Copyright (C) 2012 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/>.
31 static QuviError
_get(_quvi_t q
, const QuviInfo n
, ...)
42 type
= QUVI_INFO_TYPE_MASK
& (gint
) n
;
52 case QUVI_INFO_TYPE_LONG
:
53 lp
= va_arg(arg
, glong
*);
55 rc
= QUVI_ERROR_INVALID_ARG
;
57 case QUVI_INFO_TYPE_VOID
:
58 vp
= va_arg(arg
, gpointer
*);
60 rc
= QUVI_ERROR_INVALID_ARG
;
62 case QUVI_INFO_TYPE_DOUBLE
:
63 dp
= va_arg(arg
, gdouble
*);
65 rc
= QUVI_ERROR_INVALID_ARG
;
67 case QUVI_INFO_TYPE_STRING
:
68 sp
= va_arg(arg
, gchar
**);
70 rc
= QUVI_ERROR_INVALID_ARG
;
73 rc
= QUVI_ERROR_INVALID_ARG
;
83 case QUVI_INFO_RESPONSE_CODE
:
84 *lp
= q
->status
.resp_code
;
86 case QUVI_INFO_CURL_HANDLE
:
90 rc
= QUVI_ERROR_INVALID_ARG
;
96 /** @brief Return information about the library handle
97 @sa @ref getting_started
100 void quvi_get(quvi_t handle
, QuviInfo info
, ...)
106 /* If G_DISABLE_CHECKS is defined then the check is not performed. */
107 g_return_if_fail(handle
!= NULL
);
110 p
= va_arg(arg
, gpointer
);
113 q
= (_quvi_t
) handle
;
114 q
->status
.rc
= _get(q
, info
, p
);
117 /* vim: set ts=2 sw=2 tw=72 expandtab: */