"Fossies" - the Fresh Open Source Software Archive

Member "procmeter3-3.6+svn387/procmeterp.h" (8 Jan 2012, 3890 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 "procmeterp.h" see the Fossies "Dox" file reference documentation.

    1 /***************************************
    2   ProcMeter - A system monitoring program for Linux - Version 3.6.
    3 
    4   Global private header file.
    5   ******************/ /******************
    6   Written by Andrew M. Bishop
    7 
    8   This file Copyright 1998-2012 Andrew M. Bishop
    9   It may be distributed under the GNU Public License, version 2, or
   10   any higher version.  See section COPYING of the GNU Public license
   11   for conditions under which this file may be redistributed.
   12   ***************************************/
   13 
   14 
   15 #ifndef PROCMETERP_H
   16 #define PROCMETERP_H    /*+ To stop multiple inclusions. +*/
   17 
   18 /* The public header file. */
   19 
   20 #include "procmeter.h"
   21 
   22 
   23 /* The file locations. */
   24 
   25 #ifndef INSTDIR
   26 #define INSTDIR "/usr/local"
   27 #endif
   28 
   29 #ifndef LIB_PATH
   30 #define LIB_PATH  INSTDIR  "/lib/ProcMeter3"
   31 #endif
   32 #ifndef MOD_PATH
   33 #define MOD_PATH  LIB_PATH "/modules"
   34 #endif
   35 #ifndef RC_PATH
   36 #define RC_PATH   LIB_PATH
   37 #endif
   38 
   39 /* The run mode options */
   40 
   41 #define RUN_NONE       0
   42 #define RUN_SHELL      1
   43 #define RUN_XTERM      2
   44 #define RUN_XTERM_WAIT 3
   45 #define RUN_XBELL      4
   46 
   47 /*+ The information needed to run a command. +*/
   48 typedef struct _RunOption
   49 {
   50  char flag;                     /*+ The type of command to run. +*/
   51  char *command;                 /*+ The pre-parsed command string. +*/
   52 }
   53 RunOption;
   54 
   55 /* A forward definition for the Output type. */
   56 
   57 typedef struct _Output *Output;
   58 
   59 /*+ The information about a module that is used internally. +*/
   60 typedef struct _Module
   61 {
   62  char *filename;                /*+ The filename of the module. +*/
   63 
   64  void *dlhandle;                /*+ The handle returned by dlopen(). +*/
   65 
   66  int (*Update)(time_t,ProcMeterOutput*); /*+ The update function for the outputs in the module. +*/
   67 
   68  ProcMeterModule *module;       /*+ The module information returned by the Load() function. +*/
   69  Output *outputs;               /*+ The outputs based on those returned by the Initialise function. +*/
   70 
   71  void *menu_item_widget;        /*+ The menu item widget for the module on the main menu. +*/
   72  void *submenu_widget;          /*+ The submenu widget for the module. +*/
   73 }
   74 *Module;
   75 
   76 /*+ The information about an output that is used internally. +*/
   77 struct _Output
   78 {
   79  ProcMeterOutput *output;       /*+ The output that this represents. +*/
   80 
   81  char label[PROCMETER_NAME_LEN+1];/*+ The label for the output. +*/
   82 
   83  RunOption menu_run;            /*+ The function that can be run for this output. +*/
   84 
   85  int type;                      /*+ The type of output. +*/
   86 
   87  int first;                     /*+ Set this to true if the widget is new and needs an update. +*/
   88 
   89  void *menu_item_widget;        /*+ The menu item widget for the output on the module menu. +*/
   90  void *output_widget;           /*+ The widget for the output in the main window. +*/
   91 };
   92 
   93 
   94 /*+ The complete list of modules. +*/
   95 extern Module* Modules;
   96 
   97 /* In procmeter.c */
   98 
   99 void UpdateOutputs(time_t now);
  100 void AddDefaultOutputs(int argc,char **argv);
  101 
  102 /* In module.c */
  103 
  104 void LoadAllModules(void);
  105 void UnloadAllModules(void);
  106 
  107 Module LoadModule(char* filename);
  108 void UnloadModule(Module module);
  109 
  110 /* In procmeterrc.c */
  111 
  112 void LoadProcMeterRC(int *argc,char **argv);
  113 
  114 char *GetProcMeterRC(char *section,char *parameter);
  115 char *GetProcMeterRC2(char *module,char *output,char *parameter);
  116 
  117 void FreeProcMeterRC(void);
  118 
  119 /* In xaw/window.c or gtk/window.c or log/window.c or lcd/window.c */
  120 
  121 void Start(int *argc,char **argv);
  122 void Stop(void);
  123 
  124 void Sleep(time_t until);
  125 
  126 void AddRemoveOutput(Output output);
  127 
  128 void UpdateGraph(Output output,short value);
  129 void UpdateText(Output output,char *value);
  130 void UpdateBar(Output output,short value);
  131 
  132 /* In xaw/menus.c or gtk/menus.c or no-x/menus.c */
  133 
  134 void AddModuleToMenu(Module module);
  135 void RemoveModuleFromMenu(Module module);
  136 
  137 /* In xaw/run.c or gtk/run.c or no-x/run.c */
  138 
  139 void ParseRunCommand(char *string,RunOption *run);
  140 
  141 void RunProgram(RunOption *run);
  142 
  143 
  144 #endif /* PROCMETERP_H */