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
14 #include <afs/param.h>
19 #include "svc_general.h"
23 * ROUTINES ___________________________________________________________________
27 void Services_GuessLogName (LPTSTR pszLogFile, LPIDENT lpiService)
29 TCHAR szService[ cchRESOURCE ];
30 lpiService->GetServiceName (szService);
31 Services_GuessLogName (pszLogFile, szService);
34 void Services_GuessLogName (LPTSTR pszLogFile, LPTSTR pszService)
36 if (!lstrcmpi (pszService, TEXT("BOS")))
37 lstrcpy (pszLogFile, TEXT("BosLog"));
38 else if (!lstrcmpi (pszService, TEXT("kaserver")))
39 lstrcpy (pszLogFile, TEXT("AuthLog"));
40 else if (!lstrcmpi (pszService, TEXT("buserver")))
41 lstrcpy (pszLogFile, TEXT("BackupLog"));
42 else if (!lstrcmpi (pszService, TEXT("fileserver")))
43 lstrcpy (pszLogFile, TEXT("FileLog"));
44 else if (!lstrcmpi (pszService, TEXT("fs")))
45 lstrcpy (pszLogFile, TEXT("FileLog"));
46 else if (!lstrcmpi (pszService, TEXT("volserver")))
47 lstrcpy (pszLogFile, TEXT("VolserLog"));
48 else if (!lstrcmpi (pszService, TEXT("ptserver")))
49 lstrcpy (pszLogFile, TEXT("PtLog"));
50 else if (!lstrcmpi (pszService, TEXT("salvager")))
51 lstrcpy (pszLogFile, TEXT("SalvageLog"));
52 else if (!lstrcmpi (pszService, TEXT("vlserver")))
53 lstrcpy (pszLogFile, TEXT("VLLog"));
54 else if (!lstrcmpi (pszService, TEXT("upclient")))
55 pszLogFile[0] = TEXT('\0');
56 else if (!lstrcmpi (pszService, TEXT("upserver")))
57 pszLogFile[0] = TEXT('\0');
59 pszLogFile[0] = TEXT('\0');
63 PVOID Services_LoadPreferences (LPIDENT lpiService)
65 LPSERVICE_PREF psp = New (SERVICE_PREF);
67 if (!RestorePreferences (lpiService, psp, sizeof(SERVICE_PREF)))
69 psp->fWarnSvcStop = TRUE;
70 Alert_SetDefaults (&psp->oa);
72 Services_GuessLogName (psp->szLogFile, lpiService);
74 // write the logfile down so we won't have to guess again.
75 StorePreferences (lpiService, psp, sizeof(SERVICE_PREF));
78 Alert_Initialize (&psp->oa);
83 BOOL Services_SavePreferences (LPIDENT lpiService)
87 PVOID psp = lpiService->GetUserParam();
90 rc = StorePreferences (lpiService, psp, sizeof(SERVICE_PREF));