Annotation of uae/src/include/fsdb.h, revision 1.1.1.3

1.1       root        1:  /*
                      2:   * UAE - The Un*x Amiga Emulator
                      3:   *
                      4:   * Library of functions to make emulated filesystem as independent as
                      5:   * possible of the host filesystem's capabilities.
                      6:   *
                      7:   * Copyright 1999 Bernd Schmidt
                      8:   */
                      9: 
                     10: #ifndef FSDB_FILE
                     11: #define FSDB_FILE "_UAEFSDB.___"
                     12: #endif
                     13: 
                     14: #ifndef FSDB_DIR_SEPARATOR
                     15: #define FSDB_DIR_SEPARATOR '/'
                     16: #endif
                     17: 
                     18: /* AmigaOS errors */
                     19: #define ERROR_NO_FREE_STORE            103
                     20: #define ERROR_OBJECT_IN_USE            202
                     21: #define ERROR_OBJECT_EXISTS            203
                     22: #define ERROR_DIR_NOT_FOUND            204
1.1.1.3 ! root       23: #define ERROR_OBJECT_NOT_AROUND                205
1.1       root       24: #define ERROR_ACTION_NOT_KNOWN         209
                     25: #define ERROR_INVALID_LOCK             211
                     26: #define ERROR_OBJECT_WRONG_TYPE                212
                     27: #define ERROR_DISK_WRITE_PROTECTED     214
                     28: #define ERROR_DIRECTORY_NOT_EMPTY      216
                     29: #define ERROR_DEVICE_NOT_MOUNTED       218
                     30: #define ERROR_SEEK_ERROR               219
                     31: #define ERROR_DISK_IS_FULL             221
                     32: #define ERROR_DELETE_PROTECTED         222
                     33: #define ERROR_WRITE_PROTECTED          223
                     34: #define ERROR_READ_PROTECTED           224
                     35: #define ERROR_NO_MORE_ENTRIES          232
                     36: #define ERROR_NOT_IMPLEMENTED          236
                     37: 
                     38: #define A_FIBF_SCRIPT  (1<<6)
                     39: #define A_FIBF_PURE    (1<<5)
                     40: #define A_FIBF_ARCHIVE (1<<4)
                     41: #define A_FIBF_READ    (1<<3)
                     42: #define A_FIBF_WRITE   (1<<2)
                     43: #define A_FIBF_EXECUTE (1<<1)
                     44: #define A_FIBF_DELETE  (1<<0)
                     45: 
                     46: /* AmigaOS "keys" */
                     47: typedef struct a_inode_struct {
                     48:     /* Circular list of recycleable a_inodes.  */
                     49:     struct a_inode_struct *next, *prev;
                     50:     /* This a_inode's relatives in the directory structure.  */
                     51:     struct a_inode_struct *parent;
                     52:     struct a_inode_struct *child, *sibling;
                     53:     /* AmigaOS name, and host OS name.  The host OS name is a full path, the
                     54:      * AmigaOS name is relative to the parent.  */
                     55:     char *aname;
                     56:     char *nname;
                     57:     /* AmigaOS file comment, or NULL if file has none.  */
                     58:     char *comment;
                     59:     /* AmigaOS protection bits.  */
                     60:     int amigaos_mode;
                     61:     /* Unique number for identification.  */
                     62:     uae_u32 uniq;
                     63:     /* AmigaOS locking bits.  */
                     64:     int shlock;
1.1.1.3 ! root       65:     long db_offset;
1.1       root       66:     unsigned int dir:1;
                     67:     unsigned int elock:1;
                     68:     /* Nonzero if this came from an entry in our database.  */
                     69:     unsigned int has_dbentry:1;
                     70:     /* Nonzero if this will need an entry in our database.  */
                     71:     unsigned int needs_dbentry:1;
                     72:     /* This a_inode possibly needs writing back to the database.  */
                     73:     unsigned int dirty:1;
                     74:     /* If nonzero, this represents a deleted file; the corresponding
                     75:      * entry in the database must be cleared.  */
                     76:     unsigned int deleted:1;
                     77: } a_inode;
                     78: 
                     79: extern char *nname_begin (char *);
                     80: 
                     81: extern char *build_nname (const char *d, const char *n);
                     82: extern char *build_aname (const char *d, const char *n);
                     83: 
                     84: /* Filesystem-independent functions.  */
                     85: extern void fsdb_clean_dir (a_inode *);
                     86: extern char *fsdb_search_dir (const char *dirname, char *rel);
                     87: extern void fsdb_dir_writeback (a_inode *);
                     88: extern int fsdb_used_as_nname (a_inode *base, const char *);
                     89: extern a_inode *fsdb_lookup_aino_aname (a_inode *base, const char *);
                     90: extern a_inode *fsdb_lookup_aino_nname (a_inode *base, const char *);
                     91: 
1.1.1.2   root       92: STATIC_INLINE int same_aname (const char *an1, const char *an2)
1.1       root       93: {
                     94:     return strcasecmp (an1, an2) == 0;
                     95: }
                     96: 
                     97: /* Filesystem-dependent functions.  */
                     98: extern int fsdb_name_invalid (const char *n);
                     99: extern void fsdb_fill_file_attrs (a_inode *);
                    100: extern int fsdb_set_file_attrs (a_inode *, int);
                    101: extern int fsdb_mode_representable_p (const a_inode *);
                    102: extern char *fsdb_create_unique_nname (a_inode *base, const char *);

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.