Skip to content

Commit

Permalink
Axe automated header generation.
Browse files Browse the repository at this point in the history
Reasoning:
 - implementation was unsound -- broke down when I added a fairly
   basic macro definition expanding to a struct initializer in a *.c
   file.

 - made it way too easy (e.g. via otherwise totally innocuous git
   commands) to end up with timestamps such that it always ran
   MakeHeader.py but never used its output, leading to overbuild noise
   when running what should be a null 'make'.

 - but mostly: it's just an awkward way of dealing with C code.
  • Loading branch information
zevweiss committed Sep 2, 2020
1 parent f79591e commit 53f6288
Show file tree
Hide file tree
Showing 152 changed files with 1 addition and 2,013 deletions.
32 changes: 0 additions & 32 deletions Action.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,6 @@ in the source distribution for its full text.
#include <sys/param.h>
#include <sys/time.h>

/*{
#include "IncSet.h"
#include "Settings.h"
#include "Header.h"
#include "UsersTable.h"
#include "ProcessList.h"
#include "Panel.h"
typedef enum {
HTOP_OK = 0x00,
HTOP_REFRESH = 0x01,
HTOP_RECALCULATE = 0x03, // implies HTOP_REFRESH
HTOP_SAVE_SETTINGS = 0x04,
HTOP_KEEP_FOLLOWING = 0x08,
HTOP_QUIT = 0x10,
HTOP_REDRAW_BAR = 0x20,
HTOP_UPDATE_PANELHDR = 0x41, // implies HTOP_REFRESH
} Htop_Reaction;
typedef Htop_Reaction (*Htop_Action)();
typedef struct State_ {
Settings* settings;
UsersTable* ut;
ProcessList* pl;
Panel* panel;
Header* header;
} State;
}*/

