* Start a section. */
| 897 | * Start a section. |
| 898 | */ |
| 899 | void |
| 900 | sbuf_start_section(struct sbuf *s, ssize_t *old_lenp) |
| 901 | { |
| 902 | |
| 903 | assert_sbuf_integrity(s); |
| 904 | assert_sbuf_state(s, 0); |
| 905 | |
| 906 | if (!SBUF_ISSECTION(s)) { |
| 907 | KASSERT(s->s_sect_len == 0, |
| 908 | ("s_sect_len != 0 when starting a section")); |
| 909 | if (old_lenp != NULL) |
| 910 | *old_lenp = -1; |
| 911 | s->s_rec_off = s->s_len; |
| 912 | SBUF_SETFLAG(s, SBUF_INSECTION); |
| 913 | } else { |
| 914 | KASSERT(old_lenp != NULL, |
| 915 | ("s_sect_len should be saved when starting a subsection")); |
| 916 | *old_lenp = s->s_sect_len; |
| 917 | s->s_sect_len = 0; |
| 918 | } |
| 919 | } |
| 920 | |
| 921 | /* |
| 922 | * End the section padding to the specified length with the specified |
no outgoing calls
no test coverage detected