"Fossies" - the Fresh Open Source Software Archive

Member "procmeter3-3.6+svn387/modules/procmeter.c" (24 Dec 2010, 2523 Bytes) of package /linux/misc/procmeter3-3.6+svn387.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "procmeter.c" see the Fossies "Dox" file reference documentation.

    1 /***************************************
    2   $Header: /home/amb/CVS/procmeter3/modules/procmeter.c,v 1.5 2002-12-07 19:38:59 amb Exp $
    3 
    4   ProcMeter - A system monitoring program for Linux - Version 3.4.
    5 
    6   Information about the ProcMeter program source file.
    7   ******************/ /******************
    8   Written by Andrew M. Bishop
    9 
   10   This file Copyright 1998,99,2002 Andrew M. Bishop
   11   It may be distributed under the GNU Public License, version 2, or
   12   any higher version.  See section COPYING of the GNU Public license
   13   for conditions under which this file may be redistributed.
   14   ***************************************/
   15 
   16 
   17 #include <stdio.h>
   18 #include <stdlib.h>
   19 
   20 #include "procmeter.h"
   21 
   22 /* The interface information.  */
   23 
   24 /*+ The version output +*/
   25 ProcMeterOutput version_output=
   26 {
   27  /* char  name[];          */ "Version",
   28  /* char *description;     */ "The version of procmeter that is running.",
   29  /* char  type;            */ PROCMETER_TEXT,
   30  /* short interval;        */ 0,
   31  /* char  text_value[];    */ "ProcMeter V" PROCMETER_VERSION,
   32  /* long  graph_value;     */ -1,
   33  /* short graph_scale;     */ 0,
   34  /* char  graph_units[];   */ "n/a"
   35 };
   36 
   37 /*+ The outputs. +*/
   38 ProcMeterOutput *outputs[]=
   39 {
   40  &version_output,
   41  NULL
   42 };
   43 
   44 /*+ The module. +*/
   45 ProcMeterModule module=
   46 {
   47  /* char name[];           */ "ProcMeter",
   48  /* char *description;     */ "Information about the procmeter program itself.",
   49 };
   50 
   51 
   52 /*++++++++++++++++++++++++++++++++++++++
   53   Load the module.
   54 
   55   ProcMeterModule *Load Returns the module information.
   56   ++++++++++++++++++++++++++++++++++++++*/
   57 
   58 ProcMeterModule *Load(void)
   59 {
   60  return(&module);
   61 }
   62 
   63 
   64 /*++++++++++++++++++++++++++++++++++++++
   65   Initialise the module, creating the outputs as required.
   66 
   67   ProcMeterOutput **Initialise Returns a NULL terminated list of outputs.
   68 
   69   char *options The options string for the module from the .procmeterrc file.
   70   ++++++++++++++++++++++++++++++++++++++*/
   71 
   72 ProcMeterOutput **Initialise(char *options)
   73 {
   74  return(outputs);
   75 }
   76 
   77 
   78 /*++++++++++++++++++++++++++++++++++++++
   79   Perform an update on one of the statistics.
   80 
   81   int Update Returns 0 if OK, else -1.
   82 
   83   time_t now The current time.
   84 
   85   ProcMeterOutput *output The output that the value is wanted for.
   86   ++++++++++++++++++++++++++++++++++++++*/
   87 
   88 int Update(time_t now,ProcMeterOutput *output)
   89 {
   90  if(output==&version_output)
   91     return(0);
   92 
   93  return(-1);
   94 }
   95 
   96 
   97 /*++++++++++++++++++++++++++++++++++++++
   98   Tidy up and prepare to have the module unloaded.
   99   ++++++++++++++++++++++++++++++++++++++*/
  100 
  101 void Unload(void)
  102 {
  103 }