1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; -*- */
5 * Copyright (C) 2005 Novell, Inc.
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included in
18 * all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
29 #ifndef __BEAGLE_PRIVATE_H
30 #define __BEAGLE_PRIVATE_H
32 #include "beagle-hit.h"
33 #include "beagle-queryable-status.h"
34 #include "beagle-scheduler-information.h"
35 #include "beagle-parser.h"
36 #include "beagle-query-part.h"
37 #include "beagle-indexable.h"
38 #include "beagle-request.h"
39 #include "beagle-error-response.h"
40 #include "beagle-search-term-response.h"
41 #include "beagle-timestamp.h"
48 BeagleTimestamp
*timestamp
;
58 struct _BeagleProperty
{
62 BeaglePropertyType type
;
68 struct _BeagleQueryableStatus
{
73 BeagleQueryableState state
;
78 struct _BeagleSchedulerInformation
{
83 GSList
*pending_task
; /* Of string */
84 GSList
*future_task
; /* Of string */
85 GSList
*blocked_task
; /* Of string */
88 BeagleHit
*_beagle_hit_new (void);
90 BeagleQueryableStatus
*_beagle_queryable_status_new (void);
92 BeagleSchedulerInformation
*_beagle_scheduler_information_new (void);
94 void _beagle_hit_set_property (BeagleHit
*hit
, const char *name
, const char *value
);
96 void _beagle_hit_list_free (GSList
*list
);
98 void _beagle_response_class_set_parser_handlers (BeagleResponseClass
*klass
,
99 BeagleParserHandler
*handlers
);
101 int _beagle_property_compare (BeagleProperty
*prop_a
, BeagleProperty
*prop_b
);
102 int _beagle_property_key_compare (BeagleProperty
*prop_a
, char *key
);
104 void _beagle_hit_add_property (BeagleHit
*hit
, BeagleProperty
*prop
);
105 void _beagle_hit_list_free (GSList
*list
);
107 void _beagle_hit_to_xml (BeagleHit
*hit
, GString
*data
);
109 void _beagle_queryable_status_to_xml (BeagleQueryableStatus
*status
, GString
*data
);
111 void _beagle_scheduler_information_to_xml (BeagleSchedulerInformation
*status
, GString
*data
);
113 void _beagle_properties_to_xml (GSList
*properties
, GString
*data
);
115 void _beagle_indexable_to_xml (BeagleIndexable
*indexable
, GString
*data
);
117 BeagleResponse
*_beagle_parser_context_get_response (BeagleParserContext
*ctx
);
119 GString
*_beagle_query_part_to_xml (BeagleQueryPart
*part
);
121 void _beagle_query_part_append_standard_header (GString
*data
,
122 BeagleQueryPart
*part
,
123 const char *xsi_type
);
124 void _beagle_query_part_append_standard_footer (GString
*data
);
126 BeagleResponse
*_beagle_request_send (BeagleRequest
*request
,
127 const char *socket_path
,
130 void _beagle_request_class_set_response_types (BeagleRequestClass
*klass
,
131 const char *beagle_type
,
135 gboolean
_beagle_request_send_async (BeagleRequest
*request
,
136 const char *socket_path
,
138 void _beagle_request_append_standard_header (GString
*data
,
139 const char *xsi_type
);
140 void _beagle_request_append_standard_footer (GString
*data
);
142 void _beagle_error_response_to_g_error (BeagleErrorResponse
*response
,
145 GSList
*_beagle_search_term_response_get_exact_text (BeagleSearchTermResponse
*response
);
146 GSList
*_beagle_search_term_response_get_stemmed_text (BeagleSearchTermResponse
*response
);
148 char *_beagle_timestamp_to_string (BeagleTimestamp
*timestamp
);
149 char *_beagle_timestamp_get_start (void);
151 #endif /* __BEAGLE_PRIVATE_H */