Skip to content

Commit 36feef0

Browse files
committed
Reorganize headers into sass subfolder
1 parent 965f226 commit 36feef0

28 files changed

+120
-118
lines changed

Makefile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,21 @@ $(DESTDIR)$(PREFIX)/lib: $(DESTDIR)$(PREFIX)
246246
$(DESTDIR)$(PREFIX)/include: $(DESTDIR)$(PREFIX)
247247
$(MKDIR) $(DESTDIR)$(PREFIX)/include
248248

249+
$(DESTDIR)$(PREFIX)/include/sass: $(DESTDIR)$(PREFIX)/include
250+
$(MKDIR) $(DESTDIR)$(PREFIX)/include/sass
251+
249252
$(DESTDIR)$(PREFIX)/include/%.h: include/%.h \
250-
$(DESTDIR)$(PREFIX)/include
253+
$(DESTDIR)$(PREFIX)/include \
254+
$(DESTDIR)$(PREFIX)/include/sass
251255
$(INSTALL) -v -m0644 "$<" "$@"
252256

253257
install-headers: $(DESTDIR)$(PREFIX)/include/sass.h \
254258
$(DESTDIR)$(PREFIX)/include/sass2scss.h \
255-
$(DESTDIR)$(PREFIX)/include/sass_values.h \
256-
$(DESTDIR)$(PREFIX)/include/sass_version.h \
257-
$(DESTDIR)$(PREFIX)/include/sass_context.h \
258-
$(DESTDIR)$(PREFIX)/include/sass_functions.h
259+
$(DESTDIR)$(PREFIX)/include/sass/base.h \
260+
$(DESTDIR)$(PREFIX)/include/sass/version.h \
261+
$(DESTDIR)$(PREFIX)/include/sass/values.h \
262+
$(DESTDIR)$(PREFIX)/include/sass/context.h \
263+
$(DESTDIR)$(PREFIX)/include/sass/functions.h
259264

260265
$(DESTDIR)$(PREFIX)/lib/%.a: lib/%.a \
261266
$(DESTDIR)$(PREFIX)/lib
@@ -293,7 +298,7 @@ test_build: $(SASSC_BIN)
293298
test_issues: $(SASSC_BIN)
294299
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues
295300

296-
clean-objects:
301+
clean-objects: lib
297302
-$(RM) lib/*.a lib/*.so lib/*.dll lib/*.la
298303
-$(RMDIR) lib
299304
clean: clean-objects

Readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,3 @@ Our MIT license is designed to be as simple, and liberal as possible.
9393
sass2scss was originally written by [Marcel Greter](@mgreter)
9494
and he happily agreed to have it merged into the project.
9595

96-
[sass_interface.h]: sass_interface.h

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AC_INIT([libsass], m4_esyscmd_s([./version.sh]), [[email protected]])
77
AC_CONFIG_SRCDIR([src/ast.hpp])
88
AC_CONFIG_MACRO_DIR([m4])
99
AC_CONFIG_HEADERS([src/config.h])
10-
AC_CONFIG_FILES([include/sass_version.h])
10+
AC_CONFIG_FILES([include/sass/version.h])
1111
AC_CONFIG_AUX_DIR([script])
1212
# These are flags passed to automake
1313
# Though they look like gcc flags!

contrib/plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <cstring>
22
#include <iostream>
33
#include <stdint.h>
4-
#include "sass_values.h"
4+
#include <sass.h>
55

66
// gcc: g++ -shared plugin.cpp -o plugin.so -fPIC -Llib -lsass
77
// mingw: g++ -shared plugin.cpp -o plugin.dll -Llib -lsass

include/sass.h

Lines changed: 6 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -3,85 +3,13 @@
33

44
// #define DEBUG 1
55

6-
#ifdef _MSC_VER
7-
#pragma warning(disable : 4503)
8-
9-
#ifndef _SCL_SECURE_NO_WARNINGS
10-
#define _SCL_SECURE_NO_WARNINGS
11-
#endif
12-
13-
#ifndef _CRT_SECURE_NO_WARNINGS
14-
#define _CRT_SECURE_NO_WARNINGS
15-
#endif
16-
17-
#ifndef _CRT_NONSTDC_NO_DEPRECATE
18-
#define _CRT_NONSTDC_NO_DEPRECATE
19-
#endif
20-
21-
#endif
22-
23-
#include <stddef.h>
24-
#include <stdbool.h>
25-
26-
#ifdef __GNUC__
27-
#define DEPRECATED(func) func __attribute__ ((deprecated))
28-
#elif defined(_MSC_VER)
29-
#define DEPRECATED(func) __declspec(deprecated) func
30-
#else
31-
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
32-
#define DEPRECATED(func) func
33-
#endif
34-
35-
#ifdef _WIN32
36-
37-
/* You should define ADD_EXPORTS *only* when building the DLL. */
38-
#ifdef ADD_EXPORTS
39-
#define ADDAPI __declspec(dllexport)
40-
#define ADDCALL __cdecl
41-
#else
42-
#define ADDAPI
43-
#define ADDCALL
44-
#endif
45-
46-
#else /* _WIN32 not defined. */
47-
48-
/* Define with no value on non-Windows OSes. */
49-
#define ADDAPI
50-
#define ADDCALL
51-
52-
#endif
53-
546
// include API headers
55-
#include "sass_version.h"
56-
#include "sass_values.h"
57-
#include "sass_functions.h"
7+
#include <sass/base.h>
8+
#include <sass/version.h>
9+
#include <sass/values.h>
10+
#include <sass/functions.h>
11+
#include <sass/context.h>
12+
#include <sass2scss.h>
5813

