/*Copyright (C) 2006 Michael Kasianowicz (xtravar@yahoo.com)

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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
#ifndef __P2KCMD_FSAC_H__
#define __P2KCMD_FSAC_H__

#include <unistd.h>
#include <p2kusb.h>

typedef enum {
	P2K_SEEK_BEGIN,
	P2K_SEEK_CURRENT,
	P2K_SEEK_END
} p2k_seek_dir;

typedef enum {
	P2K_FILE_NOATTR	= 0x00,
	P2K_FILE_READ	= 0x01,
	P2K_FILE_HIDDEN	= 0x02,
	P2K_FILE_SYSTEM = 0x04,
	P2K_FILE_VOL	= 0x08,
	P2K_FILE_SUBDIR	= 0x10,
	P2K_FILE_ARCHIVE= 0x20
} p2k_file_attribute;

int p2k_fsac_count(p2k_phone *ph);
int p2k_fsac_volname(p2k_phone *ph, char *output, int outmax);
int p2k_fsac_volspace(p2k_phone *ph, const char *volume);

int p2k_fsac_open(p2k_phone *ph, const char *fname, p2k_file_attribute attr);
int p2k_fsac_read(p2k_phone *ph, uint8_t *buffer, int count);
int p2k_fsac_write(p2k_phone *ph, uint8_t *buffer, int count);
int p2k_fsac_close(p2k_phone *ph);
off_t p2k_fsac_seek(p2k_phone *ph, off_t oset, p2k_seek_dir dir);
int p2k_fsac_delete(p2k_phone *ph, const char *path);



#endif /* P2KCMD_FSAC_H */
