Brian Silverman | 66f079a | 2013-08-26 16:24:30 -0700 | [diff] [blame^] | 1 | #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 | |
| 9 | namespace aos { |
| 10 | |
| 11 | // Holds global configuration data. All of the functions are safe to call |
| 12 | // from wherever. |
| 13 | namespace configuration { |
| 14 | |
| 15 | // Returns "our" IP address. |
| 16 | const 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. |
| 22 | const 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. |
| 26 | const char *GetLoggingDirectory(); |
| 27 | |
| 28 | } // namespace configuration |
| 29 | } // namespace aos |
| 30 | |
| 31 | #endif // AOS_ATOM_CODE_CONFIGURATION_H_ |