summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_file_common.c
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-11-04 11:26:59 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-11-04 11:26:59 +0900
commit687e4ae7442e9763e0587553d50a4177d2f9b6ca (patch)
tree418a8eba800de69b0d065429038d085ebc8f2538 /src/lib/eina/eina_file_common.c
parenta3eb8d2e9d42a83c633d19196d28f3c621522dc5 (diff)
eina: roll const into Eina_File API.
Note that eina_file_dup is const from the caller perspective as it will return a fresh "non const" Eina_File that it will be able to manipulate as it like.
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_file_common.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index e5b1250e09..5a0250cc4a 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -431,8 +431,10 @@ eina_file_virtual(Eina_File *file)
431} 431}
432 432
433EAPI Eina_File * 433EAPI Eina_File *
434eina_file_dup(Eina_File *file) 434eina_file_dup(const Eina_File *f)
435{ 435{
436 Eina_File *file = (Eina_File*) f;
437
436 if (file) 438 if (file)
437 { 439 {
438 eina_lock_take(&file->lock); 440 eina_lock_take(&file->lock);
@@ -464,21 +466,21 @@ eina_file_close(Eina_File *file)
464} 466}
465 467
466EAPI size_t 468EAPI size_t
467eina_file_size_get(Eina_File *file) 469eina_file_size_get(const Eina_File *file)
468{ 470{
469 EINA_SAFETY_ON_NULL_RETURN_VAL(file, 0); 471 EINA_SAFETY_ON_NULL_RETURN_VAL(file, 0);
470 return file->length; 472 return file->length;
471} 473}
472 474
473EAPI time_t 475EAPI time_t
474eina_file_mtime_get(Eina_File *file) 476eina_file_mtime_get(const Eina_File *file)
475{ 477{
476 EINA_SAFETY_ON_NULL_RETURN_VAL(file, 0); 478 EINA_SAFETY_ON_NULL_RETURN_VAL(file, 0);
477 return file->mtime; 479 return file->mtime;
478} 480}
479 481
480EAPI const char * 482EAPI const char *
481eina_file_filename_get(Eina_File *file) 483eina_file_filename_get(const Eina_File *file)
482{ 484{
483 EINA_SAFETY_ON_NULL_RETURN_VAL(file, NULL); 485 EINA_SAFETY_ON_NULL_RETURN_VAL(file, NULL);
484 return file->filename; 486 return file->filename;