Esempio n. 1
0
static void
version(void)
{
	printf("bsdtar %s - %s\n",
	    BSDTAR_VERSION_STRING,
	    archive_version_string());
	exit(0);
}
Esempio n. 2
0
static void
version(void)
{
	fprintf(stdout,"bsdcpio %s -- %s\n",
	    BSDCPIO_VERSION_STRING,
	    archive_version_string());
	exit(0);
}
Esempio n. 3
0
static int ar_version(lua_State *L) {
    const char* version = archive_version_string();
    int         count   = strlen(version) + 1;
    char*       cur     = (char*)memcpy(lua_newuserdata(L, count),
                                        version, count);

    count = 0;
    while ( *cur ) {
        char* begin = cur;
        // Find all digits:
        while ( isdigit(*cur) ) cur++;
        if ( begin != cur ) {
            int is_end = *cur == '\0';
            *cur = '\0';
            lua_pushnumber(L, atoi(begin));
            count++;
            if ( is_end ) break;
            cur++;
        }
        while ( *cur && ! isdigit(*cur) ) cur++;
    }

    return count;
}
Esempio n. 4
0
/* Deprecated synonym for archive_version_string() */
const char *
archive_version(void)
{
	return (archive_version_string());
}
Esempio n. 5
0
static void
ranlib_version(void)
{
	(void)printf("ranlib %s - %s\n", BSDAR_VERSION, archive_version_string());
	exit(EX_OK);
}
Esempio n. 6
0
static void
bsdar_version(void)
{
	(void)printf("BSD ar %s - %s\n", BSDAR_VERSION, archive_version_string());
	exit(EX_OK);
}