home *** CD-ROM | disk | FTP | other *** search
- // MyString
- // © Dirk Holtwick, 1997
-
- /// Includes
- #include <clib/alib_protos.h>
- #include <proto/exec.h>
- #include <exec/memory.h>
- #include <string.h>
- ///
-
- /// Example
- /*
-
- char *s;
-
- s = MyAllocString("Hallo");
-
- MyFreeString(s);
-
- */
- ///
- /// MyAllocString
- char *MyAllocString(register char *str)
- {
- register char *h;
-
- if(str)
- {
- if(h = AllocVec(strlen(str)+1, 0))
- {
- strcpy(h, str);
- return(h);
- }
- }
- return(0);
- }
- ///
- /// MyFreeString
- char *MyFreeString(register char *str)
- {
- if(str)
- {
- FreeVec(str);
- }
-
- return(NULL);
- }
- ///
-