From 8f1a7a8ff13fde75ae8da5022d3fa21b5fe413b2 Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Wed, 15 Oct 2014 22:52:39 +0200 Subject: [PATCH] Exports quote and unquote functions for C bindings Needed to exchange strings with registered functions. --- sass_interface.cpp | 9 +++++++++ sass_interface.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/sass_interface.cpp b/sass_interface.cpp index 1695312a97..8a897c2fdd 100644 --- a/sass_interface.cpp +++ b/sass_interface.cpp @@ -6,6 +6,7 @@ #include "sass_interface.h" #include "context.hpp" +#include "inspect.hpp" #ifndef SASS_ERROR_HANDLING #include "error_handling.hpp" @@ -266,4 +267,12 @@ extern "C" { return 1; } + const char* quote (const char *str, const char quotemark) { + return Sass::quote(str, quotemark).c_str(); + } + + const char* unquote (const char *str) { + return Sass::unquote(str).c_str(); + } + } diff --git a/sass_interface.h b/sass_interface.h index 0a20b80536..dbad3f74b8 100644 --- a/sass_interface.h +++ b/sass_interface.h @@ -88,6 +88,9 @@ int sass_compile (struct sass_context* ctx); int sass_compile_file (struct sass_file_context* ctx); int sass_compile_folder (struct sass_folder_context* ctx); +const char* quote (const char *str, const char quotemark); +const char* unquote (const char *str); + #ifdef __cplusplus } #endif