view src/dynamicstring.h @ 193:021d145e34e9 noffle

[svn] * src/fetch.c: Only leave articles in the requested list if the error fetching them was fatal. Otherwise article requests will accumulate indefinitely (e.g retrieving through NNTPcache when it can't find the body of an article, now or event. Yes, this happened to me; I had nearly 2000 requests backed up and never being cleared). * src/group.c: The weekend's change introduced code that causes a bus error on Sparc ( *(time_t *)p = xxx ). Replace with a safe memcpy, and also use memcpy when reading the Entry and time items to remove warnings on Sparc compilation.
author bears
date Mon, 22 Oct 2001 14:41:43 +0100
parents e612b263934f
children
line wrap: on
line source

/*
  dynamicstring.h

  String utilities

  $Id: dynamicstring.h 65 2000-05-12 16:52:41Z enz $
*/

#ifndef DYNAMICSTRING_H
#define DYNAMICSTRING_H

#if HAVE_CONFIG_H
#include <config.h>
#endif

#include <sys/types.h>

/* A dynamically growing string */
struct DynStr;
typedef struct DynStr DynStr;

/* Create new DynStr with given capacity */
DynStr *
new_DynStr( int reserve );

/* Delete DynStr */
void
del_DynStr( DynStr *self );

/* Return DynStr's length */
int
DynStr_len( const DynStr *self );

/* Return DynStr's content ptr */
const char *
DynStr_str( const DynStr *self );

/* append C-string to DynStr */
void
DynStr_app( DynStr *self, const char *s );

/* append a DynStr to DynStr */
void
DynStr_appDynStr( DynStr *self, const DynStr *s );

/* Append C-string + newline to DynStr */
void
DynStr_appLn( DynStr *self, const char *s );

/* Append a maximum of n characters from C-string s to DynStr self */
void
DynStr_appN( DynStr *self, const char *s, int n );

/* Truncate content of DynString to zero length */
void
DynStr_clear( DynStr *self );

#endif