![]() |
![]() |
![]() |
geocode-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <geocode-glib/geocode-ipclient.h> struct GeocodeIpclient; struct GeocodeIpclientClass; GeocodeIpclient * geocode_ipclient_new (void
); GeocodeIpclient * geocode_ipclient_new_for_ip (const char *str
); void geocode_ipclient_search_async (GeocodeIpclient *ipclient
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); GeocodeLocation * geocode_ipclient_search_finish (GeocodeIpclient *ipclient
,GAsyncResult *res
,GError **error
); GeocodeLocation * geocode_ipclient_search (GeocodeIpclient *ipclient
,GError **error
);
"compatibility-mode" gboolean : Read / Write / Construct "server" gchar* : Read / Write / Construct
struct GeocodeIpclient;
All the fields in the GeocodeIpclient structure are private and should never be accessed directly.
struct GeocodeIpclientClass { };
All the fields in the GeocodeIpclientClass structure are private and should never be accessed directly.
GeocodeIpclient * geocode_ipclient_new (void
);
Creates a new GeocodeIpclient to fetch the geolocation data.
Here the IP address is not provided the by client, hence the server
will try to get the IP address from various proxy variables.
Use geocode_ipclient_search_async()
to query the server
Returns : |
a new GeocodeIpclient. Use g_object_unref() when done. |
GeocodeIpclient * geocode_ipclient_new_for_ip (const char *str
);
Creates a new GeocodeIpclient to fetch the geolocation data
Use geocode_ipclient_search_async()
to query the server
|
The IP address |
Returns : |
a new GeocodeIpclient. Use g_object_unref() when done. |
void geocode_ipclient_search_async (GeocodeIpclient *ipclient
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously performs a query to get the geolocation information
from the server. Use geocode_ipclient_search()
to do the same
thing synchronously.
When the operation is finished, callback
will be called. You can then call
geocode_ipclient_search_finish()
to get the result of the operation.
|
a GeocodeIpclient representing a query |
|
optional GCancellable forward, NULL to ignore. |
|
a GAsyncReadyCallback to call when the request is satisfied |
|
the data to pass to callback function |
GeocodeLocation * geocode_ipclient_search_finish (GeocodeIpclient *ipclient
,GAsyncResult *res
,GError **error
);
Finishes a geolocation search operation. See geocode_ipclient_search_async()
.
|
a GeocodeIpclient representing a query |
|
a GAsyncResult |
|
a GError |
Returns : |
A GeocodeLocation object or NULL in case of
errors. Free the returned object with g_object_unref() when done. [transfer full]
|
GeocodeLocation * geocode_ipclient_search (GeocodeIpclient *ipclient
,GError **error
);
Gets the geolocation data for an IP address from the server.
|
a GeocodeIpclient representing a query |
|
a GError |
Returns : |
A GeocodeLocation object or NULL in case of
errors. Free the returned object with g_object_unref() when done. [transfer full]
|