]> git.proxmox.com Git - ceph.git/blame - ceph/src/common/code_environment.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / common / code_environment.h
CommitLineData
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
15#ifndef CEPH_COMMON_CODE_ENVIRONMENT_H
16#define CEPH_COMMON_CODE_ENVIRONMENT_H
17
18enum code_environment_t {
19 CODE_ENVIRONMENT_UTILITY = 0,
20 CODE_ENVIRONMENT_DAEMON = 1,
21 CODE_ENVIRONMENT_LIBRARY = 2,
22 CODE_ENVIRONMENT_UTILITY_NODOUT = 3,
23};
24
25#ifdef __cplusplus
26#include <iosfwd>
27#include <string>
28
29extern "C" code_environment_t g_code_env;
30extern "C" const char *code_environment_to_str(enum code_environment_t e);
31std::ostream &operator<<(std::ostream &oss, enum code_environment_t e);
32extern "C" int get_process_name(char *buf, int len);
33std::string get_process_name_cpp();
34
35#else
36
37extern code_environment_t g_code_env;
38const char *code_environment_to_str(enum code_environment_t e);
39extern int get_process_name(char *buf, int len);
40
41#endif
42
43#endif