Rename macroses: @echopath to @areapath, @echoname to @areaname, @echotype to @areatype

This commit is contained in:
Stas Degteff 2005-11-01 18:43:31 +00:00
parent 1523486ef1
commit 8023d3c623
2 changed files with 19 additions and 14 deletions

View File

@ -10,6 +10,11 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
! Rename macroses:
@echopath to @areapath - path to echoarea base,
@echoname to @areaname - echoarea file name without path,
@echotype to @areatype - echoarea base type.
- Case insensitive regexp should work on Win9x now.
+ New config file token LatinToLocal.

View File

@ -388,40 +388,40 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
if (strnieql(dst, "@echo", 5))
{
if (tokenxchg(dst, "@echotype", AA->basetype()))
if (tokenxchg(dst, "@areatype", AA->basetype()))
continue;
char echopath[GMAXPATH];
char echoname[GMAXPATH];
char areapath[GMAXPATH];
char areaname[GMAXPATH];
strcpy(echopath, AA->path());
echoname[0] = NUL;
strcpy(areapath, AA->path());
areaname[0] = NUL;
size_t slashpos;
size_t pathlen = strlen(echopath);
size_t pathlen = strlen(areapath);
for (slashpos = pathlen-1; slashpos < pathlen; slashpos--)
if (isslash(echopath[slashpos])) break;
if (isslash(areapath[slashpos])) break;
if (slashpos < pathlen)
{
strcpy(echoname, &echopath[slashpos+1]);
echopath[slashpos+1] = NUL;
strcpy(areaname, &areapath[slashpos+1]);
areapath[slashpos+1] = NUL;
}
else
{
strcpy(echoname, echopath);
echopath[0] = NUL;
strcpy(areaname, areapath);
areapath[0] = NUL;
}
if (tokenxchg(dst, "@echopath", echopath))
if (tokenxchg(dst, "@areapath", areapath))
continue;
if (tokenxchg(dst, "@echoname", echoname))
if (tokenxchg(dst, "@areaname", areaname))
continue;
}
char *ptr1, *ptr2;
if (strnieql(dst, "@pad{", 5) &&
if (strnieql(dst, "@pad{", 5) &&
((ptr1 = strstr(dst+5, "}{")) != NULL) &&
((ptr1-dst-5) > 2) &&
((ptr2 = strchr(ptr1+2, '}')) != NULL)