Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
jmemansi.c File Reference
#include "jinclude.h"
#include "jpeglib.h"
#include "jmemsys.h"

Go to the source code of this file.

Defines

#define JPEG_INTERNALS
#define SEEK_SET   0 /* if not, assume 0 is correct */
#define DEFAULT_MAX_MEM   1000000L /* default: one megabyte */

Functions

 jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
 jpeg_free_small (j_common_ptr cinfo, void *object, size_t sizeofobject)
 jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
 jpeg_free_large (j_common_ptr cinfo, void FAR *object, size_t sizeofobject)
 jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, long max_bytes_needed, long already_allocated)
 read_backing_store (j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
 write_backing_store (j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
 close_backing_store (j_common_ptr cinfo, backing_store_ptr info)
 jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, long total_bytes_needed)
 jpeg_mem_init (j_common_ptr cinfo)
 jpeg_mem_term (j_common_ptr cinfo)

Define Documentation

#define DEFAULT_MAX_MEM   1000000L /* default: one megabyte */

Definition at line 77 of file jmemansi.c.

Definition at line 15 of file jmemansi.c.

#define SEEK_SET   0 /* if not, assume 0 is correct */

Definition at line 26 of file jmemansi.c.


Function Documentation

Definition at line 123 of file jmemansi.c.

{
  fclose(info->temp_file);
  /* Since this implementation uses tmpfile() to create the file,
   * no explicit file deletion is needed.
   */
}

Here is the call graph for this function:

Here is the caller graph for this function:

jpeg_free_large ( j_common_ptr  cinfo,
void FAR object,
size_t  sizeofobject 
)

Definition at line 62 of file jmemansi.c.

{
  free(object);
}

Here is the caller graph for this function:

jpeg_free_small ( j_common_ptr  cinfo,
void object,
size_t  sizeofobject 
)

Definition at line 42 of file jmemansi.c.

{
  free(object);
}

Here is the caller graph for this function:

jpeg_get_large ( j_common_ptr  cinfo,
size_t  sizeofobject 
)

Definition at line 56 of file jmemansi.c.

{
  return (void FAR *) malloc(sizeofobject);
}

Here is the caller graph for this function:

jpeg_get_small ( j_common_ptr  cinfo,
size_t  sizeofobject 
)

Definition at line 36 of file jmemansi.c.

{
  return (void *) malloc(sizeofobject);
}

Here is the caller graph for this function:

jpeg_mem_available ( j_common_ptr  cinfo,
long  min_bytes_needed,
long  max_bytes_needed,
long  already_allocated 
)

Definition at line 81 of file jmemansi.c.

{
  return cinfo->mem->max_memory_to_use - already_allocated;
}

Here is the caller graph for this function:

Definition at line 158 of file jmemansi.c.

{
  return DEFAULT_MAX_MEM;   /* default for max_memory_to_use */
}

Here is the caller graph for this function:

Definition at line 164 of file jmemansi.c.

{
  /* no work */
}

Here is the caller graph for this function:

jpeg_open_backing_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
long  total_bytes_needed 
)

Definition at line 141 of file jmemansi.c.

{
  if ((info->temp_file = tmpfile()) == NULL)
    ERREXITS(cinfo, JERR_TFILE_CREATE, "");
  info->read_backing_store = read_backing_store;
  info->write_backing_store = write_backing_store;
  info->close_backing_store = close_backing_store;
}

Here is the call graph for this function:

Here is the caller graph for this function:

read_backing_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
void FAR buffer_address,
long  file_offset,
long  byte_count 
)

Definition at line 97 of file jmemansi.c.

{
  if (fseek(info->temp_file, file_offset, SEEK_SET))
    ERREXIT(cinfo, JERR_TFILE_SEEK);
  if (JFREAD(info->temp_file, buffer_address, byte_count)
      != (size_t) byte_count)
    ERREXIT(cinfo, JERR_TFILE_READ);
}

Here is the call graph for this function:

Here is the caller graph for this function:

write_backing_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
void FAR buffer_address,
long  file_offset,
long  byte_count 
)

Definition at line 110 of file jmemansi.c.

{
  if (fseek(info->temp_file, file_offset, SEEK_SET))
    ERREXIT(cinfo, JERR_TFILE_SEEK);
  if (JFWRITE(info->temp_file, buffer_address, byte_count)
      != (size_t) byte_count)
    ERREXIT(cinfo, JERR_TFILE_WRITE);
}

Here is the call graph for this function:

Here is the caller graph for this function: