/* curl write callback, to fill tidy's input buffer... */ uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out) { uint r; r = size * nmemb; tidyBufAppend( out, in, r ); return(r); }
Bool TIDY_CALL tidyNodeGetValue( TidyDoc tdoc, TidyNode tnod, TidyBuffer* buf ) { TidyDocImpl *doc = tidyDocToImpl( tdoc ); Node *node = tidyNodeToImpl( tnod ); if ( doc == NULL || node == NULL || buf == NULL ) return no; switch( node->type ) { case TextNode: case CDATATag: case CommentTag: case ProcInsTag: case SectionTag: case AspTag: case JsteTag: case PhpTag: { tidyBufClear( buf ); tidyBufAppend( buf, doc->lexer->lexbuf + node->start, node->end - node->start ); break; } default: /* The node doesn't have a value */ return no; } return yes; }