From c7bffe3021abde4f8f2866a25cf29160627aa3f8 Mon Sep 17 00:00:00 2001 From: crunchy Date: Wed, 23 Apr 2003 08:53:23 +0000 Subject: restructuring part 2 --- Makefile.am | 2 +- configure.in | 4 +- libmpio/Makefile.am | 4 +- libmpio/debug.c | 313 ------------------------------------------------ libmpio/debug.h | 110 ----------------- libmpio/defs.h | 334 ++++++++++++++++++++++++++++++++++++++++++++++++++++ libmpio/mpio.h | 218 ++++++++++++++++++++++++++++++++++ libmpio/src/defs.h | 334 ---------------------------------------------------- libmpio/src/mpio.h | 218 ---------------------------------- 9 files changed, 558 insertions(+), 979 deletions(-) delete mode 100644 libmpio/debug.c delete mode 100644 libmpio/debug.h create mode 100644 libmpio/defs.h create mode 100644 libmpio/mpio.h delete mode 100644 libmpio/src/defs.h delete mode 100644 libmpio/src/mpio.h diff --git a/Makefile.am b/Makefile.am index b91b948..231d4fb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS=@MPLIB_SUBDIR@ kernel libmpio mpiosh etc tools +SUBDIRS=kernel libmpio mpiosh etc tools sbin_SCRIPTS=mkmpiodev EXTRA_DIST=mpio.spec mkmpiodev diff --git a/configure.in b/configure.in index a2af5cc..62a9418 100644 --- a/configure.in +++ b/configure.in @@ -46,11 +46,13 @@ AC_CACHE_CHECK([whether to use mplib], TEST_MPLIB if test "$ac_cv_use_mplib" = yes; then - AC_CONFIG_SUBDIRS(mplib) MPLIB_INCLUDE=-Implib MPLIB_CFLAGS=-DMPLIB fi +AC_SUBST(MPLIB_INCLUDE) +AC_SUBST(MPLIB_CFLAGS) +: dnl --- check for kernel version kernel_version=`uname -r 2>&1` echo -n "checking for kernel version ... " diff --git a/libmpio/Makefile.am b/libmpio/Makefile.am index 1451b75..2adfa19 100644 --- a/libmpio/Makefile.am +++ b/libmpio/Makefile.am @@ -19,8 +19,8 @@ libmpio_la_SOURCES= \ mplib/xmalloc.c pkginclude_HEADERS= \ - src/mpio.h \ - src/defs.h + mpio.h \ + defs.h noinst_HEADERS= \ src/io.h \ diff --git a/libmpio/debug.c b/libmpio/debug.c deleted file mode 100644 index c1ead3e..0000000 --- a/libmpio/debug.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - * debug.c - * - * Authors: Dirk Meyer - * Andreas Büsching - * - * $Id: debug.c,v 1.3 2003/03/20 13:34:05 crunchy Exp $ - */ - -#include "debug.h" - -#include -#include -#include -#include -#include - -#define DCOLOR "_color" -#define DFILE "_file" -#define DSUFFIX "_debug" -#define LEVEL_HEXDUMP 5 - -#define CHECK_FD if (__debug_fd == NULL) return; - -char *__debug_color = NULL; -int __debug_level = 0; -FILE *__debug_fd = NULL; - -void -debug_init(void) { - char *env_var = malloc(strlen(DPACKAGE) + strlen(DFILE) + 1); - const char *env; - - /* check debug output file */ - strcpy(env_var, DPACKAGE); - strcat(env_var, DFILE); - - if ((env = getenv(env_var))) { - if (__debug_fd && fileno(__debug_fd) != -1) { - fclose(__debug_fd); - } - - __debug_fd = fopen(env, "a"); - if (!__debug_fd) { - __debug_fd = stderr; - } - } else { - __debug_fd = stderr; - } - - free(env_var); - - /* check debug level */ - env_var = malloc(strlen(DPACKAGE) + strlen(DSUFFIX) + 1); - strcpy(env_var, DPACKAGE); - strcat(env_var, DSUFFIX); - - if ((env = getenv(env_var))) - if (isdigit(env[0])) - __debug_level = strtol(env, NULL, 10); - else - __debug_level = 1; - else - __debug_level = -1; - - free(env_var); - - /* check debug color */ - env_var = malloc(strlen(DPACKAGE) + strlen(DCOLOR) + 1); - - strcpy(env_var, DPACKAGE); - strcat(env_var, DCOLOR); - - if (__debug_color) free(__debug_color); - __debug_color = NULL; - - if ((env = getenv(env_var))) { - if (env[0] != '\0') { - __debug_color = malloc(4 + strlen(env)); - sprintf(__debug_color, "\033[%sm", env); - } else - __debug_color = malloc(6); - strcpy(__debug_color, "\033[32m"); - } else { - __debug_color = NULL; - } - - free(env_var); -} - -int -debug_file(char *filename) -{ - if (__debug_fd && fileno(__debug_fd) != -1) { - fclose(__debug_fd); - } - - __debug_fd = fopen(filename, "a"); - if (!__debug_fd) { - perror("fopen:"); - __debug_fd = stderr; - return 0; - } - - return 1; -} - -int -debug_level(int level) -{ - int tmp = __debug_level; - - __debug_level = level; - - return tmp; -} - -int -debug_level_get(void) -{ - return __debug_level; -} - - -void -_hexdump (const char *package, const char* file, int line, - const char* function, const char* data, int len) -{ - char buf[17]; - int i; - - CHECK_FD; - - if (_use_debug(LEVEL_HEXDUMP)) { - fprintf (__debug_fd, "%s%s:\033[m %s(%d): %s: data=%p len=%d\n", - __debug_color, package, file, line, function, data, len); - for (i = 0; data != NULL && i < len; i++) { - if (i % 16 == 0) - fprintf(__debug_fd, "\033[30m%s:\033[m %04x: ", package, i); - fprintf(__debug_fd, "%02x ", (unsigned int)(unsigned char)data[i]); - buf[i % 16] = (data[i] >= 32 && data[i] <= 126) ? data[i] : '.'; - buf[i % 16 + 1] = '\0'; - if (i % 4 == 3) fprintf(__debug_fd, " "); - if (i % 16 == 15) fprintf(__debug_fd, "%s\n", buf); - } - if (i % 16 != 0) { - for (; i % 16 != 0; i++) - fprintf (__debug_fd, (i % 4 == 3) ? " " : " "); - fprintf(__debug_fd, "%s\n", buf); - } - } -} - -void -_hexdump_n (const char *package, const int n, const char* file, int line, - const char* function, const char* data, int len) -{ - char buf[17]; - int i; - - CHECK_FD; - - if (_use_debug(n)) { - fprintf (__debug_fd, "%s%s:\033[m %s(%d): %s: data=%p len=%d\n", - __debug_color, package, file, line, function, data, len); - for (i = 0; data != NULL && i < len; i++) { - if (i % 16 == 0) - fprintf(__debug_fd, "\033[30m%s:\033[m %04x: ", package, i); - fprintf(__debug_fd, "%02x ", (unsigned int)(unsigned char)data[i]); - buf[i % 16] = (data[i] >= 32 && data[i] <= 126) ? data[i] : '.'; - buf[i % 16 + 1] = '\0'; - if (i % 4 == 3) fprintf(__debug_fd, " "); - if (i % 16 == 15) fprintf(__debug_fd, "%s\n", buf); - } - if (i % 16 != 0) { - for (; i % 16 != 0; i++) - fprintf (__debug_fd, (i % 4 == 3) ? " " : " "); - fprintf(__debug_fd, "%s\n", buf); - } - } -} - - -void -_hexdump_text (const char *text, - const char *package, const char *file, int line, - const char *function, const char *data, int len) -{ - CHECK_FD; - - if (_use_debug(LEVEL_HEXDUMP)) { - fprintf(__debug_fd, "%s%s: %s(%d): %s: %s\033[m", __debug_color, - package, file, line, function, text); - _hexdump(package, file, line, function, data, len); - } -} - - - -void -_error(const char *package, const char *file, int line, - const char *function, int fatal, const char *format, ...) -{ - char foo[2048]; - va_list ap; - - CHECK_FD; - - va_start(ap, format); - - - vsnprintf(foo, sizeof(foo) - strlen(format) - 1, format, ap); - if (_use_debug(0)) - fprintf(__debug_fd, "\033[31m%s: %s(%d): %s: %s\033[m", - package, file, line, function, foo); - else - fprintf(__debug_fd, "%s: %s(%d): %s: %s", - package, file, line, function, foo); - fflush(__debug_fd); - - if (fatal) { - fprintf(__debug_fd, "\033[31mfatal error -- exit programm\033[m\n"); - exit(1); - } - - va_end(ap); -} - -void -_debug(const char *package, const char *file, int line, - const char *function, const char *format, ...) -{ - char foo[2048]; - va_list ap; - va_start(ap, format); - - CHECK_FD; - - vsnprintf(foo, sizeof(foo) - strlen(format) - 1, format, ap); - - if (_use_debug(0)) { - fprintf(__debug_fd, "%s%s: %s(%d): %s: %s\033[m", - ( __debug_color ? __debug_color : ""), - package, file, line, function, foo); - fflush(__debug_fd); - } - - va_end(ap); -} - -void -_debug_n(const char *package, const int n, const char *file, - int line, const char *function, const char *format, ...) -{ - char foo[2048]; - va_list ap; - va_start(ap, format); - - CHECK_FD; - - vsnprintf(foo, sizeof(foo) - strlen(format) - 1, format, ap); - - if (_use_debug(n)) { - fprintf(__debug_fd, "%s%s: %s(%d): %s: %s\033[m", - ( __debug_color ? __debug_color : ""), - package, file, line, function, foo); - fflush(__debug_fd); - } - - va_end(ap); -} - -void -_octetstr(const char *package, const char *file, int line, - const char *function, const uint8_t *str, - const unsigned int len, const char *what) -{ - CHECK_FD; - - if (_use_debug(LEVEL_HEXDUMP)) { - unsigned int i; - - fprintf(__debug_fd, "%s%s: %s(%d): %s: ", - package, file, function, line, (what?what:"")); - for (i = 0; i < len; i++) { - if (i < (len - 1)) - fprintf(__debug_fd, "%03d.", str [i]); - else - fprintf(__debug_fd, "%03d", str [i]); - } - } -} - -int -_use_debug(int level) -{ - if (__debug_level == -1) return 0; - - CHECK_FD; - - if (level <= __debug_level) { - return 1; - } - - return 0; -} - -/* end of debug.c */ - - - - - diff --git a/libmpio/debug.h b/libmpio/debug.h deleted file mode 100644 index 09ae078..0000000 --- a/libmpio/debug.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * debug.h - * - * Author: Dirk Meyer - * Andreas Büsching - * - * $Id: debug.h,v 1.2 2002/10/26 13:07:43 germeier Exp $ - */ - -#ifndef _MPIO_DEBUG_H_ -#define _MPIO_DEBUG_H_ - -// if DPACKAGE is not definied use PACKAGE or "unknown" - -#ifndef DPACKAGE - -#ifdef PACKAGE -#define DPACKAGE PACKAGE -#else -#define DPACKAGE unknown -#endif - -#endif - -#include - -#ifdef sun -#include -#else -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef PBOOL -#define PBOOL(x) (x)?"True":"False" -#endif - -#define UNUSED(x) (x = x) - -#define debugn(n,args...) \ - _debug_n(DPACKAGE, n, __FILE__, __LINE__, __FUNCTION__, args) - -#define debug(args...) \ - _debug(DPACKAGE, __FILE__, __LINE__, __FUNCTION__, args) - -#define debug_error(fatal,args...) \ - _error(DPACKAGE, __FILE__, __LINE__, __FUNCTION__, fatal, args) - -#define hexdump(data,len) \ - _hexdump(DPACKAGE, __FILE__, __LINE__, __FUNCTION__, data, len) - -#define hexdumpn(n,data,len) \ - _hexdump_n(DPACKAGE, n, __FILE__, __LINE__, __FUNCTION__, data, len) - -#define hexdump_text(text,data,len) \ - _hexdump_text(text, DPACKAGE, __FILE__, __LINE__, __FUNCTION__, data, len) - -#define octetstrdump(data,len) \ - _octetstr(DPACKAGE, __FILE__, __LINE__, __FUNCTION__, data, len) - -#define ipadr_dump(data,len,text) \ - _octetstr(DPACKAGE, __FILE__, __LINE__, __FUNCTION__, data, len, text) - -#define use_debug() \ - use_debug(DPACKAGE) - - -#define with_special_debug(what) \ - _use_debug(DPACKAGE, what) - -void debug_init(void); -int debug_file(char *filename); -int debug_level(int level); -int debug_level_get(void); - -void _debug(const char *package, const char* file, int line, - const char* function, const char *format, ...); - -void _debug_n(const char *package, const int n, const char* file, - int line, const char* function, const char *format, ...); - -void _hexdump (const char *package, const char* file, int line, - const char* function, const char* data, int len); - -void _hexdump_n (const char *package, const int n, const char* file, int line, - const char* function, const char* data, int len); - -void _hexdump_text (const char *text, - const char *package, const char* file, int line, - const char* function, const char* data, int len); - -void _error(const char *package, const char* file, int line, - const char* function, int fatal, const char *format, ...); - -void _octetstr(const char *package, const char* file, int line, - const char* function, const uint8_t *str, - const unsigned int len, const char *what); - -int _use_debug(int level); - -#ifdef __cplusplus -} -#endif - -#endif /* _MPIO_DEBUG_H_ */ - -/* end of debug.h */ diff --git a/libmpio/defs.h b/libmpio/defs.h new file mode 100644 index 0000000..fa9483e --- /dev/null +++ b/libmpio/defs.h @@ -0,0 +1,334 @@ +/* -*- linux-c -*- */ + +/* + * $Id: defs.h,v 1.24 2003/04/23 08:53:23 crunchy Exp $ + * + * Library for USB MPIO-* + * + * Markus Germeier (mager@tzi.de) + * + * uses code from mpio_stat.c by + * Yuji Touya (salmoon@users.sourceforge.net) + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * */ + +#ifndef _MPIO_DEFS_H_ +#define _MPIO_DEFS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef unsigned int DWORD; + +/* Memory selection */ +typedef enum { MPIO_INTERNAL_MEM = 0x01, + MPIO_EXTERNAL_MEM = 0x10 } mpio_mem_t; + +/* model type */ +typedef enum { MPIO_MODEL_DME = 0x00, + MPIO_MODEL_DMG = 0x01, + MPIO_MODEL_DMG_PLUS = 0x02, + MPIO_MODEL_DMB = 0x03, + MPIO_MODEL_DMB_PLUS = 0x04, + MPIO_MODEL_DMK = 0x05, + MPIO_MODEL_FD100 = 0x06, + MPIO_MODEL_FL100 = 0x07, + MPIO_MODEL_FY100 = 0x08, + MPIO_MODEL_UNKNOWN = 0x09 } mpio_model_t; + +/* USB commands */ +typedef enum { GET_VERSION = 0x01, + GET_BLOCK = 0x02, + PUT_SECTOR = 0x03, + DEL_BLOCK = 0x04, + GET_SECTOR = 0x06, + GET_SPARE_AREA = 0x07, + PUT_BLOCK = 0x08, + MODIFY_FIRMWARE = 0xa0 } mpio_cmd_t; + +/* file types on internal memory */ +/* found in the code of salmoon, are these needed? -mager */ +typedef enum { FTYPE_CHAN = 0x00, + FTYPE_MUSIC = 0x01, + FTYPE_CONF = 'C', + FTYPE_FONT = 'F', + FTYPE_OTHER = 'H', + FTYPE_MEMO = 'M', + FTYPE_WAV = 'V', + FTYPE_ENTRY = 'R', + FTYPE_DIR = 'D', + FTYPE_PLAIN = '-'} mpio_filetype_t; + +/* fixed filenames */ +#define MPIO_CONFIG_FILE "CONFIG.DAT" +#define MPIO_CHANNEL_FILE "FMCONFIG.DAT" +#define MPIO_MPIO_RECORD "MPIO RECORD" + +/* type of callback functions */ +typedef BYTE (*mpio_callback_t)(int, int) ; +typedef BYTE (*mpio_callback_init_t)(mpio_mem_t, int, int) ; + +/* zone lookup table */ +#define MPIO_ZONE_MAX 8 /* 8* 16MB = 128MB */ +#define MPIO_ZONE_PBLOCKS 1024 /* physical blocks per zone */ +#define MPIO_ZONE_LBLOCKS 1000 /* logical blocks per zone */ +typedef DWORD mpio_zonetable_t[MPIO_ZONE_MAX][MPIO_ZONE_PBLOCKS]; + +#define MPIO_BLOCK_FREE 0xffff +#define MPIO_BLOCK_DEFECT 0xffee +#define MPIO_BLOCK_CIS 0xaaaa +#define MPIO_BLOCK_NOT_FOUND 0xcccccccc + +/* filenames */ +#define MPIO_FILENAME_LEN 129 +typedef BYTE mpio_filename_t[MPIO_FILENAME_LEN]; + +#ifndef NULL +#define NULL 0 +#endif + +#define MPIO_DEVICE "/dev/usb/mpio" +#define MPIO_CHARSET "ISO-8859-15" + +#define MPIO_ID3_FORMAT "%p - %t" + +#define SECTOR_SIZE 0x200 +#define SECTOR_ECC 0x040 +#define SECTOR_TRANS (SECTOR_SIZE + SECTOR_ECC) + +#define BLOCK_SECTORS 0x20 /* 0x10 8MB Smartmedia :salmoon */ +#define BLOCK_SIZE (SECTOR_SIZE * BLOCK_SECTORS) +#define BLOCK_TRANS (BLOCK_SIZE + (SECTOR_ECC * BLOCK_SECTORS)) + +#define DIR_NUM 0x10 +#define DIR_SIZE (SECTOR_SIZE*DIR_NUM) +#define DIR_ENTRY_SIZE 0x20 + +#define SMALL_MEM 0x02 + +#define CMD_SIZE 0x40 + +#define INFO_LINE 129 + +/* error codes */ +typedef struct { + int id; + char *msg; +} mpio_error_t; + +#define MPIO_OK 0 +#define MPIO_ERR_FILE_NOT_FOUND -1 +#define MPIO_ERR_NOT_ENOUGH_SPACE -2 +#define MPIO_ERR_FILE_EXISTS -3 +#define MPIO_ERR_FAT_ERROR -4 +#define MPIO_ERR_READING_FILE -5 +#define MPIO_ERR_PERMISSION_DENIED -6 +#define MPIO_ERR_WRITING_FILE -7 +#define MPIO_ERR_DIR_TOO_LONG -8 +#define MPIO_ERR_DIR_NOT_FOUND -9 +#define MPIO_ERR_DIR_NOT_A_DIR -10 +#define MPIO_ERR_DIR_NAME_ERROR -11 +#define MPIO_ERR_DIR_NOT_EMPTY -12 +#define MPIO_ERR_DEVICE_NOT_READY -13 +#define MPIO_ERR_OUT_OF_MEMORY -14 +#define MPIO_ERR_INTERNAL -15 +/* internal errors, occur when UI has errors! */ +#define MPIO_ERR_INT_STRING_INVALID -101 + +/* get formatted information, about the MPIO player */ + +typedef struct { + BYTE firmware_id[INFO_LINE]; + BYTE firmware_version[INFO_LINE]; + BYTE firmware_date[INFO_LINE]; + + BYTE model[INFO_LINE]; + + BYTE mem_internal[INFO_LINE]; + BYTE mem_external[INFO_LINE]; + +} mpio_info_t; + +/* view of the MPIO firmware */ +typedef struct { + /* everything we get from GET_VERSION */ + BYTE id[12]; + BYTE major[3]; + BYTE minor[3]; + BYTE year[5]; + BYTE month[3]; + BYTE day[3]; +} mpio_firmware_t; + +/* */ +typedef struct { + DWORD NumCylinder; + DWORD NumHead; + DWORD NumSector; + DWORD SumSector; +} mpio_disk_phy_t; + +/* */ + +struct mpio_directory_tx { + BYTE name[INFO_LINE]; + BYTE dir[BLOCK_SIZE]; + + BYTE *dentry; + + struct mpio_directory_tx *prev; + struct mpio_directory_tx *next; + +}; +typedef struct mpio_directory_tx mpio_directory_t; + + +/* view of a SmartMedia(tm) card */ +typedef struct { + BYTE id; + BYTE manufacturer; + WORD size; /* MB */ + BYTE chips; /* this is the hack for + MPIO internal representation, because + there might be up to four chips involved */ + + /* only needed for external SmartMedia cards */ + mpio_disk_phy_t geo; + + BYTE cis[SECTOR_SIZE]; + BYTE mbr[SECTOR_SIZE]; /* Master Boot Record */ + BYTE pbr[SECTOR_SIZE]; /* Partition Boot Record */ + + int pbr_offset; /* sector offset for the PBR */ + int fat_offset; /* sector offset for the FAT */ + int dir_offset; + + /* these are needed for internal and external cards */ + int max_cluster; /* # of clusters actually available */ + int fat_size; /* # sectors for FAT */ + int fat_nums; /* # of FATs */ + BYTE * fat; /* *real FAT (like in block allocation :-) */ + + /* needed for directory support */ + mpio_directory_t *root; /* root directory */ + mpio_directory_t *cdir; /* current directory */ + + /* how many physical blocks are available + * for internal memory is this value equal to max_cluster + */ + int max_blocks; + BYTE * spare; + + /* lookup table for phys.<->log. block mapping */ + mpio_zonetable_t zonetable; + +} mpio_smartmedia_t; + +/* health status of a memory "card" */ +typedef struct { + WORD total; /* total blocks on "card" */ + WORD spare; /* (available spare blocks */ + WORD broken; /* broken blocks */ +} mpio_health_single_t; + +typedef struct { + BYTE num; /* number of chips or zones */ + /* internal: max 4 chips + * external: max 8 zones (128MB) -> max 8 */ + mpio_health_single_t data[8]; +} mpio_health_t; + +/* view of the MPIO-* */ +typedef struct { + BYTE version[CMD_SIZE]; + + int fd; + BYTE *charset; /* charset used for filename conversion */ + + BYTE id3; /* enable/disable ID3 rewriting support */ + BYTE id3_format[INFO_LINE]; + BYTE id3_temp[INFO_LINE]; + + mpio_firmware_t firmware; + + mpio_model_t model; + + mpio_smartmedia_t internal; + mpio_smartmedia_t external; +} mpio_t; + +typedef struct { + mpio_t *m; + BYTE mem; /* internal/external memory */ + + DWORD entry; /* number of FAT entry */ + + /* internal */ + BYTE i_index; /* file index of file to store */ + BYTE i_fat[16]; /* internal FAT entry */ + + /* external */ + DWORD e_sector; /* logical startsector of cluster */ + + /* mapping to HW (== block address) */ + DWORD hw_address; /* 3 bytes block addressing + 1 byte chip */ + +} mpio_fatentry_t; + + +/* these are copied from: + * http://www.linuxhq.com/kernel/v2.4/doc/filesystems/vfat.txt.html + * + */ + +typedef struct { // Short 8.3 names + unsigned char name[8]; // file name + unsigned char ext[3]; // file extension + unsigned char attr; // attribute byte + unsigned char lcase; // Case for base and extension + unsigned char ctime_ms; // Creation time, milliseconds + unsigned char ctime[2]; // Creation time + unsigned char cdate[2]; // Creation date + unsigned char adate[2]; // Last access date + unsigned char reserved[2]; // reserved values (ignored) + unsigned char time[2]; // time stamp + unsigned char date[2]; // date stamp + unsigned char start[2]; // starting cluster number + unsigned char size[4]; // size of the file +} mpio_dir_entry_t; + +typedef struct { // Up to 13 characters of a long name + unsigned char id; // sequence number for slot + unsigned char name0_4[10]; // first 5 characters in name + unsigned char attr; // attribute byte + unsigned char reserved; // always 0 + unsigned char alias_checksum; // checksum for 8.3 alias + unsigned char name5_10[12]; // 6 more characters in name + unsigned char start[2]; // starting cluster number + unsigned char name11_12[4]; // last 2 characters in name +} mpio_dir_slot_t; + +#ifdef __cplusplus +} +#endif + +#endif /* _MPIO_DEFS_H_ */ + diff --git a/libmpio/mpio.h b/libmpio/mpio.h new file mode 100644 index 0000000..436ff85 --- /dev/null +++ b/libmpio/mpio.h @@ -0,0 +1,218 @@ +#/* -*- linux-c -*- */ + +/* + * $Id: mpio.h,v 1.20 2003/04/23 08:53:24 crunchy Exp $ + * + * Library for USB MPIO-* + * + * Markus Germeier (mager@tzi.de) + * + * uses code from mpio_stat.c by + * Yuji Touya (salmoon@users.sourceforge.net) + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * */ + +#ifndef _MPIO_H_ +#define _MPIO_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "defs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + *init and shutdown + */ + +mpio_t *mpio_init(mpio_callback_init_t); +void mpio_close(mpio_t *); + +/* + * request information + */ + +/* get version */ +void mpio_get_info(mpio_t *, mpio_info_t *); +/* get model */ +mpio_model_t mpio_get_model(mpio_t *); +/* retrieves free memory in bytes */ +int mpio_memory_free(mpio_t *, mpio_mem_t, int *free); + +/* + * charset for filename encoding/converting + */ +BYTE *mpio_charset_get(mpio_t *); +BYTE mpio_charset_set(mpio_t *, BYTE *); + +/* + * directory operations + */ + +/* context, memory bank */ +BYTE* mpio_directory_open(mpio_t *, mpio_mem_t); +/* context, memory bank, directory name */ +int mpio_directory_make(mpio_t *, mpio_mem_t, BYTE *); +/* context, memory bank, directory name */ +int mpio_directory_cd(mpio_t *, mpio_mem_t, BYTE *); +/* context, memory bank, directory name buffer space */ +void mpio_directory_pwd(mpio_t *, mpio_mem_t, BYTE pwd[INFO_LINE]); +/* context, dir context */ +BYTE* mpio_dentry_next(mpio_t *, mpio_mem_t, BYTE *); +/* context, dir context */ +int mpio_dentry_get(mpio_t *, mpio_mem_t, BYTE *, BYTE *, int,WORD *, + BYTE *, BYTE *, BYTE *, BYTE *, DWORD *, BYTE *); + +/* + * reading/writing/deleting of files + */ + +int mpio_file_get_as(mpio_t *, mpio_mem_t, mpio_filename_t, + mpio_filename_t,mpio_callback_t); + +/* context, memory bank, filename, callback */ +int mpio_file_get(mpio_t *, mpio_mem_t, mpio_filename_t, mpio_callback_t); + +/* context, memory bank, filename, filetype, callback */ +int mpio_file_put(mpio_t *, mpio_mem_t, mpio_filename_t, mpio_filetype_t, + mpio_callback_t); + +/* context, memory bank, filename, as, filetype, callback */ +int mpio_file_put_as(mpio_t *, mpio_mem_t, mpio_filename_t, + mpio_filename_t, mpio_filetype_t, + mpio_callback_t); + +/* context, memory bank, filename, callback */ +int mpio_file_del(mpio_t *, mpio_mem_t, mpio_filename_t, mpio_callback_t); + +/* + * reading/writing files into memory (used for config+font files) + */ + +/* context, memory bank, filename, callback, pointer to memory */ +/* the needed memory is allocated and the memory pointer is return */ +/* via the "BYTE **" */ + +int mpio_file_get_to_memory(mpio_t *, mpio_mem_t, mpio_filename_t, + mpio_callback_t, BYTE **); + +/* context, memory bank, filename, filetype, callback ... */ +/* ... memory pointer, size of file */ +int mpio_file_put_from_memory(mpio_t *, mpio_mem_t, mpio_filename_t, + mpio_filetype_t, mpio_callback_t, + BYTE *, int); + +/* + * rename a file on the MPIO + */ +/* context, memory bank, filename, filename */ +int mpio_file_rename(mpio_t *, mpio_mem_t, + mpio_filename_t, mpio_filename_t); + +/* + * switch position of two files + */ +/* context, memory bank, filename, filename */ +int mpio_file_switch(mpio_t *, mpio_mem_t, + mpio_filename_t, mpio_filename_t); + +/* Move a named file after a given file. If after==NULL move it + to the top of the list, +*/ + +int mpio_file_move(mpio_t *,mpio_mem_t m,mpio_filename_t,mpio_filename_t); + +/* + * formating a memory (internal mem or external SmartMedia card) + */ + +/* context, memory bank, callback */ +int mpio_memory_format(mpio_t *, mpio_mem_t, mpio_callback_t); + +/* mpio_sync has to be called after every set of mpio_file_{del,put} + * operations to write the current state of FAT and (root) directory. + * This is done explicitly to avoid writing these informations to often + * and thereby exhausting the SmartMedia chips + */ +/* context, memory bank */ +int mpio_sync(mpio_t *, mpio_mem_t); + +/* + * ID3 rewriting support + */ + +/* enable disable ID3 rewriting support */ +BYTE mpio_id3_set(mpio_t *, BYTE); +/* query ID3 rewriting support */ +BYTE mpio_id3_get(mpio_t *); + +/* set format string for rewriting*/ +void mpio_id3_format_set(mpio_t *, BYTE *); +/* get format string for rewriting*/ +void mpio_id3_format_get(mpio_t *, BYTE *); + +/* + * "special" functions + */ + +/* returns health status of selected memory */ +int mpio_health(mpio_t *, mpio_mem_t, mpio_health_t *); + +/* + * error handling + */ + +/* returns error code of last error */ +int mpio_errno(void); + +/* returns the description of the error */ +char * mpio_strerror(int err); + +/* prints the error message of the last error*/ +void mpio_perror(char *prefix); + +/* + * debugging + */ + +/* context, memory bank */ +int mpio_memory_dump(mpio_t *, mpio_mem_t); + +/* + * timeline: + * --------- + * 2004: some functions to change the order of files + * 2005: read mp3 tags of the files + */ + +#ifdef __cplusplus +} +#endif + +#endif /* _MPIO_H_ */ + + diff --git a/libmpio/src/defs.h b/libmpio/src/defs.h deleted file mode 100644 index f676e23..0000000 --- a/libmpio/src/defs.h +++ /dev/null @@ -1,334 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * $Id: defs.h,v 1.1 2003/04/23 08:34:14 crunchy Exp $ - * - * Library for USB MPIO-* - * - * Markus Germeier (mager@tzi.de) - * - * uses code from mpio_stat.c by - * Yuji Touya (salmoon@users.sourceforge.net) - * - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * */ - -#ifndef _MPIO_DEFS_H_ -#define _MPIO_DEFS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef unsigned char BYTE; -typedef unsigned short WORD; -typedef unsigned int DWORD; - -/* Memory selection */ -typedef enum { MPIO_INTERNAL_MEM = 0x01, - MPIO_EXTERNAL_MEM = 0x10 } mpio_mem_t; - -/* model type */ -typedef enum { MPIO_MODEL_DME = 0x00, - MPIO_MODEL_DMG = 0x01, - MPIO_MODEL_DMG_PLUS = 0x02, - MPIO_MODEL_DMB = 0x03, - MPIO_MODEL_DMB_PLUS = 0x04, - MPIO_MODEL_DMK = 0x05, - MPIO_MODEL_FD100 = 0x06, - MPIO_MODEL_FL100 = 0x07, - MPIO_MODEL_FY100 = 0x08, - MPIO_MODEL_UNKNOWN = 0x09 } mpio_model_t; - -/* USB commands */ -typedef enum { GET_VERSION = 0x01, - GET_BLOCK = 0x02, - PUT_SECTOR = 0x03, - DEL_BLOCK = 0x04, - GET_SECTOR = 0x06, - GET_SPARE_AREA = 0x07, - PUT_BLOCK = 0x08, - MODIFY_FIRMWARE = 0xa0 } mpio_cmd_t; - -/* file types on internal memory */ -/* found in the code of salmoon, are these needed? -mager */ -typedef enum { FTYPE_CHAN = 0x00, - FTYPE_MUSIC = 0x01, - FTYPE_CONF = 'C', - FTYPE_FONT = 'F', - FTYPE_OTHER = 'H', - FTYPE_MEMO = 'M', - FTYPE_WAV = 'V', - FTYPE_ENTRY = 'R', - FTYPE_DIR = 'D', - FTYPE_PLAIN = '-'} mpio_filetype_t; - -/* fixed filenames */ -#define MPIO_CONFIG_FILE "CONFIG.DAT" -#define MPIO_CHANNEL_FILE "FMCONFIG.DAT" -#define MPIO_MPIO_RECORD "MPIO RECORD" - -/* type of callback functions */ -typedef BYTE (*mpio_callback_t)(int, int) ; -typedef BYTE (*mpio_callback_init_t)(mpio_mem_t, int, int) ; - -/* zone lookup table */ -#define MPIO_ZONE_MAX 8 /* 8* 16MB = 128MB */ -#define MPIO_ZONE_PBLOCKS 1024 /* physical blocks per zone */ -#define MPIO_ZONE_LBLOCKS 1000 /* logical blocks per zone */ -typedef DWORD mpio_zonetable_t[MPIO_ZONE_MAX][MPIO_ZONE_PBLOCKS]; - -#define MPIO_BLOCK_FREE 0xffff -#define MPIO_BLOCK_DEFECT 0xffee -#define MPIO_BLOCK_CIS 0xaaaa -#define MPIO_BLOCK_NOT_FOUND 0xcccccccc - -/* filenames */ -#define MPIO_FILENAME_LEN 129 -typedef BYTE mpio_filename_t[MPIO_FILENAME_LEN]; - -#ifndef NULL -#define NULL 0 -#endif - -#define MPIO_DEVICE "/dev/usb/mpio" -#define MPIO_CHARSET "ISO-8859-15" - -#define MPIO_ID3_FORMAT "%p - %t" - -#define SECTOR_SIZE 0x200 -#define SECTOR_ECC 0x040 -#define SECTOR_TRANS (SECTOR_SIZE + SECTOR_ECC) - -#define BLOCK_SECTORS 0x20 /* 0x10 8MB Smartmedia :salmoon */ -#define BLOCK_SIZE (SECTOR_SIZE * BLOCK_SECTORS) -#define BLOCK_TRANS (BLOCK_SIZE + (SECTOR_ECC * BLOCK_SECTORS)) - -#define DIR_NUM 0x10 -#define DIR_SIZE (SECTOR_SIZE*DIR_NUM) -#define DIR_ENTRY_SIZE 0x20 - -#define SMALL_MEM 0x02 - -#define CMD_SIZE 0x40 - -#define INFO_LINE 129 - -/* error codes */ -typedef struct { - int id; - char *msg; -} mpio_error_t; - -#define MPIO_OK 0 -#define MPIO_ERR_FILE_NOT_FOUND -1 -#define MPIO_ERR_NOT_ENOUGH_SPACE -2 -#define MPIO_ERR_FILE_EXISTS -3 -#define MPIO_ERR_FAT_ERROR -4 -#define MPIO_ERR_READING_FILE -5 -#define MPIO_ERR_PERMISSION_DENIED -6 -#define MPIO_ERR_WRITING_FILE -7 -#define MPIO_ERR_DIR_TOO_LONG -8 -#define MPIO_ERR_DIR_NOT_FOUND -9 -#define MPIO_ERR_DIR_NOT_A_DIR -10 -#define MPIO_ERR_DIR_NAME_ERROR -11 -#define MPIO_ERR_DIR_NOT_EMPTY -12 -#define MPIO_ERR_DEVICE_NOT_READY -13 -#define MPIO_ERR_OUT_OF_MEMORY -14 -#define MPIO_ERR_INTERNAL -15 -/* internal errors, occur when UI has errors! */ -#define MPIO_ERR_INT_STRING_INVALID -101 - -/* get formatted information, about the MPIO player */ - -typedef struct { - BYTE firmware_id[INFO_LINE]; - BYTE firmware_version[INFO_LINE]; - BYTE firmware_date[INFO_LINE]; - - BYTE model[INFO_LINE]; - - BYTE mem_internal[INFO_LINE]; - BYTE mem_external[INFO_LINE]; - -} mpio_info_t; - -/* view of the MPIO firmware */ -typedef struct { - /* everything we get from GET_VERSION */ - BYTE id[12]; - BYTE major[3]; - BYTE minor[3]; - BYTE year[5]; - BYTE month[3]; - BYTE day[3]; -} mpio_firmware_t; - -/* */ -typedef struct { - DWORD NumCylinder; - DWORD NumHead; - DWORD NumSector; - DWORD SumSector; -} mpio_disk_phy_t; - -/* */ - -struct mpio_directory_tx { - BYTE name[INFO_LINE]; - BYTE dir[BLOCK_SIZE]; - - BYTE *dentry; - - struct mpio_directory_tx *prev; - struct mpio_directory_tx *next; - -}; -typedef struct mpio_directory_tx mpio_directory_t; - - -/* view of a SmartMedia(tm) card */ -typedef struct { - BYTE id; - BYTE manufacturer; - WORD size; /* MB */ - BYTE chips; /* this is the hack for - MPIO internal representation, because - there might be up to four chips involved */ - - /* only needed for external SmartMedia cards */ - mpio_disk_phy_t geo; - - BYTE cis[SECTOR_SIZE]; - BYTE mbr[SECTOR_SIZE]; /* Master Boot Record */ - BYTE pbr[SECTOR_SIZE]; /* Partition Boot Record */ - - int pbr_offset; /* sector offset for the PBR */ - int fat_offset; /* sector offset for the FAT */ - int dir_offset; - - /* these are needed for internal and external cards */ - int max_cluster; /* # of clusters actually available */ - int fat_size; /* # sectors for FAT */ - int fat_nums; /* # of FATs */ - BYTE * fat; /* *real FAT (like in block allocation :-) */ - - /* needed for directory support */ - mpio_directory_t *root; /* root directory */ - mpio_directory_t *cdir; /* current directory */ - - /* how many physical blocks are available - * for internal memory is this value equal to max_cluster - */ - int max_blocks; - BYTE * spare; - - /* lookup table for phys.<->log. block mapping */ - mpio_zonetable_t zonetable; - -} mpio_smartmedia_t; - -/* health status of a memory "card" */ -typedef struct { - WORD total; /* total blocks on "card" */ - WORD spare; /* (available spare blocks */ - WORD broken; /* broken blocks */ -} mpio_health_single_t; - -typedef struct { - BYTE num; /* number of chips or zones */ - /* internal: max 4 chips - * external: max 8 zones (128MB) -> max 8 */ - mpio_health_single_t data[8]; -} mpio_health_t; - -/* view of the MPIO-* */ -typedef struct { - BYTE version[CMD_SIZE]; - - int fd; - BYTE *charset; /* charset used for filename conversion */ - - BYTE id3; /* enable/disable ID3 rewriting support */ - BYTE id3_format[INFO_LINE]; - BYTE id3_temp[INFO_LINE]; - - mpio_firmware_t firmware; - - mpio_model_t model; - - mpio_smartmedia_t internal; - mpio_smartmedia_t external; -} mpio_t; - -typedef struct { - mpio_t *m; - BYTE mem; /* internal/external memory */ - - DWORD entry; /* number of FAT entry */ - - /* internal */ - BYTE i_index; /* file index of file to store */ - BYTE i_fat[16]; /* internal FAT entry */ - - /* external */ - DWORD e_sector; /* logical startsector of cluster */ - - /* mapping to HW (== block address) */ - DWORD hw_address; /* 3 bytes block addressing + 1 byte chip */ - -} mpio_fatentry_t; - - -/* these are copied from: - * http://www.linuxhq.com/kernel/v2.4/doc/filesystems/vfat.txt.html - * - */ - -typedef struct { // Short 8.3 names - unsigned char name[8]; // file name - unsigned char ext[3]; // file extension - unsigned char attr; // attribute byte - unsigned char lcase; // Case for base and extension - unsigned char ctime_ms; // Creation time, milliseconds - unsigned char ctime[2]; // Creation time - unsigned char cdate[2]; // Creation date - unsigned char adate[2]; // Last access date - unsigned char reserved[2]; // reserved values (ignored) - unsigned char time[2]; // time stamp - unsigned char date[2]; // date stamp - unsigned char start[2]; // starting cluster number - unsigned char size[4]; // size of the file -} mpio_dir_entry_t; - -typedef struct { // Up to 13 characters of a long name - unsigned char id; // sequence number for slot - unsigned char name0_4[10]; // first 5 characters in name - unsigned char attr; // attribute byte - unsigned char reserved; // always 0 - unsigned char alias_checksum; // checksum for 8.3 alias - unsigned char name5_10[12]; // 6 more characters in name - unsigned char start[2]; // starting cluster number - unsigned char name11_12[4]; // last 2 characters in name -} mpio_dir_slot_t; - -#ifdef __cplusplus -} -#endif - -#endif /* _MPIO_DEFS_H_ */ - diff --git a/libmpio/src/mpio.h b/libmpio/src/mpio.h deleted file mode 100644 index 1d5ba3c..0000000 --- a/libmpio/src/mpio.h +++ /dev/null @@ -1,218 +0,0 @@ -#/* -*- linux-c -*- */ - -/* - * $Id: mpio.h,v 1.1 2003/04/23 08:34:15 crunchy Exp $ - * - * Library for USB MPIO-* - * - * Markus Germeier (mager@tzi.de) - * - * uses code from mpio_stat.c by - * Yuji Touya (salmoon@users.sourceforge.net) - * - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * */ - -#ifndef _MPIO_H_ -#define _MPIO_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "defs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - *init and shutdown - */ - -mpio_t *mpio_init(mpio_callback_init_t); -void mpio_close(mpio_t *); - -/* - * request information - */ - -/* get version */ -void mpio_get_info(mpio_t *, mpio_info_t *); -/* get model */ -mpio_model_t mpio_get_model(mpio_t *); -/* retrieves free memory in bytes */ -int mpio_memory_free(mpio_t *, mpio_mem_t, int *free); - -/* - * charset for filename encoding/converting - */ -BYTE *mpio_charset_get(mpio_t *); -BYTE mpio_charset_set(mpio_t *, BYTE *); - -/* - * directory operations - */ - -/* context, memory bank */ -BYTE* mpio_directory_open(mpio_t *, mpio_mem_t); -/* context, memory bank, directory name */ -int mpio_directory_make(mpio_t *, mpio_mem_t, BYTE *); -/* context, memory bank, directory name */ -int mpio_directory_cd(mpio_t *, mpio_mem_t, BYTE *); -/* context, memory bank, directory name buffer space */ -void mpio_directory_pwd(mpio_t *, mpio_mem_t, BYTE pwd[INFO_LINE]); -/* context, dir context */ -BYTE* mpio_dentry_next(mpio_t *, mpio_mem_t, BYTE *); -/* context, dir context */ -int mpio_dentry_get(mpio_t *, mpio_mem_t, BYTE *, BYTE *, int,WORD *, - BYTE *, BYTE *, BYTE *, BYTE *, DWORD *, BYTE *); - -/* - * reading/writing/deleting of files - */ - -int mpio_file_get_as(mpio_t *, mpio_mem_t, mpio_filename_t, - mpio_filename_t,mpio_callback_t); - -/* context, memory bank, filename, callback */ -int mpio_file_get(mpio_t *, mpio_mem_t, mpio_filename_t, mpio_callback_t); - -/* context, memory bank, filename, filetype, callback */ -int mpio_file_put(mpio_t *, mpio_mem_t, mpio_filename_t, mpio_filetype_t, - mpio_callback_t); - -/* context, memory bank, filename, as, filetype, callback */ -int mpio_file_put_as(mpio_t *, mpio_mem_t, mpio_filename_t, - mpio_filename_t, mpio_filetype_t, - mpio_callback_t); - -/* context, memory bank, filename, callback */ -int mpio_file_del(mpio_t *, mpio_mem_t, mpio_filename_t, mpio_callback_t); - -/* - * reading/writing files into memory (used for config+font files) - */ - -/* context, memory bank, filename, callback, pointer to memory */ -/* the needed memory is allocated and the memory pointer is return */ -/* via the "BYTE **" */ - -int mpio_file_get_to_memory(mpio_t *, mpio_mem_t, mpio_filename_t, - mpio_callback_t, BYTE **); - -/* context, memory bank, filename, filetype, callback ... */ -/* ... memory pointer, size of file */ -int mpio_file_put_from_memory(mpio_t *, mpio_mem_t, mpio_filename_t, - mpio_filetype_t, mpio_callback_t, - BYTE *, int); - -/* - * rename a file on the MPIO - */ -/* context, memory bank, filename, filename */ -int mpio_file_rename(mpio_t *, mpio_mem_t, - mpio_filename_t, mpio_filename_t); - -/* - * switch position of two files - */ -/* context, memory bank, filename, filename */ -int mpio_file_switch(mpio_t *, mpio_mem_t, - mpio_filename_t, mpio_filename_t); - -/* Move a named file after a given file. If after==NULL move it - to the top of the list, -*/ - -int mpio_file_move(mpio_t *,mpio_mem_t m,mpio_filename_t,mpio_filename_t); - -/* - * formating a memory (internal mem or external SmartMedia card) - */ - -/* context, memory bank, callback */ -int mpio_memory_format(mpio_t *, mpio_mem_t, mpio_callback_t); - -/* mpio_sync has to be called after every set of mpio_file_{del,put} - * operations to write the current state of FAT and (root) directory. - * This is done explicitly to avoid writing these informations to often - * and thereby exhausting the SmartMedia chips - */ -/* context, memory bank */ -int mpio_sync(mpio_t *, mpio_mem_t); - -/* - * ID3 rewriting support - */ - -/* enable disable ID3 rewriting support */ -BYTE mpio_id3_set(mpio_t *, BYTE); -/* query ID3 rewriting support */ -BYTE mpio_id3_get(mpio_t *); - -/* set format string for rewriting*/ -void mpio_id3_format_set(mpio_t *, BYTE *); -/* get format string for rewriting*/ -void mpio_id3_format_get(mpio_t *, BYTE *); - -/* - * "special" functions - */ - -/* returns health status of selected memory */ -int mpio_health(mpio_t *, mpio_mem_t, mpio_health_t *); - -/* - * error handling - */ - -/* returns error code of last error */ -int mpio_errno(void); - -/* returns the description of the error */ -char * mpio_strerror(int err); - -/* prints the error message of the last error*/ -void mpio_perror(char *prefix); - -/* - * debugging - */ - -/* context, memory bank */ -int mpio_memory_dump(mpio_t *, mpio_mem_t); - -/* - * timeline: - * --------- - * 2004: some functions to change the order of files - * 2005: read mp3 tags of the files - */ - -#ifdef __cplusplus -} -#endif - -#endif /* _MPIO_H_ */ - - -- cgit v1.2.3