Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add xbt_basename to the xbt/file module
[simgrid.git] / include / xbt / file.h
1 /* str.h - XBT string related functions.                                    */
2
3 /* Copyright (c) 2007-2015. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #ifndef XBT_FILE_H
10 #define XBT_FILE_H
11
12 #include <stdint.h> /* ssize_t */
13 #include <stdarg.h>             /* va_* */
14 #include <stdio.h>  /* FILE */
15 #include <stdlib.h> /* size_t, ssize_t */
16 #include "xbt/misc.h"
17 #include "xbt/dynar.h"
18 #include "xbt/dict.h"
19 #include "simgrid_config.h"     /* FILE for getline */
20
21 SG_BEGIN_DECL()
22
23 /** @addtogroup XBT_file
24  *  @brief File manipulation functions
25  *
26  * This module redefine some quite classical functions such as xbt_getline() or xbt_dirname() for the platforms
27  * lacking them.
28  * @{
29  */
30 /* Our own implementation of getline, mainly useful on the platforms not enjoying this function */
31 XBT_PUBLIC(ssize_t) xbt_getline(char **lineptr, size_t * n, FILE * stream);
32
33 /* Our own implementation of dirname, that does not exist on windows */
34 XBT_PUBLIC(char *) xbt_dirname(const char *path);
35 XBT_PUBLIC(char *) xbt_basename(const char *path);
36
37
38 /**@}*/
39
40 SG_END_DECL()
41 #endif                          /* XBT_FILE_H */