This repository has been archived by the owner on Jul 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Big update. Changed architecture. Added Declaration, Property, Values
- Loading branch information
1 parent
91c2946
commit 33cedeb
Showing
119 changed files
with
6,584 additions
and
3,152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
Copyright (C) 2016 Alexander Borisov | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
Author: [email protected] (Alexander Borisov) | ||
*/ | ||
|
||
#ifndef MyHTML_MyCSS_DECLARATION_ENTRY_H | ||
#define MyHTML_MyCSS_DECLARATION_ENTRY_H | ||
#pragma once | ||
|
||
#include <mycss/declaration/myosi.h> | ||
#include <mycss/values/values.h> | ||
#include <mycss/property/init.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
mycss_declaration_entry_t * mycss_declaration_entry_create(mycss_declaration_t* declaration, myhtml_status_t* status); | ||
void mycss_declaration_entry_clean(mycss_declaration_entry_t* entry); | ||
void mycss_declaration_entry_clean_all(mycss_declaration_entry_t* entry); | ||
void mycss_declaration_entry_destroy(mycss_declaration_t* declaration, mycss_declaration_entry_t* dec_entry); | ||
|
||
mycss_declaration_entry_t * mycss_declaration_entry(mycss_declaration_t* declaration); | ||
mycss_declaration_entry_t * mycss_declaration_entry_last(mycss_declaration_t* declaration); | ||
|
||
void mycss_declaration_entry_append_to_current(mycss_declaration_t* declaration, mycss_declaration_entry_t* dec_entry); | ||
void mycss_declaration_entry_remove(mycss_declaration_t* declaration, mycss_declaration_entry_t* dec_entry); | ||
mycss_declaration_entry_t * mycss_declaration_entry_delete(mycss_declaration_t* declaration, mycss_declaration_entry_t* dec_entry); | ||
|
||
void mycss_declaration_entry_print(mycss_declaration_t* declaration, mycss_declaration_entry_t* dec_entry, FILE* fh); | ||
void mycss_declaration_entries_print(mycss_declaration_t* declaration, mycss_declaration_entry_t* first_dec_entry, FILE* fh); | ||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif /* MyHTML_MyCSS_DECLARATION_ENTRY_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
Copyright (C) 2016 Alexander Borisov | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
Author: [email protected] (Alexander Borisov) | ||
*/ | ||
|
||
#ifndef MyHTML_MyCSS_DECLARATION_INIT_H | ||
#define MyHTML_MyCSS_DECLARATION_INIT_H | ||
#pragma once | ||
|
||
#include <mycss/declaration/myosi.h> | ||
#include <mycss/entry.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
mycss_declaration_t * mycss_declaration_create(void); | ||
mycss_status_t mycss_declaration_init(mycss_entry_t* entry, mycss_declaration_t* declaration); | ||
void mycss_declaration_clean_all(mycss_declaration_t* declaration); | ||
void mycss_declaration_clean(mycss_declaration_t* declaration); | ||
mycss_declaration_t * mycss_declaration_destroy(mycss_declaration_t* declaration, bool self_destroy); | ||
|
||
mycss_declaration_entry_t * mycss_declaration_entry(mycss_declaration_t* declaration); | ||
void mycss_declaration_entry_clean(mycss_declaration_entry_t* entry); | ||
|
||
mycss_declaration_entry_t * mycss_declaration_entry_create(mycss_declaration_t* declaration, myhtml_status_t* status); | ||
void mycss_declaration_entry_clean_all(mycss_declaration_entry_t* entry); | ||
void mycss_declaration_entry_append_to_current(mycss_declaration_t* declaration, mycss_declaration_entry_t* dec_entry); | ||
|
||
mycss_declaration_entry_t * mycss_declaration_parse(mycss_declaration_t* declaration, myhtml_encoding_t encoding, const char* data, size_t data_size, mycss_status_t* out_status); | ||
|
||
mycss_token_type_t mycss_declaration_ending_token_type(mycss_declaration_t* declaration); | ||
void mycss_declaration_ending_token_type_set(mycss_declaration_t* declaration, mycss_token_type_t ending_token_type); | ||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif /* MyHTML_MyCSS_DECLARATION_INIT_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
Copyright (C) 2016 Alexander Borisov | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
Author: [email protected] (Alexander Borisov) | ||
*/ | ||
|
||
#ifndef MyHTML_MyCSS_DECLARATION_MYOSI_H | ||
#define MyHTML_MyCSS_DECLARATION_MYOSI_H | ||
#pragma once | ||
|
||
#include <mycss/myosi.h> | ||
#include <mycss/values/units.h> | ||
#include <mycss/property/myosi.h> | ||
#include <myhtml/utils/mcobject.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct mycss_declaration_entry mycss_declaration_entry_t; | ||
typedef struct mycss_declaration mycss_declaration_t; | ||
|
||
typedef void (*mycss_callback_declaration_destroy_f)(mycss_entry_t* entry, mycss_declaration_entry_t* dec_entry); | ||
|
||
enum mycss_declaration_flags { | ||
MyCSS_DECLARATION_FLAGS_UNDEF = 0x00, | ||
MyCSS_DECLARATION_FLAGS_BAD = 0x01 | ||
} | ||
typedef mycss_declaration_flags_t; | ||
|
||
struct mycss_declaration { | ||
mycss_entry_t* ref_entry; | ||
|
||
mycss_declaration_entry_t** entry; | ||
mycss_declaration_entry_t* entry_last; | ||
|
||
mycss_token_type_t ending_token; | ||
|
||
mcobject_t* mcobject_entries; /* for a dec entries */ | ||
mcobject_t* mcobject_list; /* for a dec list */ | ||
}; | ||
|
||
struct mycss_declaration_entry { | ||
mycss_property_type_t type; | ||
|
||
unsigned int value_type; | ||
void* value; | ||
|
||
bool is_important; | ||
mycss_declaration_flags_t flags; | ||
|
||
mycss_declaration_entry_t* next; | ||
mycss_declaration_entry_t* prev; | ||
}; | ||
|
||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif /* MyHTML_MyCSS_DECLARATION_MYOSI_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,23 +18,24 @@ | |
Author: [email protected] (Alexander Borisov) | ||
*/ | ||
|
||
#ifndef MyHTML_MyCSS_RULES_INIT_H | ||
#define MyHTML_MyCSS_RULES_INIT_H | ||
#ifndef MyHTML_MyCSS_DECLARATION_PARSER_H | ||
#define MyHTML_MyCSS_DECLARATION_PARSER_H | ||
#pragma once | ||
|
||
#include "mycss/rules/myosi.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
mycss_rules_t * mycss_rules_create(void); | ||
mycss_status_t mycss_rules_init(mycss_entry_t* entry, mycss_rules_t* rules); | ||
mycss_status_t mycss_rules_clean_all(mycss_rules_t* rules); | ||
mycss_rules_t * mycss_rules_destroy(mycss_rules_t* rules, bool self_destroy); | ||
#include <mycss/entry.h> | ||
#include <mycss/property/init.h> | ||
#include <mycss/declaration/entry.h> | ||
|
||
void mycss_declaration_parser_begin(mycss_entry_t* entry, mycss_token_t* token); | ||
void mycss_declaration_parser_ident(mycss_entry_t* entry, mycss_token_t* token); | ||
|
||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif /* MyHTML_MyCSS_RULES_INIT_H */ | ||
#endif /* MyHTML_MyCSS_DECLARATION_PARSER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
Copyright (C) 2016 Alexander Borisov | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
Author: [email protected] (Alexander Borisov) | ||
*/ | ||
|
||
#ifndef MyHTML_MyCSS_DECLARATION_DECLARATION_H | ||
#define MyHTML_MyCSS_DECLARATION_DECLARATION_H | ||
#pragma once | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <mycss/entry.h> | ||
#include <mycss/declaration/parser.h> | ||
|
||
bool mycss_declaration_state_begin(mycss_entry_t* entry, mycss_token_t* token, bool last_response); | ||
|
||
bool mycss_declaration_state_data(mycss_entry_t* entry, mycss_token_t* token, bool last_response); | ||
bool mycss_declaration_state_ident(mycss_entry_t* entry, mycss_token_t* token, bool last_response); | ||
bool mycss_declaration_state_colon_before_important(mycss_entry_t* entry, mycss_token_t* token, bool last_response); | ||
bool mycss_declaration_state_colon_important(mycss_entry_t* entry, mycss_token_t* token, bool last_response); | ||
bool mycss_declaration_state_colon_delim_after_important(mycss_entry_t* entry, mycss_token_t* token, bool last_response); | ||
bool mycss_declaration_state_find_ending(mycss_entry_t* entry, mycss_token_t* token, bool last_response); | ||
bool mycss_declaration_state_parse_error(mycss_entry_t* entry, mycss_token_t* token, bool last_response); | ||
bool mycss_declaration_state_drop_component_value(mycss_entry_t* entry, mycss_token_t* token, bool last_response); | ||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif /* MyHTML_MyCSS_DECLARATION_DECLARATION_H */ |
Oops, something went wrong.