summaryrefslogtreecommitdiff
path: root/src/lib/eio
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-09-07 16:20:23 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-09-08 15:16:43 -0700
commitc6e145da2df8f607708effa31ddd5f5131878b54 (patch)
tree348029746b9f8a744f0a4f186c102b9466510c5e /src/lib/eio
parent5579d2f5cdda0286d908e4975c0cd9f5361b8df0 (diff)
eio: add an internal function for getting xattr in bulk.
Diffstat (limited to 'src/lib/eio')
-rw-r--r--src/lib/eio/eio_private.h5
-rw-r--r--src/lib/eio/eio_xattr.c56
2 files changed, 50 insertions, 11 deletions
diff --git a/src/lib/eio/eio_private.h b/src/lib/eio/eio_private.h
index 69a73d3020..dece4c1811 100644
--- a/src/lib/eio/eio_private.h
+++ b/src/lib/eio/eio_private.h
@@ -545,6 +545,11 @@ Eio_File * _eio_dir_stat_ls(const char *dir,
545 Eio_Done_Cb done_cb, 545 Eio_Done_Cb done_cb,
546 Eio_Error_Cb error_cb, 546 Eio_Error_Cb error_cb,
547 const void *data); 547 const void *data);
548Eio_File * _eio_file_xattr(const char *path,
549 Eio_Array_Cb main_internal_cb,
550 Eio_Done_Cb done_cb,
551 Eio_Error_Cb error_cb,
552 const void *data);
548 553
549// Sharing notifier between recursive and non recursive code. 554// Sharing notifier between recursive and non recursive code.
550void _eio_string_notify(void *data, Ecore_Thread *thread EINA_UNUSED, void *msg_data); 555void _eio_string_notify(void *data, Ecore_Thread *thread EINA_UNUSED, void *msg_data);
diff --git a/src/lib/eio/eio_xattr.c b/src/lib/eio/eio_xattr.c
index 0dfec5b367..fdfb8990a6 100644
--- a/src/lib/eio/eio_xattr.c
+++ b/src/lib/eio/eio_xattr.c
@@ -305,27 +305,36 @@ _eio_file_xattr_setup_set(Eio_File_Xattr *async,
305 * API * 305 * API *
306 *============================================================================*/ 306 *============================================================================*/
307 307
308EAPI Eio_File * 308static Eio_File *
309eio_file_xattr(const char *path, 309_eio_file_internal_xattr(const char *path,
310 Eio_Filter_Cb filter_cb, 310 Eio_Filter_Cb filter_cb,
311 Eio_Main_Cb main_cb, 311 Eio_Main_Cb main_cb,
312 Eio_Done_Cb done_cb, 312 Eio_Array_Cb main_internal_cb,
313 Eio_Error_Cb error_cb, 313 Eio_Done_Cb done_cb,
314 const void *data) 314 Eio_Error_Cb error_cb,
315 const void *data)
315{ 316{
316 Eio_File_Char_Ls *async; 317 Eio_File_Char_Ls *async;
317 318
318 EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); 319 EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
319 EINA_SAFETY_ON_NULL_RETURN_VAL(main_cb, NULL);
320 EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL); 320 EINA_SAFETY_ON_NULL_RETURN_VAL(done_cb, NULL);
321 EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL); 321 EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL);
322 322
323 async = calloc(1, sizeof (Eio_File_Char_Ls)); 323 async = eio_common_alloc(sizeof (Eio_File_Char_Ls));
324 EINA_SAFETY_ON_NULL_RETURN_VAL(async, NULL); 324 EINA_SAFETY_ON_NULL_RETURN_VAL(async, NULL);
325 325
326 async->filter_cb = filter_cb;
327 async->main_cb = main_cb;
328 async->ls.directory = eina_stringshare_add(path); 326 async->ls.directory = eina_stringshare_add(path);
327 async->filter_cb = filter_cb;
328
329 if (main_internal_cb)
330 {
331 async->main_internal_cb = main_internal_cb;
332 async->ls.gather = EINA_TRUE;
333 }
334 else
335 {
336 async->main_cb = main_cb;
337 }
329 338
330 if (!eio_long_file_set(&async->ls.common, 339 if (!eio_long_file_set(&async->ls.common,
331 done_cb, 340 done_cb,
@@ -341,6 +350,31 @@ eio_file_xattr(const char *path,
341} 350}
342 351
343EAPI Eio_File * 352EAPI Eio_File *
353eio_file_xattr(const char *path,
354 Eio_Filter_Cb filter_cb,
355 Eio_Main_Cb main_cb,
356 Eio_Done_Cb done_cb,
357 Eio_Error_Cb error_cb,
358 const void *data)
359{
360 EINA_SAFETY_ON_NULL_RETURN_VAL(main_cb, NULL);
361
362 return _eio_file_internal_xattr(path, filter_cb, main_cb, NULL, done_cb, error_cb, data);
363}
364
365Eio_File *
366_eio_file_xattr(const char *path,
367 Eio_Array_Cb main_internal_cb,
368 Eio_Done_Cb done_cb,
369 Eio_Error_Cb error_cb,
370 const void *data)
371{
372 EINA_SAFETY_ON_NULL_RETURN_VAL(main_internal_cb, NULL);
373
374 return _eio_file_internal_xattr(path, NULL, NULL, main_internal_cb, done_cb, error_cb, data);
375}
376
377EAPI Eio_File *
344eio_file_xattr_get(const char *path, 378eio_file_xattr_get(const char *path,
345 const char *attribute, 379 const char *attribute,
346 Eio_Done_Data_Cb done_cb, 380 Eio_Done_Data_Cb done_cb,