void qspRefreshPlayList() { QSP_CHAR **s, *file, *str, *pos; int count = qspPLFilesCount; if (!count) return; qspCopyStrs(&s, qspPLFiles, 0, count); qspClearPlayList(QSP_FALSE); while (--count >= 0) { str = s[count]; pos = qspStrChar(str, QSP_PLVOLUMEDELIM[0]); if (pos) *pos = 0; if (qspIsAnyString(str)) { file = qspGetAbsFromRelPath(str); if (qspSearchPlayList(str) < 0 && qspCallIsPlayingFile(file)) { if (pos) *pos = QSP_PLVOLUMEDELIM[0]; qspPLFiles[qspPLFilesCount++] = qspGetNewText(str, -1); } free(file); } free(str); } free(s); }
void qspMemClear(QSP_BOOL isFirst) { int i; qspClearIncludes(isFirst); qspClearVars(isFirst); qspClearObjects(isFirst); qspClearActions(isFirst); qspClearPlayList(isFirst); qspClearRegExps(isFirst); if (!isFirst) { if (qspCurDesc) { free(qspCurDesc); if (qspCurDescLen) qspIsMainDescChanged = QSP_TRUE; } if (qspCurVars) { free(qspCurVars); if (qspCurVarsLen) qspIsVarsDescChanged = QSP_TRUE; } if (qspCurInput) free(qspCurInput); if (qspViewPath) free(qspViewPath); for (i = qspSavedVarsGroupsCount - 1; i >= 0; --i) qspClearVarsList(qspSavedVarsGroups[i].Vars, qspSavedVarsGroups[i].VarsCount); if (qspSavedVarsGroups) free(qspSavedVarsGroups); } qspCurDesc = 0; qspCurDescLen = 0; qspCurVars = 0; qspCurVarsLen = 0; qspCurInput = 0; qspCurInputLen = 0; qspViewPath = 0; qspSavedVarsGroups = 0; qspSavedVarsGroupsCount = 0; }
QSP_BOOL qspStatementCloseFile(QSPVariant *args, int count, QSP_CHAR **jumpTo, int extArg) { int pos; QSP_CHAR *file; if (!qspPLFilesCount) return QSP_FALSE; if (count) { if (qspIsAnyString(QSP_STR(args[0]))) { pos = qspSearchPlayList(QSP_STR(args[0])); if (pos >= 0) { file = qspGetAbsFromRelPath(QSP_STR(args[0])); qspCallCloseFile(file); free(file); do { free(qspPLFiles[pos]); --qspPLFilesCount; while (pos < qspPLFilesCount) { qspPLFiles[pos] = qspPLFiles[pos + 1]; ++pos; } pos = qspSearchPlayList(QSP_STR(args[0])); } while (pos >= 0); } } } else { qspClearPlayList(QSP_FALSE); qspCallCloseFile(0); } return QSP_FALSE; }