Category : C Source Code
Archive   : CSRC2.ZIP
Filename : VSTRIN.H

 
Output of file : VSTRIN.H contained in archive : CSRC2.ZIP
/*
* v s t r i n g . h
*/

#ifdef DOCUMENTATION

title vstring Header file for vstrings
index Header file for using using vstrings

synopsis

#ifdef vms
#include "c:vstrin.h"
#else
#include
#endif

description

This header file is used to allow programs to access vstrings. See
vstring.c for additional details.

This file defines the structure of a vstring. The fields are:
.lm+8

char *vsdata

Pointer to the actual data. This will always be the first field, so
that a vstring can be considered to be of type char ** if you only
want to read it. vsdata will be NULL if the vstring has been damaged.

unsigned vslen

Number of bytes stored in the vstring.

unsigned vsdim

Total number of bytes there is room for.

unsigned vsext

Allocation quantum - the amount the vstring is to grow by if it fills.
If vsext==0, the vstring cannot grow.

.lm-8
The only fields generally directly accessed by programs are vsdata and
vslen. Note that vsdata may change over time as items are added to and
removed from the vstring.

The only field you should normally change is vsext, the extension
quantum. The value current the next time the vstring must grow will
determine how much it grows by.

vstring.h also includes external declarations of the appropriate type
for the functions in vstring.c.

bugs

A vstring is really just a special case of a flex with item size 1.
It has been retained as a separate datatype because the type of
operations done on strings are not always generalizable. For example,
there is no obvious use for an fxadds().

author
Jerry Leichter

#endif

/*
)EDITLEVEL=16
*
* Edit history
* 0.0 30-Apr-81 JSL Invention
* 0.1 4-May-81 JSL Better error handling
* 0.2 12-May-81 JSL Decided to keep blocks after all; balloc() is now
* block().
* 0.3 13-May-81 JSL Added _BLOCKS_
* 0.4 18-May-81 JSL Fix up documentation so GETRNO can find it.
* 1.0 26-Jun-81 JSL Changed name to vstring, which makes much more sense.
* 1.1 29-Jun-81 JSL More name changes, get consistent with flexes.
* 1.2 14-Jul-82 JSL Fixed some ancient typos.
*/

#ifndef _VSTRING_ /* Don't do this twice */
#define _VSTRING_

typedef struct vheader
{ char *vsdata;
unsigned vslen;
unsigned vsdim;
unsigned vsext;
} VSTRING;

extern VSTRING *vstring(), *vsaddc(), *vsadds();

#endif


  3 Responses to “Category : C Source Code
Archive   : CSRC2.ZIP
Filename : VSTRIN.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/