mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2024-11-03 04:17:18 -05:00
Some more cosmetic tweaks.
git-svn-id: https://svn.xiph.org/trunk/ezstream@12620 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
parent
9a5b5ed973
commit
2c8e1beef3
13
src/compat.h
13
src/compat.h
@ -17,18 +17,19 @@
|
|||||||
|
|
||||||
# define _PATH_DEVNULL "nul"
|
# define _PATH_DEVNULL "nul"
|
||||||
|
|
||||||
# define strncasecmp strnicmp
|
|
||||||
# define popen _popen
|
|
||||||
# define pclose _pclose
|
# define pclose _pclose
|
||||||
|
# define popen _popen
|
||||||
# define snprintf _snprintf
|
# define snprintf _snprintf
|
||||||
# define stat _stat
|
# define stat _stat
|
||||||
|
# define strncasecmp strnicmp
|
||||||
|
# define strtoll _strtoi64
|
||||||
|
|
||||||
# define S_IXGRP 0
|
|
||||||
# define S_IXOTH 0
|
|
||||||
# define S_IWGRP 0
|
|
||||||
# define S_IWOTH 0
|
|
||||||
# define S_IRGRP 0
|
# define S_IRGRP 0
|
||||||
# define S_IROTH 0
|
# define S_IROTH 0
|
||||||
|
# define S_IWGRP 0
|
||||||
|
# define S_IWOTH 0
|
||||||
|
# define S_IXGRP 0
|
||||||
|
# define S_IXOTH 0
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ parseConfig(const char *fileName)
|
|||||||
const char *errstr;
|
const char *errstr;
|
||||||
|
|
||||||
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
|
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
|
||||||
ezConfig.fileNameIsProgram = strtonum(ls_xmlContentPtr, 0, 1, &errstr);
|
ezConfig.fileNameIsProgram = (int)strtonum(ls_xmlContentPtr, 0, 1, &errstr);
|
||||||
if (errstr) {
|
if (errstr) {
|
||||||
printf("%s[%ld]: Error: <playlist_program> may only contain 1 or 0\n",
|
printf("%s[%ld]: Error: <playlist_program> may only contain 1 or 0\n",
|
||||||
fileName, xmlGetLineNo(cur));
|
fileName, xmlGetLineNo(cur));
|
||||||
@ -266,7 +266,7 @@ parseConfig(const char *fileName)
|
|||||||
const char *errstr;
|
const char *errstr;
|
||||||
|
|
||||||
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
|
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
|
||||||
ezConfig.shuffle = strtonum(ls_xmlContentPtr, 0, 1, &errstr);
|
ezConfig.shuffle = (int)strtonum(ls_xmlContentPtr, 0, 1, &errstr);
|
||||||
if (errstr) {
|
if (errstr) {
|
||||||
printf("%s[%ld]: Error: <shuffle> may only contain 1 or 0\n",
|
printf("%s[%ld]: Error: <shuffle> may only contain 1 or 0\n",
|
||||||
fileName, xmlGetLineNo(cur));
|
fileName, xmlGetLineNo(cur));
|
||||||
@ -288,7 +288,7 @@ parseConfig(const char *fileName)
|
|||||||
const char *errstr;
|
const char *errstr;
|
||||||
|
|
||||||
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
|
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
|
||||||
ezConfig.streamOnce = strtonum(ls_xmlContentPtr, 0, 1, &errstr);
|
ezConfig.streamOnce = (int)strtonum(ls_xmlContentPtr, 0, 1, &errstr);
|
||||||
if (errstr) {
|
if (errstr) {
|
||||||
printf("%s[%ld]: Error: <stream_once> may only contain 1 or 0\n",
|
printf("%s[%ld]: Error: <stream_once> may only contain 1 or 0\n",
|
||||||
fileName, xmlGetLineNo(cur));
|
fileName, xmlGetLineNo(cur));
|
||||||
@ -310,7 +310,7 @@ parseConfig(const char *fileName)
|
|||||||
const char *errstr;
|
const char *errstr;
|
||||||
|
|
||||||
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
|
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
|
||||||
ezConfig.reconnectAttempts = strtonum(ls_xmlContentPtr, 0, UINT_MAX, &errstr);
|
ezConfig.reconnectAttempts = (unsigned int)strtonum(ls_xmlContentPtr, 0, UINT_MAX, &errstr);
|
||||||
if (errstr) {
|
if (errstr) {
|
||||||
printf("%s[%ld]: Error: In <reconnect_tries>: '%s' is %s\n",
|
printf("%s[%ld]: Error: In <reconnect_tries>: '%s' is %s\n",
|
||||||
fileName, xmlGetLineNo(cur), ls_xmlContentPtr, errstr);
|
fileName, xmlGetLineNo(cur), ls_xmlContentPtr, errstr);
|
||||||
@ -437,7 +437,7 @@ parseConfig(const char *fileName)
|
|||||||
const char *errstr;
|
const char *errstr;
|
||||||
|
|
||||||
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
|
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
|
||||||
ezConfig.serverPublic = strtonum(ls_xmlContentPtr, 0, 1, &errstr);
|
ezConfig.serverPublic = (int)strtonum(ls_xmlContentPtr, 0, 1, &errstr);
|
||||||
if (errstr) {
|
if (errstr) {
|
||||||
printf("%s[%ld]: Error: <svrinfopublic> may only contain 1 or 0\n",
|
printf("%s[%ld]: Error: <svrinfopublic> may only contain 1 or 0\n",
|
||||||
fileName, xmlGetLineNo(cur));
|
fileName, xmlGetLineNo(cur));
|
||||||
@ -466,7 +466,7 @@ parseConfig(const char *fileName)
|
|||||||
const char *errstr;
|
const char *errstr;
|
||||||
|
|
||||||
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur2->xmlChildrenNode, 1);
|
ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur2->xmlChildrenNode, 1);
|
||||||
ezConfig.reencode = strtonum(ls_xmlContentPtr, 0, 1, &errstr);
|
ezConfig.reencode = (int)strtonum(ls_xmlContentPtr, 0, 1, &errstr);
|
||||||
if (errstr) {
|
if (errstr) {
|
||||||
printf("%s[%ld]: Error: <enable> may only contain 1 or 0\n",
|
printf("%s[%ld]: Error: <enable> may only contain 1 or 0\n",
|
||||||
fileName, xmlGetLineNo(cur));
|
fileName, xmlGetLineNo(cur));
|
||||||
|
@ -217,7 +217,7 @@ urlParse(const char *url, char **hostname, int *port, char **mountname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
strlcpy(tmpPort, p2, (p3 - p2) + 1);
|
strlcpy(tmpPort, p2, (p3 - p2) + 1);
|
||||||
*port = strtonum(tmpPort, 1, 65535, &errstr);
|
*port = (int)strtonum(tmpPort, 1, 65535, &errstr);
|
||||||
if (errstr) {
|
if (errstr) {
|
||||||
printf("%s: Error: Invalid <url>: Port '%s' is %s\n",
|
printf("%s: Error: Invalid <url>: Port '%s' is %s\n",
|
||||||
__progname, tmpPort, errstr);
|
__progname, tmpPort, errstr);
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "strfctns.h"
|
#include "strfctns.h"
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
#define INVALID 1
|
#define INVALID 1
|
||||||
#define TOOSMALL 2
|
#define TOOSMALL 2
|
||||||
@ -37,10 +38,6 @@
|
|||||||
# define LLONG_MAX LONG_LONG_MAX
|
# define LLONG_MAX LONG_LONG_MAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
# define strtoll _strtoi64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
long long
|
long long
|
||||||
local_strtonum(const char *numstr, long long minval, long long maxval,
|
local_strtonum(const char *numstr, long long minval, long long maxval,
|
||||||
const char **errstrp)
|
const char **errstrp)
|
||||||
|
Loading…
Reference in New Issue
Block a user