OLD | NEW |
1 /* | 1 /* |
2 ** 2004 May 22 | 2 ** 2004 May 22 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
(...skipping 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2074 } | 2074 } |
2075 | 2075 |
2076 /* | 2076 /* |
2077 ** Return the device characteristics for the file. This is always 0. | 2077 ** Return the device characteristics for the file. This is always 0. |
2078 */ | 2078 */ |
2079 static int unixDeviceCharacteristics(sqlite3_file *id){ | 2079 static int unixDeviceCharacteristics(sqlite3_file *id){ |
2080 return 0; | 2080 return 0; |
2081 } | 2081 } |
2082 | 2082 |
2083 /* | 2083 /* |
| 2084 ** Initializes a unixFile structure with zeros. |
| 2085 */ |
| 2086 void initUnixFile(sqlite3_file* file) { |
| 2087 memset(file, 0, sizeof(unixFile)); |
| 2088 } |
| 2089 |
| 2090 /* |
2084 ** Initialize the contents of the unixFile structure pointed to by pId. | 2091 ** Initialize the contents of the unixFile structure pointed to by pId. |
2085 ** | 2092 ** |
2086 ** When locking extensions are enabled, the filepath and locking style | 2093 ** When locking extensions are enabled, the filepath and locking style |
2087 ** are needed to determine the unixFile pMethod to use for locking operations. | 2094 ** are needed to determine the unixFile pMethod to use for locking operations. |
2088 ** The locking-style specific lockingContext data structure is created | 2095 ** The locking-style specific lockingContext data structure is created |
2089 ** and assigned here also. | 2096 ** and assigned here also. |
2090 */ | 2097 */ |
2091 static int fillInUnixFile( | 2098 int fillInUnixFile( |
2092 sqlite3_vfs *pVfs, /* Pointer to vfs object */ | 2099 sqlite3_vfs *pVfs, /* Pointer to vfs object */ |
2093 int h, /* Open file descriptor of file being opened */ | 2100 int h, /* Open file descriptor of file being opened */ |
2094 int dirfd, /* Directory file descriptor */ | 2101 int dirfd, /* Directory file descriptor */ |
2095 sqlite3_file *pId, /* Write to the unixFile structure here */ | 2102 sqlite3_file *pId, /* Write to the unixFile structure here */ |
2096 const char *zFilename, /* Name of the file being opened */ | 2103 const char *zFilename, /* Name of the file being opened */ |
2097 int noLock /* Omit locking if true */ | 2104 int noLock /* Omit locking if true */ |
2098 ){ | 2105 ){ |
2099 int eLockingStyle; | 2106 int eLockingStyle; |
2100 unixFile *pNew = (unixFile *)pId; | 2107 unixFile *pNew = (unixFile *)pId; |
2101 int rc = SQLITE_OK; | 2108 int rc = SQLITE_OK; |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2741 } | 2748 } |
2742 | 2749 |
2743 /* | 2750 /* |
2744 ** Shutdown the operating system interface. This is a no-op for unix. | 2751 ** Shutdown the operating system interface. This is a no-op for unix. |
2745 */ | 2752 */ |
2746 int sqlite3_os_end(void){ | 2753 int sqlite3_os_end(void){ |
2747 return SQLITE_OK; | 2754 return SQLITE_OK; |
2748 } | 2755 } |
2749 | 2756 |
2750 #endif /* SQLITE_OS_UNIX */ | 2757 #endif /* SQLITE_OS_UNIX */ |
OLD | NEW |