Changeset 117 for trunk/src/helpers/configsys.c
- Timestamp:
- Nov 24, 2001, 2:54:10 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/configsys.c
r91 r117 1058 1058 } 1059 1059 1060 /* ****************************************************************** 1061 * 1062 * Swappath 1063 * 1064 ********************************************************************/ 1065 1066 extern CHAR G_szSwapperFilename[CCHMAXPATH] = ""; 1067 1068 /* 1069 *@@ csysParseSwapPath: 1070 * 1071 *@@added V0.9.9 (2001-02-08) [umoeller] 1072 *@@changed V0.9.16 (2001-11-10) [umoeller]: moved to helpers 1073 */ 1074 1075 BOOL csysParseSwapPath(const char *pcszConfigSys, // in: if NULL, this gets loaded 1076 PSZ pszSwapPath, // out: swapper directory 1077 PULONG pulMinFree, // out: min free 1078 PULONG pulMinSize) // out: min size 1079 { 1080 BOOL brc = FALSE; 1081 1082 PSZ pszConfigSysTemp = 0; 1083 1084 if (!pcszConfigSys) 1085 { 1086 // not specified: load it 1087 if (csysLoadConfigSys(NULL, &pszConfigSysTemp) == NO_ERROR) 1088 pcszConfigSys = pszConfigSysTemp; 1089 } 1090 1091 if (pcszConfigSys) 1092 { 1093 // parse SWAPPATH command 1094 PSZ p; 1095 if (p = csysGetParameter(pcszConfigSys, "SWAPPATH=", NULL, 0)) 1096 { 1097 CHAR szSwap[CCHMAXPATH]; 1098 ULONG ulMinFree = 2048, ulMinSize = 2048; 1099 // int iScanned; 1100 sscanf(p, 1101 "%s %d %d", 1102 &szSwap, &ulMinFree, &ulMinSize); 1103 1104 if (pszSwapPath) 1105 strcpy(pszSwapPath, szSwap); 1106 if (pulMinFree) 1107 *pulMinFree = ulMinFree; 1108 if (pulMinSize) 1109 *pulMinSize = ulMinSize; 1110 1111 if (G_szSwapperFilename[0] == '\0') 1112 { 1113 // first call: copy to global so that the swapper 1114 // monitors will always use the old one, in case 1115 // the user changes this 1116 strcpy(G_szSwapperFilename, szSwap); 1117 if (G_szSwapperFilename[strlen(G_szSwapperFilename)-1] != '\\') 1118 strcat(G_szSwapperFilename, "\\"); 1119 strcat(G_szSwapperFilename, "swapper.dat"); 1120 } 1121 1122 brc = TRUE; 1123 } 1124 } 1125 1126 if (pszConfigSysTemp) 1127 free(pszConfigSysTemp); 1128 1129 return (brc); 1130 } 1131 1132 /* 1133 *@@ csysQuerySwapperSize: 1134 * returns the current size of the swap file 1135 * in bytes. 1136 * 1137 *@@added V0.9.9 (2001-02-08) [umoeller] 1138 *@@changed V0.9.16 (2001-11-10) [umoeller]: moved to helpers 1139 */ 1140 1141 ULONG csysQuerySwapperSize(VOID) 1142 { 1143 ULONG ulrc = 0; 1144 1145 if (G_szSwapperFilename[0] == '\0') 1146 { 1147 // first call: compose the path 1148 csysParseSwapPath(NULL, 1149 NULL, 1150 NULL, 1151 NULL); 1152 } 1153 1154 if (G_szSwapperFilename[0]) 1155 doshQueryPathSize(G_szSwapperFilename, &ulrc); 1156 1157 return (ulrc); 1158 } 1159 1060 1160 // testcase 1061 1161
Note:
See TracChangeset
for help on using the changeset viewer.