File: limit.cmd

package info (click to toggle)
freetype 1.3.1-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,652 kB
  • ctags: 6,860
  • sloc: ansic: 47,576; pascal: 13,773; sh: 7,513; makefile: 786; cpp: 351; csh: 53; perl: 13
file content (63 lines) | stat: -rwxr-xr-x 1,227 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* */
call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
call SysLoadFuncs

Parse Upper Arg a1 a2

app = "FreeType/2"
key = "OPENFACES"

if Arg() = 0 then call usage

if a1 = 'Q' then call query

if a1 = 'S' then call set
call usage

set:

val = a2

if val = '' then do
   say 'Invalid limit!'
   exit
end

if val < 8 then do
   say 'The lowest acceptable limit is 8!'
   pause
   exit
end

szval = val || d2c(0)

rc = SysIni('USER', app, key, szval)
say rc
if rc = 'ERROR:' then do
   say 'Error updating OS2.INI!'
   pause
   exit
end

say "Open faces limit updated to " || val || ". Please reboot to activate changes."
pause
exit

query:
val = SysIni('USER', app, key)
if val = "ERROR:" then val = "not set"
/* strip the terminating NULL character */
else val = substr(val, 1, pos(d2c(0), val) - 1)

say 'The current open faces limit is ' || val
pause
exit

usage:
say 'This program is used to set the limit of concurrently open typefaces for'
say 'FreeType/2. Use lower numbers to limit memory consumption and higher to'
say 'improve performance if you use lots of fonts.'
say
say 'Usage: LIMIT q         - query the current limit'
say '       LIMIT s  <val>  - set limit to <val> (effective on next reboot).'
pause