1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
/********************************************************************
* $Author: lindner $
* $Revision: 3.7 $
* $Date: 1995/09/25 22:07:20 $
* $Source: /home/arcwelder/GopherSrc/CVS/gopher+/object/STRstring.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: STRstring.h
* A dynamic string in C that really wants to be C++
*********************************************************************
* Revision History:
* $Log: STRstring.h,v $
* Revision 3.7 1995/09/25 22:07:20 lindner
* Ansification
*
* Revision 3.6 1994/03/30 21:37:12 lindner
* Fix for URL code
*
* Revision 3.5 1994/03/04 23:26:55 lindner
* explicitly cast to char
*
* Revision 3.4 1994/02/20 16:23:27 lindner
* Optimize STRinit so that memory isn't freed then reallocated
*
* Revision 3.3 1993/10/27 18:53:44 lindner
* Add STRsize()
*
* Revision 3.2 1993/06/22 05:48:03 lindner
* Mods for VMS
*
* Revision 3.1.1.1 1993/02/11 18:03:04 lindner
* Gopher+1.2beta release
*
* Revision 1.1 1992/12/10 23:27:52 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifndef STRstring_H
#define STRstring_H
struct string_struct {
int len;
char *data;
};
typedef struct string_struct String;
/** VMS doesn't like multiple case blech! **/
#ifdef VMS
# define STRcpy GSTRcpy
# define STRcmp GSTRcmp
# define STRcat GSTRcat
#endif
String *STRnew(void);
String *STRcpy(String*, String*);
void STRinit(String*);
void STRset(String*, char*);
void STRdestroy(String*);
#define STRget(s) ((char*)((s)->len<0) ? NULL : (s)->data)
#define STRlen(s) (((s)->len > 0) ? (s)->len : 0)
#define STRsize(s) ((s)->len)
String* STRcat(String *, char*);
int STRcmp(String *, String*);
#endif
|