/usr/include/libdmapsharing-3.0/libdmapsharing/dmap-connection.h is in libdmapsharing-3.0-dev 2.9.34-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | /*
* Copyright (C) 2004,2005 Charles Schmidt <cschmidt2@emich.edu>
* Copyright (C) 2006 INDT
* Andre Moreira Magalhaes <andre.magalhaes@indt.org.br>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __DMAP_CONNECTION_H
#define __DMAP_CONNECTION_H
#include <glib.h>
#include <glib-object.h>
#include <libsoup/soup.h>
#include <libdmapsharing/dmap-structure.h>
#include <libdmapsharing/dmap-db.h>
#include <libdmapsharing/dmap-record-factory.h>
G_BEGIN_DECLS typedef struct
{
char *name;
int id;
GList *uris;
} DMAPPlaylist;
/**
* DMAP_TYPE_CONNECTION:
*
* The type for #DMAPConnection.
*/
#define DMAP_TYPE_CONNECTION (dmap_connection_get_type ())
/**
* DMAP_CONNECTION:
* @o: Object which is subject to casting.
*
* Casts a #DMAPConnection or derived pointer into a (DMAPConnection *) pointer.
* Depending on the current debugging level, this function may invoke
* certain runtime checks to identify invalid casts.
*/
#define DMAP_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DMAP_TYPE_CONNECTION, DMAPConnection))
/**
* DMAP_CONNECTION_CLASS:
* @k: a valid #DMAPConnectionClass
*
* Casts a derived #DMAPConnectionClass structure into a #DMAPConnectionClass
* structure.
*/
#define DMAP_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), DMAP_TYPE_CONNECTION, DMAPConnectionClass))
/**
* IS_DMAP_CONNECTION:
* @o: Instance to check for being a %DMAP_TYPE_CONNECTION.
*
* Checks whether a valid #GTypeInstance pointer is of type %DMAP_TYPE_CONNECTION.
*/
#define IS_DMAP_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DMAP_TYPE_CONNECTION))
/**
* IS_DMAP_CONNECTION_CLASS:
* @k: a #DMAPConnectionClass
*
* Checks whether @k "is a" valid #DMAPConnectionClass structure of type
* %DMAP_CONNECTION or derived.
*/
#define IS_DMAP_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DMAP_TYPE_CONNECTION))
/**
* DMAP_CONNECTION_GET_CLASS:
* @o: a #DMAPConnection instance.
*
* Get the class structure associated to a #DMAPConnection instance.
*
* Returns: pointer to object class structure.
*/
#define DMAP_CONNECTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DMAP_TYPE_CONNECTION, DMAPConnectionClass))
typedef struct DMAPConnectionPrivate DMAPConnectionPrivate;
typedef enum
{
DMAP_GET_INFO = 0,
DMAP_LOGIN,
DMAP_GET_REVISION_NUMBER,
DMAP_GET_DB_INFO,
DMAP_GET_SONGS,
DMAP_GET_PLAYLISTS,
DMAP_GET_PLAYLIST_ENTRIES,
DMAP_LOGOUT,
DMAP_DONE
} DMAPConnectionState;
typedef struct
{
GObject parent;
DMAPConnectionPrivate *priv;
} DMAPConnection;
typedef struct
{
GObjectClass parent;
/* Pure virtual methods: */
DMAPContentCode (*get_protocol_version_cc) (DMAPConnection *
connection);
gchar *(*get_query_metadata) (DMAPConnection * connection);
DMAPRecord *(*handle_mlcl) (DMAPConnection * connection,
DMAPRecordFactory * factory, GNode * mlcl,
gint * item_id);
SoupMessage *(*build_message)
(DMAPConnection * connection,
const gchar * path,
gboolean need_hash,
gdouble version, gint req_id, gboolean send_close);
void (*connected) (DMAPConnection * connection);
void (*disconnected) (DMAPConnection * connection);
char *(*authenticate) (DMAPConnection * connection, const char *name);
void (*connecting) (DMAPConnection * connection,
DMAPConnectionState state, float progress);
void (*operation_done) (DMAPConnection * connection);
} DMAPConnectionClass;
/* hmm, maybe should give more error information? */
typedef gboolean (*DMAPConnectionCallback) (DMAPConnection * connection,
gboolean result,
const char *reason,
gpointer user_data);
typedef void (*DMAPResponseHandler) (DMAPConnection * connection,
guint status,
GNode * structure, gpointer user_data);
GType dmap_connection_get_type (void);
gboolean dmap_connection_is_connected (DMAPConnection * connection);
void dmap_connection_setup (DMAPConnection * connection);
void dmap_connection_connect (DMAPConnection * connection,
DMAPConnectionCallback callback,
gpointer user_data);
void dmap_connection_disconnect (DMAPConnection * connection,
DMAPConnectionCallback callback,
gpointer user_data);
SoupMessageHeaders *dmap_connection_get_headers (DMAPConnection * connection,
const char *uri);
GSList *dmap_connection_get_playlists (DMAPConnection * connection);
SoupMessage *dmap_connection_build_message (DMAPConnection * connection,
const gchar * path,
gboolean need_hash,
gdouble version,
gint req_id, gboolean send_close);
/**
* dmap_connection_authenticate_message:
* @connection: A #DMAPConnection
* @session: A #SoupSession
* @message: A #SoupMessage
* @auth: A #SoupAuth
* @password: A password
*
* Attach an authentication credential to a request. This
* method should be called by a function that is connected to the
* #DMAPConnection::authenticate signal. The signal will provide the
* connection, session, message and auth to that function. That function
* should obtain a password and provide it to this method.
*/
void dmap_connection_authenticate_message (DMAPConnection *connection,
SoupSession *session,
SoupMessage *message,
SoupAuth *auth,
const char *password);
gboolean dmap_connection_get (DMAPConnection * self,
const gchar * path,
gboolean need_hash,
DMAPResponseHandler handler,
gpointer user_data);
G_END_DECLS
#endif /* __DMAP_CONNECTION_H */
|