6 * Name: smb_abstraction.h
7 * Description: Interface to the smb abstraction layer.
8 * Author: Christian Starkjohann <cs -at- hal -dot- kph -dot- tuwien -dot- ac -dot- at>
12 * Modified for use with AmigaOS by Olaf Barthel <obarthel -at- gmx -dot- net>
13 * Modified to support record locking by Peter Riede <Noster-Riede -at- T-Online -dot- de>
16 #ifndef _SMB_ABSTRACTION_H
17 #define _SMB_ABSTRACTION_H 1
19 /****************************************************************************/
21 /* Forward declaration to keep the compiler happy. */
24 #endif /* _SMB_FS_SB */
26 /****************************************************************************/
28 typedef struct smba_connect_parameters
30 char server_ipname
[64];
37 } smba_connect_parameters_t
;
39 typedef struct smba_stat
45 unsigned is_archive
:1;
52 /****************************************************************************/
54 typedef struct smba_server smba_server_t
;
55 typedef struct smba_file smba_file_t
;
57 /****************************************************************************/
59 typedef int (*smba_callback_t
) (void *d
, int fpos
, int nextpos
, char *name
, int eof
, smba_stat_t
* st
);
61 /****************************************************************************/
63 int smba_open(smba_server_t
*s
, char *name
, size_t name_size
, smba_file_t
**file
);
64 void smba_close(smba_file_t
*f
);
65 int smba_read(smba_file_t
*f
, char *data
, long len
, long offset
);
66 int smba_write(smba_file_t
*f
, char *data
, long len
, long offset
);
67 long smba_seek (smba_file_t
*f
, long offset
, long mode
, off_t
* new_position_ptr
);
68 int smba_lockrec (smba_file_t
*f
, long offset
, long len
, long mode
, int unlocked
, long timeout
);
69 int smba_getattr(smba_file_t
*f
, smba_stat_t
*data
);
70 int smba_setattr(smba_file_t
*f
, smba_stat_t
*data
);
71 int smba_readdir(smba_file_t
*f
, long offs
, void *d
, smba_callback_t callback
);
72 int smba_create(smba_file_t
*dir
, const char *name
, smba_stat_t
*attr
);
73 int smba_mkdir(smba_file_t
*dir
, const char *name
);
74 int smba_remove(smba_server_t
*s
, char *path
);
75 int smba_rmdir(smba_server_t
*s
, char *path
);
76 int smba_rename(smba_server_t
*s
, char *from
, char *to
);
77 int smba_statfs(smba_server_t
*s
, long *bsize
, long *blocks
, long *bfree
);
78 void smb_invalidate_all_inodes(struct smb_server
*server
);
79 int smba_start(char *service
, char *opt_workgroup
, char *opt_username
, char *opt_password
, char *opt_clientname
, char *opt_servername
, int opt_cachesize
, smba_server_t
**result
);
80 void smba_disconnect(smba_server_t
*server
);
81 int smba_get_dircache_size(struct smba_server
* server
);
82 int smba_change_dircache_size(struct smba_server
* server
,int cache_size
);
84 /****************************************************************************/
86 #endif /* _SMB_ABSTRACTION_H */