misc/libfreetype/src/lzw/ftlzw.c
author koda
Mon, 25 Apr 2011 01:46:54 +0200
changeset 5172 88f2e05288ba
permissions -rw-r--r--
aaand let's add freetype as well while we are at it other smaller changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
/*  ftlzw.c                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
/*    FreeType support for .Z compressed files.                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*  This optional component relies on NetBSD's zopen().  It should mainly  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  be used to parse compressed PCF fonts, as found with many X11 server   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*  distributions.                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*  Copyright 2004, 2005, 2006, 2009, 2010 by                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
/*  Albert Chin-A-Young.                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
/*  Based on code in src/gzip/ftgzip.c, Copyright 2004 by                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
/*  This file is part of the FreeType project, and may only be used,       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
/*  modified, and distributed under the terms of the FreeType project      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
/*  this file you indicate that you have read the license and              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
/*  understand and accept it fully.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
#include FT_INTERNAL_MEMORY_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
#include FT_INTERNAL_STREAM_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
#include FT_INTERNAL_DEBUG_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
#include FT_LZW_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
#include FT_CONFIG_STANDARD_LIBRARY_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
#include FT_MODULE_ERRORS_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
#undef __FTERRORS_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
#define FT_ERR_PREFIX  LZW_Err_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
#define FT_ERR_BASE    FT_Mod_Err_LZW
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
#include FT_ERRORS_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
#ifdef FT_CONFIG_OPTION_USE_LZW
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
#ifdef FT_CONFIG_OPTION_PIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
#error "lzw code does not support PIC yet"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
#endif 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
#include "ftzopen.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
/*****                                                                 *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
/*****                  M E M O R Y   M A N A G E M E N T              *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
/*****                                                                 *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
/*****                                                                 *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
/*****                   F I L E   D E S C R I P T O R                 *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
/*****                                                                 *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
#define FT_LZW_BUFFER_SIZE  4096
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
  typedef struct  FT_LZWFileRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
    FT_Stream       source;         /* parent/source stream        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
    FT_Stream       stream;         /* embedding stream            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
    FT_Memory       memory;         /* memory allocator            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
    FT_LzwStateRec  lzw;            /* lzw decompressor state      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
    FT_Byte         buffer[FT_LZW_BUFFER_SIZE]; /* output buffer      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
    FT_ULong        pos;                        /* position in output */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
    FT_Byte*        cursor;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
    FT_Byte*        limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
  } FT_LZWFileRec, *FT_LZWFile;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
  /* check and skip .Z header */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
  ft_lzw_check_header( FT_Stream  stream )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
    FT_Error  error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
    FT_Byte   head[2];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
    if ( FT_STREAM_SEEK( 0 )       ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
         FT_STREAM_READ( head, 2 ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
      goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
    /* head[0] && head[1] are the magic numbers */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
    if ( head[0] != 0x1f ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
         head[1] != 0x9d )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
      error = LZW_Err_Invalid_File_Format;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
  Exit:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
    return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
  ft_lzw_file_init( FT_LZWFile  zip,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
                    FT_Stream   stream,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
                    FT_Stream   source )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
    FT_LzwState  lzw   = &zip->lzw;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
    FT_Error     error = LZW_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
    zip->stream = stream;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
    zip->source = source;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
    zip->memory = stream->memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
    zip->limit  = zip->buffer + FT_LZW_BUFFER_SIZE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
    zip->cursor = zip->limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
    zip->pos    = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
    /* check and skip .Z header */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
    error = ft_lzw_check_header( source );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
    if ( error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
      goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
    /* initialize internal lzw variable */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
    ft_lzwstate_init( lzw, source );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
  Exit:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
    return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   137
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
  ft_lzw_file_done( FT_LZWFile  zip )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   139
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   140
    /* clear the rest */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
    ft_lzwstate_done( &zip->lzw );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
    zip->memory = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
    zip->source = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
    zip->stream = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
  ft_lzw_file_reset( FT_LZWFile  zip )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
    FT_Stream  stream = zip->source;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
    FT_Error   error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
    if ( !FT_STREAM_SEEK( 0 ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
      ft_lzwstate_reset( &zip->lzw );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
      zip->limit  = zip->buffer + FT_LZW_BUFFER_SIZE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
      zip->cursor = zip->limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
      zip->pos    = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   163
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
    return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
  ft_lzw_file_fill_output( FT_LZWFile  zip )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
    FT_LzwState  lzw = &zip->lzw;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
    FT_ULong     count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
    FT_Error     error = LZW_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
    zip->cursor = zip->buffer;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   178
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
    count = ft_lzwstate_io( lzw, zip->buffer, FT_LZW_BUFFER_SIZE );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
    zip->limit = zip->cursor + count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
    if ( count == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
      error = LZW_Err_Invalid_Stream_Operation;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
    return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
  /* fill output buffer; `count' must be <= FT_LZW_BUFFER_SIZE */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
  ft_lzw_file_skip_output( FT_LZWFile  zip,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   193
                           FT_ULong    count )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
    FT_Error  error = LZW_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
    /* first, we skip what we can from the output buffer */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
      FT_ULong  delta = (FT_ULong)( zip->limit - zip->cursor );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
      if ( delta >= count )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
        delta = count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
      zip->cursor += delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
      zip->pos    += delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
      count -= delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
    /* next, we skip as many bytes remaining as possible */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
    while ( count > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
      FT_ULong  delta = FT_LZW_BUFFER_SIZE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   216
      FT_ULong  numread;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   218
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   219
      if ( delta > count )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   220
        delta = count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   221
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   222
      numread = ft_lzwstate_io( &zip->lzw, NULL, delta );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   223
      if ( numread < delta )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   224
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   225
        /* not enough bytes */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   226
        error = LZW_Err_Invalid_Stream_Operation;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   227
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   228
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   229
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   230
      zip->pos += delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   231
      count    -= delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   232
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   233
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   234
    return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   235
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   236
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   237
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   238
  static FT_ULong
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   239
  ft_lzw_file_io( FT_LZWFile  zip,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   240
                  FT_ULong    pos,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   241
                  FT_Byte*    buffer,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   242
                  FT_ULong    count )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   243
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   244
    FT_ULong  result = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   245
    FT_Error  error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   246
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   247
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   248
    /* seeking backwards. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   249
    if ( pos < zip->pos )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   250
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   251
      /* If the new position is within the output buffer, simply       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   252
      /* decrement pointers, otherwise we reset the stream completely! */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   253
      if ( ( zip->pos - pos ) <= (FT_ULong)( zip->cursor - zip->buffer ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   254
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   255
        zip->cursor -= zip->pos - pos;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   256
        zip->pos     = pos;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   257
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   258
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   259
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   260
        error = ft_lzw_file_reset( zip );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   261
        if ( error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   262
          goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   263
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   264
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   265
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   266
    /* skip unwanted bytes */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   267
    if ( pos > zip->pos )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   268
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   269
      error = ft_lzw_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   270
      if ( error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   271
        goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   272
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   273
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   274
    if ( count == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   275
      goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   276
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   277
    /* now read the data */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   278
    for (;;)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   279
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   280
      FT_ULong  delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   281
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   282
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   283
      delta = (FT_ULong)( zip->limit - zip->cursor );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   284
      if ( delta >= count )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   285
        delta = count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   286
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   287
      FT_MEM_COPY( buffer + result, zip->cursor, delta );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   288
      result      += delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   289
      zip->cursor += delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   290
      zip->pos    += delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   291
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   292
      count -= delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   293
      if ( count == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   294
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   295
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   296
      error = ft_lzw_file_fill_output( zip );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   297
      if ( error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   298
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   299
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   300
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   301
  Exit:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   302
    return result;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   303
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   304
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   305
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   306
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   307
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   308
/*****                                                                 *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   309
/*****            L Z W   E M B E D D I N G   S T R E A M              *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   310
/*****                                                                 *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   311
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   312
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   313
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   314
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   315
  ft_lzw_stream_close( FT_Stream  stream )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   316
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   317
    FT_LZWFile  zip    = (FT_LZWFile)stream->descriptor.pointer;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   318
    FT_Memory   memory = stream->memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   319
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   320
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   321
    if ( zip )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   322
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   323
      /* finalize lzw file descriptor */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   324
      ft_lzw_file_done( zip );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   325
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   326
      FT_FREE( zip );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   327
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   328
      stream->descriptor.pointer = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   329
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   330
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   331
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   332
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   333
  static FT_ULong
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   334
  ft_lzw_stream_io( FT_Stream  stream,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   335
                    FT_ULong   pos,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   336
                    FT_Byte*   buffer,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   337
                    FT_ULong   count )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   338
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   339
    FT_LZWFile  zip = (FT_LZWFile)stream->descriptor.pointer;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   340
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   341
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   342
    return ft_lzw_file_io( zip, pos, buffer, count );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   343
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   344
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   345
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   346
  FT_EXPORT_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   347
  FT_Stream_OpenLZW( FT_Stream  stream,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   348
                     FT_Stream  source )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   349
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   350
    FT_Error    error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   351
    FT_Memory   memory = source->memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   352
    FT_LZWFile  zip;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   353
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   354
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   355
    /*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   356
     *  Check the header right now; this prevents allocation of a huge
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   357
     *  LZWFile object (400 KByte of heap memory) if not necessary.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   358
     *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   359
     *  Did I mention that you should never use .Z compressed font
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   360
     *  files?
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   361
     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   362
    error = ft_lzw_check_header( source );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   363
    if ( error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   364
      goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   365
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   366
    FT_ZERO( stream );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   367
    stream->memory = memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   368
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   369
    if ( !FT_NEW( zip ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   370
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   371
      error = ft_lzw_file_init( zip, stream, source );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   372
      if ( error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   373
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   374
        FT_FREE( zip );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   375
        goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   376
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   377
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   378
      stream->descriptor.pointer = zip;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   379
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   380
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   381
    stream->size  = 0x7FFFFFFFL;  /* don't know the real size! */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   382
    stream->pos   = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   383
    stream->base  = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   384
    stream->read  = ft_lzw_stream_io;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   385
    stream->close = ft_lzw_stream_close;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   386
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   387
  Exit:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   388
    return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   389
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   390
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   391
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   392
#include "ftzopen.c"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   393
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   394
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   395
#else  /* !FT_CONFIG_OPTION_USE_LZW */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   396
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   397
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   398
  FT_EXPORT_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   399
  FT_Stream_OpenLZW( FT_Stream  stream,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   400
                     FT_Stream  source )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   401
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   402
    FT_UNUSED( stream );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   403
    FT_UNUSED( source );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   404
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   405
    return LZW_Err_Unimplemented_Feature;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   406
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   407
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   408
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   409
#endif /* !FT_CONFIG_OPTION_USE_LZW */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   410
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   411
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   412
/* END */