Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. int check_is_the_adress_local(dword _in)
  3. {
  4.         if(!strncmp(_in,"/sys/",5)) return true;
  5.         if(!strncmp(_in,"/hd/",4)) return true;
  6.         if(!strncmp(_in,"/fd/",4)) return true;
  7.         if(!strncmp(_in,"/rd/",4)) return true;
  8.         if(!strncmp(_in,"/tmp/",5)) return true;
  9.         if(!strncmp(_in,"/cd/",4)) return true;
  10.         if(!strncmp(_in,"/bd/",4)) return true;
  11.         if(!strncmp(_in,"/usbhd/",7)) return true;
  12.         if(!strncmp(_in,"/kolibrios/",11)) return true;
  13.         return false;
  14. }
  15.  
  16. /*
  17. int check_is_the_url_absolute(dword in)
  18. {
  19.         if(!strncmp(_in,"http:",5)) return true;
  20.         if(!strncmp(_in,"https:",6)) return true;
  21.         if(!strncmp(_in,"ftp:",4)) return true;
  22. }
  23.  
  24. void GetAbsoluteURL(dword in_URL)
  25. {
  26.         int i;
  27.         dword orig_URL = in_URL;
  28.         char newurl[UML];
  29.  
  30.         while (i=strstr(in_URL, "&"))
  31.         {
  32.                 strcpy(i+1, i+5);
  33.         }
  34.  
  35.         if (UrlIsAbsolute(in_URL)) return;
  36.        
  37.         IF (!strcmpn(in_URL,"./", 2)) in_URL+=2;
  38.         if (!http_transfer)
  39.         {
  40.                 strcpy(#newurl, History.current());
  41.         }
  42.         else
  43.         {
  44.                 strcpy(#newurl, History.items.get(History.active-2));
  45.         }
  46.  
  47.         if (ESBYTE[in_URL] == '/') //remove everything after site domain name
  48.         {
  49.                 i = strchr(#newurl+8, '/');
  50.                 if (i) ESBYTE[i]=0;
  51.                 in_URL+=1;
  52.         }
  53.                
  54.         _CUT_ST_LEVEL_MARK:
  55.                
  56.         if (newurl[strrchr(#newurl, '/')-2]<>'/')
  57.         {
  58.                 newurl[strrchr(#newurl, '/')] = 0x00;
  59.         }
  60.        
  61.         IF (!strncmp(in_URL,"../",3))
  62.         {
  63.                 in_URL+=3;
  64.                 newurl[strrchr(#newurl, '/')-1] = 0x00;
  65.                 goto _CUT_ST_LEVEL_MARK;
  66.         }
  67.        
  68.         if (newurl[strlen(#newurl)-1]<>'/') strcat(#newurl, "/");
  69.        
  70.         strcat(#newurl, in_URL);
  71.         strcpy(orig_URL, #newurl);
  72. }
  73.  
  74. */