Variable Length Strings. More...

#include "common.h"
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>
#include "bio.h"
#include "bu/log.h"
#include "bu/malloc.h"
#include "bu/parallel.h"
#include "bu/str.h"
#include "bu/vls.h"
#include "./vls_internals.h"
Include dependency graph for vls.c:

Go to the source code of this file.


void bu_vls_init (struct bu_vls *vp)
void bu_vls_init_if_uninit (struct bu_vls *vp)
struct bu_vlsbu_vls_vlsinit (void)
const char * bu_vls_cstr (const struct bu_vls *vp)
char * bu_vls_addr (const struct bu_vls *vp)
void bu_vls_extend (struct bu_vls *vp, size_t extra)
void bu_vls_setlen (struct bu_vls *vp, size_t newlen)
size_t bu_vls_strlen (const struct bu_vls *vp)
void bu_vls_trunc (struct bu_vls *vp, int len)
void bu_vls_nibble (struct bu_vls *vp, off_t len)
void bu_vls_free (struct bu_vls *vp)
void bu_vls_vlsfree (struct bu_vls *vp)
char * bu_vls_strdup (const struct bu_vls *vp)
char * bu_vls_strgrab (struct bu_vls *vp)
void bu_vls_strcpy (struct bu_vls *vp, const char *s)
void bu_vls_strncpy (struct bu_vls *vp, const char *s, size_t n)
void bu_vls_strcat (struct bu_vls *vp, const char *s)
void bu_vls_strncat (struct bu_vls *vp, const char *s, size_t n)
void bu_vls_vlscat (struct bu_vls *dest, const struct bu_vls *src)
void bu_vls_vlscatzap (struct bu_vls *dest, struct bu_vls *src)
void bu_vls_substr (struct bu_vls *dest, const struct bu_vls *src, size_t begin, size_t nchars)
int bu_vls_strcmp (struct bu_vls *s1, struct bu_vls *s2)
int bu_vls_strncmp (struct bu_vls *s1, struct bu_vls *s2, size_t n)
void bu_vls_from_argv (struct bu_vls *vp, int argc, const char *argv[])
void bu_vls_fwrite (FILE *fp, const struct bu_vls *vp)
void bu_vls_write (int fd, const struct bu_vls *vp)
int bu_vls_read (struct bu_vls *vp, int fd)
int bu_vls_gets (struct bu_vls *vp, FILE *fp)
void bu_vls_putc (struct bu_vls *vp, int c)
void bu_vls_trimspace (struct bu_vls *vp)
void bu_vls_printf (struct bu_vls *vls, const char *fmt,...)
void bu_vls_sprintf (struct bu_vls *vls, const char *fmt,...)
void bu_vls_spaces (struct bu_vls *vp, size_t cnt)
size_t bu_vls_print_positions_used (const struct bu_vls *vp)
void bu_vls_detab (struct bu_vls *vp)
void bu_vls_prepend (struct bu_vls *vp, char *str)


const char bu_vls_message []
const char bu_strdup_message []

Detailed Description

Variable Length Strings.

This structure provides support for variable length strings, freeing the programmer from concerns about having character arrays large enough to hold strings.

Assumption: libc-provided sprintf() function is safe to use in parallel, on parallel systems.

Definition in file vls.c.

Variable Documentation

const char bu_vls_message[]

used by malloc and vls as the bu_malloc/bu_free debug string.

NOT published in a public header.

Definition at line 57 of file globals.c.

Referenced by bu_vls_extend().

const char bu_strdup_message[]

used by malloc and vls as the bu_strdup debug string.

NOT published in a public header.

Definition at line 64 of file globals.c.

Referenced by bu_vls_strdup().