diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libpiano/crypt.c | 13 | ||||
-rw-r--r-- | src/libpiano/piano.c | 8 | ||||
-rw-r--r-- | src/libpiano/xml.c | 1 | ||||
-rw-r--r-- | src/libpiano/xml.h | 20 | ||||
-rw-r--r-- | src/libwaitress/waitress.c | 2 | ||||
-rw-r--r-- | src/terminal.c | 2 | ||||
-rw-r--r-- | src/ui.c | 2 |
7 files changed, 27 insertions, 21 deletions
diff --git a/src/libpiano/crypt.c b/src/libpiano/crypt.c index 8d743e2..9c96629 100644 --- a/src/libpiano/crypt.c +++ b/src/libpiano/crypt.c @@ -27,6 +27,7 @@ THE SOFTWARE. #include <stdint.h> #include <arpa/inet.h> +#include "crypt.h" #include "crypt_key_output.h" #include "crypt_key_input.h" #include "piano_private.h" @@ -46,10 +47,11 @@ THE SOFTWARE. */ #define INITIAL_SHIFT 28 #define SHIFT_DEC 4 -unsigned char *PianoDecryptString (const unsigned char *strInput) { +char *PianoDecryptString (const char * const s) { + const unsigned char *strInput = (unsigned char *) s; /* hex-decode => strlen/2 + null-byte */ uint32_t *iDecrypt; - unsigned char *strDecrypted; + char *strDecrypted; unsigned char shift = INITIAL_SHIFT, intsDecoded = 0, j; /* blowfish blocks, 32-bit */ uint32_t f, l, r, lrExchange; @@ -58,7 +60,7 @@ unsigned char *PianoDecryptString (const unsigned char *strInput) { sizeof (*iDecrypt))) == NULL) { return NULL; } - strDecrypted = (unsigned char *) iDecrypt; + strDecrypted = (char *) iDecrypt; while (*strInput != '\0') { /* hex-decode string */ @@ -119,7 +121,8 @@ unsigned char *PianoDecryptString (const unsigned char *strInput) { * @param encrypt this * @return encrypted, hex-encoded string */ -unsigned char *PianoEncryptString (const unsigned char *strInput) { +char *PianoEncryptString (const char *s) { + const unsigned char *strInput = (unsigned char *) s; const size_t strInputN = strlen ((char *) strInput); /* num of 64-bit blocks, rounded to next block */ size_t blockN = strInputN / 8 + 1; @@ -193,5 +196,5 @@ unsigned char *PianoEncryptString (const unsigned char *strInput) { free (blockInput); - return strHex; + return (char *) strHex; } diff --git a/src/libpiano/piano.c b/src/libpiano/piano.c index 367a2c9..56f2bf7 100644 --- a/src/libpiano/piano.c +++ b/src/libpiano/piano.c @@ -62,7 +62,7 @@ void PianoInit (PianoHandle_t *ph) { /* destroy artist linked list */ -void PianoDestroyArtists (PianoArtist_t *artists) { +static void PianoDestroyArtists (PianoArtist_t *artists) { PianoArtist_t *curArtist, *lastArtist; curArtist = artists; @@ -98,7 +98,7 @@ void PianoDestroyStation (PianoStation_t *station) { /* free complete station list * @param piano handle */ -void PianoDestroyStations (PianoStation_t *stations) { +static void PianoDestroyStations (PianoStation_t *stations) { PianoStation_t *curStation, *lastStation; curStation = stations; @@ -148,7 +148,7 @@ void PianoDestroyStationInfo (PianoStationInfo_t *info) { /* destroy genre linked list */ -void PianoDestroyGenres (PianoGenre_t *genres) { +static void PianoDestroyGenres (PianoGenre_t *genres) { PianoGenre_t *curGenre, *lastGenre; curGenre = genres; @@ -163,7 +163,7 @@ void PianoDestroyGenres (PianoGenre_t *genres) { /* destroy user information */ -void PianoDestroyUserInfo (PianoUserInfo_t *user) { +static void PianoDestroyUserInfo (PianoUserInfo_t *user) { free (user->webAuthToken); free (user->authToken); free (user->listenerId); diff --git a/src/libpiano/xml.c b/src/libpiano/xml.c index a4250a7..1f6eed7 100644 --- a/src/libpiano/xml.c +++ b/src/libpiano/xml.c @@ -32,6 +32,7 @@ THE SOFTWARE. #include <ezxml.h> #include <assert.h> +#include "xml.h" #include "piano.h" #include "crypt.h" #include "config.h" diff --git a/src/libpiano/xml.h b/src/libpiano/xml.h index cca82c0..58ee28f 100644 --- a/src/libpiano/xml.h +++ b/src/libpiano/xml.h @@ -26,21 +26,21 @@ THE SOFTWARE. #include "piano.h" -PianoReturn_t PianoXmlParseUserinfo (PianoHandle_t *ph, const char *xml); -PianoReturn_t PianoXmlParseStations (PianoHandle_t *ph, const char *xml); -PianoReturn_t PianoXmlParsePlaylist (PianoHandle_t *ph, const char *xml, +PianoReturn_t PianoXmlParseUserinfo (PianoHandle_t *ph, char *xml); +PianoReturn_t PianoXmlParseStations (PianoHandle_t *ph, char *xml); +PianoReturn_t PianoXmlParsePlaylist (PianoHandle_t *ph, char *xml, PianoSong_t **); -PianoReturn_t PianoXmlParseSearch (const char *searchXml, +PianoReturn_t PianoXmlParseSearch (char *searchXml, PianoSearchResult_t *searchResult); -PianoReturn_t PianoXmlParseSimple (const char *xml); +PianoReturn_t PianoXmlParseSimple (char *xml); PianoReturn_t PianoXmlParseCreateStation (PianoHandle_t *ph, - const char *xml); -PianoReturn_t PianoXmlParseAddSeed (PianoHandle_t *ph, const char *xml, + char *xml); +PianoReturn_t PianoXmlParseAddSeed (PianoHandle_t *ph, char *xml, PianoStation_t *station); PianoReturn_t PianoXmlParseGenreExplorer (PianoHandle_t *ph, - const char *xmlContent); -PianoReturn_t PianoXmlParseTranformStation (const char *searchXml); -PianoReturn_t PianoXmlParseNarrative (const char *xml, char **retNarrative); + char *xmlContent); +PianoReturn_t PianoXmlParseTranformStation (char *searchXml); +PianoReturn_t PianoXmlParseNarrative (char *xml, char **retNarrative); PianoReturn_t PianoXmlParseSeedSuggestions (char *, PianoSearchResult_t *); PianoReturn_t PianoXmlParseGetStationInfo (char *, PianoStationInfo_t *); diff --git a/src/libwaitress/waitress.c b/src/libwaitress/waitress.c index c20e059..5d37a4e 100644 --- a/src/libwaitress/waitress.c +++ b/src/libwaitress/waitress.c @@ -85,7 +85,7 @@ void WaitressFree (WaitressHandle_t *waith) { * @param Waitress handle * @return true|false */ -bool WaitressProxyEnabled (const WaitressHandle_t *waith) { +static bool WaitressProxyEnabled (const WaitressHandle_t *waith) { assert (waith != NULL); return waith->proxy.host != NULL; diff --git a/src/terminal.c b/src/terminal.c index d3a1121..44513ce 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -30,6 +30,8 @@ THE SOFTWARE. #include <termios.h> #include <stdio.h> +#include "terminal.h" + /* en/disable echoing for stdin * @param 1 = enable, everything else = disable */ @@ -633,7 +633,7 @@ void BarStationFromGenre (BarApp_t *app) { * @param format characters * @param replacement for each given format character */ -void BarUiCustomFormat (char *dest, size_t destSize, const char *format, +static void BarUiCustomFormat (char *dest, size_t destSize, const char *format, const char *formatChars, const char **formatVals) { bool haveFormatChar = false; |