예제 #1
0
파일: rgenstat.c 프로젝트: GYGit/reactos
// Build a path and filename so it is of the format [module][directory][filename].
// Also convert all backslashes into forward slashes.
static void
get_filename(char *cvspath, char *filename, char *result)
{
  strcpy(result, cvspath);
  strcat(result, filename);
  path_to_url(result);
}
예제 #2
0
파일: main.c 프로젝트: pombredanne/NetSurf
nsurl *gui_get_resource_url(const char *path)
{
	char buf[PATH_MAX];
	char *raw;
	nsurl *url = NULL;

	raw = path_to_url(filepath_sfind(respaths, buf, path));
	if (raw != NULL) {
		nsurl_create(raw, &url);
		free(raw);
	}

	return url;
}
예제 #3
0
파일: gui.c 프로젝트: galexcode/NetSurf68k
nsurl *gui_get_resource_url(const char *path)
{
    char buf[PATH_MAX];
    char *raw;
    nsurl *url = NULL;

    atari_find_resource((char*)&buf, path, path);
    raw = path_to_url((char*)&buf);
    if (raw != NULL) {
        nsurl_create(raw, &url);
        free(raw);
    }

    return url;
}
예제 #4
0
nsurl *gui_get_resource_url(const char *path)
{
	char buf[PATH_MAX];
	char *raw;
	nsurl *url = NULL;

	if (strcmp(path, "favicon.ico") == 0)
		path = "favicon.png";

	raw = path_to_url(filepath_sfind(respaths, buf, path));
	
	LOG(("Findfile gui: %s", raw));
	if (raw != NULL) {
		nsurl_create(raw, &url);
		free(raw);
	}

	return url;
}
예제 #5
0
파일: gui.c 프로젝트: pcwalton/NetSurf
nsurl *gui_get_resource_url(const char *path)
{
	char buf[PATH_MAX];
	char *raw;
	nsurl *url = NULL;

	/* default.css -> gtkdefault.css */
	if (strcmp(path, "default.css") == 0)
		path = "gtkdefault.css";

	/* favicon.ico -> favicon.png */
	if (strcmp(path, "favicon.ico") == 0)
		path = "favicon.png";	

	raw = path_to_url(filepath_sfind(respaths, buf, path));
	if (raw != NULL) {
		nsurl_create(raw, &url);
		free(raw);
	}

	return url;
}
예제 #6
0
void ami_file_open(struct gui_window_2 *gwin)
{
	char *temp, *temp2;
	nsurl *url;

	if(AslRequestTags(filereq,
			ASLFR_TitleText, messages_get("NetSurf"),
			ASLFR_Window, gwin->win,
			ASLFR_SleepWindow, TRUE,
			ASLFR_Screen, scrn,
			ASLFR_DoSaveMode, FALSE,
			ASLFR_RejectIcons, TRUE,
			ASLFR_FilterFunc, &aslhookfunc,
			TAG_DONE))
	{
		if(temp = AllocVecTagList(1024, NULL))
		{
			strlcpy(temp, filereq->fr_Drawer, 1024);
			AddPart(temp, filereq->fr_File, 1024);
			temp2 = path_to_url(temp);

			if (nsurl_create(temp2, &url) != NSERROR_OK) {
				warn_user("NoMemory", 0);
			} else {
				browser_window_navigate(gwin->bw,
					url,
					NULL,
					BW_NAVIGATE_HISTORY,
					NULL,
					NULL,
					NULL);
				nsurl_unref(url);
			}

			free(temp2);
			FreeVec(temp);
		}
	}
}
예제 #7
0
파일: rgenstat.c 프로젝트: GYGit/reactos
static void
generate_xml_for_component(char *component_name,
                           char *component_base)
{
  PAPI_INFO api_info;
  char canonical_base[MAX_PATH];
  char buf[200];
  int complete;
  int implemented_total;
  int unimplemented_total;

  // Sort list
  api_info_list = sort_linked_list(api_info_list, 0, compare_api_order);

  implemented_total = 0;
  unimplemented_total = 0;

  api_info = api_info_list;
  while (api_info != NULL)
    {
      if (api_info->tag_id == TAG_IMPLEMENTED)
          implemented_total ++;
      else if (api_info->tag_id == TAG_UNIMPLEMENTED)
          unimplemented_total ++;

      api_info = api_info->next;
    }

  if (implemented_total + unimplemented_total > 0)
      complete = ((implemented_total) * 100) / (implemented_total + unimplemented_total);
  else
      complete = 100;

  strcpy(canonical_base, component_base);
  path_to_url(canonical_base);

  sprintf(buf, "<component name=\"%s\" base=\"%s\" complete=\"%d\" implemented_total=\"%d\" unimplemented_total=\"%d\">",
    component_name, canonical_base, complete, implemented_total, unimplemented_total);
  write_line(buf);

  if (api_info_list != NULL)
    {
      write_line("<functions>");

      api_info = api_info_list;
      while (api_info != NULL)
        {
          sprintf(buf, "<f n=\"%s\" i=\"%s\" f=\"%s\" />",
            api_info->name,
            api_info->tag_id == TAG_IMPLEMENTED ? "true" : "false",
            get_filename_without_base(component_base,
	                              api_info->filename));
          write_line(buf);
          api_info = api_info->next;
        }

      write_line("</functions>");
    }

  write_line("</component>");
}