Blame src/sass.hpp

Packit Service 7770af
// must be the first include in all compile units
Packit Service 7770af
#ifndef SASS_SASS_H
Packit Service 7770af
#define SASS_SASS_H
Packit Service 7770af
Packit Service 7770af
// undefine extensions macro to tell sys includes
Packit Service 7770af
// that we do not want any macros to be exported
Packit Service 7770af
// mainly fixes an issue on SmartOS (SEC macro)
Packit Service 7770af
#undef __EXTENSIONS__
Packit Service 7770af
Packit Service 7770af
#ifdef _MSC_VER
Packit Service 7770af
#pragma warning(disable : 4005)
Packit Service 7770af
#endif
Packit Service 7770af
Packit Service 7770af
// aplies to MSVC and MinGW
Packit Service 7770af
#ifdef _WIN32
Packit Service 7770af
// we do not want the ERROR macro
Packit Service 7770af
# define NOGDI
Packit Service 7770af
// we do not want the min/max macro
Packit Service 7770af
# define NOMINMAX
Packit Service 7770af
// we do not want the IN/OUT macro
Packit Service 7770af
# define _NO_W32_PSEUDO_MODIFIERS
Packit Service 7770af
#endif
Packit Service 7770af
Packit Service 7770af
Packit Service 7770af
// should we be case insensitive
Packit Service 7770af
// when dealing with files or paths
Packit Service 7770af
#ifndef FS_CASE_SENSITIVE
Packit Service 7770af
# ifdef _WIN32
Packit Service 7770af
#  define FS_CASE_SENSITIVE 0
Packit Service 7770af
# else
Packit Service 7770af
#  define FS_CASE_SENSITIVE 1
Packit Service 7770af
# endif
Packit Service 7770af
#endif
Packit Service 7770af
Packit Service 7770af
// path separation char
Packit Service 7770af
#ifndef PATH_SEP
Packit Service 7770af
# ifdef _WIN32
Packit Service 7770af
#  define PATH_SEP ';'
Packit Service 7770af
# else
Packit Service 7770af
#  define PATH_SEP ':'
Packit Service 7770af
# endif
Packit Service 7770af
#endif
Packit Service 7770af
Packit Service 7770af
Packit Service 7770af
// include C-API header
Packit Service 7770af
#include "sass/base.h"
Packit Service 7770af
Packit Service 7770af
// For C++ helper
Packit Service 7770af
#include <string>
Packit Service 7770af
Packit Service 7770af
// output behaviours
Packit Service 7770af
namespace Sass {
Packit Service 7770af
Packit Service 7770af
  // create some C++ aliases for the most used options
Packit Service 7770af
  const static Sass_Output_Style NESTED = SASS_STYLE_NESTED;
Packit Service 7770af
  const static Sass_Output_Style COMPACT = SASS_STYLE_COMPACT;
Packit Service 7770af
  const static Sass_Output_Style EXPANDED = SASS_STYLE_EXPANDED;
Packit Service 7770af
  const static Sass_Output_Style COMPRESSED = SASS_STYLE_COMPRESSED;
Packit Service 7770af
  // only used internal to trigger ruby inspect behavior
Packit Service 7770af
  const static Sass_Output_Style INSPECT = SASS_STYLE_INSPECT;
Packit Service 7770af
  const static Sass_Output_Style TO_SASS = SASS_STYLE_TO_SASS;
Packit Service 7770af
Packit Service 7770af
  // helper to aid dreaded MSVC debug mode
Packit Service 7770af
  // see implementation for more details
Packit Service 7770af
  char* sass_copy_string(std::string str);
Packit Service 7770af
Packit Service 7770af
}
Packit Service 7770af
Packit Service 7770af
// input behaviours
Packit Service 7770af
enum Sass_Input_Style {
Packit Service 7770af
  SASS_CONTEXT_NULL,
Packit Service 7770af
  SASS_CONTEXT_FILE,
Packit Service 7770af
  SASS_CONTEXT_DATA,
Packit Service 7770af
  SASS_CONTEXT_FOLDER
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// simple linked list
Packit Service 7770af
struct string_list {
Packit Service 7770af
  string_list* next;
Packit Service 7770af
  char* string;
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// sass config options structure
Packit Service 7770af
struct Sass_Inspect_Options {
Packit Service 7770af
Packit Service 7770af
  // Output style for the generated css code
Packit Service 7770af
  // A value from above SASS_STYLE_* constants
Packit Service 7770af
  enum Sass_Output_Style output_style;
Packit Service 7770af
Packit Service 7770af
  // Precision for fractional numbers
Packit Service 7770af
  int precision;
Packit Service 7770af
Packit Service 7770af
  // initialization list (constructor with defaults)
Packit Service 7770af
  Sass_Inspect_Options(Sass_Output_Style style = Sass::NESTED,
Packit Service 7770af
                       int precision = 5)
Packit Service 7770af
  : output_style(style), precision(precision)
Packit Service 7770af
  { }
Packit Service 7770af
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
// sass config options structure
Packit Service 7770af
struct Sass_Output_Options : Sass_Inspect_Options {
Packit Service 7770af
Packit Service 7770af
  // String to be used for indentation
Packit Service 7770af
  const char* indent;
Packit Service 7770af
  // String to be used to for line feeds
Packit Service 7770af
  const char* linefeed;
Packit Service 7770af
Packit Service 7770af
  // Emit comments in the generated CSS indicating
Packit Service 7770af
  // the corresponding source line.
Packit Service 7770af
  bool source_comments;
Packit Service 7770af
Packit Service 7770af
  // initialization list (constructor with defaults)
Packit Service 7770af
  Sass_Output_Options(struct Sass_Inspect_Options opt,
Packit Service 7770af
                      const char* indent = "  ",
Packit Service 7770af
                      const char* linefeed = "\n",
Packit Service 7770af
                      bool source_comments = false)
Packit Service 7770af
  : Sass_Inspect_Options(opt),
Packit Service 7770af
    indent(indent), linefeed(linefeed),
Packit Service 7770af
    source_comments(source_comments)
Packit Service 7770af
  { }
Packit Service 7770af
Packit Service 7770af
  // initialization list (constructor with defaults)
Packit Service 7770af
  Sass_Output_Options(Sass_Output_Style style = Sass::NESTED,
Packit Service 7770af
                      int precision = 5,
Packit Service 7770af
                      const char* indent = "  ",
Packit Service 7770af
                      const char* linefeed = "\n",
Packit Service 7770af
                      bool source_comments = false)
Packit Service 7770af
  : Sass_Inspect_Options(style, precision),
Packit Service 7770af
    indent(indent), linefeed(linefeed),
Packit Service 7770af
    source_comments(source_comments)
Packit Service 7770af
  { }
Packit Service 7770af
Packit Service 7770af
};
Packit Service 7770af
Packit Service 7770af
#endif