diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-09-08 14:15:28 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-09-08 14:15:28 +0200 |
commit | faf7004c13f45442a6cdbe68ba977523d6593fc7 (patch) | |
tree | ac89711aa837fefbd02b157cb5f18685acd25b15 /src | |
parent | 83ba73a034583165d03873e8c3098397fc9ae5e8 (diff) | |
download | pianobar-faf7004c13f45442a6cdbe68ba977523d6593fc7.tar.gz pianobar-faf7004c13f45442a6cdbe68ba977523d6593fc7.tar.bz2 pianobar-faf7004c13f45442a6cdbe68ba977523d6593fc7.zip |
C99 conformance
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 3 | ||||
-rw-r--r-- | src/settings.c | 2 | ||||
-rw-r--r-- | src/terminal.c | 7 | ||||
-rw-r--r-- | src/terminal.h | 4 | ||||
-rw-r--r-- | src/ui.c | 4 | ||||
-rw-r--r-- | src/ui.h | 8 | ||||
-rw-r--r-- | src/ui_readline.c | 2 | ||||
-rw-r--r-- | src/ui_readline.h | 2 |
8 files changed, 22 insertions, 10 deletions
@@ -21,6 +21,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define _POSIX_C_SOURCE 1 /* fileno() */ +#define _BSD_SOURCE /* strdup() */ + /* system includes */ #include <stdlib.h> #include <string.h> diff --git a/src/settings.c b/src/settings.c index 341510f..a7d6f61 100644 --- a/src/settings.c +++ b/src/settings.c @@ -23,6 +23,8 @@ THE SOFTWARE. /* application settings */ +#define _BSD_SOURCE /* strdup() */ + #include <string.h> #include <stdlib.h> #include <stdio.h> diff --git a/src/terminal.c b/src/terminal.c index ab96004..2875638 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -21,6 +21,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define _POSIX_C_SOURCE 1 /* fileno() */ +#define _BSD_SOURCE /* setlinebuf() */ + #include <termios.h> #include <stdio.h> @@ -60,14 +63,14 @@ void BarTermSetBuffer (char enable) { /* Save old terminal settings * @param save settings here */ -inline void BarTermSave (struct termios *termOrig) { +void BarTermSave (struct termios *termOrig) { tcgetattr (fileno (stdin), termOrig); } /* Restore terminal settings * @param Old settings */ -inline void BarTermRestore (struct termios *termOrig) { +void BarTermRestore (struct termios *termOrig) { tcsetattr (fileno (stdin), TCSANOW, termOrig); } diff --git a/src/terminal.h b/src/terminal.h index 13e9d57..e7aded9 100644 --- a/src/terminal.h +++ b/src/terminal.h @@ -26,7 +26,7 @@ THE SOFTWARE. void BarTermSetEcho (char); void BarTermSetBuffer (char); -inline void BarTermSave (struct termios *); -inline void BarTermRestore (struct termios *termOrig); +void BarTermSave (struct termios *); +void BarTermRestore (struct termios *termOrig); #endif /* _TERMINAL_H */ @@ -23,12 +23,16 @@ THE SOFTWARE. /* everything that interacts with the user */ +#define _POSIX_C_SOURCE 1 /* fileno() */ +#define _BSD_SOURCE /* strdup() */ + #include <stdio.h> #include <stdarg.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <errno.h> +#include <strings.h> /* waitpid () */ #include <sys/types.h> @@ -31,16 +31,16 @@ THE SOFTWARE. typedef enum {MSG_NONE, MSG_INFO, MSG_PLAYING, MSG_TIME, MSG_ERR, MSG_QUESTION, MSG_LIST} uiMsg_t; -inline void BarUiMsg (uiMsg_t type, const char *format, ...); -inline PianoReturn_t BarUiPrintPianoStatus (PianoReturn_t ret); +void BarUiMsg (uiMsg_t type, const char *format, ...); +PianoReturn_t BarUiPrintPianoStatus (PianoReturn_t ret); PianoStation_t *BarUiSelectStation (PianoHandle_t *ph, const char *prompt, FILE *curFd); PianoSong_t *BarUiSelectSong (PianoSong_t *startSong, FILE *curFd); PianoArtist_t *BarUiSelectArtist (PianoArtist_t *startArtist, FILE *curFd); char *BarUiSelectMusicId (PianoHandle_t *ph, FILE *curFd, char *); void BarStationFromGenre (PianoHandle_t *ph, FILE *curFd); -inline void BarUiPrintStation (PianoStation_t *); -inline void BarUiPrintSong (PianoSong_t *, PianoStation_t *); +void BarUiPrintStation (PianoStation_t *); +void BarUiPrintSong (PianoSong_t *, PianoStation_t *); void BarUiStartEventCmd (const BarSettings_t *settings, const char *type, const PianoStation_t *curStation, const PianoSong_t *curSong, PianoReturn_t); diff --git a/src/ui_readline.c b/src/ui_readline.c index 6b92ca6..b368a56 100644 --- a/src/ui_readline.c +++ b/src/ui_readline.c @@ -167,7 +167,7 @@ size_t BarReadline (char *buf, size_t bufSize, const char *mask, * @param buffer size * @return number of bytes read from stdin */ -inline size_t BarReadlineStr (char *buf, size_t bufSize, char noEcho, +size_t BarReadlineStr (char *buf, size_t bufSize, char noEcho, FILE *fd) { return BarReadline (buf, bufSize, NULL, 0, noEcho, fd); } diff --git a/src/ui_readline.h b/src/ui_readline.h index 194668a..f9620b6 100644 --- a/src/ui_readline.h +++ b/src/ui_readline.h @@ -22,7 +22,7 @@ THE SOFTWARE. */ size_t BarReadline (char *, size_t, const char *, char, char, FILE *); -inline size_t BarReadlineStr (char *, size_t, char, FILE *); +size_t BarReadlineStr (char *, size_t, char, FILE *); size_t BarReadlineInt (int *, FILE *); int BarReadlineYesNo (char def, FILE *); |