libcss
Loading...
Searching...
No Matches
Macros | Functions
margin.c File Reference
#include <assert.h>
#include <string.h>
#include "bytecode/bytecode.h"
#include "bytecode/opcodes.h"
#include "parse/properties/properties.h"
#include "parse/properties/utils.h"

Macros

#define SIDE_APPEND(OP, NUM)
 

Functions

css_error css__parse_margin (css_language *c, const parserutils_vector *vector, int32_t *ctx, css_style *result)
 

Macro Definition Documentation

◆ SIDE_APPEND

#define SIDE_APPEND (   OP,
  NUM 
)
Value:
error = css__stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \
if (error != CSS_OK) \
break; \
if (side_val[(NUM)] == MARGIN_SET) { \
error = css__stylesheet_style_append(result, side_length[(NUM)]); \
if (error != CSS_OK) \
break; \
error = css__stylesheet_style_append(result, side_unit[(NUM)]); \
if (error != CSS_OK) \
break; \
}
@ CSS_OK
Definition errors.h:19
@ MARGIN_SET
Definition opcodes.h:559
css_error css__stylesheet_style_append(css_style *style, css_code_t css_code)
Definition stylesheet.c:726

Function Documentation

◆ css__parse_margin()

css_error css__parse_margin ( css_language c,
const parserutils_vector *  vector,
int32_t *  ctx,
css_style result 
)

Parse margin shorthand

Parameters
cParsing context
vectorVector of tokens to process
ctxPointer to vector iteration context
resultPointer to location to receive resulting style
Returns
CSS_OK on success, CSS_NOMEM on memory exhaustion, CSS_INVALID if the input is not valid

Post condition: *ctx is updated with the next token to process If the input is invalid, then *ctx remains unchanged.