Roxen.git / server / modules / misc / pathinfo.pike

version» Context lines:

Roxen.git/server/modules/misc/pathinfo.pike:1:   // This is a ChiliMoon module. Copyright © 1998 - 2001, Roxen IS.      inherit "module";    - constant cvs_version = "$Id: pathinfo.pike,v 1.22 2004/06/04 08:29:23 _cvs_stephen Exp $"; + constant cvs_version = "$Id: pathinfo.pike,v 1.23 2004/06/06 22:16:26 _cvs_dirix Exp $";   constant thread_safe = 1;      #ifdef PATHINFO_DEBUG   # define PATHINFO_WERR(X) werror("PATHINFO: "+X+"\n");   #else   # define PATHINFO_WERR(X)   #endif      constant module_type = MODULE_LAST;   constant module_name = "Scripting: Path info support";
Roxen.git/server/modules/misc/pathinfo.pike:50: Inside #if undefined(PATHINFO_LINEAR)
   int lo = (offsets[0] == 0); // Skip testing the empty string.    int hi = sizeof(offsets) - 1;       while(lo <= hi) { // Don't let the beams cross.    int probe = (lo + hi + 1)/2;    string file = query[..offsets[probe]-1];       PATHINFO_WERR(sprintf("Trying %O...", file));       /* Note: Zapps id->not_query. */ -  array st = id->conf->stat_file(file, id); +  Stdio.Stat st = id->conf->file_stat(file, id);    if (st) { -  if (st[1] >= 0) { +  if (st->type >= 0) {    // Found a file!    id->misc->path_info = query[offsets[probe]..];    id->not_query = file;    PATHINFO_WERR(sprintf("Found: %O:%O",    id->not_query, id->misc->path_info));    return 1; // Go through id->handle_request() one more time...    }    PATHINFO_WERR(sprintf("Directory: %O", file));    lo = probe + 1;    } else {
Roxen.git/server/modules/misc/pathinfo.pike:77:    string pi = "";    while( has_value( query[1..], "/" ) ) && sizeof( query ) > 0 )    {    query = reverse(query);    string add_path_info;    sscanf( query, "%[^/]/%s", add_path_info, query );    query = reverse( query );    pi = "/"+reverse( add_path_info )+pi;    id->misc->path_info = pi;    PATHINFO_WERR(sprintf("Trying: %O (%O)", query, pi)); -  array st = id->conf->stat_file( query, id ); -  if( st && (st[ ST_SIZE ] > 0)) +  Stdio.Stat st = id->conf->file_stat( query, id ); +  if( st && (st->size > 0))    {    id->not_query = query;    PATHINFO_WERR(sprintf("Found: %O:%O",    id->not_query, id->misc->path_info));    return 1;    }    }   #endif /* !PATHINFO_LINEAR */    return 0;   }