2019-01-05 00:01:34 +00:00
|
|
|
/* myMPD
|
|
|
|
(c) 2018-2019 Juergen Mang <mail@jcgames.de>
|
|
|
|
This project's homepage is: https://github.com/jcorporation/mympd
|
|
|
|
|
|
|
|
myMPD ist fork of:
|
|
|
|
|
|
|
|
ympd
|
|
|
|
(c) 2013-2014 Andrew Karpow <andy@ndyk.de>
|
|
|
|
This project's homepage is: http://www.ympd.org
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2019-01-05 12:29:10 +00:00
|
|
|
#ifndef __GLOBAL_H__
|
|
|
|
#define __GLOBAL_H__
|
2019-01-05 00:01:34 +00:00
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdlib.h>
|
2019-01-05 12:29:10 +00:00
|
|
|
#include <signal.h>
|
2019-01-05 00:01:34 +00:00
|
|
|
|
2019-01-05 12:29:10 +00:00
|
|
|
//architecture
|
|
|
|
#cmakedefine PKGARCH64
|
|
|
|
|
|
|
|
//myMPD version from cmake
|
|
|
|
#define MYMPD_VERSION_MAJOR ${CPACK_PACKAGE_VERSION_MAJOR}
|
|
|
|
#define MYMPD_VERSION_MINOR ${CPACK_PACKAGE_VERSION_MINOR}
|
|
|
|
#define MYMPD_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH}
|
|
|
|
#define MYMPD_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}"
|
|
|
|
|
|
|
|
//Webserver document root
|
|
|
|
#define DOC_ROOT "${ASSETS_PATH}"
|
|
|
|
|
|
|
|
//Max size of mpd_client response buffer
|
2019-01-05 00:01:34 +00:00
|
|
|
#define MAX_SIZE 2048 * 400
|
|
|
|
#define MAX_ELEMENTS_PER_PAGE 400
|
|
|
|
|
2019-01-05 12:29:10 +00:00
|
|
|
//central logging definition
|
|
|
|
#cmakedefine DEBUG
|
2019-01-05 00:01:34 +00:00
|
|
|
#define LOG_INFO() if (config.loglevel >= 1)
|
|
|
|
#define LOG_VERBOSE() if (config.loglevel >= 2)
|
|
|
|
#define LOG_DEBUG() if (config.loglevel == 3)
|
|
|
|
|
2019-01-05 12:29:10 +00:00
|
|
|
//signal handler
|
|
|
|
sig_atomic_t s_signal_received;
|
|
|
|
|
|
|
|
//myMPD configuration
|
2019-01-05 00:01:34 +00:00
|
|
|
typedef struct {
|
|
|
|
long mpdport;
|
|
|
|
const char *mpdhost;
|
|
|
|
const char *mpdpass;
|
|
|
|
const char *webport;
|
|
|
|
bool ssl;
|
|
|
|
const char *sslport;
|
|
|
|
const char *sslcert;
|
|
|
|
const char *sslkey;
|
|
|
|
const char *user;
|
|
|
|
bool coverimage;
|
|
|
|
const char *coverimagename;
|
|
|
|
long coverimagesize;
|
|
|
|
bool stickers;
|
|
|
|
bool mixramp;
|
|
|
|
const char *taglist;
|
|
|
|
const char *searchtaglist;
|
|
|
|
const char *browsetaglist;
|
|
|
|
bool smartpls;
|
|
|
|
const char *varlibdir;
|
|
|
|
const char *etcdir;
|
|
|
|
unsigned long max_elements_per_page;
|
|
|
|
bool syscmds;
|
|
|
|
bool localplayer;
|
|
|
|
long streamport;
|
|
|
|
const char *streamurl;
|
|
|
|
unsigned long last_played_count;
|
|
|
|
long loglevel;
|
|
|
|
} t_config;
|
|
|
|
|
|
|
|
t_config config;
|
|
|
|
|
|
|
|
void sanitize_string(const char *data);
|
|
|
|
int copy_string(char * const dest, char const * const src, size_t const dst_len, size_t const src_len);
|
|
|
|
#endif
|