blob: a3917cc9b3e15a1ce17cd2b5fc7f2e29c8cb0d20 [file] [log] [blame]
Brian Silverman66f079a2013-08-26 16:24:30 -07001#ifndef AOS_ATOM_CODE_CONFIGURATION_H_
2#define AOS_ATOM_CODE_CONFIGURATION_H_
3
4#include <stdint.h>
5#include <sys/socket.h>
6#include <netinet/in.h>
7#include <arpa/inet.h>
8
9namespace aos {
10
11// Holds global configuration data. All of the functions are safe to call
12// from wherever.
13namespace configuration {
14
15// Returns "our" IP address.
16const in_addr &GetOwnIPAddress();
17
18// Returns the "root directory" for this run. Under linux, this is the
19// directory where the executable is located (from /proc/self/exe)
20// The return value will always be to a static string, so no freeing is
21// necessary.
22const char *GetRootDirectory();
23// Returns the directory where logs get written. Relative to GetRootDirectory().
24// The return value will always be to a static string, so no freeing is
25// necessary.
26const char *GetLoggingDirectory();
27
28} // namespace configuration
29} // namespace aos
30
31#endif // AOS_ATOM_CODE_CONFIGURATION_H_