This file is indexed.

/usr/lib/X11/ProcMeter3/example/README is in procmeter3 3.5d-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
                                ProcMeter - Version 3.1 - Modules
                                =================================

In version 3.x of ProcMeter the different outputs (graphs or text) are
implemented as loadable modules.


Version 3.1 changes
-------------------

The graph_units field is now a printf string that is filled in at run time with
the value of the graph_scale field.


Interface
---------

To be used in ProcMeter they must follow a few simple rules that allows the
ProcMeter program load them and interact with them.

1) The Load() function.

There must be a function with the following prototype:

ProcMeterModule *Load(void);

This function will be the first one in the module that is called.  It will only
be called once, if it does not exist then the module will not be loaded.  The
purpose of the function is to initialise the module and return information to
the main program so that the initialisation can proceed.


2) The Initialise() function

There must be a function with the following prototype:

ProcMeterOutput **Initialise(char *options);

This function will be called once only, following the Load() function.  The
purpose of the module is to initialise all of the outputs and return the
information about them to the main program as a NULL terminated array.  The
'options' parameter is a string that is taken from the .procmeterrc file for the
module.


3) The Update() function

There must be a function with the following prototype:

int Update(time_t now,ProcMeterOutput *output);

This function is called each time that one of the outputs needs to be updated.
The parameter 'now' is the current time and may be the same on different calls
to the function or it may be higher, it never decreases.  The 'output' parameter
is a pointer to one of the outputs that were returned in the Initialise()
function.  This output is to have its information filled in (both text and graph
if appropriate).  If the Update function is succesful it should return 0, if
there is an error it should set the output values to a suitable value and return
-1.


4) The Unload() function

There can be a function with the following prototype:

void Unload(void);

If it exists then it is called after all of the other functions, before the
module is unloaded.  It is only ever called once.


Compilation
-----------

The module must be compiled to be a loadable object.  If the source file name is
template.c then the following commands will do that.

        gcc -c -O template.c -o template.o -I.. -fPIC
        ld template.o -o template.so -shared


Example
-------

As an example the file template.c is a very simple example of a module.  It can
be used as the basis for other modules since the basic file structure is
present.



Andrew M. Bishop
12th Feb 1999