This file is indexed.

/usr/share/calc/intfile.cal is in apcalc-common 2.12.5.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
/*
 * intfile - integer to file and file to integer conversion
 *
 * Copyright (C) 2001  Landon Curt Noll
 *
 * Calc is open software; you can redistribute it and/or modify it under
 * the terms of the version 2.1 of the GNU Lesser General Public License
 * as published by the Free Software Foundation.
 *
 * Calc is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
 * Public License for more details.
 *
 * A copy of version 2.1 of the GNU Lesser General Public License is
 * distributed with calc under the filename COPYING-LGPL.  You should have
 * received a copy with calc; if not, write to Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * @(#) $Revision: 30.1 $
 * @(#) $Id: intfile.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $
 * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/intfile.cal,v $
 *
 * Under source code control:   2001/03/31 08:13:11
 * File existed as early as:    2001
 *
 * chongo <was here> /\oo/\     http://www.isthe.com/chongo/
 * Share and enjoy!  :-)        http://www.isthe.com/chongo/tech/comp/calc/
 */


/*
 * NOTE: Because leading HALF values are trimmed from integer, a file
 *	 that begins with lots of 0 bits (in the case of big endian)
 *	 or that ends with lots of 0 bits (in the case of little endian)
 *	 will be changed when the subsequent integer is written back.
 */


/*
 * file2be - convert a file into an big endian integer
 *
 * given:
 *	filename	filename to read
 *
 * returns:
 *	integer read from its contents on big endian order
 */
define file2be(filename)
{
    local fd;	/* open file */
    local ret;	/* integer to return */
    local c;	/* character read from the file */
    local i;

    /*
     * open the file for reading
     */
    fd = fopen(filename, "rb");
    if (!isfile(fd)) quit "file2be: cannot open file for reading";

    /*
     * read the contents of the file
     *
     * The first octets become the most significant bits of the integer.
     */
    ret = 0;
    while (! isnull(c = fgetc(fd))) {
	ret <<= 8;
	ret += ord(c);
    }

    /*
     * cleanup and return the integer
     */
    fclose(fd);
    return ret;
}


/*
 * file2le - convert a file into an little endian integer
 *
 * given:
 *	filename	filename to read
 *
 * returns:
 *	integer read from its contents on little endian order
 */
define file2le(filename)
{
    local fd;	/* open file */
    local ret;	/* integer to return */
    local c;	/* character read from the file */
    local shft;	/* bit shift for the c value */
    local i;

    /*
     * open the file for reading
     */
    fd = fopen(filename, "rb");
    if (!isfile(fd)) quit "file2le: cannot open file for reading";

    /*
     * read the contents of the file into a string
     *
     * The first octets become are the least significant bits of the integer.
     */
    ret = 0;
    shft = 0;
    while (! isnull(c = fgetc(fd))) {
	ret |= (ord(c) << shft);
	shft += 8;
    }

    /*
     * cleanup and return the integer
     */
    fclose(fd);
    return ret;
}


/*
 * be2file - convert a big endian integer into a file
 *
 * given:
 *	v		integer to write to the file
 *	filename	filename to write
 *
 * returns:
 *	The number of octets written to the file.
 *
 * NOTE: The absolute value of the integer is written to the file.
 */
define be2file(v, filename)
{
    local fd;		/* open file */
    local octlen;	/* length of v in octets */
    local i;

    /*
     * firewall
     */
    if (!isint(v)) {
	quit "be2file: 1st arg not an integer";
    }
    v = abs(v);

    /*
     * open the file for writing
     */
    fd = fopen(filename, "wb");
    if (!isfile(fd)) quit "be2file: cannot open file for writing";

    /*
     * write the octets to the file
     *
     * The most significant bits of the integer become the first file octets.
     */
    octlen = int((highbit(v)+8) / 8);
    for (i=octlen-1; i >= 0; --i) {
    	fputc(fd, char(v >> (i*8)));
    }

    /*
     * cleanup
     */
    fclose(fd);
    return octlen;
}


/*
 * le2file - convert a little endian integer into a file
 *
 * given:
 *	v		integer to write to the file
 *	filename	filename to write
 *
 * returns:
 *	The number of octets written to the file.
 *
 * NOTE: The absolute value of the integer is written to the file.
 */
define le2file(v, filename)
{
    local fd;	/* open file */
    local cnt;	/* octets written */

    /*
     * firewall
     */
    if (!isint(v)) {
	quit "be2file: 1st arg not an integer";
    }
    v = abs(v);

    /*
     * open the file for writing
     */
    fd = fopen(filename, "wb");
    if (!isfile(fd)) quit "le2file: cannot open file for writing";

    /*
     * Write the octets to the file.
     *
     * The least significant bits of the integer become the first file octets.
     */
    cnt = 0;
    while (v > 0) {
	fputc(fd, char(v));
	v >>= 8;
	++cnt;
    }

    /*
     * cleanup
     */
    fclose(fd);
    return cnt;
}