Fossil SCM
Removed BLOB_SEEK_END from the API, per /chat discussion, as it was unused and appeared to have a semantic discrepancy vis-a-vis fseek() and SEEK_END.
Commit
6fc730e0c76d4bd2845953bcf1b91c673fc2f5c484c93659548e33cf0c3b4ad7
Parent
282402d82fb394c…
1 file changed
-3
-3
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -63,11 +63,10 @@ | ||
| 63 | 63 | /* |
| 64 | 64 | ** Seek whence parameter values |
| 65 | 65 | */ |
| 66 | 66 | #define BLOB_SEEK_SET 1 |
| 67 | 67 | #define BLOB_SEEK_CUR 2 |
| 68 | -#define BLOB_SEEK_END 3 | |
| 69 | 68 | |
| 70 | 69 | #endif /* INTERFACE */ |
| 71 | 70 | |
| 72 | 71 | /* |
| 73 | 72 | ** Make sure a blob is initialized |
| @@ -579,12 +578,10 @@ | ||
| 579 | 578 | int blob_seek(Blob *p, int offset, int whence){ |
| 580 | 579 | if( whence==BLOB_SEEK_SET ){ |
| 581 | 580 | p->iCursor = offset; |
| 582 | 581 | }else if( whence==BLOB_SEEK_CUR ){ |
| 583 | 582 | p->iCursor += offset; |
| 584 | - }else if( whence==BLOB_SEEK_END ){ | |
| 585 | - p->iCursor = p->nUsed + offset - 1; | |
| 586 | 583 | } |
| 587 | 584 | if( p->iCursor>p->nUsed ){ |
| 588 | 585 | p->iCursor = p->nUsed; |
| 589 | 586 | } |
| 590 | 587 | return p->iCursor; |
| 591 | 588 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -63,11 +63,10 @@ | |
| 63 | /* |
| 64 | ** Seek whence parameter values |
| 65 | */ |
| 66 | #define BLOB_SEEK_SET 1 |
| 67 | #define BLOB_SEEK_CUR 2 |
| 68 | #define BLOB_SEEK_END 3 |
| 69 | |
| 70 | #endif /* INTERFACE */ |
| 71 | |
| 72 | /* |
| 73 | ** Make sure a blob is initialized |
| @@ -579,12 +578,10 @@ | |
| 579 | int blob_seek(Blob *p, int offset, int whence){ |
| 580 | if( whence==BLOB_SEEK_SET ){ |
| 581 | p->iCursor = offset; |
| 582 | }else if( whence==BLOB_SEEK_CUR ){ |
| 583 | p->iCursor += offset; |
| 584 | }else if( whence==BLOB_SEEK_END ){ |
| 585 | p->iCursor = p->nUsed + offset - 1; |
| 586 | } |
| 587 | if( p->iCursor>p->nUsed ){ |
| 588 | p->iCursor = p->nUsed; |
| 589 | } |
| 590 | return p->iCursor; |
| 591 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -63,11 +63,10 @@ | |
| 63 | /* |
| 64 | ** Seek whence parameter values |
| 65 | */ |
| 66 | #define BLOB_SEEK_SET 1 |
| 67 | #define BLOB_SEEK_CUR 2 |
| 68 | |
| 69 | #endif /* INTERFACE */ |
| 70 | |
| 71 | /* |
| 72 | ** Make sure a blob is initialized |
| @@ -579,12 +578,10 @@ | |
| 578 | int blob_seek(Blob *p, int offset, int whence){ |
| 579 | if( whence==BLOB_SEEK_SET ){ |
| 580 | p->iCursor = offset; |
| 581 | }else if( whence==BLOB_SEEK_CUR ){ |
| 582 | p->iCursor += offset; |
| 583 | } |
| 584 | if( p->iCursor>p->nUsed ){ |
| 585 | p->iCursor = p->nUsed; |
| 586 | } |
| 587 | return p->iCursor; |
| 588 |