Ignore:
Timestamp:
Jan 14, 2001, 5:42:22 PM (25 years ago)
Author:
umoeller
Message:

Misc. updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/prfh.c

    r14 r22  
    8888
    8989PSZ prfhQueryKeysForApp(HINI hIni,      // in: INI handle (can be HINI_USER or HINI_SYSTEM)
    90                         PSZ pszApp)     // in: application to query list for (or NULL for applications list)
     90                        const char *pcszApp)     // in: application to query list for (or NULL for applications list)
    9191{
    9292    PSZ     pKeys = NULL;
     
    9494
    9595    // get size of keys list for pszApp
    96     if (PrfQueryProfileSize(hIni, pszApp, NULL, &ulSizeOfKeysList))
     96    if (PrfQueryProfileSize(hIni, (PSZ)pcszApp, NULL, &ulSizeOfKeysList))
    9797    {
    9898        pKeys = (PSZ)malloc(ulSizeOfKeysList);
    99         if (!PrfQueryProfileData(hIni, pszApp, NULL, pKeys, &ulSizeOfKeysList))
     99        if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, NULL, pKeys, &ulSizeOfKeysList))
    100100        {
    101101            free(pKeys);
     
    118118
    119119PSZ prfhQueryProfileDataDebug(HINI hIni,      // in: INI handle (can be HINI_USER or HINI_SYSTEM)
    120                               PSZ pszApp,      // in: application to query
    121                               PSZ pszKey,      // in: key to query
     120                              const char *pcszApp,      // in: application to query
     121                              const char *pcszKey,      // in: key to query
    122122                              PULONG pcbBuf,   // out: size of the returned buffer
    123123                              const char *file,
     
    129129
    130130    // get size of data for pszApp/pszKey
    131     if (PrfQueryProfileSize(hIni, pszApp, pszKey, &ulSizeOfData))
     131    if (PrfQueryProfileSize(hIni, (PSZ)pcszApp, (PSZ)pcszKey, &ulSizeOfData))
    132132    {
    133133        if (ulSizeOfData)
    134134        {
    135135            pData = (PSZ)memdMalloc(ulSizeOfData, file, line, function);
    136             if (!PrfQueryProfileData(hIni, pszApp, pszKey, pData, &ulSizeOfData))
     136            if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, (PSZ)pcszKey, pData, &ulSizeOfData))
    137137            {
    138138                free(pData);
     
    169169
    170170PSZ prfhQueryProfileData(HINI hIni,      // in: INI handle (can be HINI_USER or HINI_SYSTEM)
    171                          PSZ pszApp,     // in: application to query
    172                          PSZ pszKey,     // in: key to query
     171                         const char *pcszApp,     // in: application to query
     172                         const char *pcszKey,     // in: key to query
    173173                         PULONG pcbBuf)  // out: size of the returned buffer; ptr can be NULL
    174174{
     
    177177
    178178    // get size of data for pszApp/pszKey
    179     if (PrfQueryProfileSize(hIni, pszApp, pszKey, &ulSizeOfData))
     179    if (PrfQueryProfileSize(hIni, (PSZ)pcszApp, (PSZ)pcszKey, &ulSizeOfData))
    180180    {
    181181        if (ulSizeOfData)
    182182        {
    183183            pData = (PSZ)malloc(ulSizeOfData);
    184             if (!PrfQueryProfileData(hIni, pszApp, pszKey, pData, &ulSizeOfData))
     184            if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, (PSZ)pcszKey, pData, &ulSizeOfData))
    185185            {
    186186                free(pData);
     
    208208
    209209CHAR prfhQueryProfileChar(HINI hini,        // in: INI handle (can be HINI_USER or HINI_SYSTEM)
    210                           PSZ pszApp,       // in: application to query
    211                           PSZ pszKey,       // in: key to query
     210                          const char *pcszApp,       // in: application to query
     211                          const char *pcszKey,       // in: key to query
    212212                          CHAR cDefault)    // in: default to return if not found
    213213{
     
    217217    szDefault[0] = cDefault;
    218218    szDefault[1] = 0;
    219     PrfQueryProfileString(HINI_USER, pszApp, pszKey,
     219    PrfQueryProfileString(HINI_USER, (PSZ)pcszApp, (PSZ)pcszKey,
    220220                          szDefault,
    221221                          szTemp, sizeof(szTemp)-1);
     
    263263 */
    264264
    265 LONG prfhQueryColor(PSZ pszKeyName, PSZ pszDefault)
     265LONG prfhQueryColor(const char *pcszKeyName,
     266                    const char *pcszDefault)
    266267{
    267268    CHAR szColor[30];
     
    270271                HINI_USER,
    271272                "PM_Colors",
    272                 pszKeyName,
    273                 pszDefault,
     273                (PSZ)pcszKeyName,
     274                (PSZ)pcszDefault,
    274275                szColor,
    275276                sizeof(szColor)-1);
     
    303304
    304305ULONG prfhCopyKey(HINI hiniSource,       // in: source profile (can be HINI_USER or HINI_SYSTEM)
    305                  PSZ pszSourceApp,      // in: source application
    306                  PSZ pszKey,            // in: source/target key
     306                 const char *pcszSourceApp,      // in: source application
     307                 const char *pcszKey,            // in: source/target key
    307308                 HINI hiniTarget,       // in: target profile (can be HINI_USER or HINI_SYSTEM)
    308                  PSZ pszTargetApp)      // in: target app
     309                 const char *pcszTargetApp)      // in: target app
    309310{
    310311    ULONG   ulSizeOfData = 0,
    311312            ulrc = 0;       // return: no error
    312313
    313     if (PrfQueryProfileSize(hiniSource, pszSourceApp, pszKey, &ulSizeOfData))
     314    if (PrfQueryProfileSize(hiniSource, (PSZ)pcszSourceApp, (PSZ)pcszKey, &ulSizeOfData))
    314315    {
    315316        PSZ pData = 0;
     
    332333        {
    333334            if (PrfQueryProfileData(hiniSource,
    334                                     pszSourceApp,
    335                                     pszKey,
     335                                    (PSZ)pcszSourceApp,
     336                                    (PSZ)pcszKey,
    336337                                    pData,
    337338                                    &ulSizeOfData))
    338339            {
    339340                if (!PrfWriteProfileData(hiniTarget,
    340                                          pszTargetApp,
    341                                          pszKey,
     341                                         (PSZ)pcszTargetApp,
     342                                         (PSZ)pcszKey,
    342343                                         pData,
    343344                                         ulSizeOfData))
     
    401402
    402403ULONG prfhCopyApp(HINI hiniSource,   // in: source profile (can be HINI_USER or HINI_SYSTEM)
    403                   PSZ pszSourceApp,  // in: source application
     404                  const char *pcszSourceApp,  // in: source application
    404405                  HINI hiniTarget,   // in: target profile (can be HINI_USER or HINI_SYSTEM)
    405                   PSZ pszTargetApp,  // in: name of pszSourceApp in hiniTarget
     406                  const char *pcszTargetApp,  // in: name of pszSourceApp in hiniTarget
    406407                  PSZ pszErrorKey)   // out: failing key in case of error; ptr can be NULL
    407408{
     
    412413        *pszErrorKey = 0;
    413414
    414     pszKeysList = prfhQueryKeysForApp(hiniSource, pszSourceApp);
     415    pszKeysList = prfhQueryKeysForApp(hiniSource, (PSZ)pcszSourceApp);
    415416    if (pszKeysList)
    416417    {
     
    421422            // copy this key
    422423            ulrc = prfhCopyKey(hiniSource,
    423                                pszSourceApp,
     424                               pcszSourceApp,
    424425                               pKey2,
    425426                               hiniTarget,
    426                                pszTargetApp);
     427                               pcszTargetApp);
    427428            if (ulrc)
    428429            {
     
    453454
    454455BOOL prfhSetUserProfile(HAB hab,
    455                         PSZ pszUserProfile)     // in: new user profile (.INI)
     456                        const char *pcszUserProfile)     // in: new user profile (.INI)
    456457{
    457458    BOOL    brc = FALSE;
     
    475476                // change INIs
    476477                free(Profiles.pszUserName);
    477                 Profiles.pszUserName = pszUserProfile;
    478                 Profiles.cchUserName = strlen(pszUserProfile) + 1;
     478                Profiles.pszUserName = (PSZ)pcszUserProfile;
     479                Profiles.cchUserName = strlen(pcszUserProfile) + 1;
    479480                brc = PrfReset(hab, &Profiles);
    480481                free(Profiles.pszSysName);
Note: See TracChangeset for help on using the changeset viewer.