/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* String utility functions with dynamic memory management.
*/
/*
* Copyright 2016 Joyent, Inc.
*/
#include <stdlib.h>
#include <err.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include "libcmdutils.h"
typedef enum {
struct custr {
char *cus_data;
};
void
{
return;
cus->cus_strlen = 0;
}
{
return (cus->cus_strlen);
}
const char *
{
/*
* This function should never return NULL. If no buffer has
* been allocated, return a pointer to a zero-length string.
*/
return ("");
}
}
int
{
if (len == -1)
return (len);
chunksz *= 2;
}
char *new_data;
return (-1);
}
/*
* Allocate replacement memory:
*/
return (-1);
}
/*
* Copy existing data into replacement memory and free
* the old memory.
*/
}
/*
* Swap in the replacement buffer:
*/
}
/*
* Append new string to existing string:
*/
if (len == -1)
return (len);
return (0);
}
int
{
}
int
{
int ret;
return (ret);
}
int
{
}
int
{
custr_t *t;
return (-1);
}
*cus = t;
return (0);
}
int
{
int ret;
return (-1);
}
return (ret);
(*cus)->cus_strlen = 0;
return (0);
}
void
{
return;
}