Skip to content

Commit

Permalink
clang-format of headers
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni committed Feb 8, 2017
1 parent 189e842 commit 559ee8b
Show file tree
Hide file tree
Showing 51 changed files with 4,402 additions and 2,816 deletions.
7 changes: 3 additions & 4 deletions include/sass.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

// include API headers
#include <sass/base.h>
#include <sass/version.h>
#include <sass/values.h>
#include <sass/functions.h>
#include <sass/context.h>
#include <sass/functions.h>
#include <sass/values.h>
#include <sass/version.h>
#include <sass2scss.h>

#endif

143 changes: 71 additions & 72 deletions include/sass2scss.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@

#ifdef _WIN32

/* You should define ADD_EXPORTS *only* when building the DLL. */
#ifdef ADD_EXPORTS
#define ADDAPI __declspec(dllexport)
#define ADDCALL __cdecl
#else
#define ADDAPI
#define ADDCALL
#endif
/* You should define ADD_EXPORTS *only* when building the DLL. */
#ifdef ADD_EXPORTS
#define ADDAPI __declspec(dllexport)
#define ADDCALL __cdecl
#else
#define ADDAPI
#define ADDCALL
#endif

#else /* _WIN32 not defined. */

/* Define with no value on non-Windows OSes. */
#define ADDAPI
#define ADDCALL
/* Define with no value on non-Windows OSes. */
#define ADDAPI
#define ADDCALL

#endif

#ifdef __cplusplus

#include <stack>
#include <string>
#include <cstring>
#include <sstream>
#include <iostream>
#include <sstream>
#include <stack>
#include <string>

#ifndef SASS2SCSS_VERSION
// Hardcode once the file is copied from
Expand All @@ -44,74 +44,73 @@
namespace Sass
{

// pretty print options
const int SASS2SCSS_PRETTIFY_0 = 0;
const int SASS2SCSS_PRETTIFY_1 = 1;
const int SASS2SCSS_PRETTIFY_2 = 2;
const int SASS2SCSS_PRETTIFY_3 = 3;

// remove one-line comment
const int SASS2SCSS_KEEP_COMMENT = 32;
// remove multi-line comments
const int SASS2SCSS_STRIP_COMMENT = 64;
// convert one-line to multi-line
const int SASS2SCSS_CONVERT_COMMENT = 128;

// String for finding something interesting
const std::string SASS2SCSS_FIND_WHITESPACE = " \t\n\v\f\r";

// converter struct
// holding all states
struct converter
{
// bit options
int options;
// is selector
bool selector;
// concat lists
bool comma;
// has property
bool property;
// has semicolon
bool semicolon;
// comment context
std::string comment;
// flag end of file
bool end_of_file;
// whitespace buffer
std::string whitespace;
// context/block stack
std::stack<std::string> indents;
};

// function only available in c++ code
char* sass2scss (const std::string& sass, const int options);

// pretty print options
const int SASS2SCSS_PRETTIFY_0 = 0;
const int SASS2SCSS_PRETTIFY_1 = 1;
const int SASS2SCSS_PRETTIFY_2 = 2;
const int SASS2SCSS_PRETTIFY_3 = 3;

// remove one-line comment
const int SASS2SCSS_KEEP_COMMENT = 32;
// remove multi-line comments
const int SASS2SCSS_STRIP_COMMENT = 64;
// convert one-line to multi-line
const int SASS2SCSS_CONVERT_COMMENT = 128;

// String for finding something interesting
const std::string SASS2SCSS_FIND_WHITESPACE = " \t\n\v\f\r";

// converter struct
// holding all states
struct converter
{
// bit options
int options;
// is selector
bool selector;
// concat lists
bool comma;
// has property
bool property;
// has semicolon
bool semicolon;
// comment context
std::string comment;
// flag end of file
bool end_of_file;
// whitespace buffer
std::string whitespace;
// context/block stack
std::stack<std::string> indents;
};

// function only available in c++ code
char* sass2scss(const std::string& sass, const int options);
}
// EO namespace

// declare for c
extern "C" {
#endif

// prettyfy print options
#define SASS2SCSS_PRETTIFY_0 0
#define SASS2SCSS_PRETTIFY_1 1
#define SASS2SCSS_PRETTIFY_2 2
#define SASS2SCSS_PRETTIFY_3 3
// prettyfy print options
#define SASS2SCSS_PRETTIFY_0 0
#define SASS2SCSS_PRETTIFY_1 1
#define SASS2SCSS_PRETTIFY_2 2
#define SASS2SCSS_PRETTIFY_3 3

// keep one-line comments
#define SASS2SCSS_KEEP_COMMENT 32
// remove multi-line comments
#define SASS2SCSS_STRIP_COMMENT 64
// convert one-line to multi-line
#define SASS2SCSS_CONVERT_COMMENT 128
// keep one-line comments
#define SASS2SCSS_KEEP_COMMENT 32
// remove multi-line comments
#define SASS2SCSS_STRIP_COMMENT 64
// convert one-line to multi-line
#define SASS2SCSS_CONVERT_COMMENT 128

// available to c and c++ code
ADDAPI char* ADDCALL sass2scss (const char* sass, const int options);
// available to c and c++ code
ADDAPI char* ADDCALL sass2scss(const char* sass, const int options);

// Get compiled sass2scss version
ADDAPI const char* ADDCALL sass2scss_version(void);
// Get compiled sass2scss version
ADDAPI const char* ADDCALL sass2scss_version(void);

#ifdef __cplusplus
} // __cplusplus defined.
Expand Down
Loading

0 comments on commit 559ee8b

Please sign in to comment.