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.

stephan 2021-03-01 13:34 trunk
Commit 6fc730e0c76d4bd2845953bcf1b91c673fc2f5c484c93659548e33cf0c3b4ad7
1 file changed -3
-3
--- src/blob.c
+++ src/blob.c
@@ -63,11 +63,10 @@
6363
/*
6464
** Seek whence parameter values
6565
*/
6666
#define BLOB_SEEK_SET 1
6767
#define BLOB_SEEK_CUR 2
68
-#define BLOB_SEEK_END 3
6968
7069
#endif /* INTERFACE */
7170
7271
/*
7372
** Make sure a blob is initialized
@@ -579,12 +578,10 @@
579578
int blob_seek(Blob *p, int offset, int whence){
580579
if( whence==BLOB_SEEK_SET ){
581580
p->iCursor = offset;
582581
}else if( whence==BLOB_SEEK_CUR ){
583582
p->iCursor += offset;
584
- }else if( whence==BLOB_SEEK_END ){
585
- p->iCursor = p->nUsed + offset - 1;
586583
}
587584
if( p->iCursor>p->nUsed ){
588585
p->iCursor = p->nUsed;
589586
}
590587
return p->iCursor;
591588
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button