Object* Action_pickFromVector(State* st, Panel* list, int x, bool followProcess) {
Panel* panel = st->panel;
Header* header = st->header;
Expand Down
2 changes: 0 additions & 2 deletions Action.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_Action
#define HEADER_Action
/*
Expand Down
12 changes: 0 additions & 12 deletions Affinity.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@ in the source distribution for its full text.
#include <sched.h>
#endif

/*{
#include "Process.h"
#include "ProcessList.h"
typedef struct Affinity_ {
ProcessList* pl;
int size;
int used;
int* cpus;
} Affinity;
}*/

Affinity* Affinity_new(ProcessList* pl) {
Affinity* this = xCalloc(1, sizeof(Affinity));
Expand Down
2 changes: 0 additions & 2 deletions Affinity.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_Affinity
#define HEADER_Affinity
/*
Expand Down
7 changes: 0 additions & 7 deletions AffinityPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ in the source distribution for its full text.
#include <hwloc.h>
#endif

/*{
#include "Panel.h"
#include "Affinity.h"
#include "ProcessList.h"
}*/

typedef struct MaskItem_ {
Object super;
const char* text;
Expand Down
2 changes: 0 additions & 2 deletions AffinityPanel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_AffinityPanel
#define HEADER_AffinityPanel
/*
Expand Down
9 changes: 0 additions & 9 deletions AvailableColumnsPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ in the source distribution for its full text.
#include <ctype.h>
#include <string.h>

/*{
#include "Panel.h"
typedef struct AvailableColumnsPanel_ {
Panel super;
Panel* columns;
} AvailableColumnsPanel;
}*/

static const char* const AvailableColumnsFunctions[] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done ", NULL};

Expand Down
2 changes: 0 additions & 2 deletions AvailableColumnsPanel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_AvailableColumnsPanel
#define HEADER_AvailableColumnsPanel
/*
Expand Down
17 changes: 0 additions & 17 deletions AvailableMetersPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@ in the source distribution for its full text.
#include <assert.h>
#include <stdlib.h>

/*{
#include "Settings.h"
#include "Panel.h"
#include "ScreenManager.h"
#include "ProcessList.h"
typedef struct AvailableMetersPanel_ {
Panel super;
ScreenManager* scr;
Settings* settings;
Header* header;
Panel* leftPanel;
Panel* rightPanel;
} AvailableMetersPanel;
}*/

static void AvailableMetersPanel_delete(Object* object) {
Panel* super = (Panel*) object;
Expand Down
2 changes: 0 additions & 2 deletions AvailableMetersPanel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_AvailableMetersPanel
#define HEADER_AvailableMetersPanel
/*
Expand Down
9 changes: 0 additions & 9 deletions BatteryMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ This meter written by Ian P. Hands ([email protected], [email protected]).
#include <string.h>
#include <stdlib.h>

/*{
#include "Meter.h"
typedef enum ACPresence_ {
AC_ABSENT,
AC_PRESENT,
AC_ERROR
} ACPresence;
}*/

int BatteryMeter_attributes[] = {
BATTERY
Expand Down
2 changes: 0 additions & 2 deletions BatteryMeter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_BatteryMeter
#define HEADER_BatteryMeter
/*
Expand Down
18 changes: 0 additions & 18 deletions CPUMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,6 @@ in the source distribution for its full text.
#include <string.h>
#include <math.h>

/*{
#include "Meter.h"
typedef enum {
CPU_METER_NICE = 0,
CPU_METER_NORMAL = 1,
CPU_METER_KERNEL = 2,
CPU_METER_IRQ = 3,
CPU_METER_SOFTIRQ = 4,
CPU_METER_STEAL = 5,
CPU_METER_GUEST = 6,
CPU_METER_IOWAIT = 7,
CPU_METER_FREQUENCY = 8,
CPU_METER_ITEMCOUNT = 9, // number of entries in this enum
} CPUMeterValues;
}*/

int CPUMeter_attributes[] = {
CPU_NICE, CPU_NORMAL, CPU_SYSTEM, CPU_IRQ, CPU_SOFTIRQ, CPU_STEAL, CPU_GUEST, CPU_IOWAIT
};
Expand Down
2 changes: 0 additions & 2 deletions CPUMeter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_CPUMeter
#define HEADER_CPUMeter
/*
Expand Down
104 changes: 0 additions & 104 deletions CRT.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,110 +45,6 @@ in the source distribution for its full text.

//#link curses

/*{
#include <stdbool.h>
typedef enum TreeStr_ {
TREE_STR_HORZ,
TREE_STR_VERT,
TREE_STR_RTEE,
TREE_STR_BEND,
TREE_STR_TEND,
TREE_STR_OPEN,
TREE_STR_SHUT,
TREE_STR_COUNT
} TreeStr;
typedef enum ColorSchemes_ {
COLORSCHEME_DEFAULT = 0,
COLORSCHEME_MONOCHROME = 1,
COLORSCHEME_BLACKONWHITE = 2,
COLORSCHEME_LIGHTTERMINAL = 3,
COLORSCHEME_MIDNIGHT = 4,
COLORSCHEME_BLACKNIGHT = 5,
COLORSCHEME_BROKENGRAY = 6,
LAST_COLORSCHEME = 7,
} ColorSchemes;
typedef enum ColorElements_ {
RESET_COLOR,
DEFAULT_COLOR,
FUNCTION_BAR,
FUNCTION_KEY,
FAILED_SEARCH,
PANEL_HEADER_FOCUS,
PANEL_HEADER_UNFOCUS,
PANEL_SELECTION_FOCUS,
PANEL_SELECTION_FOLLOW,
PANEL_SELECTION_UNFOCUS,
LARGE_NUMBER,
METER_TEXT,
METER_VALUE,
LED_COLOR,
UPTIME,
BATTERY,
TASKS_RUNNING,
SWAP,
PROCESS,
PROCESS_SHADOW,
PROCESS_TAG,
PROCESS_MEGABYTES,
PROCESS_TREE,
PROCESS_R_STATE,
PROCESS_D_STATE,
PROCESS_BASENAME,
PROCESS_HIGH_PRIORITY,
PROCESS_LOW_PRIORITY,
PROCESS_THREAD,
PROCESS_THREAD_BASENAME,
BAR_BORDER,
BAR_SHADOW,
GRAPH_1,
GRAPH_2,
MEMORY_USED,
MEMORY_BUFFERS,
MEMORY_BUFFERS_TEXT,
MEMORY_CACHE,
LOAD,
LOAD_AVERAGE_FIFTEEN,
LOAD_AVERAGE_FIVE,
LOAD_AVERAGE_ONE,
CHECK_BOX,
CHECK_MARK,
CHECK_TEXT,
CLOCK,
HELP_BOLD,
HOSTNAME,
CPU_NICE,
CPU_NICE_TEXT,
CPU_NORMAL,
CPU_SYSTEM,
CPU_IOWAIT,
CPU_IRQ,
CPU_SOFTIRQ,
CPU_STEAL,
CPU_GUEST,
PRESSURE_STALL_TEN,
PRESSURE_STALL_SIXTY,
PRESSURE_STALL_THREEHUNDRED,
ZFS_MFU,
ZFS_MRU,
ZFS_ANON,
ZFS_HEADER,
ZFS_OTHER,
ZFS_COMPRESSED,
ZFS_RATIO,
LAST_COLORELEMENT
} ColorElements;
extern void CRT_fatalError(const char* note) __attribute__ ((noreturn));
extern void CRT_handleSIGSEGV(int sgn);
#define KEY_ALT(x) (KEY_F(64 - 26) + (x - 'A'))
}*/

const char *CRT_treeStrAscii[TREE_STR_COUNT] = {
"-", // TREE_STR_HORZ
"|", // TREE_STR_VERT
Expand Down
2 changes: 0 additions & 2 deletions CRT.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_CRT
#define HEADER_CRT
/*
Expand Down
16 changes: 0 additions & 16 deletions CategoriesPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,6 @@ in the source distribution for its full text.
#include <assert.h>
#include <stdlib.h>

/*{
#include "Panel.h"
#include "Settings.h"
#include "ScreenManager.h"
#include "ProcessList.h"
typedef struct CategoriesPanel_ {
Panel super;
ScreenManager* scr;
Settings* settings;
Header* header;
ProcessList* pl;
} CategoriesPanel;
}*/

static const char* const CategoriesFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};

Expand Down
2 changes: 0 additions & 2 deletions CategoriesPanel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_CategoriesPanel
#define HEADER_CategoriesPanel
/*
Expand Down
11 changes: 0 additions & 11 deletions CheckItem.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ in the source distribution for its full text.
#include <assert.h>
#include <stdlib.h>

/*{
#include "Object.h"
typedef struct CheckItem_ {
Object super;
char* text;
bool* ref;
bool value;
} CheckItem;
}*/

static void CheckItem_delete(Object* cast) {
CheckItem* this = (CheckItem*)cast;
Expand Down
2 changes: 0 additions & 2 deletions CheckItem.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_CheckItem
#define HEADER_CheckItem
/*
Expand Down
3 changes: 0 additions & 3 deletions ClockMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ in the source distribution for its full text.

#include <time.h>

/*{
#include "Meter.h"
}*/

int ClockMeter_attributes[] = {
CLOCK
Expand Down
2 changes: 0 additions & 2 deletions ClockMeter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* Do not edit this file. It was automatically generated. */

#ifndef HEADER_ClockMeter
#define HEADER_ClockMeter
/*
Expand Down
Loading

0 comments on commit 53f6288

Please sign in to comment.