netatalk  4.4.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
spotlight.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2012 Frank Lahm <[email protected]>
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#include <stdbool.h>
24
25#include <gio/gio.h>
26
27#ifdef HAVE_TRACKER3
28#include <tracker-sparql.h>
29#else
30#include <tinysparql.h>
31#endif
32
33#include <atalk/globals.h>
34#include <atalk/volume.h>
35#include <atalk/dalloc.h>
36
37/******************************************************************************
38 * Spotlight RPC and marshalling stuff
39 ******************************************************************************/
40
41/* FPSpotlightRPC subcommand codes */
42#define SPOTLIGHT_CMD_OPEN 1
43#define SPOTLIGHT_CMD_FLAGS 2
44#define SPOTLIGHT_CMD_RPC 3
45#define SPOTLIGHT_CMD_OPEN2 4
46
47/* Can be ored and used as flags */
48#define SL_ENC_LITTLE_ENDIAN 1
49#define SL_ENC_BIG_ENDIAN 2
50#define SL_ENC_UTF_16 4
51
55typedef int sl_nil_t;
56typedef bool sl_bool_t;
57typedef struct timeval sl_time_t;
58typedef struct {
59 char sl_uuid[16];
60} sl_uuid_t;
61typedef struct {
62 uint16_t ca_unkn1;
63 uint32_t ca_context;
65} sl_cnids_t;
66
67/******************************************************************************
68 * Some helper stuff dealing with queries
69 ******************************************************************************/
70
82
89
109
110struct sl_ctx {
111 TrackerSparqlConnection *tracker_con;
112 GCancellable *cancellable;
113 GMainLoop *mainloop;
115};
116
117/******************************************************************************
118 * Function declarations
119 ******************************************************************************/
120
121extern int spotlight_init(AFPObj *obj);
122extern int afp_spotlight_rpc(AFPObj *obj, char *ibuf, size_t ibuflen _U_,
123 char *rbuf, size_t *rbuflen);
124extern int sl_pack(DALLOC_CTX *query, char *buf);
125extern int sl_unpack(DALLOC_CTX *query, const char *buf);
126extern void configure_spotlight_attributes(const char *attributes);
127
128#endif /* SPOTLIGHT_H */
static size_t rbuflen
Definition afpfunc_helpers.c:45
static char rbuf[rbufsize]
Definition afpfunc_helpers.c:44
static char buf[MAXPATHLEN+1]
Definition afppasswd.c:75
static AFPObj obj
Definition netatalk.c:62
void configure_spotlight_attributes(const char *attributes)
Definition sparql_map.c:107
bool sl_bool_t
Definition spotlight.h:56
int spotlight_init(AFPObj *obj)
Definition spotlight.c:1309
int sl_pack(DALLOC_CTX *query, char *buf)
Definition spotlight_marshalling.c:852
DALLOC_CTX sl_array_t
Definition spotlight.h:52
int sl_nil_t
Definition spotlight.h:55
struct timeval sl_time_t
Definition spotlight.h:57
DALLOC_CTX sl_dict_t
Definition spotlight.h:53
struct _slq_t slq_t
int sl_unpack(DALLOC_CTX *query, const char *buf)
Definition spotlight_marshalling.c:880
DALLOC_CTX sl_filemeta_t
Definition spotlight.h:54
int afp_spotlight_rpc(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
Definition spotlight.c:1364
slq_state_t
Definition spotlight.h:72
@ SLQ_STATE_NEW
Definition spotlight.h:73
@ SLQ_STATE_RUNNING
Definition spotlight.h:74
@ SLQ_STATE_CANCELLED
Definition spotlight.h:79
@ SLQ_STATE_DONE
Definition spotlight.h:77
@ SLQ_STATE_CANCEL_PENDING
Definition spotlight.h:78
@ SLQ_STATE_RESULTS
Definition spotlight.h:75
@ SLQ_STATE_FULL
Definition spotlight.h:76
@ SLQ_STATE_ERROR
Definition spotlight.h:80
Definition spotlight.h:91
uint64_t slq_ctx1
Definition spotlight.h:98
AFPObj * slq_obj
Definition spotlight.h:94
sl_array_t * slq_reqinfo
Definition spotlight.h:100
bool slq_allow_expr
Definition spotlight.h:105
uint64_t * slq_cnids
Definition spotlight.h:102
const struct vol * slq_vol
Definition spotlight.h:95
char * slq_scope
Definition spotlight.h:96
struct sl_rslts * query_results
Definition spotlight.h:107
slq_state_t slq_state
Definition spotlight.h:93
time_t slq_time
Definition spotlight.h:97
uint64_t slq_ctx2
Definition spotlight.h:99
const char * slq_qstring
Definition spotlight.h:101
size_t slq_cnids_num
Definition spotlight.h:103
struct list_head slq_list
Definition spotlight.h:92
void * tracker_cursor
Definition spotlight.h:104
uint64_t slq_result_limit
Definition spotlight.h:106
Definition globals.h:154
Definition dalloc.h:25
Definition include/atalk/list.h:18
Definition spotlight.h:61
DALLOC_CTX * ca_cnids
Definition spotlight.h:64
uint32_t ca_context
Definition spotlight.h:63
uint16_t ca_unkn1
Definition spotlight.h:62
Definition spotlight.h:110
slq_t * query_list
Definition spotlight.h:114
GCancellable * cancellable
Definition spotlight.h:112
GMainLoop * mainloop
Definition spotlight.h:113
TrackerSparqlConnection * tracker_con
Definition spotlight.h:111
Definition spotlight.h:84
int num_results
Definition spotlight.h:85
sl_cnids_t * cnids
Definition spotlight.h:86
sl_array_t * fm_array
Definition spotlight.h:87
Definition spotlight.h:58
char sl_uuid[16]
Definition spotlight.h:59
Definition include/atalk/volume.h:30