Skip to content

Commit

Permalink
minor readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mickjc750 committed Mar 13, 2023
1 parent 46e6d5e commit 0921f32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,16 @@ While this is a string api, dropping the requirement for null termination means

If the buffer holding the string is available, the buf->cstr member can be accessed and will always contain a null terminated string.

For passing a view to printf, two macros defined for this **PRIstr** and **PRIstrarg()**, which make use if printf's dynamic precision to limit the number of characters read. These are __PRIstr__ for the type, and __PRIstrarg__ as an argument wrapper.
For passing a view to printf, two macros are defined for this **PRIstr** and **PRIstrarg()**, which make use of printf's dynamic precision to limit the number of characters read. These are __PRIstr__ for the type, and __PRIstrarg__ as an argument wrapper.

printf("The string is %"PRIstr"\n", PRIstrarg(mystring));

 
# For more details on the usage of strbuf.h strview.h and strnum.h see the following:
* [strbuf.h api reference](/docs/strbuf-api.md)
* [strview.h api reference](/docs/strview-api.md)
* [strnum.h api reference](/docs/strnum-api.md)


 
# Contributing
Expand Down
4 changes: 2 additions & 2 deletions docs/strview-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ Simply assign the source to your destination before splitting:

 
## `strview_t strview_split_left(strview_t* strview_ptr, strview_t pos);`
Given a view (pos) into strview_ptr, will return a strview_t containing the content to the left of strview_ptr.
Given a view (pos) into strview_ptr, will return a strview_t containing the content to the left of strview_ptr. The returned view will be removed (popped) from strview_ptr.

 
## `strview_t strview_split_right(strview_t* strview_ptr, strview_t pos);`
Given a view (pos) into strview_ptr, will return a strview_t containing the content to the right of strview_ptr.
Given a view (pos) into strview_ptr, will return a strview_t containing the content to the right of strview_ptr. The returned view will be removed (popped) from strview_ptr.

 
## `char strview_pop_first_char(strview_t* strview_ptr);`
Expand Down

0 comments on commit 0921f32

Please sign in to comment.