ext/iodine/mustache_parser.h
/**
 * Returns the section's parent for nested sections, or NULL (for root section).
 *
 * This allows the `udata` values in the parent to be accessed and can be used,
 * for example, when seeking a value (argument / keyword) within a nested data
 * structure such as a Hash.
 */
Returns the section's parent for nested sections, or NULL (for root section).
This allows the `udata` values in the parent to be accessed and can be used,
for example, when seeking a value (argument / keyword) within a nested data
structure such as a Hash.
Returns the section ' s parent for nested sections or NULL ( for root section ) . This allows the ` udata ` values in the parent to be accessed and can be used for example when seeking a value ( argument / keyword ) within a nested data structure such as a Hash .
static inline mustache_section_s *
mustache_section_parent(mustache_section_s *section) {
  mustache_section_s tmp = *section;
  mustache__section_stack_frame_s *f =
      (mustache__section_stack_frame_s *)section;
  while (f->frame) {
    --f;
    if (tmp.udata1 != f->sec.udata1 || tmp.udata2 != f->sec.udata2)
      return &f->sec;
  }
  return NULL;
}
static inline mustache_section_s * mustache_section_parent ( mustache_section_s * section ) { mustache_section_s tmp = * section ; mustache__section_stack_frame_s * f = ( mustache__section_stack_frame_s * ) section ; while ( f -> frame ) { -- f ; if ( tmp . udata1 != f -> sec . udata1 || tmp . udata2 != f -> sec . udata2 ) return & f -> sec ; } return NULL ; }
Returns the section's parent for nested sections, or NULL (for root section).
Returns the section ' s parent for nested sections or NULL ( for root section ) .