src/api/: Use intended license header
[libquvi.git] / src / api / resolve_new.c
blob9df33a54bf0248e76840f37becc8060c2767a222
1 /* libquvi
2 * Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301 USA
20 /** @file resolve_new.c */
22 #include "config.h"
24 #include <glib.h>
26 #include "quvi.h"
27 /* -- */
28 #include "_quvi_s.h"
29 #include "_quvi_net_resolve_s.h"
30 /* -- */
31 #include "misc/resolve.h"
32 #include "net/resolve.h"
33 #include "net/handle.h"
35 /** @brief Resolve URL redirection
36 @return New handle, @ref quvi_resolve_free it when done using it
37 @note Use @ref quvi_ok for checking if an error occurred
38 @ingroup resolve
40 quvi_resolve_t quvi_resolve_new(quvi_t handle, const char *url)
42 _quvi_net_resolve_t r;
43 _quvi_t q;
45 /* If G_DISABLE_CHECKS is defined then the check is not performed. */
46 g_return_val_if_fail(handle != NULL, NULL);
47 g_return_val_if_fail(url != NULL, NULL);
49 q = (_quvi_t) handle;
50 r = n_resolve_new(q, url);
52 m_resolve(q, url, r->url.dst);
54 return (r);
57 /* vim: set ts=2 sw=2 tw=72 expandtab: */