示例#1
0
  // check if plugin is compatible with this version
  // plugins may be linked static against libsass
  // we try to be compatible between major versions
  inline bool compatibility(const char* their_version)
  {
// const char* their_version = "3.1.2";
    // first check if anyone has an unknown version
    const char* our_version = libsass_version();
    if (!strcmp(their_version, "[na]")) return false;
    if (!strcmp(our_version, "[na]")) return false;

    // find the position of the second dot
    size_t pos = string(our_version).find('.', 0);
    if (pos != string::npos) pos = string(our_version).find('.', pos + 1);

    // if we do not have two dots we fallback to compare complete string
    if (pos == string::npos) { return strcmp(their_version, our_version) ? 0 : 1; }
    // otherwise only compare up to the second dot (major versions)
    else { return strncmp(their_version, our_version, pos) ? 0 : 1; }

  }
示例#2
0
文件: sassc.c 项目: rototor/sassc
void print_version(char* argv0) {
    printf("sassc: %s\n", SASSC_VERSION);
    printf("libsass: %s\n", libsass_version());
    printf("sass2scss: %s\n", sass2scss_version());
}
示例#3
0
static int version_lua( lua_State *L )
{
    lua_pushstring( L, libsass_version() );
    return 1;
}
示例#4
0
文件: sassc.c 项目: Belisk/sassc
void print_version() {
    printf("sassc: %s\n", SASSC_VERSION);
    printf("libsass: %s\n", libsass_version());
    printf("sass2scss: %s\n", sass2scss_version());
    printf("sass: %s\n", libsass_language_version());
}
extern "C" const char* ADDCALL libsass_get_version() {
  return libsass_version();
}