Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
version.cc
Go to the documentation of this file.
1/*
2 * Dillo web browser
3 *
4 * Copyright 2024 Rodrigo Arias Mallo <rodarima@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include "config.h"
21#include "commit.h"
22
23#include "djpeg.h"
24#include "dpng.h"
25#include "dwebp.h"
26#include "IO/tls.h"
27
28#include <FL/Fl.H>
29#include <zlib.h>
30
31#include <stdio.h>
32
33static void print_libs()
34{
35 char buf[256];
36
37 printf("Libraries:");
38
39 /* FLTK only offers a single number */
40 {
41#if FL_MAJOR_VERSION == 1 && FL_MINOR_VERSION == 3 && FL_PATCH_VERSION <= 3
42 /* The version comes in a double like this 1.0302 (1.3.3), so we
43 * transform it to a integer as Fl::api_version(): 1.0303 -> 10303 */
44 int fltkver = (int) (Fl::version() * 10000.0);
45#else
46 int fltkver = Fl::api_version();
47#endif
48 int fltk_maj = fltkver / 10000;
49 int fltk_min = (fltkver / 100) % 100;
50 int fltk_pat = fltkver % 100;
51 printf(" fltk/%d.%d.%d", fltk_maj, fltk_min, fltk_pat);
52 }
53
54 printf(" zlib/%s", zlibVersion());
55
56#ifdef ENABLE_JPEG
57 printf(" jpeg/%s", a_Jpeg_version());
58#endif
59
60#ifdef ENABLE_PNG
61 printf(" png/%s", a_Png_version());
62#endif
63
64#ifdef ENABLE_WEBP
65 printf(" webp/%s", a_Webp_version(buf, 256));
66#endif
67
68#ifdef ENABLE_TLS
69 /* TLS prints the name/version format, as it determines which SSL
70 * library is in use */
71 printf(" %s", a_Tls_version(buf, 256));
72#endif
73
74 printf("\n");
75}
76
77static void print_features()
78{
79 printf("Features:"
80#ifdef ENABLE_GIF
81 " +GIF"
82#else
83 " -GIF"
84#endif
85#ifdef ENABLE_JPEG
86 " +JPEG"
87#else
88 " -JPEG"
89#endif
90#ifdef ENABLE_PNG
91 " +PNG"
92#else
93 " -PNG"
94#endif
95#ifdef ENABLE_SVG
96 " +SVG"
97#else
98 " -SVG"
99#endif
100#ifdef ENABLE_WEBP
101 " +WEBP"
102#else
103 " -WEBP"
104#endif
105#if !( defined(DISABLE_XEMBED) || defined(WIN32) || defined(__APPLE__) )
106 " +XEMBED"
107#else
108 " -XEMBED"
109#endif
110#ifdef ENABLE_TLS
111 " +TLS"
112#else
113 " -TLS"
114#endif
115 "\n");
116}
117
119{
120 const char *version = "v" VERSION;
121
122#ifdef GIT_COMMIT
123 version = GIT_COMMIT;
124#endif
125
126 printf("Dillo %s\n", version);
127 print_libs();
129}
const char * a_Jpeg_version(void)
Definition jpeg.c:424
const char * a_Png_version(void)
Definition png.c:440
const char * a_Webp_version(char *buf, int n)
Definition webp.c:218
const char * a_Tls_version(char *buf, int n)
Get the version of the TLS library.
Definition tls.c:31
static void print_libs()
Definition version.cc:33
void a_Version_print_info(void)
Definition version.cc:118
static void print_features()
Definition version.cc:77