]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | /* | |
4 | * Ceph - scalable distributed file system | |
5 | * | |
6 | * Copyright (C) 2011 New Dream Network | |
7 | * | |
8 | * This is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU Lesser General Public | |
10 | * License version 2.1, as published by the Free Software | |
11 | * Foundation. See file COPYING. | |
12 | * | |
13 | */ | |
14 | ||
31f18b77 FG |
15 | #include <string.h> |
16 | ||
7c673cae FG |
17 | #include "ceph_ver.h" |
18 | #include "common/version.h" | |
31f18b77 | 19 | #include "include/rados.h" |
7c673cae FG |
20 | |
21 | #include <sstream> | |
7c673cae FG |
22 | |
23 | #define _STR(x) #x | |
24 | #define STRINGIFY(x) _STR(x) | |
25 | ||
26 | const char *ceph_version_to_str(void) | |
27 | { | |
28 | return CEPH_GIT_NICE_VER; | |
29 | } | |
30 | ||
11fdf7f2 TL |
31 | const char *ceph_release_to_str(void) |
32 | { | |
33 | return ceph_release_name(CEPH_RELEASE); | |
34 | } | |
35 | ||
7c673cae FG |
36 | const char *git_version_to_str(void) |
37 | { | |
38 | return STRINGIFY(CEPH_GIT_VER); | |
39 | } | |
40 | ||
41 | std::string const pretty_version_to_str(void) | |
42 | { | |
43 | std::ostringstream oss; | |
31f18b77 FG |
44 | oss << "ceph version " << CEPH_GIT_NICE_VER |
45 | << " (" << STRINGIFY(CEPH_GIT_VER) << ") " | |
46 | << ceph_release_name(CEPH_RELEASE) | |
47 | << " (" << CEPH_RELEASE_TYPE << ")"; | |
7c673cae FG |
48 | return oss.str(); |
49 | } | |
31f18b77 FG |
50 | |
51 | unsigned ceph_release(void) | |
52 | { | |
53 | return CEPH_RELEASE; | |
54 | } | |
55 | ||
56 | const char *ceph_release_type(void) | |
57 | { | |
58 | return CEPH_RELEASE_TYPE; | |
59 | } |