ext/iodine/mustache_parser.h
/**
 * This helper function should be used to write text to the output
 * stream (often used within the `mustache_on_arg` callback).
 */
This helper function should be used to write text to the output
stream (often used within the `mustache_on_arg` callback).
This helper function should be used to write text to the output stream ( often used within the ` mustache_on_arg ` callback ) .
static inline int mustache_write_text(mustache_section_s *section, char *text,
                                      uint32_t len, uint8_t escape) {
  mustache__builder_stack_s *s = mustache___section2stack(section);
  if (escape)
    return mustache__write_escaped(s, text, len);
#if MUSTACHE_USE_DYNAMIC_PADDING
  char *end = memchr(text, '\n', len);
  while (len && end) {
    ++end;
    const uint32_t slice_len = end - text;
    if (mustache_on_text(&s->stack[s->index].sec, text, slice_len) == -1)
      return -1;
    text = end;
    len -= slice_len;
    end = memchr(text, '\n', len);
    if (mustache__write_padding(s) == -1)
      return -1;
  }
  if (len && mustache_on_text(&s->stack[s->index].sec, text, len) == -1)
    return -1;
#else
  if (mustache_on_text(&s->stack[s->index].sec, text, len) == -1)
    return -1;
#endif
  return 0;
}
static inline int mustache_write_text ( mustache_section_s * section , char * text , uint32_t len , uint8_t escape ) { mustache__builder_stack_s * s = mustache___section2stack ( section ) ; if ( escape ) return mustache__write_escaped ( s , text , len ) ; #if MUSTACHE_USE_DYNAMIC_PADDING char * end = memchr ( text , ' \n ' , len ) ; while ( len && end ) { ++ end ; const uint32_t slice_len = end - text ; if ( mustache_on_text ( & s -> stack [ s -> index ] . sec , text , slice_len ) == -1 ) return -1 ; text = end ; len -= slice_len ; end = memchr ( text , ' \n ' , len ) ; if ( mustache__write_padding ( s ) == -1 ) return -1 ; } if ( len && mustache_on_text ( & s -> stack [ s -> index ] . sec , text , len ) == -1 ) return -1 ; #else if ( mustache_on_text ( & s -> stack [ s -> index ] . sec , text , len ) == -1 ) return -1 ; #endif return 0 ; }
This helper function should be used to write text to the output
 stream (often used within the `mustache_on_arg` callback).
This helper function should be used to write text to the output stream ( often used within the ` mustache_on_arg ` callback ) .
/* TODO */