home *** CD-ROM | disk | FTP | other *** search
- #include "memory.h"
-
- STRPTR __saveds __asm NameInSpool(register __a0 PagerHandle_t * ph, register __a1 STRPTR name)
- {
- STRPTR location, ptr;
- ULONG allocSize;
-
- if (!name)
- name = "";
-
- location = FindPagerConfigDefault(ph, "SPOOLDIR", "pager:spool");
-
- allocSize = strlen(location) + strlen(name) + 4;
-
- if (ptr = MyAllocVec(allocSize)) {
- strcpy(ptr, location);
- if (name[0])
- AddPart(ptr, name, allocSize);
- }
-
- /*
- * we don't actually call FreePagerConfig(location) here. this way,
- * the config entry will remain loaded in memory and any subsequent
- * calls the client makes to NameInSpool will not have to re-read the
- * config file to find out where the spool directory is located. when
- * the client calls FreePagerHandle() the config entry for the spool
- * directory will finally go away.
- */
-
- return ptr;
- }
-
- void __saveds __asm FreeNameInSpool(register __a0 STRPTR name)
- {
- MyFreeVec(name);
- }
-