Changes in uspace/lib/c/generic/loc.c [d0dd7b5:763e0cd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/loc.c
rd0dd7b5 r763e0cd 267 267 } 268 268 269 /** Register new service.270 * 271 * The @p interface is used when forwarding connection to the server.269 /** Register new device. 270 * 271 * The @p interface is used when forwarding connection to the driver. 272 272 * If not 0, the first argument is the interface and the second argument 273 273 * is the service ID. … … 276 276 * the handle (to ensure backward compatibility). 277 277 * 278 * @param fq sn Fully qualified service name279 * @param[out] sid Service ID of new service280 * @param interface Interface when forwarding 281 * 282 */ 283 int loc_service_register_with_iface(const char *fq sn,284 service_id_t * sid, sysarg_t interface)278 * @param fqdn Fully qualified device name. 279 * @param[out] handle Handle to the created instance of device. 280 * @param interface Interface when forwarding. 281 * 282 */ 283 int loc_service_register_with_iface(const char *fqdn, 284 service_id_t *handle, sysarg_t interface) 285 285 { 286 286 async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_SUPPLIER); … … 289 289 aid_t req = async_send_2(exch, LOC_SERVICE_REGISTER, interface, 0, 290 290 &answer); 291 sysarg_t retval = async_data_write_start(exch, fq sn, str_size(fqsn));291 sysarg_t retval = async_data_write_start(exch, fqdn, str_size(fqdn)); 292 292 293 293 loc_exchange_end(exch); … … 301 301 302 302 if (retval != EOK) { 303 if ( sid!= NULL)304 * sid= -1;305 306 return retval; 307 } 308 309 if ( sid!= NULL)310 * sid= (service_id_t) IPC_GET_ARG1(answer);303 if (handle != NULL) 304 *handle = -1; 305 306 return retval; 307 } 308 309 if (handle != NULL) 310 *handle = (service_id_t) IPC_GET_ARG1(answer); 311 311 312 312 return retval; 313 313 } 314 314 315 /** Register new service. 316 * 317 * @param fqsn Fully qualified service name 318 * @param sid Output: ID of new service 319 * 320 */ 321 int loc_service_register(const char *fqdn, service_id_t *sid) 322 { 323 return loc_service_register_with_iface(fqdn, sid, 0); 324 } 325 326 /** Unregister service. 327 * 328 * @param sid Service ID 329 */ 330 int loc_service_unregister(service_id_t sid) 331 { 332 async_exch_t *exch; 333 sysarg_t retval; 334 335 exch = loc_exchange_begin_blocking(LOC_PORT_SUPPLIER); 336 retval = async_req_1_0(exch, LOC_SERVICE_UNREGISTER, sid); 337 loc_exchange_end(exch); 338 339 return (int)retval; 315 /** Register new device. 316 * 317 * @param fqdn Fully qualified device name. 318 * @param handle Output: Handle to the created instance of device. 319 * 320 */ 321 int loc_service_register(const char *fqdn, service_id_t *handle) 322 { 323 return loc_service_register_with_iface(fqdn, handle, 0); 340 324 } 341 325
Note:
See TracChangeset
for help on using the changeset viewer.