// set string to a default value if unset if (string == 0 || *string == 0) {
string = "./";
}
// check if we append, prepend or overwrite. if (string[0] == ';') { // Count the number of root directories already present.
n = 0; while (SyGapRootPaths[n][0] != '\0')
n++;
// Skip leading semicolon.
string++;
} elseif (string[strlen(string) - 1] == ';') { // Count the number of directories in 'string'.
n = 0;
p = string; while (*p) if (*p++ == ';')
n++;
// Find last root path. for (i = 0; i < MAX_GAP_DIRS; i++) if (SyGapRootPaths[i][0] == '\0') break;
i--;
#ifdef HPCGAP
n *= 2; // for each root <ROOT> we also add <ROOT/hpcgap> as a root #endif
// Move existing root paths to the back if (i + n >= MAX_GAP_DIRS) return; while (i >= 0) {
memcpy(SyGapRootPaths[i + n], SyGapRootPaths[i], sizeof(SyGapRootPaths[i + n]));
i--;
}
n = 0;
} else { // Make sure to wipe out all possibly existing root paths for (i = 0; i < MAX_GAP_DIRS; i++)
SyGapRootPaths[i][0] = '\0';
n = 0;
}
// unpack the argument
p = string; while (*p) { if (n >= MAX_GAP_DIRS) return;
#ifdef SYS_IS_CYGWIN32 // change backslash to slash for Windows if (*q == '\\')
*q = '/'; #endif
q++;
} if (q == SyGapRootPaths[n]) {
strxcpy(SyGapRootPaths[n], "./", sizeof(SyGapRootPaths[n]));
} elseif (q[-1] != '/') {
*q++ = '/';
*q = '\0';
} else {
*q = '\0';
} if (*p) {
p++;
}
n++; #ifdef HPCGAP // for each root <ROOT> to be added, we first add <ROOT/hpcgap> as a root if (n < MAX_GAP_DIRS) {
gap_strlcpy(SyGapRootPaths[n], SyGapRootPaths[n - 1], sizeof(SyGapRootPaths[n]));
}
strxcat(SyGapRootPaths[n - 1], "hpcgap/", sizeof(SyGapRootPaths[n - 1]));
n++; #endif
}
// replace leading tilde ~ by HOME environment variable // TODO; instead of iterating over all entries each time, just // do this for the new entries char * userhome = getenv("HOME"); if (!userhome || !*userhome) return; const UInt userhomelen = strlen(userhome); for (i = 0; i < MAX_GAP_DIRS && SyGapRootPaths[i][0]; i++) { const UInt pathlen = strlen(SyGapRootPaths[i]); if (SyGapRootPaths[i][0] == '~' &&
userhomelen + pathlen < sizeof(SyGapRootPaths[i])) {
SyMemmove(SyGapRootPaths[i] + userhomelen, // don't copy the ~ but the trailing '\0'
SyGapRootPaths[i] + 1, pathlen);
memcpy(SyGapRootPaths[i], userhome, userhomelen);
}
}
}
/**************************************************************************** ** *FSyGetGapRootPaths()
*/
Obj SyGetGapRootPaths(void)
{
Obj tmp = NEW_PLIST_IMM(T_PLIST, MAX_GAP_DIRS); for (int i = 0; i < MAX_GAP_DIRS; i++) { if (SyGapRootPaths[i][0]) {
PushPlist(tmp, MakeImmString(SyGapRootPaths[i]));
}
}
MakeImmutableNoRecurse(tmp); return tmp;
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.13Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.