website/archive/binaries/mac/src/clustalo/src/clustal-omega.c
/**
 * @brief Returns major version of HMMER. Whichever hmmbuild version
 * is found first in your PATH will be used
 *
 * @return -1 on error, major hmmer version otherwise
 *
 */
@brief Returns major version of HMMER. Whichever hmmbuild version
is found first in your PATH will be used

@return -1 on error, major hmmer version otherwise
@brief Returns major version of HMMER . Whichever hmmbuild version is found first in your PATH will be used @return - 1 on error major hmmer version otherwise
int
HmmerVersion()
{
    char zcHmmerTestCall[] = "hmmbuild -h";
    FILE *fp = NULL;
    int iMajorVersion = 0;
    char zcLine[16384];
    if (NULL == (fp = popen(zcHmmerTestCall, "r"))) {
        Log(&rLog, LOG_ERROR, "Couldn't exec %s", zcHmmerTestCall);
        return -1;
    }
    while (fgets(zcLine, sizeof(zcLine), fp)) {
        char *pcLocate;
        if ((pcLocate = strstr(zcLine, "HMMER "))) {
            iMajorVersion = atoi(&pcLocate[6]);
            break;
        }
    }
    pclose(fp);
    return iMajorVersion;
}
int HmmerVersion ( ) { char zcHmmerTestCall [ ] = " " ; FILE * fp = NULL ; int iMajorVersion = 0 ; char zcLine [ 16384 ] ; if ( NULL == ( fp = popen ( zcHmmerTestCall , " " ) ) ) { Log ( & rLog , LOG_ERROR , " " , zcHmmerTestCall ) ; return -1 ; } while ( fgets ( zcLine , sizeof ( zcLine ) , fp ) ) { char * pcLocate ; if ( ( pcLocate = strstr ( zcLine , " " ) ) ) { iMajorVersion = atoi ( & pcLocate [ 6 ] ) ; break ; } } pclose ( fp ) ; return iMajorVersion ; }
@brief Returns major version of HMMER.
@brief Returns major version of HMMER .