profile.c (86e1cf34) | profile.c (509a48ff) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 276 unchanged lines hidden (view full) --- 285sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile) 286{ 287 osl_TProfileImpl* pProfile = (osl_TProfileImpl*)Profile; 288 289#ifdef TRACE_OSL_PROFILE 290 OSL_TRACE("In osl_closeProfile\n"); 291#endif 292 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 276 unchanged lines hidden (view full) --- 285sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile) 286{ 287 osl_TProfileImpl* pProfile = (osl_TProfileImpl*)Profile; 288 289#ifdef TRACE_OSL_PROFILE 290 OSL_TRACE("In osl_closeProfile\n"); 291#endif 292 |
293 if ( pProfile == 0 ) | 293 if ( pProfile == NULL ) |
294 { 295#ifdef TRACE_OSL_PROFILE 296 OSL_TRACE("Out osl_closeProfile [profile==0]\n"); 297#endif 298 return sal_False; 299 } 300 301 if (! (pProfile->m_Flags & osl_Profile_SYSTEM)) 302 { 303 pProfile = acquireProfile(Profile,sal_True); 304 | 294 { 295#ifdef TRACE_OSL_PROFILE 296 OSL_TRACE("Out osl_closeProfile [profile==0]\n"); 297#endif 298 return sal_False; 299 } 300 301 if (! (pProfile->m_Flags & osl_Profile_SYSTEM)) 302 { 303 pProfile = acquireProfile(Profile,sal_True); 304 |
305 if ( pProfile != 0 ) | 305 if ( pProfile != NULL ) |
306 { 307 if ( !( pProfile->m_Flags & osl_Profile_READLOCK ) && ( pProfile->m_Flags & FLG_MODIFIED ) ) 308 { 309/* if (pProfile->m_pFile == NULL) */ 310/* pProfile->m_pFile = openFileImpl(pProfile->m_Filename, sal_True); */ 311 312 storeProfile(pProfile->m_pFile, pProfile, sal_False); 313 } 314 } 315 else 316 { 317 pProfile = acquireProfile(Profile,sal_False); 318 } 319 | 306 { 307 if ( !( pProfile->m_Flags & osl_Profile_READLOCK ) && ( pProfile->m_Flags & FLG_MODIFIED ) ) 308 { 309/* if (pProfile->m_pFile == NULL) */ 310/* pProfile->m_pFile = openFileImpl(pProfile->m_Filename, sal_True); */ 311 312 storeProfile(pProfile->m_pFile, pProfile, sal_False); 313 } 314 } 315 else 316 { 317 pProfile = acquireProfile(Profile,sal_False); 318 } 319 |
320 if ( pProfile == 0 ) | 320 if ( pProfile == NULL ) |
321 { 322#ifdef TRACE_OSL_PROFILE 323 OSL_TRACE("Out osl_closeProfile [pProfile==0]\n"); 324#endif 325 return sal_False; 326 } 327 328 if (pProfile->m_pFile != NULL) 329 closeFileImpl(pProfile->m_pFile); 330 } 331 332 pProfile->m_pFile = NULL; 333 rtl_uString_release(pProfile->m_strFileName); 334 pProfile->m_strFileName = NULL; 335 336 /* release whole profile data types memory */ 337 if ( pProfile->m_NoLines > 0) 338 { 339 unsigned int index=0; | 321 { 322#ifdef TRACE_OSL_PROFILE 323 OSL_TRACE("Out osl_closeProfile [pProfile==0]\n"); 324#endif 325 return sal_False; 326 } 327 328 if (pProfile->m_pFile != NULL) 329 closeFileImpl(pProfile->m_pFile); 330 } 331 332 pProfile->m_pFile = NULL; 333 rtl_uString_release(pProfile->m_strFileName); 334 pProfile->m_strFileName = NULL; 335 336 /* release whole profile data types memory */ 337 if ( pProfile->m_NoLines > 0) 338 { 339 unsigned int index=0; |
340 if ( pProfile->m_Lines != 0 ) | 340 if ( pProfile->m_Lines != NULL ) |
341 { 342 for ( index = 0 ; index < pProfile->m_NoLines ; ++index) 343 { | 341 { 342 for ( index = 0 ; index < pProfile->m_NoLines ; ++index) 343 { |
344 if ( pProfile->m_Lines[index] != 0 ) | 344 if ( pProfile->m_Lines[index] != NULL ) |
345 { 346 free(pProfile->m_Lines[index]); 347 } 348 } 349 free(pProfile->m_Lines); 350 } | 345 { 346 free(pProfile->m_Lines[index]); 347 } 348 } 349 free(pProfile->m_Lines); 350 } |
351 if ( pProfile->m_Sections != 0 ) | 351 if ( pProfile->m_Sections != NULL ) |
352 { 353 /*osl_TProfileSection* pSections=pProfile->m_Sections;*/ 354 for ( index = 0 ; index < pProfile->m_NoSections ; ++index ) 355 { | 352 { 353 /*osl_TProfileSection* pSections=pProfile->m_Sections;*/ 354 for ( index = 0 ; index < pProfile->m_NoSections ; ++index ) 355 { |
356 if ( pProfile->m_Sections[index].m_Entries != 0 ) | 356 if ( pProfile->m_Sections[index].m_Entries != NULL ) |
357 { 358 free(pProfile->m_Sections[index].m_Entries); 359 } 360 } 361 free(pProfile->m_Sections); 362 } 363 364 } --- 10 unchanged lines hidden (view full) --- 375 osl_TProfileImpl* pProfile = (osl_TProfileImpl*) Profile; 376 osl_TFile* pFile; 377 sal_Bool bRet = sal_False; 378 379#ifdef TRACE_OSL_PROFILE 380 OSL_TRACE("In osl_flushProfile()\n"); 381#endif 382 | 357 { 358 free(pProfile->m_Sections[index].m_Entries); 359 } 360 } 361 free(pProfile->m_Sections); 362 } 363 364 } --- 10 unchanged lines hidden (view full) --- 375 osl_TProfileImpl* pProfile = (osl_TProfileImpl*) Profile; 376 osl_TFile* pFile; 377 sal_Bool bRet = sal_False; 378 379#ifdef TRACE_OSL_PROFILE 380 OSL_TRACE("In osl_flushProfile()\n"); 381#endif 382 |
383 if ( pProfile == 0 ) | 383 if ( pProfile == NULL ) |
384 { 385#ifdef TRACE_OSL_PROFILE 386 OSL_TRACE("Out osl_flushProfile() [pProfile == 0]\n"); 387#endif 388 return sal_False; 389 } 390 391 pFile = pProfile->m_pFile; | 384 { 385#ifdef TRACE_OSL_PROFILE 386 OSL_TRACE("Out osl_flushProfile() [pProfile == 0]\n"); 387#endif 388 return sal_False; 389 } 390 391 pFile = pProfile->m_pFile; |
392 if ( !( pFile != 0 && pFile->m_Handle >= 0 ) ) | 392 if ( !( pFile != NULL && pFile->m_Handle >= 0 ) ) |
393 { 394#ifdef TRACE_OSL_PROFILE 395 OSL_TRACE("Out osl_flushProfile() [invalid file]\n"); 396#endif 397 return sal_False; 398 } 399 400 if ( pProfile->m_Flags & FLG_MODIFIED ) --- 11 unchanged lines hidden (view full) --- 412} 413 414sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile, 415 const sal_Char* pszSection, const sal_Char* pszEntry, 416 sal_Char* pszString, sal_uInt32 MaxLen, 417 const sal_Char* pszDefault) 418{ 419 sal_uInt32 NoEntry; | 393 { 394#ifdef TRACE_OSL_PROFILE 395 OSL_TRACE("Out osl_flushProfile() [invalid file]\n"); 396#endif 397 return sal_False; 398 } 399 400 if ( pProfile->m_Flags & FLG_MODIFIED ) --- 11 unchanged lines hidden (view full) --- 412} 413 414sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile, 415 const sal_Char* pszSection, const sal_Char* pszEntry, 416 sal_Char* pszString, sal_uInt32 MaxLen, 417 const sal_Char* pszDefault) 418{ 419 sal_uInt32 NoEntry; |
420 const sal_Char* pStr = 0; | 420 const sal_Char* pStr = NULL; |
421 osl_TProfileSection* pSec; | 421 osl_TProfileSection* pSec; |
422 osl_TProfileImpl* pProfile = 0; | 422 osl_TProfileImpl* pProfile = NULL; |
423 424 425#ifdef TRACE_OSL_PROFILE 426 OSL_TRACE("In osl_readProfileString\n"); 427#endif 428 429 pProfile = acquireProfile(Profile, sal_False); 430 --- 13 unchanged lines hidden (view full) --- 444 if (((pSec = findEntry(pProfile, pszSection, pszEntry, &NoEntry)) != NULL) && 445 (NoEntry < pSec->m_NoEntries) && 446 ((pStr = strchr(pProfile->m_Lines[pSec->m_Entries[NoEntry].m_Line], 447 '=')) != NULL)) 448 pStr++; 449 else 450 pStr = pszDefault; 451 | 423 424 425#ifdef TRACE_OSL_PROFILE 426 OSL_TRACE("In osl_readProfileString\n"); 427#endif 428 429 pProfile = acquireProfile(Profile, sal_False); 430 --- 13 unchanged lines hidden (view full) --- 444 if (((pSec = findEntry(pProfile, pszSection, pszEntry, &NoEntry)) != NULL) && 445 (NoEntry < pSec->m_NoEntries) && 446 ((pStr = strchr(pProfile->m_Lines[pSec->m_Entries[NoEntry].m_Line], 447 '=')) != NULL)) 448 pStr++; 449 else 450 pStr = pszDefault; 451 |
452 if ( pStr != 0 ) | 452 if ( pStr != NULL ) |
453 { 454 pStr = stripBlanks(pStr, NULL); 455 MaxLen = (MaxLen - 1 < strlen(pStr)) ? (MaxLen - 1) : strlen(pStr); 456 pStr = stripBlanks(pStr, &MaxLen); 457 strncpy(pszString, pStr, MaxLen); 458 pszString[MaxLen] = '\0'; 459 } 460 } 461 else 462 PrfQueryProfileString(pProfile->m_hIni, (PCSZ)pszSection, 463 (PCSZ)pszEntry, (PCSZ)pszDefault, 464 pszString, MaxLen); 465 466 releaseProfile(pProfile); 467 | 453 { 454 pStr = stripBlanks(pStr, NULL); 455 MaxLen = (MaxLen - 1 < strlen(pStr)) ? (MaxLen - 1) : strlen(pStr); 456 pStr = stripBlanks(pStr, &MaxLen); 457 strncpy(pszString, pStr, MaxLen); 458 pszString[MaxLen] = '\0'; 459 } 460 } 461 else 462 PrfQueryProfileString(pProfile->m_hIni, (PCSZ)pszSection, 463 (PCSZ)pszEntry, (PCSZ)pszDefault, 464 pszString, MaxLen); 465 466 releaseProfile(pProfile); 467 |
468 if ( pStr == 0 ) | 468 if ( pStr == NULL ) |
469 { 470#ifdef TRACE_OSL_PROFILE 471 OSL_TRACE("Out osl_readProfileString [pStr==0]\n"); 472#endif 473 474 475 return (sal_False); 476 } --- 75 unchanged lines hidden (view full) --- 552 const sal_Char* pszString) 553{ 554 sal_uInt32 i; 555 sal_Bool bRet = sal_False; 556 sal_uInt32 NoEntry; 557 const sal_Char* pStr; 558 sal_Char Line[4096]; 559 osl_TProfileSection* pSec; | 469 { 470#ifdef TRACE_OSL_PROFILE 471 OSL_TRACE("Out osl_readProfileString [pStr==0]\n"); 472#endif 473 474 475 return (sal_False); 476 } --- 75 unchanged lines hidden (view full) --- 552 const sal_Char* pszString) 553{ 554 sal_uInt32 i; 555 sal_Bool bRet = sal_False; 556 sal_uInt32 NoEntry; 557 const sal_Char* pStr; 558 sal_Char Line[4096]; 559 osl_TProfileSection* pSec; |
560 osl_TProfileImpl* pProfile = 0; | 560 osl_TProfileImpl* pProfile = NULL; |
561 562#ifdef TRACE_OSL_PROFILE 563 OSL_TRACE("In osl_writeProfileString\n"); 564#endif 565 566 pProfile = acquireProfile(Profile, sal_True); 567 568 if (pProfile == NULL) --- 126 unchanged lines hidden (view full) --- 695} 696 697 698sal_Bool SAL_CALL osl_removeProfileEntry(oslProfile Profile, 699 const sal_Char *pszSection, const sal_Char *pszEntry) 700{ 701 sal_uInt32 NoEntry; 702 osl_TProfileSection* pSec; | 561 562#ifdef TRACE_OSL_PROFILE 563 OSL_TRACE("In osl_writeProfileString\n"); 564#endif 565 566 pProfile = acquireProfile(Profile, sal_True); 567 568 if (pProfile == NULL) --- 126 unchanged lines hidden (view full) --- 695} 696 697 698sal_Bool SAL_CALL osl_removeProfileEntry(oslProfile Profile, 699 const sal_Char *pszSection, const sal_Char *pszEntry) 700{ 701 sal_uInt32 NoEntry; 702 osl_TProfileSection* pSec; |
703 osl_TProfileImpl* pProfile = 0; | 703 osl_TProfileImpl* pProfile = NULL; |
704 sal_Bool bRet = sal_False; 705 706#ifdef TRACE_OSL_PROFILE 707 OSL_TRACE("In osl_removeProfileEntry\n"); 708#endif 709 710 pProfile = acquireProfile(Profile, sal_True); 711 --- 41 unchanged lines hidden (view full) --- 753 754 755sal_uInt32 SAL_CALL osl_getProfileSectionEntries(oslProfile Profile, const sal_Char *pszSection, 756 sal_Char* pszBuffer, sal_uInt32 MaxLen) 757{ 758 sal_uInt32 i, n = 0; 759 sal_uInt32 NoEntry; 760 osl_TProfileSection* pSec; | 704 sal_Bool bRet = sal_False; 705 706#ifdef TRACE_OSL_PROFILE 707 OSL_TRACE("In osl_removeProfileEntry\n"); 708#endif 709 710 pProfile = acquireProfile(Profile, sal_True); 711 --- 41 unchanged lines hidden (view full) --- 753 754 755sal_uInt32 SAL_CALL osl_getProfileSectionEntries(oslProfile Profile, const sal_Char *pszSection, 756 sal_Char* pszBuffer, sal_uInt32 MaxLen) 757{ 758 sal_uInt32 i, n = 0; 759 sal_uInt32 NoEntry; 760 osl_TProfileSection* pSec; |
761 osl_TProfileImpl* pProfile = 0; | 761 osl_TProfileImpl* pProfile = NULL; |
762 763#ifdef TRACE_OSL_PROFILE 764 OSL_TRACE("In osl_getProfileSectionEntries\n"); 765#endif 766 767 pProfile = acquireProfile(Profile, sal_False); 768 769 if (pProfile == NULL) --- 376 unchanged lines hidden (view full) --- 1146 sal_uInt32 action; 1147 APIRET rc; 1148 osl_TFile* pFile = (osl_TFile*)calloc(1, sizeof(osl_TFile)); 1149 1150 ULONG attributes; 1151 ULONG flags; 1152 ULONG mode; 1153 sal_Bool bWriteable = sal_False; | 762 763#ifdef TRACE_OSL_PROFILE 764 OSL_TRACE("In osl_getProfileSectionEntries\n"); 765#endif 766 767 pProfile = acquireProfile(Profile, sal_False); 768 769 if (pProfile == NULL) --- 376 unchanged lines hidden (view full) --- 1146 sal_uInt32 action; 1147 APIRET rc; 1148 osl_TFile* pFile = (osl_TFile*)calloc(1, sizeof(osl_TFile)); 1149 1150 ULONG attributes; 1151 ULONG flags; 1152 ULONG mode; 1153 sal_Bool bWriteable = sal_False; |
1154 rtl_String* strFileName=0; 1155 sal_Char* pszFileName=0; | 1154 rtl_String* strFileName=NULL; 1155 sal_Char* pszFileName=NULL; |
1156 1157 /* check parameters */ 1158 OSL_ASSERT( ustrFileName ); 1159 1160 rtl_uString2String( &strFileName, 1161 rtl_uString_getStr(ustrFileName), 1162 rtl_uString_getLength(ustrFileName), 1163 osl_getThreadTextEncoding(), --- 37 unchanged lines hidden (view full) --- 1201 { 1202 free(pFile); 1203 rtl_string_release(strFileName); 1204 return (NULL); 1205 } 1206 1207 rtl_string_release(strFileName); 1208 | 1156 1157 /* check parameters */ 1158 OSL_ASSERT( ustrFileName ); 1159 1160 rtl_uString2String( &strFileName, 1161 rtl_uString_getStr(ustrFileName), 1162 rtl_uString_getLength(ustrFileName), 1163 osl_getThreadTextEncoding(), --- 37 unchanged lines hidden (view full) --- 1201 { 1202 free(pFile); 1203 rtl_string_release(strFileName); 1204 return (NULL); 1205 } 1206 1207 rtl_string_release(strFileName); 1208 |
1209 pFile->m_pWriteBuf=0; | 1209 pFile->m_pWriteBuf=NULL; |
1210 pFile->m_nWriteBufFree=0; 1211 pFile->m_nWriteBufLen=0; 1212 1213 if ( ProfileFlags & (osl_Profile_WRITELOCK | osl_Profile_READLOCK ) ) 1214 { 1215#ifdef DEBUG_OSL_PROFILE 1216 OSL_TRACE("locking '%s' file\n",pszFilename); 1217#endif --- 8 unchanged lines hidden (view full) --- 1226 return (pFile); 1227} 1228 1229//static osl_TStamp closeFile(osl_TFile* pFile) 1230static osl_TStamp closeFileImpl(osl_TFile* pFile) 1231{ 1232 osl_TStamp stamp = {0, 0}; 1233 | 1210 pFile->m_nWriteBufFree=0; 1211 pFile->m_nWriteBufLen=0; 1212 1213 if ( ProfileFlags & (osl_Profile_WRITELOCK | osl_Profile_READLOCK ) ) 1214 { 1215#ifdef DEBUG_OSL_PROFILE 1216 OSL_TRACE("locking '%s' file\n",pszFilename); 1217#endif --- 8 unchanged lines hidden (view full) --- 1226 return (pFile); 1227} 1228 1229//static osl_TStamp closeFile(osl_TFile* pFile) 1230static osl_TStamp closeFileImpl(osl_TFile* pFile) 1231{ 1232 osl_TStamp stamp = {0, 0}; 1233 |
1234 if ( pFile == 0 ) | 1234 if ( pFile == NULL ) |
1235 { 1236 return stamp; 1237 } 1238 1239 if (pFile->m_Handle) 1240 { 1241 /* mfe: new WriteBuf obsolete */ 1242 /* we just closing the file here, DO NOT write, it has to be handled in higher levels */ --- 8 unchanged lines hidden (view full) --- 1251 1252 stamp = getFileStamp(pFile); 1253 1254 lockFile(pFile, un_lock); 1255 1256 DosClose(pFile->m_Handle); 1257 } 1258 | 1235 { 1236 return stamp; 1237 } 1238 1239 if (pFile->m_Handle) 1240 { 1241 /* mfe: new WriteBuf obsolete */ 1242 /* we just closing the file here, DO NOT write, it has to be handled in higher levels */ --- 8 unchanged lines hidden (view full) --- 1251 1252 stamp = getFileStamp(pFile); 1253 1254 lockFile(pFile, un_lock); 1255 1256 DosClose(pFile->m_Handle); 1257 } 1258 |
1259 if ( pFile->m_pWriteBuf != 0 ) | 1259 if ( pFile->m_pWriteBuf != NULL ) |
1260 { 1261 free(pFile->m_pWriteBuf); 1262 } 1263 1264 free(pFile); 1265 1266 return(stamp); 1267} --- 110 unchanged lines hidden (view full) --- 1378static sal_Bool putLine(osl_TFile* pFile, const sal_Char *pszLine) 1379{ 1380 unsigned int Len = strlen(pszLine); 1381 1382#ifdef DEBUG_OSL_PROFILE 1383 int strLen=0; 1384#endif 1385 | 1260 { 1261 free(pFile->m_pWriteBuf); 1262 } 1263 1264 free(pFile); 1265 1266 return(stamp); 1267} --- 110 unchanged lines hidden (view full) --- 1378static sal_Bool putLine(osl_TFile* pFile, const sal_Char *pszLine) 1379{ 1380 unsigned int Len = strlen(pszLine); 1381 1382#ifdef DEBUG_OSL_PROFILE 1383 int strLen=0; 1384#endif 1385 |
1386 if ( pFile == 0 || pFile->m_Handle < 0 ) | 1386 if ( pFile == NULL || pFile->m_Handle < 0 ) |
1387 { 1388 return (sal_False); 1389 } 1390 | 1387 { 1388 return (sal_False); 1389 } 1390 |
1391 if ( pFile->m_pWriteBuf == 0 ) | 1391 if ( pFile->m_pWriteBuf == NULL ) |
1392 { 1393 pFile->m_pWriteBuf = (sal_Char*) malloc(Len+3); 1394 pFile->m_nWriteBufLen = Len+3; 1395 pFile->m_nWriteBufFree = Len+3; 1396 } 1397 else 1398 { 1399 if ( pFile->m_nWriteBufFree <= Len + 3 ) 1400 { 1401 sal_Char* pTmp; 1402 1403 pTmp=(sal_Char*) realloc(pFile->m_pWriteBuf,( ( pFile->m_nWriteBufLen + Len ) * 2) ); | 1392 { 1393 pFile->m_pWriteBuf = (sal_Char*) malloc(Len+3); 1394 pFile->m_nWriteBufLen = Len+3; 1395 pFile->m_nWriteBufFree = Len+3; 1396 } 1397 else 1398 { 1399 if ( pFile->m_nWriteBufFree <= Len + 3 ) 1400 { 1401 sal_Char* pTmp; 1402 1403 pTmp=(sal_Char*) realloc(pFile->m_pWriteBuf,( ( pFile->m_nWriteBufLen + Len ) * 2) ); |
1404 if ( pTmp == 0 ) | 1404 if ( pTmp == NULL ) |
1405 { 1406 return sal_False; 1407 } 1408 pFile->m_pWriteBuf = pTmp; 1409 pFile->m_nWriteBufFree = pFile->m_nWriteBufFree + pFile->m_nWriteBufLen + ( 2 * Len ); 1410 pFile->m_nWriteBufLen = ( pFile->m_nWriteBufLen + Len ) * 2; 1411 memset( (pFile->m_pWriteBuf) + ( pFile->m_nWriteBufLen - pFile->m_nWriteBufFree ), 0, pFile->m_nWriteBufFree); 1412 } --- 149 unchanged lines hidden (view full) --- 1562 1563 for (n = 0; n < pSec->m_NoEntries; n++) 1564 if (pSec->m_Entries[n].m_Line > LineNo) 1565 pSec->m_Entries[n].m_Line--; 1566 } 1567 } 1568 else 1569 { | 1405 { 1406 return sal_False; 1407 } 1408 pFile->m_pWriteBuf = pTmp; 1409 pFile->m_nWriteBufFree = pFile->m_nWriteBufFree + pFile->m_nWriteBufLen + ( 2 * Len ); 1410 pFile->m_nWriteBufLen = ( pFile->m_nWriteBufLen + Len ) * 2; 1411 memset( (pFile->m_pWriteBuf) + ( pFile->m_nWriteBufLen - pFile->m_nWriteBufFree ), 0, pFile->m_nWriteBufFree); 1412 } --- 149 unchanged lines hidden (view full) --- 1562 1563 for (n = 0; n < pSec->m_NoEntries; n++) 1564 if (pSec->m_Entries[n].m_Line > LineNo) 1565 pSec->m_Entries[n].m_Line--; 1566 } 1567 } 1568 else 1569 { |
1570 pProfile->m_Lines[LineNo] = 0; | 1570 pProfile->m_Lines[LineNo] = NULL; |
1571 } 1572 1573 pProfile->m_NoLines--; 1574 } 1575 1576 return; 1577} 1578 --- 110 unchanged lines hidden (view full) --- 1689 free (pSection->m_Entries); 1690 if (pProfile->m_NoSections - Section > 1) 1691 { 1692 memmove(&pProfile->m_Sections[Section], &pProfile->m_Sections[Section + 1], 1693 (pProfile->m_NoSections - Section - 1) * sizeof(osl_TProfileSection)); 1694 } 1695 else 1696 { | 1571 } 1572 1573 pProfile->m_NoLines--; 1574 } 1575 1576 return; 1577} 1578 --- 110 unchanged lines hidden (view full) --- 1689 free (pSection->m_Entries); 1690 if (pProfile->m_NoSections - Section > 1) 1691 { 1692 memmove(&pProfile->m_Sections[Section], &pProfile->m_Sections[Section + 1], 1693 (pProfile->m_NoSections - Section - 1) * sizeof(osl_TProfileSection)); 1694 } 1695 else 1696 { |
1697 pSection->m_Entries = 0; | 1697 pSection->m_Entries = NULL; |
1698 } 1699 1700 pProfile->m_NoSections--; 1701 } 1702 1703 return; 1704} 1705 --- 210 unchanged lines hidden (view full) --- 1916 } 1917 } 1918 } 1919 else 1920 { 1921 sal_Bool bWriteable = sal_False; 1922 char pszFilename[PATH_MAX] = ""; 1923 | 1698 } 1699 1700 pProfile->m_NoSections--; 1701 } 1702 1703 return; 1704} 1705 --- 210 unchanged lines hidden (view full) --- 1916 } 1917 } 1918 } 1919 else 1920 { 1921 sal_Bool bWriteable = sal_False; 1922 char pszFilename[PATH_MAX] = ""; 1923 |
1924 if ( pProfile->m_strFileName != 0 && pProfile->m_strFileName->buffer[0] != 0 ) | 1924 if ( pProfile->m_strFileName != NULL && pProfile->m_strFileName->buffer[0] != 0 ) |
1925 FileURLToPath( pszFilename, PATH_MAX, pProfile->m_strFileName ); 1926 /* hack: usually you have a specific HAB, but NULL works here... */ 1927 pProfile->m_hIni = PrfOpenProfile(NULL, (PCSZ)pszFilename); 1928 if (! pProfile->m_hIni) 1929 return (NULL); 1930 } 1931 } 1932 1933 return (pProfile); 1934} 1935 1936static sal_Bool releaseProfile(osl_TProfileImpl* pProfile) 1937{ 1938#ifdef TRACE_OSL_PROFILE 1939 OSL_TRACE("In releaseProfile\n"); 1940#endif 1941 | 1925 FileURLToPath( pszFilename, PATH_MAX, pProfile->m_strFileName ); 1926 /* hack: usually you have a specific HAB, but NULL works here... */ 1927 pProfile->m_hIni = PrfOpenProfile(NULL, (PCSZ)pszFilename); 1928 if (! pProfile->m_hIni) 1929 return (NULL); 1930 } 1931 } 1932 1933 return (pProfile); 1934} 1935 1936static sal_Bool releaseProfile(osl_TProfileImpl* pProfile) 1937{ 1938#ifdef TRACE_OSL_PROFILE 1939 OSL_TRACE("In releaseProfile\n"); 1940#endif 1941 |
1942 if ( pProfile == 0 ) | 1942 if ( pProfile == NULL ) |
1943 { 1944#ifdef TRACE_OSL_PROFILE 1945 OSL_TRACE("Out releaseProfile [profile==0]\n"); 1946#endif 1947 return sal_False; 1948 } 1949 1950 if (! (pProfile->m_Flags & osl_Profile_SYSTEM)) --- 341 unchanged lines hidden --- | 1943 { 1944#ifdef TRACE_OSL_PROFILE 1945 OSL_TRACE("Out releaseProfile [profile==0]\n"); 1946#endif 1947 return sal_False; 1948 } 1949 1950 if (! (pProfile->m_Flags & osl_Profile_SYSTEM)) --- 341 unchanged lines hidden --- |