Example #1
0
/*
**  Name: CFBackupConf
**
**  Description:
**      Save the current configuration as a .bak file.
**
** Inputs:
**      loc                 Current location
**
** Outputs:
**      none
**
** Returns:
**      OK      success
**      FAIL    failure
**
** History:
**      11-Feb-2000 (fanra01)
**          Created.
*/
STATUS
CFBackupConf( LOCATION* loc, PRL begin )
{
    STATUS status;
    char buffer[MAX_LOC + 1];
    char device[MAX_LOC + 1];
    char path[MAX_LOC + 1];
    char filename[MAX_LOC + 1];
    char extension[MAX_LOC + 1];
    char version[MAX_LOC + 1];
    LOCATION backup;

    LOcopy( loc, buffer, &backup );
    LOdetail( loc, device, path, filename, extension, version );
    LOcompose( device, path, filename, ERx( "bak" ), version, &backup );
    status = CFWriteConf( &backup, begin );
    return (status);
}
Example #2
0
/*
** Name: RegisterColdFusionICEExtensions
**
** Description:
**      Backup the existing extension file, remove any existing tags and
**      prepend the ICE extensions to the file.
**
** Inputs:
**      cfpath      ColdFusion extension path
**      icfpath     Ice ColdFusion extension path
**
** Outputs:
**      None.
**
** History:
**      11-Feb-2000 (fanra01)
**          Created.
*/
STATUS
RegisterColdFusionICEExtensions( char* cfpath, char* icfpath )
{
    STATUS      status  = FAIL;
    PRL         cbegin  = NULL;
    PRL         ibegin  = NULL;
    int         version;
    LOCATION    cloc;
    LOCATION    iloc;
    char        clocpath[MAX_LOC + 1];
    char        ilocpath[MAX_LOC + 1];

    LOfroms( PATH, clocpath, &cloc );
    LOfroms( PATH, ilocpath, &iloc );

    cfpath = SetColdFusionPath( cfpath );
    icfpath = SetIngresICEPath( icfpath );

    /*
    ** Detect if ColdFusion is on the system
    */
    if ((cfpath != NULL) || ((version = IsColdFusionInstalled()) > 0))
    {
        do
        {
            /*
            ** Function parameters override the values determined from
            ** registry.
            */
            if (((icfpath != NULL) ||
                ((icfpath = GetIngresICECFPath()) != NULL)) &&
                ((cfpath != NULL) ||
                ((cfpath = GetColdFusionPath( version )) != NULL)))
            {
                if ((status = CFReadConf( icfpath, icfvtm, &iloc, &ibegin ))
                    != OK)
                    break;

                if ((status = CFReadConf( cfpath, cfvtm, &cloc, &cbegin ))
                    != OK)
                    break;

                if ((status = CFBackupConf( &cloc, cbegin )) != OK)
                    break;

                if ((status = DropExistingTags( &cbegin )) != OK)
                    break;

                if ((status = MergeTags( ibegin, &cbegin )) != OK)
                    break;

                status = CFWriteConf( &cloc, cbegin );
            }
            break;
        }
        while(TRUE);

        if(status != OK)
        {
            /*
            ** we had an error
            */
        }
    }
    else
    {
        /*
        ** Get ColdFusion from Allaire web site
        */
        status = FAIL;
    }
    return  (status);
}