2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 #include <afs/param.h>
16 #include "svc_general.h"
20 * ROUTINES ___________________________________________________________________
24 void Services_GuessLogName (LPTSTR pszLogFile, LPIDENT lpiService)
26 TCHAR szService[ cchRESOURCE ];
27 lpiService->GetServiceName (szService);
28 Services_GuessLogName (pszLogFile, szService);
31 void Services_GuessLogName (LPTSTR pszLogFile, LPTSTR pszService)
33 if (!lstrcmpi (pszService, TEXT("BOS")))
34 lstrcpy (pszLogFile, TEXT("BosLog"));
35 else if (!lstrcmpi (pszService, TEXT("kaserver")))
36 lstrcpy (pszLogFile, TEXT("AuthLog"));
37 else if (!lstrcmpi (pszService, TEXT("buserver")))
38 lstrcpy (pszLogFile, TEXT("BackupLog"));
39 else if (!lstrcmpi (pszService, TEXT("fileserver")))
40 lstrcpy (pszLogFile, TEXT("FileLog"));
41 else if (!lstrcmpi (pszService, TEXT("fs")))
42 lstrcpy (pszLogFile, TEXT("FileLog"));
43 else if (!lstrcmpi (pszService, TEXT("volserver")))
44 lstrcpy (pszLogFile, TEXT("VolserLog"));
45 else if (!lstrcmpi (pszService, TEXT("ptserver")))
46 lstrcpy (pszLogFile, TEXT("PtLog"));
47 else if (!lstrcmpi (pszService, TEXT("salvager")))
48 lstrcpy (pszLogFile, TEXT("SalvageLog"));
49 else if (!lstrcmpi (pszService, TEXT("vlserver")))
50 lstrcpy (pszLogFile, TEXT("VLLog"));
51 else if (!lstrcmpi (pszService, TEXT("upclient")))
52 pszLogFile[0] = TEXT('\0');
53 else if (!lstrcmpi (pszService, TEXT("upserver")))
54 pszLogFile[0] = TEXT('\0');
56 pszLogFile[0] = TEXT('\0');
60 PVOID Services_LoadPreferences (LPIDENT lpiService)
62 LPSERVICE_PREF psp = New (SERVICE_PREF);
64 if (!RestorePreferences (lpiService, psp, sizeof(SERVICE_PREF)))
66 psp->fWarnSvcStop = TRUE;
67 Alert_SetDefaults (&psp->oa);
69 Services_GuessLogName (psp->szLogFile, lpiService);
71 // write the logfile down so we won't have to guess again.
72 StorePreferences (lpiService, psp, sizeof(SERVICE_PREF));
75 Alert_Initialize (&psp->oa);
80 BOOL Services_SavePreferences (LPIDENT lpiService)
84 PVOID psp = lpiService->GetUserParam();
87 rc = StorePreferences (lpiService, psp, sizeof(SERVICE_PREF));