A number of other functions in agxbuf.h open code the logic of `agxblen`. Moving
this function higher in the header will enable us to de-duplicate this code. The
goal here is to fully abstract this, as an upcoming commit will make the way the
length of an `agxbuf` is calculated conditional.
Gitlab: #2302
free(xb->buf);
}
+/* agxblen:
+ * Return number of characters currently stored.
+ */
+static inline size_t agxblen(const agxbuf *xb) {
+ return (size_t)(xb->ptr - xb->buf);
+}
+
/* agxbpop:
* Removes last character added, if any.
*/
return xb->ptr;
}
-/* agxblen:
- * Return number of characters currently stored.
- */
-static inline size_t agxblen(const agxbuf *xb) {
- return (size_t)(xb->ptr - xb->buf);
-}
-
/* agxbclear:
* Resets pointer to data;
*/