B: ptr = dup.st(string [, extra]);
C: #equate dup_st dup.st void *dup_st(const char *string [, int extra] );
DUP.ST is used to allocate a new copy of a string, or of a structure with a fixed header followed by a string. DUP.ST allocates "extra" words plus sufficient space to hold a copy of "string". It then copies the string into the allocated space, skipping over the first "extra" words. For example, suppose you want to create a linked list of strings. Each item in the list consists of a string preceded by a machine word that contains a pointer to the next entry in the list.
ptr = dup.st(string,1)
would allocate the space needed for a list entry, leave the first word of the entry open (so the pointer could be filled in later), and copy "string" into the rest of the entry.
Copyright © 1996, Thinkage Ltd.