Imported Upstream version 0.6.3
[fdkaac.git] / src / compat_posix.c
index 1b8f14ae71e73e22793876f495b7931cfacff674..f895637c939a55068c4d27aca85569d7f5fd6102 100644 (file)
@@ -32,20 +32,19 @@ FILE *aacenc_fopen(const char *name, const char *mode)
     return fp;
 }
 
-void aacenc_getmainargs(int *argc, char ***argv)
+int aacenc_seekable(FILE *fp)
 {
-    return;
+    return fseek(fp, 0, SEEK_CUR) == 0;
 }
 
-int aacenc_fprintf(FILE *fp, const char *fmt, ...)
+/*
+ * Different from POSIX basename() when path ends with /.
+ * Since we use this only for a regular file, the difference doesn't matter.
+ */
+const char *aacenc_basename(const char *path)
 {
-    va_list ap;
-    int cnt;
-
-    va_start(ap, fmt);
-    cnt = vfprintf(fp, fmt, ap);
-    va_end(ap);
-    return cnt;
+    const char *p = strrchr(path, '/');
+    return p ? p + 1: path;
 }
 
 #ifndef HAVE_ICONV
This page took 0.009999 seconds and 4 git commands to generate.