!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/doc/libxml2-2.5.4/examples/   drwxr-xr-x
Free 318.32 GB of 458.09 GB (69.49%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     testXPath.c (5.68 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 * testXPath.c : a small tester program for XPath.
 *
 * See Copyright for the status of this software.
 *
 * daniel@veillard.com
 */

#include "libxml.h"
#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)

#include <string.h>

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif


#include <libxml/xpath.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/debugXML.h>
#include <libxml/xmlmemory.h>
#include <libxml/parserInternals.h>
#include <libxml/xpathInternals.h>
#include <libxml/xmlerror.h>
#include <libxml/globals.h>
#if defined(LIBXML_XPTR_ENABLED)
#include <libxml/xpointer.h>
static int xptr = 0;
#endif
static int debug = 0;
static int valid = 0;
static int expr = 0;
static int tree = 0;
static int nocdata = 0;
static xmlDocPtr document = NULL;

/*
 * Default document
 */
static xmlChar buffer[] = 
"<?xml version="1.0\"?>\n\
<EXAMPLE prop1=\"gnome is great\" prop2=\"&amp; linux too\">\n\
  <head>\n\
   <title>Welcome to Gnome</title>\n\
  </head>\n\
  <chapter>\n\
   <title>The Linux adventure</title>\n\
   <p>bla bla bla ...</p>\n\
   <image href=\"linus.gif\"/>\n\
   <p>...</p>\n\
  </chapter>\n\
  <chapter>\n\
   <title>Chapter 2</title>\n\
   <p>this is chapter 2 ...</p>\n\
  </chapter>\n\
  <chapter>\n\
   <title>Chapter 3</title>\n\
   <p>this is chapter 3 ...</p>\n\
  </chapter>\n\
</EXAMPLE>\n\
"
;


static 
void
testXPath
(const char *str) {
    
xmlXPathObjectPtr res;
    
xmlXPathContextPtr ctxt;
    
#if defined(LIBXML_XPTR_ENABLED)
    
if (xptr) {
    
ctxt xmlXPtrNewContext(documentNULLNULL);
    
res xmlXPtrEval(BAD_CAST strctxt);
    } else {
#endif
    
ctxt xmlXPathNewContext(document);
    
ctxt->node xmlDocGetRootElement(document);
    if (
expr)
        
res xmlXPathEvalExpression(BAD_CAST strctxt);
    else {
        
/* res = xmlXPathEval(BAD_CAST str, ctxt); */
        
xmlXPathCompExprPtr comp;

        
comp xmlXPathCompile(BAD_CAST str);
        if (
comp != NULL) {
        if (
tree
            
xmlXPathDebugDumpCompExpr(stdoutcomp0);

        
res xmlXPathCompiledEval(compctxt);
        
xmlXPathFreeCompExpr(comp);
        } else
        
res NULL;
    }
#if defined(LIBXML_XPTR_ENABLED)
    
}
#endif
    
xmlXPathDebugDumpObject(stdoutres0);
    
xmlXPathFreeObject(res);
    
xmlXPathFreeContext(ctxt);
}

static 
void
testXPathFile
(const char *filename) {
    
FILE *input;
    
char expression[5000];
    
int len;

    
input fopen(filename"r");
    if (
input == NULL) {
        
xmlGenericError(xmlGenericErrorContext,
        
"Cannot open %s for reading\n"filename);
    return;
    }
    while (
fgets(expression4500input) != NULL) {
    
len strlen(expression);
    
len--;
    while ((
len >= 0) && 
           ((
expression[len] == '\n') || (expression[len] == '\t') ||
        (
expression[len] == '\r') || (expression[len] == ' '))) len--;
    
expression[len 1] = 0;      
    if (
len >= 0) {
        
printf("\n========================\nExpression: %s\n"expression) ;
        
testXPath(expression);
    }
    }

    
fclose(input);
}

int main(int argcchar **argv) {
    
int i;
    
int strings 0;
    
int usefile 0;
    
char *filename NULL;

    for (
1argc i++) {
#if defined(LIBXML_XPTR_ENABLED)
    
if ((!strcmp(argv[i], "-xptr")) || (!strcmp(argv[i], "--xptr")))
        
xptr++;
    else 
#endif
    
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
        
debug++;
    else if ((!
strcmp(argv[i], "-valid")) || (!strcmp(argv[i], "--valid")))
        
valid++;
    else if ((!
strcmp(argv[i], "-expr")) || (!strcmp(argv[i], "--expr")))
        
expr++;
    else if ((!
strcmp(argv[i], "-tree")) || (!strcmp(argv[i], "--tree")))
        
tree++;
    else if ((!
strcmp(argv[i], "-nocdata")) ||
         (!
strcmp(argv[i], "--nocdata")))
        
nocdata++;
    else if ((!
strcmp(argv[i], "-i")) || (!strcmp(argv[i], "--input")))
        
filename argv[++i];
    else if ((!
strcmp(argv[i], "-f")) || (!strcmp(argv[i], "--file")))
        
usefile++;
    }
    if (
valid != 0xmlDoValidityCheckingDefaultValue 1;
    
xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS;
    
xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
    
xmlSubstituteEntitiesDefaultValue 1;
    if (
nocdata != 0) {
    
xmlDefaultSAXHandlerInit();
    
xmlDefaultSAXHandler.cdataBlock NULL;
    }
    if (
document == NULL) {
        if (
filename == NULL)
        
document xmlParseDoc(buffer);
    else
        
document xmlParseFile(filename);
    }
    for (
1argc i++) {
    if ((!
strcmp(argv[i], "-i")) || (!strcmp(argv[i], "--input"))) {
        
i++; continue;
    }
    if (
argv[i][0] != '-') {
        if (
usefile)
            
testXPathFile(argv[i]);
        else
        
testXPath(argv[i]);
        
strings ++;
    }
    }
    if (
strings == 0) {
    
printf("Usage : %s [--debug] [--copy] stringsorfiles ...\n",
           
argv[0]);
    
printf("\tParse the XPath strings and output the result of the parsing\n");
    
printf("\t--debug : dump a debug version of the result\n");
    
printf("\t--valid : switch on DTD support in the parser\n");
#if defined(LIBXML_XPTR_ENABLED)
    
printf("\t--xptr : expressions are XPointer expressions\n");
#endif
    
printf("\t--expr : debug XPath expressions only\n");
    
printf("\t--tree : show the compiled XPath tree\n");
    
printf("\t--nocdata : do not generate CDATA nodes\n");
    
printf("\t--input filename : or\n");
    
printf("\t-i filename      : read the document from filename\n");
    
printf("\t--file : or\n");
    
printf("\t-f     : read queries from files, args\n");
    }
    if (
document != NULL
    
xmlFreeDoc(document);
    
xmlCleanupParser();
    
xmlMemoryDump();

    return(
0);
}
#else
#include <stdio.h>
int main(int argcchar **argv) {
    
printf("%s : XPath/Debug support not compiled in\n"argv[0]);
    return(
0);
}
#endif /* LIBXML_XPATH_ENABLED */

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0124 ]--