Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/planix-v0/sys/lib/ghostscript/gs_resst.ps – Rev 2

Subversion Repositories planix.SVN

Rev

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

Rev Author Line No. Line
2 - 1
%    Copyright (C) 2000 artofcode LLC.  All rights reserved.
2
% 
3
% This software is provided AS-IS with no warranty, either express or
4
% implied.
5
% 
6
% This software is distributed under license and may not be copied,
7
% modified or distributed except as expressly authorized under the terms
8
% of the license contained in the file LICENSE in this distribution.
9
% 
10
% For more information about licensing, please refer to
11
% http://www.ghostscript.com/licensing/. For information on
12
% commercial licensing, go to http://www.artifex.com/licensing/ or
13
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14
% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
15
 
16
% $Id: gs_resst.ps,v 1.3 2003/08/08 18:45:05 ray Exp $
17
% Redefine generic category with static resource table.
18
 
19
languagelevel 2 .setlanguagelevel
20
 
21
15 dict begin    % a temporary dictionary for local binding.
22
 
23
/sep (/) def %  The %static%  device uses platform independent paths.
24
 
25
/tempstring 8192 string def
26
 
27
/IsMyRecord      % <raw_record> IsMyRecord <raw_record> bool
28
{ dup type /dicttype eq { dup /StaticFilePos known } { false } ifelse
29
} bind def
30
 
31
/append_string    % <scratch> <index> <string> append_string <scratch> <index> 
32
{
33
   dup length 3 index 3 index 2 index getinterval   % (scratch) index (string) l (scr_substr)
34
   3 2 roll exch copy pop add                       % (scratch) index'
35
} bind def
36
 
37
/StaticResourceRecordVirtualMethods 4 dict begin
38
 
39
  /GetFilePath    % <scratch> <Name> <record> GetFilePath <filepath>
40
  { pop exch                                                % /Name (scratch)
41
    (%static%) dup length exch 2 index copy pop             % /Name (scratch) l
42
    //sep //append_string exec                              % /Name (scratch) l
43
    Category //tempstring cvs //append_string exec          % /Name (scratch) l
44
    //sep //append_string exec                              % /Name (scratch) l
45
    3 2 roll //tempstring cvs                               % (scratch) l (Name)
46
    //append_string exec                                    % (scratch) l
47
 
48
  } bind def
49
 
50
  /MakeInstance   % <Name> <record> MakeInstance <Name> <Instance> <size>
51
  {
52
    begin
53
      STRESDEBUG { (Loading a static resource ) print dup = } if
54
      8192 string 2 index 2 index //GetFilePath exec
55
      (r) file run
56
      STRESDEBUG { (Completed loading the static resource ) print dup = } if
57
      StaticFileEnd StaticFilePos sub
58
    end
59
    1 index Category findresource
60
    exch
61
  } bind def
62
 
63
  /GetSize        % <Name> <record> GetSize <size>
64
  {
65
    % WARNING : this retrives file sise rather than VM size
66
    begin
67
    pop
68
    StaticFileEnd StaticFilePos sub
69
    end
70
  } bind def
71
 
72
  /IsActive       % <record> IsActive <bool>
73
  { pop true
74
  } bind def
75
 
76
currentdict end def
77
 
78
mark
79
/MappedCategoryRedefiner /ProcSet findresource begin
80
 
81
/.StaticResourcesBeg % <end_string> <no_of_resources> <category_name> .StaticResourcesBeg <category_name>
82
%     Puts .map dictionary to dstack.
83
{
84
  STRESDEBUG { (Starting static resources for category ) print dup = } if
85
  dup /Category resourcestatus {
86
    pop pop exch dict begin exch pop
87
  } {
88
    STRESDEBUG { (Skipping the resources because the category isn't defined.) = } if
89
    pop pop .skipeof
90
  } ifelse
91
} bind
92
 
93
/.StaticResourcesEnd % <category_name> .StaticResourcesEnd -
94
%     Removes .map dictionary from dstack.
95
{
96
  STRESDEBUG { (Completting static resources for category ) print dup = } if
97
  currentdict end dup                                      % /CatName <map> <map>
98
  systemdict /.io_static_root .knownget not {
99
    10 dict                                                % /CatName <map> <map> <dir>
100
    % Save it for garbager and for debug purpose :
101
    dup systemdict exch /.io_static_root exch put          % /CatName <map> <map> <dir>
102
    dup .setup_io_static                                   % /CatName <map> <map> <dir>
103
  } if                                                     % /CatName <map> <map> <dir>
104
  exch 3 index exch put                                    % /CatName <map>
105
  14 dict begin
106
    /.map exch def                                         % /CatName
107
    /CategoryName exch def                                 %
108
    /IsMapFileOptional true def
109
    /VerifyMap  { pop } bind def
110
    /PreprocessRecord  % <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> <bool>
111
    { //IsMyRecord exec dup {
112
        pop dup /RecordVirtualMethods //StaticResourceRecordVirtualMethods put
113
        true
114
      } if
115
    } bind def
116
  currentdict end
117
  //Redefine exec
118
} bind
119
 
120
end  % MappedCategoryRedefiner
121
end  % the temporary dictionary for local binding.
122
 
123
/.BeginResource  % <instance_name> BeginResource <instance_name> 
124
%     Puts a record dictionary to dstack.
125
{
126
  STRESDEBUG { (Static resource ) print dup =string cvs print } if
127
  currentfile fileposition
128
  currentfile =string readline pop dup length 0 exch 10 .min getinterval (%% Replace) ne {
129
    % We are in COMPILE_INITS=1 .
130
    4 dict begin
131
    /StaticFilePos exch def    
132
  } {
133
    % We are in COMPILE_INITS=0 .
134
    pop
135
  } ifelse
136
  (%END_RESOURCE) .skipeof
137
} bind
138
 
139
/.EndResource  % <instance_name> EndResource -
140
%     Removes a record dictionary from dstack.
141
{
142
  currentdict /StaticFilePos known {
143
    /StaticFileEnd currentfile fileposition
144
    (.EndResource) length sub
145
    def
146
    STRESDEBUG { ( from position ) print StaticFilePos =string cvs print ( to position ) print StaticFileEnd = } if
147
    currentdict end def
148
  } {
149
    pop
150
    STRESDEBUG { ( ignored with COMPILE_INITS=0. ) = } if
151
  } ifelse
152
} bind
153
 
154
.dicttomark /StaticCategoryRedefiner exch /ProcSet defineresource pop
155
 
156
.setlanguagelevel