]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/spotlight.h
Move marshalling functions in own file
[netatalk.git] / etc / afpd / spotlight.h
1 /*
2   Copyright (c) 2012 Frank Lahm <franklahm@gmail.com>
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU General Public License as published by
6   the Free Software Foundation; either version 2 of the License, or
7   (at your option) any later version.
8
9   This program 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
12   GNU General Public License for more details.
13 */
14
15 #ifdef HAVE_CONFIG_H
16 #include "config.h"
17 #endif /* HAVE_CONFIG_H */
18
19 #ifndef SPOTLIGHT_H
20 #define SPOTLIGHT_H
21
22 #include <stdint.h>
23
24 #include <atalk/dalloc.h>
25 #include <atalk/globals.h>
26
27 /* FPSpotlightRPC subcommand codes */
28 #define SPOTLIGHT_CMD_OPEN    1
29 #define SPOTLIGHT_CMD_FLAGS   2
30 #define SPOTLIGHT_CMD_RPC     3
31 #define SPOTLIGHT_CMD_OPEN2   4
32
33 /* Can be ored and used as flags */
34 #define SL_ENC_LITTLE_ENDIAN 1
35 #define SL_ENC_BIG_ENDIAN    2
36 #define SL_ENC_UTF_16        4
37
38 typedef DALLOC_CTX     sl_array_t;    /* an array of elements                                           */
39 typedef DALLOC_CTX     sl_dict_t;     /* an array of key/value elements                                 */
40 typedef DALLOC_CTX     sl_filemeta_t; /* contains one sl_array_t                                        */
41 typedef int            sl_nil_t;      /* a nil element                                                  */
42 typedef bool           sl_bool_t;     /* a boolean, we avoid bool_t as it's a define for something else */
43 typedef struct timeval sl_time_t;     /* a boolean, we avoid bool_t as it's a define for something else */
44 typedef struct {
45     char sl_uuid[16];
46 }                      sl_uuid_t;     /* a UUID                                                         */
47 typedef struct {
48     uint16_t   ca_unkn1;
49     uint32_t   ca_context;
50     DALLOC_CTX *ca_cnids;
51 }                      sl_cnids_t;    /* an array of CNID                                               */
52
53 extern int afp_spotlight_rpc(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen);
54 extern int sl_pack(DALLOC_CTX *query, char *buf);
55 extern int sl_unpack(DALLOC_CTX *query, const char *buf);
56
57 #endif /* SPOTLIGHT_H */