summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c3
-rw-r--r--src/settings.c2
-rw-r--r--src/terminal.c7
-rw-r--r--src/terminal.h4
-rw-r--r--src/ui.c4
-rw-r--r--src/ui.h8
-rw-r--r--src/ui_readline.c2
-rw-r--r--src/ui_readline.h2
8 files changed, 22 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index 65f5bfd..4549118 100644
--- a/src/main.c
+++ b/src/main.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 /* 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 */
diff --git a/src/ui.c b/src/ui.c
index 8fd5f0f..575bdc5 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -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>
diff --git a/src/ui.h b/src/ui.h
index 8726a13..37c83e8 100644
--- a/src/ui.h
+++ b/src/ui.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 *);