59-
/* Make sure functions are exported with C linkage under C++ compilers. */
60-
#ifdef __cplusplus
61-
extern "C" {
6214
#endif
6315

64-
65-
// Different render styles
66-
enum Sass_Output_Style {
67-
SASS_STYLE_NESTED,
68-
SASS_STYLE_EXPANDED,
69-
SASS_STYLE_COMPACT,
70-
SASS_STYLE_COMPRESSED
71-
};
72-
73-
// Some convenient string helper function
74-
ADDAPI char* ADDCALL sass_string_quote (const char* str, const char quote_mark);
75-
ADDAPI char* ADDCALL sass_string_unquote (const char* str);
76-
77-
// Resolve a file via the given include paths in the include char* array
78-
ADDAPI char* ADDCALL sass_resolve_file (const char* path, const char* incs[]);
79-
80-
// Get compiled libsass version
81-
ADDAPI const char* ADDCALL libsass_version(void);
82-
83-
#ifdef __cplusplus
84-
} // __cplusplus defined.
85-
#endif
86-
87-
#endif

include/sass/base.h

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#ifndef SASS_BASE_H
2+
#define SASS_BASE_H
3+
4+
#ifdef _MSC_VER
5+
#pragma warning(disable : 4503)
6+
#ifndef _SCL_SECURE_NO_WARNINGS
7+
#define _SCL_SECURE_NO_WARNINGS
8+
#endif
9+
#ifndef _CRT_SECURE_NO_WARNINGS
10+
#define _CRT_SECURE_NO_WARNINGS
11+
#endif
12+
#ifndef _CRT_NONSTDC_NO_DEPRECATE
13+
#define _CRT_NONSTDC_NO_DEPRECATE
14+
#endif
15+
#endif
16+
17+
#include <stddef.h>
18+
#include <stdbool.h>
19+
20+
#ifdef __GNUC__
21+
#define DEPRECATED(func) func __attribute__ ((deprecated))
22+
#elif defined(_MSC_VER)
23+
#define DEPRECATED(func) __declspec(deprecated) func
24+
#else
25+
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
26+
#define DEPRECATED(func) func
27+
#endif
28+
29+
#ifdef _WIN32
30+
31+
/* You should define ADD_EXPORTS *only* when building the DLL. */
32+
#ifdef ADD_EXPORTS
33+
#define ADDAPI __declspec(dllexport)
34+
#define ADDCALL __cdecl
35+
#else
36+
#define ADDAPI
37+
#define ADDCALL
38+
#endif
39+
40+
#else /* _WIN32 not defined. */
41+
42+
/* Define with no value on non-Windows OSes. */
43+
#define ADDAPI
44+
#define ADDCALL
45+
46+
#endif
47+
48+
/* Make sure functions are exported with C linkage under C++ compilers. */
49+
#ifdef __cplusplus
50+
extern "C" {
51+
#endif
52+
53+
54+
// Different render styles
55+
enum Sass_Output_Style {
56+
SASS_STYLE_NESTED,
57+
SASS_STYLE_EXPANDED,
58+
SASS_STYLE_COMPACT,
59+
SASS_STYLE_COMPRESSED
60+
};
61+
62+
// Some convenient string helper function
63+
ADDAPI char* ADDCALL sass_string_quote (const char* str, const char quote_mark);
64+
ADDAPI char* ADDCALL sass_string_unquote (const char* str);
65+
66+
// Resolve a file via the given include paths in the include char* array
67+
ADDAPI char* ADDCALL sass_resolve_file (const char* path, const char* incs[]);
68+
69+
// Get compiled libsass version
70+
ADDAPI const char* ADDCALL libsass_version(void);
71+
72+
#ifdef __cplusplus
73+
} // __cplusplus defined.
74+
#endif
75+
76+
#endif

include/sass_context.h renamed to include/sass/context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <stddef.h>
55
#include <stdbool.h>
6-
#include "sass.h"
6+
#include <sass/base.h>
77

88
#ifdef __cplusplus
99
extern "C" {

include/sass_functions.h renamed to include/sass/functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <stddef.h>
55
#include <stdbool.h>
6-
#include "sass.h"
6+
#include <sass/base.h>
77

88
#ifdef __cplusplus
99
extern "C" {

include/sass_interface.h renamed to include/sass/interface.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#ifndef SASS_C_INTERFACE_H
22
#define SASS_C_INTERFACE_H
33

4+
// the API in this header has been deprecated
5+
// please use the new API from sass/context.h
6+
47
#include <stddef.h>
58
#include <stdbool.h>
6-
#include "sass.h"
9+
#include <sass/base.h>
710

811
#ifdef __cplusplus
912
extern "C" {

include/sass_values.h renamed to include/sass/values.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <stddef.h>
55
#include <stdbool.h>
6-
#include "sass.h"
6+
#include <sass/base.h>
77

88
#ifdef __cplusplus
99
extern "C" {

0 commit comments

Comments
 (0)