home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #9 / Amiga Plus CD - 2004 - No. 09.iso / amigaplus / tools / amigaos4_only / smbfs / source / smb_abstraction.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-08-03  |  3.0 KB  |  87 lines

  1. /*
  2.  * $Id: smb_abstraction.h,v 1.17 2004/05/16 09:51:36 obarthel Exp $
  3.  *
  4.  * :ts=8
  5.  *
  6.  * Name: smb_abstraction.h
  7.  * Description: Interface to the smb abstraction layer.
  8.  * Author: Christian Starkjohann <cs@hal.kph.tuwien.ac.at>
  9.  * Date: 1996-12-31
  10.  * Copyright: GNU-GPL
  11.  *
  12.  * Modified for use with AmigaOS by Olaf Barthel <olsen@sourcery.han.de>
  13.  * Modified to support record locking by Peter Riede <Noster-Riede@T-Online.de>
  14.  */
  15.  
  16. #ifndef _SMB_ABSTRACTION_H
  17. #define _SMB_ABSTRACTION_H 1
  18.  
  19. /****************************************************************************/
  20.  
  21. /* Forward declaration to keep the compiler happy. */
  22. #ifndef _SMB_FS_SB
  23. struct smb_server;
  24. #endif /* _SMB_FS_SB */
  25.  
  26. /****************************************************************************/
  27.  
  28. typedef struct smba_connect_parameters
  29. {
  30.   char server_ipname[64];
  31.   char service[64];
  32.   char *server_name;
  33.   char *client_name;
  34.   char *username;
  35.   char *password;
  36.   int max_xmit;
  37. } smba_connect_parameters_t;
  38.  
  39. typedef struct smba_stat
  40. {
  41.   unsigned is_dir:1;
  42.   unsigned is_wp:1;
  43.   unsigned is_hidden:1;
  44.   unsigned is_system:1;
  45.   unsigned is_archive:1;
  46.   int size;
  47.   long atime;
  48.   long ctime;
  49.   long mtime;
  50. } smba_stat_t;
  51.  
  52. /****************************************************************************/
  53.  
  54. typedef struct smba_server smba_server_t;
  55. typedef struct smba_file smba_file_t;
  56.  
  57. /****************************************************************************/
  58.  
  59. typedef int (*smba_callback_t) (void *d, int fpos, int nextpos, char *name, int eof, smba_stat_t * st);
  60.  
  61. /****************************************************************************/
  62.  
  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);
  83.  
  84. /****************************************************************************/
  85.  
  86. #endif /* _SMB_ABSTRACTION_H */
  87.