]> mj.ucw.cz Git - libucw.git/commitdiff
fb-grow: Renamed fbgrow_read_all() to fbgrow_get_buf().
authorPavel Charvat <pchar@ucw.cz>
Mon, 18 Apr 2011 12:51:15 +0000 (14:51 +0200)
committerPavel Charvat <pchar@ucw.cz>
Mon, 18 Apr 2011 12:51:15 +0000 (14:51 +0200)
ucw/fastbuf.h
ucw/fb-grow.c

index fc82a0e5c277c5bc88991a117f8337289b7a7826..197dc94f6f23240cace560865587e7a90df7a178 100644 (file)
@@ -387,7 +387,9 @@ struct fastbuf *fbgrow_create(unsigned basic_size); /** Create the growing buffe
 struct fastbuf *fbgrow_create_mp(struct mempool *mp, unsigned basic_size); /** Create the growing buffer pre-allocated to @basic_size bytes. **/
 void fbgrow_reset(struct fastbuf *b);                  /** Reset stream and prepare for writing. **/
 void fbgrow_rewind(struct fastbuf *b);                 /** Prepare for reading (of already written data). **/
-uns fbgrow_read_all(struct fastbuf *b, byte **buf);    /** Read the entire content of a growing fastbuf. Can be called in any state. **/
+uns fbgrow_get_buf(struct fastbuf *b, byte **buf);     /** Can be used in any state of @b (for example when writing or after fbgrow_rewind()) to
+                                                           return the pointer to internal buffer and its length in bytes. The returned buffer
+                                                           can be invalidated by further requests. **/
 
 /***
  * === Fastbuf on memory pools [[fbpool]]
index 59eff2b72ec44184c69a36a8a0da181d624f8a29..4912435b290ab261a487407498a2ec2f598215d1 100644 (file)
@@ -111,7 +111,7 @@ void fbgrow_rewind(struct fastbuf *b)
   brewind(b);
 }
 
-uns fbgrow_read_all(struct fastbuf *b, byte **buf)
+uns fbgrow_get_buf(struct fastbuf *b, byte **buf)
 {
   byte *end = FB_GBUF(b)->end;
   end = MAX(end, b->bptr);