Sha256: 13dbbc310cc43194e6678d9180590d63e5d6058cede50ea366b981b8ceb65363

Contents?: true

Size: 1.49 KB

Versions: 6

Compression:

Stored size: 1.49 KB

Contents

#ifndef SASS_PLUGINS_H
#define SASS_PLUGINS_H

#include <string>
#include <vector>
#include "utf8_string.hpp"
#include "sass/functions.h"

#ifdef _WIN32

  #define LOAD_LIB(var, path) HMODULE var = LoadLibraryW(UTF_8::convert_to_utf16(path).c_str())
  #define LOAD_LIB_WCHR(var, path_wide_str) HMODULE var = LoadLibraryW(path_wide_str.c_str())
  #define LOAD_LIB_FN(type, var, name) type var = (type) GetProcAddress(plugin, name)
  #define CLOSE_LIB(var) FreeLibrary(var)

  #ifndef dlerror
  #define dlerror() 0
  #endif

#else

  #define LOAD_LIB(var, path) void* var = dlopen(path.c_str(), RTLD_LAZY)
  #define LOAD_LIB_FN(type, var, name) type var = (type) dlsym(plugin, name)
  #define CLOSE_LIB(var) dlclose(var)

#endif

namespace Sass {


  class Plugins {

    public: // c-tor
      Plugins(void);
      ~Plugins(void);

    public: // methods
      // load one specific plugin
      bool load_plugin(const sass::string& path);
      // load all plugins from a directory
      size_t load_plugins(const sass::string& path);

    public: // public accessors
      const sass::vector<Sass_Importer_Entry> get_headers(void) { return headers; }
      const sass::vector<Sass_Importer_Entry> get_importers(void) { return importers; }
      const sass::vector<Sass_Function_Entry> get_functions(void) { return functions; }

    private: // private vars
      sass::vector<Sass_Importer_Entry> headers;
      sass::vector<Sass_Importer_Entry> importers;
      sass::vector<Sass_Function_Entry> functions;

  };

}

#endif

Version data entries

6 entries across 5 versions & 4 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/sassc-2.4.0/ext/libsass/src/plugins.hpp
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/sassc-2.4.0/ext/libsass/src/plugins.hpp
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/sassc-2.4.0/ext/libsass/src/plugins.hpp
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/ext/libsass/src/plugins.hpp
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/ext/libsass/src/plugins.hpp
sassc-2.4.0 ext/libsass/src/plugins.hpp