예제 #1
0
GLOBAL void jpeg_open_backing_store(j_common_ptr cinfo, backing_store_ptr info, long total_bytes_needed)
{
    select_file_name(info->temp_name);
    if((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL)
        ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
    info->read_backing_store = read_backing_store;
    info->write_backing_store = write_backing_store;
    info->close_backing_store = close_backing_store;
    TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
}
예제 #2
0
static void
command_browse_cb (GtkWidget *b, GtkEntry *entry)
{
    char *file = select_file_name(_("Select command"), gtk_entry_get_text(entry), top_dialog);

    if (file) {
	gtk_entry_set_text (entry, file);
	g_free (file);
    }
}
예제 #3
0
open_file_store (j_common_ptr cinfo, backing_store_ptr info,
		 long total_bytes_needed)
{
  short handle;

  select_file_name(info->temp_name);
  if (jdos_open((short far *) & handle, (char far *) info->temp_name)) {
    /* might as well exit since jpeg_open_backing_store will fail anyway */
    ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
    return FALSE;
  }
  info->handle.file_handle = handle;
  info->read_backing_store = read_file_store;
  info->write_backing_store = write_file_store;
  info->close_backing_store = close_file_store;
  TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
  return TRUE;			/* succeeded */
}
예제 #4
0
GLOBAL void
jopen_backing_store (backing_store_ptr info, long total_bytes_needed)
{
  char tracemsg[TEMP_NAME_LENGTH+40];

  select_file_name(info->temp_name);
  if ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL) {
    /* hack to get around ERREXIT's inability to handle string parameters */
    sprintf(tracemsg, "Failed to create temporary file %s", info->temp_name);
    ERREXIT(methods, tracemsg);
  }
  info->read_backing_store = read_backing_store;
  info->write_backing_store = write_backing_store;
  info->close_backing_store = close_backing_store;
  /* hack to get around TRACEMS' inability to handle string parameters */
  sprintf(tracemsg, "Using temp file %s", info->temp_name);
  TRACEMS(methods, 1, tracemsg);
}
LOCAL boolean
open_file_store (backing_store_ptr info, long total_bytes_needed)
{
  short handle;
  char tracemsg[TEMP_NAME_LENGTH+40];

  select_file_name(info->temp_name);
  if (jdos_open((short far *) & handle, (char far *) info->temp_name)) {
    /* hack to get around TRACEMS' inability to handle string parameters */
    sprintf(tracemsg, "Failed to create temporary file %s", info->temp_name);
    ERREXIT(methods, tracemsg);	/* jopen_backing_store will fail anyway */
    return FALSE;
  }
  info->handle.file_handle = handle;
  info->read_backing_store = read_file_store;
  info->write_backing_store = write_file_store;
  info->close_backing_store = close_file_store;
  /* hack to get around TRACEMS' inability to handle string parameters */
  sprintf(tracemsg, "Opened DOS file %d  %s", handle, info->temp_name);
  TRACEMS(methods, 1, tracemsg);
  return TRUE;			/* succeeded */
}