Index: ChangeLog
===================================================================
--- ChangeLog	(revision 5219)
+++ ChangeLog	(revision 5221)
@@ -3,4 +3,5 @@
 	* Do not set errno to zero in ogg_vorbis codec filter (Closes: #191)
 	* Updated data types for struct roar_audio_info (Closes: #189)
+	* Removed old functions from API (Closes: #186)
 
 v. 0.4 - Fri Nov 11 2011 20:12 CET
Index: doc/man1/roarcatplay.1
===================================================================
--- doc/man1/roarcatplay.1	(revision 3088)
+++ doc/man1/roarcatplay.1	(revision 5221)
@@ -26,12 +26,4 @@
 
 .TP
-\fB--passive\fR
-Use passiv playback (experimental, works only localy)
-
-.TP
-\fB--background\fR
-Use background playback, impleys passive mode
-
-.TP
 \fB--verbose\fR
 Use verbose output
@@ -40,4 +32,9 @@
 \fB--help\fR
 Show this help
+
+.SH "REMOVED OPTIONS"
+The following options has been removed:
+\fB--passive\fR,
+\fB--background\fR
 
 .SH "SEE ALSO"
Index: include/libroar/file.h
===================================================================
--- include/libroar/file.h	(revision 5109)
+++ include/libroar/file.h	(revision 5221)
@@ -45,6 +45,4 @@
 int     roar_file_codecdetect(char * buf, int len);
 ssize_t roar_file_send_raw   (int out, int in) _LIBROAR_ATTR_DEPRECATED;
-ssize_t roar_file_play       (struct roar_connection * con, char * file, int exec) _LIBROAR_ATTR_DEPRECATED;
-ssize_t roar_file_play_full  (struct roar_connection * con, char * file, int exec, int passfh, struct roar_stream * s) _LIBROAR_ATTR_DEPRECATED;
 
 ssize_t roar_file_map        (char * filename, int flags, mode_t mode, size_t len, void ** mem) _LIBROAR_ATTR_DEPRECATED;
Index: libroar/file.c
===================================================================
--- libroar/file.c	(revision 5148)
+++ libroar/file.c	(revision 5221)
@@ -198,160 +198,4 @@
 
 
-ssize_t roar_file_play (struct roar_connection * con, char * file, int exec) {
- return roar_file_play_full(con, file, exec, 0, NULL);
-}
-
-ssize_t roar_file_play_full  (struct roar_connection * con, char * file, int exec, int passfh, struct roar_stream * s) {
-#ifdef _CAN_OPERATE
- int codec = -1;
- int in, out = -1;
- ssize_t r = 0;
- int seek;
- int len;
- char buf[BUFFERSIZE];
- int rate = ROAR_RATE_DEFAULT, channels = ROAR_CHANNELS_DEFAULT, bits = ROAR_BITS_DEFAULT;
- struct roar_stream localstream[1];
-
- // FIXME: check error cases
-
- ROAR_DBG("roar_file_play_full(*) = ?");
-
- if ( s == NULL )
-  s = localstream;
-
- if ( con == NULL ) {
-  roar_err_set(ROAR_ERROR_FAULT);
-  return -1;
- }
-
- if ( file == NULL ) {
-  roar_err_set(ROAR_ERROR_FAULT);
-  return -1;
- }
-
- if ( exec && passfh ) {
-  roar_err_set(ROAR_ERROR_INVAL);
-  return -1;
- }
-
-#ifdef ROAR_TARGET_WIN32
- if ( (in = open(file, O_RDONLY|O_BINARY, 0644)) == -1 ) {
-#else
- if ( (in = open(file, O_RDONLY, 0644)) == -1 ) {
-#endif
-  roar_err_from_errno();
-  return -1;
- }
-
- if ((len = read(in, buf, BUFFERSIZE)) < 1) {
-  roar_err_from_errno();
-  close(in);
-  return -1;
- }
-
- codec = roar_file_codecdetect(buf, len);
-
- ROAR_DBG("roar_file_play_full(*): codec=%i(%s)", codec, roar_codec2str(codec));
-
- seek = lseek(in, 0, SEEK_SET) == (off_t) -1 ? 0 : 1;
-
- if ( codec == -1 ) {
-  ROAR_WARN("roar_file_play_full(*): Unknown codec of file: %s", file);
-  close(in);
-  roar_err_set(ROAR_ERROR_BADMAGIC);
-  return -1;
- }
-
- if ( passfh && !seek ) {
-  ROAR_WARN("roar_file_play_full(*): passfh on non seekable file: this may produce incorrect playback");
- }
-
- if ( exec ) {
-  if ( roar_stream_new(s, rate, channels, bits, codec) == -1 ) {
-   ROAR_DBG("roar_file_play_full(*): Can not create new stream. This is realy BAD!");
-   close(in);
-   return -1;
-  }
-
-  if ( roar_stream_connect2(con, s, ROAR_DIR_PLAY, -1) == -1 ) {
-   ROAR_DBG("roar_file_play_full(*): Can not connect new stream to server.");
-   close(in);
-   return -1;
-  }
-
-  if ( roar_stream_exec(con, s) == -1 ) {
-   ROAR_DBG("roar_file_play_full(*): Can not exec new stream on server.");
-   close(in);
-   return -1;
-  }
-
-  roar_libroar_nowarn();
-  if ( (out = roar_get_connection_fh(con)) == -1 ) {
-   ROAR_DBG("roar_file_play_full(*): Can not get socket of server connection for exec data transmition.");
-   close(in);
-   roar_libroar_warn();
-   return -1;
-  }
-  roar_libroar_warn();
-
-  ROAR_SHUTDOWN(out, SHUT_RD);
- } else {
-  if ( !(passfh && seek) ) {
-   if ( (out = roar_simple_new_stream_obj(con, s, rate, channels, bits, codec, ROAR_DIR_PLAY)) == -1 ) {
-    close(in);
-    return -1;
-   }
-  } else {
-   if ( roar_stream_new(s, rate, channels, bits, codec) == -1 ) {
-    close(in);
-    return -1;
-   }
-
-   if ( roar_stream_connect2(con, s, ROAR_DIR_PLAY, -1) == -1 ) {
-    close(in);
-    return -1;
-   }
-  }
- }
-
- if ( !seek )
-  ROAR_NETWORK_WRITE(out, buf, len);
-
- if ( !passfh ) {
-#ifndef ROAR_TARGET_WIN32
-  r = roar_file_send_raw(out, in);
-
-  close(out);
-#else
- while ((len = read(in, buf, BUFFERSIZE)) > 0)
-  if ( send(out, buf, len, 0) != len )
-   break;
-
- closesocket(out);
-#endif
-
-  if ( exec ) {
-   // TODO: FIXME: this ma cause a memory leak in future
-   // OLD: con->fh = -1;
-   roar_connect_fh(con, -2);
-  }
-
-  close(in);
- } else {
-  if ( roar_stream_passfh(con, s, in) == -1 ) {
-   return -1;
-  }
-  close(out);
-  close(in);
-  return 0;
- }
-
- return r;
-#else
- roar_err_set(ROAR_ERROR_NOSYS);
- return -1;
-#endif
-}
-
 char  * roar_cdromdevice     (void) {
  char * k;
Index: libroaryiff/playback.c
===================================================================
--- libroaryiff/playback.c	(revision 4708)
+++ libroaryiff/playback.c	(revision 5221)
@@ -36,6 +36,88 @@
 #include <libroaryiff.h>
 
+#define BUFFERSIZE  8192
+
+#ifdef ROAR_HAVE_IO_POSIX
+#define _CAN_OPERATE
+#endif
+
 YID YStartPlaySoundObjectSimple (YConnection *con, const char *path) {
  return YStartPlaySoundObject(con, path, NULL);
+}
+
+static inline ssize_t _file_play  (struct roar_connection * con, const char * file, struct roar_stream * s) {
+#ifdef _CAN_OPERATE
+ int codec = -1;
+ int in, out = -1;
+ ssize_t r = 0;
+ int seek;
+ int len;
+ char buf[BUFFERSIZE];
+ int rate = ROAR_RATE_DEFAULT, channels = ROAR_CHANNELS_DEFAULT, bits = ROAR_BITS_DEFAULT;
+
+ // FIXME: check error cases
+
+ ROAR_DBG("roar_file_play_full(*) = ?");
+
+#ifdef ROAR_TARGET_WIN32
+ if ( (in = open(file, O_RDONLY|O_BINARY, 0644)) == -1 ) {
+#else
+ if ( (in = open(file, O_RDONLY, 0644)) == -1 ) {
+#endif
+  roar_err_from_errno();
+  return -1;
+ }
+
+ if ((len = read(in, buf, BUFFERSIZE)) < 1) {
+  roar_err_from_errno();
+  close(in);
+  return -1;
+ }
+
+ codec = roar_file_codecdetect(buf, len);
+
+ ROAR_DBG("roar_file_play_full(*): codec=%i(%s)", codec, roar_codec2str(codec));
+
+ seek = lseek(in, 0, SEEK_SET) == (off_t) -1 ? 0 : 1;
+
+ if ( codec == -1 ) {
+  ROAR_WARN("roar_file_play_full(*): Unknown codec of file: %s", file);
+  close(in);
+  roar_err_set(ROAR_ERROR_BADMAGIC);
+  return -1;
+ }
+
+ if ( !seek ) {
+  ROAR_WARN("roar_file_play_full(*): passfh on non seekable file: this may produce incorrect playback");
+  close(in);
+  roar_err_set(ROAR_ERROR_NOSEEK);
+  return -1;
+ }
+
+ if ( roar_stream_new(s, rate, channels, bits, codec) == -1 ) {
+  close(in);
+  return -1;
+ }
+
+ if ( roar_stream_connect2(con, s, ROAR_DIR_PLAY, -1) == -1 ) {
+  close(in);
+  return -1;
+ }
+
+ if ( roar_stream_passfh(con, s, in) == -1 ) {
+  close(in);
+  roar_kick(con, ROAR_OT_STREAM, roar_stream_get_id(s));
+  return -1;
+ }
+
+ close(out);
+ close(in);
+ return 0;
+
+ return r;
+#else
+ roar_err_set(ROAR_ERROR_NOSYS);
+ return -1;
+#endif
 }
 
@@ -44,8 +126,8 @@
  struct roar_stream     stream[1];
 
- if ( !con )
+ if ( con == NULL )
   return YIDNULL;
 
- if ( !path )
+ if ( path == NULL )
   return YIDNULL;
 
@@ -56,5 +138,5 @@
  // in background
 
- if ( roar_file_play_full(&rcon, (char*)path, 0, 1, stream) == -1 ) {
+ if ( _file_play(&rcon, path, stream) == -1 ) {
   ROAR_ERR("Can not start playback");
   return YIDNULL;
Index: roarclients/roarcatplay.c
===================================================================
--- roarclients/roarcatplay.c	(revision 5109)
+++ roarclients/roarcatplay.c	(revision 5221)
@@ -35,6 +35,4 @@
  printf("  --server SERVER    - Set server hostname\n"
         "  --simple           - Use the simple interface (default)\n"
-        "  --passive          - Use passiv playback (experimental, works only localy)\n"
-        "  --background       - Use background playback, impleys passive mode\n"
         "  --verbose          - Use verbose output\n"
         "  --help             - Show this help\n"
@@ -43,7 +41,4 @@
 }
 
-#define MODE_SIMPLE  1
-#define MODE_PASSIVE 2
-
 int main (int argc, char * argv[]) {
  char * server   = NULL;
@@ -51,13 +46,7 @@
  int    i;
  char * file    = NULL;
- int    mode    = MODE_SIMPLE;
- int    bg      = 0;
  int    verbose = 0;
  roar_vs_t * vss;
  int err;
-#ifdef ROAR_HAVE_UNIX
- struct roar_connection con[1];
- struct roar_stream     stream[1];
-#endif
 
  for (i = 1; i < argc; i++) {
@@ -67,9 +56,5 @@
    server = argv[++i];
   } else if ( strcmp(k, "--simple") == 0 ) {
-   mode = MODE_SIMPLE;
-  } else if ( strcmp(k, "--passive") == 0 ) {
-   mode = MODE_PASSIVE;
-  } else if ( strcmp(k, "--background") == 0 ) {
-   bg = 1;
+   /* no op */
   } else if ( strcmp(k, "--verbose") == 0 || strcmp(k, "-v") == 0 ) {
    verbose++;
@@ -86,55 +71,14 @@
  }
 
- if ( bg )
-  mode = MODE_PASSIVE;
-
-#ifndef ROAR_HAVE_UNIX
- if ( mode == MODE_PASSIVE ) {
-  fprintf(stderr, "Error: passive mode is not supported on this system.\n");
-  return 1;
- }
-#endif
-
- if ( mode == MODE_PASSIVE ) {
-  fprintf(stderr, "Warning: passive mode is obsoleted and will be removed soon.\n");
- }
-
  if ( file == NULL )
   file = "/dev/stdin";
 
-#ifdef ROAR_HAVE_UNIX
- if ( mode == MODE_PASSIVE ) {
-  if ( roar_simple_connect(con, server, "roarcatplay") == -1 ) {
-   ROAR_ERR("Can not connect to server");
-   return 0;
-  }
-
-  if ( roar_file_play_full(con, file, 0, 1, stream) == -1 ) {
-   ROAR_ERR("Can not start playback");
-   return 1;
-  }
-
-  if ( bg ) {
-   if ( roar_stream_attach_simple(con, stream, 0) == -1 ) {
-    ROAR_ERR("Can not attach stream to server");
-   }
-  } else {
-   roar_sleep(10);
-  }
-
-  roar_disconnect(con);
-
- } else { // MODE_SIMPLE
-#endif
-  if ( (vss = roar_vs_new_from_file(server, "roarcatplay", file, &err)) == NULL ) {
-   ROAR_ERR("Can not start playback: %s", roar_error2str(err));
-   return 1;
-  }
-  roar_vs_run(vss, NULL);
-  roar_vs_sync(vss, ROAR_VS_WAIT, NULL);
-  roar_vs_close(vss, ROAR_VS_FALSE, NULL);
-#ifdef ROAR_HAVE_UNIX
+ if ( (vss = roar_vs_new_from_file(server, "roarcatplay", file, &err)) == NULL ) {
+  ROAR_ERR("Can not start playback: %s", roar_error2str(err));
+  return 1;
  }
-#endif
+ roar_vs_run(vss, NULL);
+ roar_vs_sync(vss, ROAR_VS_WAIT, NULL);
+ roar_vs_close(vss, ROAR_VS_FALSE, NULL);
 
  return 0;
