YARP  2.3.68+272-20170522.1+git50f0ae7
Yet Another Robot Platform
Os.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2009 RobotCub Consortium
3 * Author: Lorenzo Natale
4 * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
5 */
6 
7 #ifndef YARP_OS_OS_H
8 #define YARP_OS_OS_H
9 
10 #include <yarp/os/api.h>
11 
12 #include <cstddef>
13 
14 
15 namespace yarp {
16  namespace os {
17  enum
18  {
21  };
22 
23  typedef void(*YarpSignalHandler)(int);
30  YARP_OS_API YarpSignalHandler signal(int signum, YarpSignalHandler sighandler);
31 
35  YARP_OS_API void exit(int v);
36 
40  YARP_OS_API void abort(bool verbose=false);
41 
47  YARP_OS_API const char *getenv(const char *var);
48 
53  YARP_OS_API int getpid();
54 
59  YARP_OS_API void setprogname(const char *progname);
60 
65  YARP_OS_API void getprogname(char* progname, size_t size);
66 
71  YARP_OS_API void gethostname(char* hostname, size_t size);
72 
77  YARP_OS_API int mkdir(const char *p);
78 
86  YARP_OS_API int mkdir_p(const char *p, int ignoreLevels = 0);
87 
92  YARP_OS_API int rmdir(const char *p);
93 
100  YARP_OS_API int rename(const char *oldname, const char *newname);
101 
105  YARP_OS_API int stat(const char *path);
106  }
107 }
108 
109 #endif // YARP_OS_OS_H
void setprogname(const char *progname)
Wrapper for ACE_OS::setprogname().
Definition: Os.cpp:105
The main, catch-all namespace for YARP.
const char * getenv(const char *var)
Wrapper for ACE_OS::getenv().
Definition: Os.cpp:56
int stat(const char *path)
Wrapper for ACE_OS::stat() function.
Definition: Os.cpp:93
YarpSignalHandler signal(int signum, YarpSignalHandler sighandler)
Wrapper for the ACE_OS::signal signal.
Definition: Os.cpp:24
void exit(int v)
Wrapper for ACE_OS::exit().
Definition: Os.cpp:37
bool verbose
Definition: yarpros.cpp:20
int rename(const char *oldname, const char *newname)
Wrapper for ACE_OS::rename().
Definition: Os.cpp:84
int getpid()
Wrapper for ACE_OS::getppid().
Definition: Os.cpp:99
void(* YarpSignalHandler)(int)
Definition: Os.h:23
void getprogname(char *progname, size_t size)
Wrapper for ACE_OS::getprogname().
Definition: Os.cpp:115
void gethostname(char *hostname, size_t size)
Wrapper for ACE_OS::hostname().
Definition: Os.cpp:134
int rmdir(const char *p)
Wrapper for ACE_OS::rmdir().
Definition: Os.cpp:75
int mkdir(const char *p)
Wrapper for ACE_OS::mkdir().
Definition: Os.cpp:61
void abort(bool verbose=false)
Wrapper for ACE_OS::abort().
Definition: Os.cpp:43
dest v
Definition: ImageCopy.cpp:62
int mkdir_p(const char *p, int ignoreLevels=0)
Create a directory and all parent directories needed.
Definition: Os.cpp:70