~noskcaj/ubuntu/trusty/libdmapsharing/2.9.24

« back to all changes in this revision

Viewing changes to libdmapsharing/dmap-utils.h

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2013-06-29 22:28:20 UTC
  • mfrom: (0.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130629222820-pdlil11aktw59fqt
Tags: 2.9.18-1
* New upstream release.
* Update symbols file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include <libdmapsharing/dmap-config.h>
27
27
 
28
 
G_BEGIN_DECLS
29
 
#if DMAP_HAVE_UNALIGNED_ACCESS
30
 
#define _DMAP_GET(__data, __size, __end) \
31
 
    (GUINT##__size##_FROM_##__end (* ((guint##__size *) (__data))))
32
 
#define DMAP_READ_UINT64_BE(data) _DMAP_GET (data, 64, BE)
33
 
#define DMAP_READ_UINT32_BE(data) _DMAP_GET (data, 32, BE)
34
 
#define DMAP_READ_UINT16_BE(data) _DMAP_GET (data, 16, BE)
35
 
#define DMAP_READ_UINT8(data)     (* ((guint8 *) (data)))
36
 
#else
37
 
#define _DMAP_GET(__data, __idx, __size, __shift) \
38
 
    (((guint##__size) (((guint8 *) (__data))[__idx])) << __shift)
39
 
#define DMAP_READ_UINT64_BE(data)  \
40
 
    (_DMAP_GET (data, 0, 64, 56) | \
41
 
     _DMAP_GET (data, 1, 64, 48) | \
42
 
     _DMAP_GET (data, 2, 64, 40) | \
43
 
     _DMAP_GET (data, 3, 64, 32) | \
44
 
     _DMAP_GET (data, 4, 64, 24) | \
45
 
     _DMAP_GET (data, 5, 64, 16) | \
46
 
     _DMAP_GET (data, 6, 64,  8) | \
47
 
     _DMAP_GET (data, 7, 64,  0))
48
 
#define DMAP_READ_UINT32_BE(data) \
49
 
    (_DMAP_GET (data, 0, 32, 24) | \
50
 
     _DMAP_GET (data, 1, 32, 16) | \
51
 
     _DMAP_GET (data, 2, 32,  8) | \
52
 
     _DMAP_GET (data, 3, 32,  0))
53
 
#define DMAP_READ_UINT16_BE(data) \
54
 
    (_DMAP_GET (data, 0, 16,  8) | \
55
 
     _DMAP_GET (data, 1, 16,  0))
56
 
#define DMAP_READ_UINT8(data) (_DMAP_GET (data, 0,  8,  0))
57
 
#endif
58
 
        typedef struct ChunkData
59
 
{
60
 
        SoupServer *server;
61
 
        GInputStream *stream;
62
 
} ChunkData;
63
 
 
64
 
void dmap_write_next_chunk (SoupMessage * message, ChunkData * cd);
65
 
void dmap_chunked_message_finished (SoupMessage * message, ChunkData * cd);
 
28
gchar * dmap_mime_to_format (const gchar * transcode_mimetype);
66
29
 
67
30
G_END_DECLS
68
31
#endif