Lines Matching defs:pSettings

263  * @param   pSettings           The settings.
266 static int scmSettingsBaseInitAndCopy(PSCMSETTINGSBASE pSettings, PCSCMSETTINGSBASE pSrc)
268 *pSettings = *pSrc;
270 int rc = RTStrDupEx(&pSettings->pszFilterFiles, pSrc->pszFilterFiles);
273 rc = RTStrDupEx(&pSettings->pszFilterOutFiles, pSrc->pszFilterOutFiles);
276 rc = RTStrDupEx(&pSettings->pszFilterOutDirs, pSrc->pszFilterOutDirs);
280 RTStrFree(pSettings->pszFilterOutFiles);
282 RTStrFree(pSettings->pszFilterFiles);
285 pSettings->pszFilterFiles = NULL;
286 pSettings->pszFilterOutFiles = NULL;
287 pSettings->pszFilterOutDirs = NULL;
295 * @param pSettings The settings.
297 static int scmSettingsBaseInit(PSCMSETTINGSBASE pSettings)
299 return scmSettingsBaseInitAndCopy(pSettings, &g_Defaults);
305 * @param pSettings The settings.
307 static void scmSettingsBaseDelete(PSCMSETTINGSBASE pSettings)
309 if (pSettings)
311 Assert(pSettings->cchTab != ~(unsigned)0);
312 pSettings->cchTab = ~(unsigned)0;
314 RTStrFree(pSettings->pszFilterFiles);
315 pSettings->pszFilterFiles = NULL;
317 RTStrFree(pSettings->pszFilterOutFiles);
318 pSettings->pszFilterOutFiles = NULL;
320 RTStrFree(pSettings->pszFilterOutDirs);
321 pSettings->pszFilterOutDirs = NULL;
333 * @param pSettings The settings to change.
337 static int scmSettingsBaseHandleOpt(PSCMSETTINGSBASE pSettings, int rc, PRTGETOPTUNION pValueUnion)
342 pSettings->fConvertEol = true;
345 pSettings->fConvertEol = false;
349 pSettings->fConvertTabs = true;
352 pSettings->fConvertTabs = false;
356 pSettings->fForceFinalEol = true;
359 pSettings->fForceFinalEol = false;
363 pSettings->fForceTrailingLine = true;
366 pSettings->fForceTrailingLine = false;
370 pSettings->fStripTrailingBlanks = true;
373 pSettings->fStripTrailingBlanks = false;
377 pSettings->fStripTrailingLines = true;
380 pSettings->fStripTrailingLines = false;
384 pSettings->fOnlySvnDirs = true;
387 pSettings->fOnlySvnDirs = false;
391 pSettings->fOnlySvnFiles = true;
394 pSettings->fOnlySvnFiles = false;
398 pSettings->fSetSvnEol = true;
401 pSettings->fSetSvnEol = false;
405 pSettings->fSetSvnExecutable = true;
408 pSettings->fSetSvnExecutable = false;
412 pSettings->fSetSvnKeywords = true;
415 pSettings->fSetSvnKeywords = false;
426 pSettings->cchTab = pValueUnion->u8;
436 case SCMOPT_FILTER_OUT_DIRS: ppsz = &pSettings->pszFilterOutDirs; break;
437 case SCMOPT_FILTER_FILES: ppsz = &pSettings->pszFilterFiles; break;
438 case SCMOPT_FILTER_OUT_FILES: ppsz = &pSettings->pszFilterOutFiles; break;
557 * Creates a new settings file struct, cloning @a pSettings.
565 PSCMSETTINGS pSettings = (PSCMSETTINGS)RTMemAlloc(sizeof(*pSettings));
566 if (!pSettings)
568 int rc = scmSettingsBaseInitAndCopy(&pSettings->Base, pSettingsBase);
571 pSettings->pDown = NULL;
572 pSettings->pUp = NULL;
573 pSettings->paPairs = NULL;
574 pSettings->cPairs = 0;
575 *ppSettings = pSettings;
578 RTMemFree(pSettings);
585 * @param pSettings The settings structure to destroy. NULL is OK.
587 static void scmSettingsDestroy(PSCMSETTINGS pSettings)
589 if (pSettings)
591 scmSettingsBaseDelete(&pSettings->Base);
592 for (size_t i = 0; i < pSettings->cPairs; i++)
594 RTStrFree(pSettings->paPairs[i].pszPattern);
595 RTStrFree(pSettings->paPairs[i].pszOptions);
596 pSettings->paPairs[i].pszPattern = NULL;
597 pSettings->paPairs[i].pszOptions = NULL;
599 RTMemFree(pSettings->paPairs);
600 pSettings->paPairs = NULL;
601 RTMemFree(pSettings);
609 * @param pSettings The settings.
613 static int scmSettingsAddPair(PSCMSETTINGS pSettings, const char *pchLine, size_t cchLine)
643 uint32_t iPair = pSettings->cPairs;
646 void *pvNew = RTMemRealloc(pSettings->paPairs, (iPair + 32) * sizeof(pSettings->paPairs[0]));
649 pSettings->paPairs = (PSCMPATRNOPTPAIR)pvNew;
652 pSettings->paPairs[iPair].pszPattern = RTStrDupN(pchLine, cchPattern);
653 pSettings->paPairs[iPair].pszOptions = RTStrDupN(pchOptions, cchOptions);
655 if ( pSettings->paPairs[iPair].pszPattern
656 && pSettings->paPairs[iPair].pszOptions)
657 rc = scmSettingsBaseVerifyString(pSettings->paPairs[iPair].pszOptions);
661 pSettings->cPairs = iPair + 1;
664 RTStrFree(pSettings->paPairs[iPair].pszPattern);
665 RTStrFree(pSettings->paPairs[iPair].pszOptions);
674 * @param pSettings Where to load the settings file.
677 static int scmSettingsLoadFile(PSCMSETTINGS pSettings, const char *pszFilename)
703 rc = scmSettingsAddPair(pSettings, pchLine, cchLine);
705 rc = scmSettingsBaseParseStringN(&pSettings->Base, pchLine, cchLine);
734 PSCMSETTINGS pSettings;
735 int rc = scmSettingsCreate(&pSettings, pSettingsBase);
738 rc = scmSettingsLoadFile(pSettings, pszFilename);
741 *ppSettings = pSettings;
745 scmSettingsDestroy(pSettings);
781 PSCMSETTINGS pSettings;
782 int rc = scmSettingsCreate(&pSettings, pBaseSettings);
800 rc = scmSettingsLoadFile(pSettings, szFile);
807 *ppSettings = pSettings;
809 scmSettingsDestroy(pSettings);
818 * @param pSettings The settings to push onto the stack.
820 static void scmSettingsStackPush(PSCMSETTINGS *ppSettingsStack, PSCMSETTINGS pSettings)
823 pSettings->pDown = pOld;
824 pSettings->pUp = NULL;
826 pOld->pUp = pSettings;
827 *ppSettingsStack = pSettings;
847 PSCMSETTINGS pSettings;
848 rc = scmSettingsCreate(&pSettings, &(*ppSettingsStack)->Base);
852 rc = scmSettingsLoadFile(pSettings, szFile);
855 scmSettingsStackPush(ppSettingsStack, pSettings);
859 scmSettingsDestroy(pSettings);
1388 PSCMSETTINGS pSettings;
1389 rc = scmSettingsCreateForPath(&pSettings, &pSettingsStack->Base, szBuf);
1392 scmSettingsStackPush(&pSettingsStack, pSettings);
1412 Assert(pPopped == pSettings);
1413 scmSettingsDestroy(pSettings);
1432 PSCMSETTINGS pSettings;
1433 rc = scmSettingsCreate(&pSettings, &g_Defaults);
1603 rc = scmProcessSomething(ValueUnion.psz, pSettings);
1611 int rc2 = scmSettingsBaseHandleOpt(&pSettings->Base, rc, &ValueUnion);
1621 scmSettingsDestroy(pSettings);