Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
colorize.h
Go to the documentation of this file.
1/*
2Part of Minetest
3Copyright (C) 2024 rubenwardy
4
5Permission to use, copy, modify, and distribute this software for any
6purpose with or without fee is hereby granted, provided that the above
7copyright notice and this permission notice appear in all copies.
8
9THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*/
17
18#pragma once
19
20#include <string>
21#include "config.h"
22
23#define COLOR_CODE(color) "\x1b(c@" color ")"
24
25#if USE_CURL
26#include <curl/curlver.h>
27// curl_url functions since 7.62.0
28#if LIBCURL_VERSION_NUM >= 0x073e00
29#define HAVE_COLORIZE_URL
30#endif
31#endif
32
33#ifdef HAVE_COLORIZE_URL
34
40std::string colorize_url(const std::string &url);
41
42#endif