Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

libhal.h

00001 /*************************************************************************** 00002 * CVSID: $Id: libhal.h,v 1.16 2004/07/29 17:07:09 david Exp $ 00003 * 00004 * libhal.h : HAL daemon C convenience library headers 00005 * 00006 * Copyright (C) 2003 David Zeuthen, <david@fubar.dk> 00007 * 00008 * Licensed under the Academic Free License version 2.0 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 * 00024 **************************************************************************/ 00025 00026 #ifndef LIBHAL_H 00027 #define LIBHAL_H 00028 00029 #include <dbus/dbus.h> 00030 00031 #if defined(__cplusplus) 00032 extern "C" { 00033 #endif 00034 00041 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00042 typedef struct LibHalContext_s LibHalContext; 00043 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00044 00050 typedef void (*LibHalIntegrateDBusIntoMainLoop) (LibHalContext *ctx, 00051 DBusConnection * 00052 dbus_connection); 00053 00058 typedef void (*LibHalDeviceAdded) (LibHalContext *ctx, const char *udi); 00059 00064 typedef void (*LibHalDeviceRemoved) (LibHalContext *ctx, const char *udi); 00065 00071 typedef void (*LibHalNewCapability) (LibHalContext *ctx, 00072 const char *udi, 00073 const char *capability); 00074 00080 typedef void (*LibHalLostCapability) (LibHalContext *ctx, 00081 const char *udi, 00082 const char *capability); 00083 00091 typedef void (*LibHalDevicePropertyModified) (LibHalContext *ctx, 00092 const char *udi, 00093 const char *key, 00094 dbus_bool_t is_removed, 00095 dbus_bool_t is_added); 00096 00106 typedef void (*LibHalDeviceCondition) (LibHalContext *ctx, 00107 const char *udi, 00108 const char *condition_name, 00109 DBusMessage *message); 00110 00111 00117 typedef struct LibHalFunctions_s { 00121 LibHalIntegrateDBusIntoMainLoop main_loop_integration; 00122 00124 LibHalDeviceAdded device_added; 00125 00127 LibHalDeviceRemoved device_removed; 00128 00130 LibHalNewCapability device_new_capability; 00131 00133 LibHalLostCapability device_lost_capability; 00134 00136 LibHalDevicePropertyModified device_property_modified; 00137 00139 LibHalDeviceCondition device_condition; 00140 00141 } LibHalFunctions; 00142 00143 00144 LibHalContext *hal_initialize (const LibHalFunctions * cb_functions, 00145 dbus_bool_t use_cache); 00146 00147 int hal_shutdown (LibHalContext *ctx); 00148 00149 void hal_ctx_set_user_data(LibHalContext *ctx, void *user_data); 00150 00151 void* hal_ctx_get_user_data(LibHalContext *ctx); 00152 00153 char **hal_get_all_devices (LibHalContext *ctx, int *num_devices); 00154 dbus_bool_t hal_device_exists (LibHalContext *ctx, const char *udi); 00155 00156 void hal_device_print (LibHalContext *ctx, const char *udi); 00157 00158 dbus_bool_t hal_device_property_exists (LibHalContext *ctx, 00159 const char *udi, 00160 const char *key); 00161 00162 char *hal_device_get_property_string (LibHalContext *ctx, const char *udi, 00163 const char *key); 00164 00165 dbus_int32_t hal_device_get_property_int (LibHalContext *ctx, 00166 const char *udi, 00167 const char *key); 00168 00169 double hal_device_get_property_double (LibHalContext *ctx, 00170 const char *udi, 00171 const char *key); 00172 00173 dbus_bool_t hal_device_get_property_bool (LibHalContext *ctx, 00174 const char *udi, 00175 const char *key); 00176 00177 dbus_bool_t hal_device_set_property_string (LibHalContext *ctx, 00178 const char *udi, 00179 const char *key, 00180 const char *value); 00181 00182 dbus_bool_t hal_device_set_property_int (LibHalContext *ctx, 00183 const char *udi, 00184 const char *key, 00185 dbus_int32_t value); 00186 00187 dbus_bool_t hal_device_set_property_double (LibHalContext *ctx, 00188 const char *udi, 00189 const char *key, 00190 double value); 00191 00192 dbus_bool_t hal_device_set_property_bool (LibHalContext *ctx, 00193 const char *udi, 00194 const char *key, 00195 dbus_bool_t value); 00196 00197 dbus_bool_t hal_device_remove_property (LibHalContext *ctx, 00198 const char *udi, 00199 const char *key); 00200 00201 int hal_device_get_property_type (LibHalContext *ctx, 00202 const char *udi, 00203 const char *key); 00204 00205 00206 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00207 struct LibHalProperty_s; 00208 typedef struct LibHalProperty_s LibHalProperty; 00209 00210 struct LibHalPropertySet_s; 00211 typedef struct LibHalPropertySet_s LibHalPropertySet; 00212 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00213 00214 00215 LibHalPropertySet *hal_device_get_all_properties (LibHalContext *ctx, 00216 const char *udi); 00217 00218 void hal_free_property_set (LibHalPropertySet * set); 00219 00221 struct LibHalPropertySetIterator_s { 00222 LibHalPropertySet *set; 00223 unsigned int index; 00224 LibHalProperty *cur_prop; 00225 void *reservered0; 00226 void *reservered1; 00227 }; 00228 00229 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00230 typedef struct LibHalPropertySetIterator_s LibHalPropertySetIterator; 00231 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00232 00233 void hal_psi_init (LibHalPropertySetIterator * iter, 00234 LibHalPropertySet * set); 00235 00236 dbus_bool_t hal_psi_has_more (LibHalPropertySetIterator * iter); 00237 void hal_psi_next (LibHalPropertySetIterator * iter); 00238 00239 int hal_psi_get_type (LibHalPropertySetIterator * iter); 00240 00241 char *hal_psi_get_key (LibHalPropertySetIterator * iter); 00242 00243 char *hal_psi_get_string (LibHalPropertySetIterator * iter); 00244 dbus_int32_t hal_psi_get_int (LibHalPropertySetIterator * iter); 00245 double hal_psi_get_double (LibHalPropertySetIterator * iter); 00246 dbus_bool_t hal_psi_get_bool (LibHalPropertySetIterator * iter); 00247 00248 void hal_free_string_array (char **str_array); 00249 void hal_free_string (char *str); 00250 00251 char *hal_agent_new_device (LibHalContext *ctx); 00252 dbus_bool_t hal_agent_commit_to_gdl (LibHalContext *ctx, 00253 const char *temp_udi, 00254 const char *udi); 00255 dbus_bool_t hal_agent_remove_device (LibHalContext *ctx, 00256 const char *udi); 00257 dbus_bool_t hal_agent_merge_properties (LibHalContext *ctx, 00258 const char *target_udi, 00259 const char *source_udi); 00260 00261 dbus_bool_t hal_agent_device_matches (LibHalContext *ctx, 00262 const char *udi1, 00263 const char *udi2, 00264 const char *property_namespace); 00265 00266 char **hal_manager_find_device_string_match (LibHalContext *ctx, 00267 const char *key, 00268 const char *value, 00269 int *num_devices); 00270 00271 00272 dbus_bool_t hal_device_add_capability (LibHalContext *ctx, 00273 const char *udi, 00274 const char *capability); 00275 00276 dbus_bool_t hal_device_query_capability (LibHalContext *ctx, 00277 const char *udi, 00278 const char *capability); 00279 00280 char **hal_find_device_by_capability (LibHalContext *ctx, 00281 const char *capability, 00282 int *num_devices); 00283 00284 int hal_device_property_watch_all (LibHalContext *ctx); 00285 int hal_device_add_property_watch (LibHalContext *ctx, 00286 const char *udi); 00287 int hal_device_remove_property_watch (LibHalContext *ctx, 00288 const char *udi); 00289 00292 #if defined(__cplusplus) 00293 } 00294 #endif 00295 00296 #endif /* LIBHAL_H */

Generated on Tue Aug 17 01:25:53 2004 for HAL by doxygen 1.3.8