[med-svn] [nut-nutrition] 01/03: Imported Upstream version 19.2

Iain Learmonth irl-guest at moszumanska.debian.org
Sun Aug 24 14:18:21 UTC 2014


This is an automated email from the git hooks/post-receive script.

irl-guest pushed a commit to branch master
in repository nut-nutrition.

commit e14b567cc96b71c8967bafab18e73ccf0ed2cccb
Author: Iain R. Learmonth <irl at fsfe.org>
Date:   Sun Aug 24 14:56:24 2014 +0100

    Imported Upstream version 19.2
---
 README                     |   7 +-
 db.h                       |   4 +-
 fltk/FoodRanking.cc        |   2 +
 fltk/MissMealWidget.cc     |   2 +
 fltk/NutButtonWidget.cc    |   8 +-
 fltk/PCF.cc                |  53 ++++++--
 fltk/PCF.h                 |   2 +-
 fltk/PersonalOptions.cc    |  38 +++---
 fltk/RecordMeals.cc        |   2 +
 fltk/ServingMenuButton.cc  |   2 +
 fltk/TheStory.cc           |   2 +
 fltk/TheUsualMenuButton.cc |   2 +
 main.c                     |   1 -
 meal.c                     | 293 +++++++++++++++++++++++++++++++++++++--------
 nut.1                      |   6 +-
 nut.html                   |   8 +-
 recmeal.c                  |  10 +-
 17 files changed, 338 insertions(+), 104 deletions(-)

diff --git a/README b/README
index eef7d03..9e4d1e8 100644
--- a/README
+++ b/README
@@ -53,11 +53,12 @@ Note:  NUT can modify your prior release database files automatically.  Just
 
 1)  Untar the nut archive:
 
-	tar xvzf nut-19.1.gz
-	cd nut-19.1/
+	tar xvzf nut-19.2.gz
+	cd nut-19.2/
 
 2)  If you want a graphical user interface, install fltk-1.3.2 or later from
-    the fltk-1.3.x branch.
+    the fltk-1.3.x branch.  fltk-1.3.2 does not compile on the Mac but later
+    versions from the fltk-1.3.x branch reportedly do work.
 
     The graphical user interface executable will be called "Nut" and the
     console program executable will be called "nut" when they are installed.
diff --git a/db.h b/db.h
index 5c0507e..2a98ca0 100644
--- a/db.h
+++ b/db.h
@@ -23,8 +23,8 @@
 #define DB_H
 
 #define MAJVERSION 19
-#define MINVERSION 1
-#define VERSIONQ "19.1"
+#define MINVERSION 2
+#define VERSIONQ "19.2"
 #define USDAVERSION "SR26"
 #define USDAVERSIONLC "sr26"
 
diff --git a/fltk/FoodRanking.cc b/fltk/FoodRanking.cc
index 9456b41..47b3193 100644
--- a/fltk/FoodRanking.cc
+++ b/fltk/FoodRanking.cc
@@ -22,7 +22,9 @@
 #include <FL/Fl.H>
 #include "FoodRanking.h"
 #include "util.h"
+#ifndef __hpux
 #include <stdint.h>
+#endif
 #include <string.h>
 
 static intptr_t the_ranking;
diff --git a/fltk/MissMealWidget.cc b/fltk/MissMealWidget.cc
index 3e7c85e..60b3af6 100644
--- a/fltk/MissMealWidget.cc
+++ b/fltk/MissMealWidget.cc
@@ -21,7 +21,9 @@
 
 #include "Nut.h"
 #include <string.h>
+#ifndef __hpux
 #include <stdint.h>
+#endif
 
 static MissMealWidget *mmwobj[10];
 static int mmwobjcount = 0;
diff --git a/fltk/NutButtonWidget.cc b/fltk/NutButtonWidget.cc
index 6cb1dc4..1664f1b 100644
--- a/fltk/NutButtonWidget.cc
+++ b/fltk/NutButtonWidget.cc
@@ -204,16 +204,16 @@ j = 4; k = 4;
 for (i = 16; i < 28; i++) nuttable[j]->add(new NutValue(column[k], row[i-15], w/6, tabheight-packspacing, widgetcolor, this, foodwork, ScreenMap[j][i], j));
 
 j = 5; k = 0;
-for (i = 1; i < 10; i++) nuttable[j]->add(new NutButton(column[k], row[i+1], w/6, tabheight-packspacing, ScreenMap[j][i], j, Nutrient[ScreenMap[j][i]]));
+for (i = 1; i < 9; i++) nuttable[j]->add(new NutButton(column[k], row[i+2], w/6, tabheight-packspacing, ScreenMap[j][i], j, Nutrient[ScreenMap[j][i]]));
 
 j = 5; k = 1;
-for (i = 1; i < 10; i++) nuttable[j]->add(new NutValue(column[k], row[i+1], w/6, tabheight-packspacing, widgetcolor, this, foodwork, ScreenMap[j][i], j));
+for (i = 1; i < 9; i++) nuttable[j]->add(new NutValue(column[k], row[i+2], w/6, tabheight-packspacing, widgetcolor, this, foodwork, ScreenMap[j][i], j));
 
 j = 5; k = 2;
-for (i = 10; i < 19; i++) nuttable[j]->add(new NutButton(column[k], row[i-8], w/6, tabheight-packspacing, ScreenMap[j][i], j, Nutrient[ScreenMap[j][i]]));
+for (i = 9; i < 19; i++) nuttable[j]->add(new NutButton(column[k], row[i-7], w/6, tabheight-packspacing, ScreenMap[j][i], j, Nutrient[ScreenMap[j][i]]));
 
 j = 5; k = 3;
-for (i = 10; i < 19; i++) nuttable[j]->add(new NutValue(column[k], row[i-8], w/6, tabheight-packspacing, widgetcolor, this, foodwork, ScreenMap[j][i], j));
+for (i = 9; i < 19; i++) nuttable[j]->add(new NutValue(column[k], row[i-7], w/6, tabheight-packspacing, widgetcolor, this, foodwork, ScreenMap[j][i], j));
 
 j = 5; k = 4;
 for (i = 19; i < 31; i++) nuttable[j]->add(new NutButton(column[k], row[i-18], w/6, tabheight-packspacing, ScreenMap[j][i], j, Nutrient[ScreenMap[j][i]]));
diff --git a/fltk/PCF.cc b/fltk/PCF.cc
index 6af4c44..f210203 100644
--- a/fltk/PCF.cc
+++ b/fltk/PCF.cc
@@ -54,49 +54,66 @@ else who_we_are->dropout();
 PCF::PCF (int x, int y, int w, int h, Fl_Color widgetcolor, MealFood *mealfood) : Fl_Group (x, y, w, h)
 {
 mf = mealfood;
-//this->tooltip("Automatic Portion Control:  Specify a food as the Protein, Carb, Fat, Thiamin, Pantothenic Acid (\"N\"), Vitamin E, or Calcium (\"Z\") food and its quantity is always adjusted to meet that DV for the entire meal.  If a portion-controlled food's quantity goes negative, there is an excess over the DV of that nutrient in the meal's other foods.");
-p = new Nut_ToggleButton(x, y, w/7, h, "P");
+p = new Nut_ToggleButton(x, y, w/10, h, "P");
 p->labelfont(FL_BOLD);
 p->color(fl_lighter(MEALCOLOR), FL_YELLOW);
 p->callback(pcf_cb,this);
 p->clear_visible_focus();
 p->tooltip("Protein automatic portion control");
-c = new Nut_ToggleButton(x+w/7, y, w/7, h, "C");
+c = new Nut_ToggleButton(x+w/10, y, w/10, h, "C");
 c->labelfont(FL_BOLD);
 c->color(fl_lighter(MEALCOLOR), FL_YELLOW);
 c->callback(pcf_cb,this);
 c->clear_visible_focus();
 c->tooltip("Non-Fiber Carb automatic portion control");
-f = new Nut_ToggleButton(x+2*w/7, y, w/7, h, "F");
+f = new Nut_ToggleButton(x+2*w/10, y, w/10, h, "F");
 f->labelfont(FL_BOLD);
 f->color(fl_lighter(MEALCOLOR), FL_YELLOW);
 f->callback(pcf_cb,this);
 f->clear_visible_focus();
 f->tooltip("Total Fat automatic portion control");
-t = new Nut_ToggleButton(x+3*w/7, y, w/7, h, "T");
+t = new Nut_ToggleButton(x+3*w/10, y, w/10, h, "T");
 t->labelfont(FL_BOLD);
 t->color(fl_lighter(MEALCOLOR), FL_YELLOW);
 t->callback(pcf_cb,this);
 t->clear_visible_focus();
 t->tooltip("Thiamin automatic portion control");
-n = new Nut_ToggleButton(x+4*w/7, y, w/7, h, "N");
+n = new Nut_ToggleButton(x+4*w/10, y, w/10, h, "N");
 n->labelfont(FL_BOLD);
 n->color(fl_lighter(MEALCOLOR), FL_YELLOW);
 n->callback(pcf_cb,this);
 n->clear_visible_focus();
 n->tooltip("Panto. Acid automatic portion control");
-e = new Nut_ToggleButton(x+5*w/7, y, w/7, h, "E");
+e = new Nut_ToggleButton(x+5*w/10, y, w/10, h, "E");
 e->labelfont(FL_BOLD);
 e->color(fl_lighter(MEALCOLOR), FL_YELLOW);
 e->callback(pcf_cb,this);
 e->clear_visible_focus();
 e->tooltip("Vitamin E automatic portion control");
-z = new Nut_ToggleButton(x+6*w/7, y, w/7, h, "Z");
+l = new Nut_ToggleButton(x+6*w/10, y, w/10, h, "L");
+l->labelfont(FL_BOLD);
+l->color(fl_lighter(MEALCOLOR), FL_YELLOW);
+l->callback(pcf_cb,this);
+l->clear_visible_focus();
+l->tooltip("Calcium automatic portion control");
+i = new Nut_ToggleButton(x+7*w/10, y, w/10, h, "I");
+i->labelfont(FL_BOLD);
+i->color(fl_lighter(MEALCOLOR), FL_YELLOW);
+i->callback(pcf_cb,this);
+i->clear_visible_focus();
+i->tooltip("Iron automatic portion control");
+k = new Nut_ToggleButton(x+8*w/10, y, w/10, h, "K");
+k->labelfont(FL_BOLD);
+k->color(fl_lighter(MEALCOLOR), FL_YELLOW);
+k->callback(pcf_cb,this);
+k->clear_visible_focus();
+k->tooltip("Potassium automatic portion control");
+z = new Nut_ToggleButton(x+9*w/10, y, w/10, h, "Z");
 z->labelfont(FL_BOLD);
 z->color(fl_lighter(MEALCOLOR), FL_YELLOW);
 z->callback(pcf_cb,this);
 z->clear_visible_focus();
-z->tooltip("Calcium automatic portion control");
+z->tooltip("Zinc automatic portion control");
 this->end();
 }
 
@@ -116,8 +133,14 @@ if (button != n) n->value(0);
 else nut = PANTAC;
 if (button != e) e->value(0); 
 else nut = VITE;
-if (button != z) z->value(0);
+if (button != l) l->value(0);
 else nut = CA;
+if (button != i) i->value(0);
+else nut = FE;
+if (button != k) k->value(0);
+else nut = K;
+if (button != z) z->value(0);
+else nut = ZN;
 if (options.abnuts[nut] != -1) pcftweak(nut,mf->mfmealptr);
 else 
  {
@@ -125,9 +148,9 @@ else
  return;
  }
 PCF_count = parent()->parent()->children();
-for (int i = 0; i < PCF_count; i++)
+for (int j = 0; j < PCF_count; j++)
  {
- mealfood = (MealFood *) (parent()->parent()->child(i));
+ mealfood = (MealFood *) (parent()->parent()->child(j));
  if (mealfood != mf)
   {
   if (button == p) mealfood->pcf->p->value(0);
@@ -136,6 +159,9 @@ for (int i = 0; i < PCF_count; i++)
   else if (button == t) mealfood->pcf->t->value(0);
   else if (button == n) mealfood->pcf->n->value(0);
   else if (button == e) mealfood->pcf->e->value(0);
+  else if (button == l) mealfood->pcf->l->value(0);
+  else if (button == i) mealfood->pcf->i->value(0);
+  else if (button == k) mealfood->pcf->k->value(0);
   else mealfood->pcf->z->value(0);
   if (mf->mffoodptr == mealfood->mffoodptr)
    {
@@ -145,6 +171,9 @@ for (int i = 0; i < PCF_count; i++)
    mealfood->pcf->t->value(0);
    mealfood->pcf->n->value(0);
    mealfood->pcf->e->value(0);
+   mealfood->pcf->l->value(0);
+   mealfood->pcf->i->value(0);
+   mealfood->pcf->k->value(0);
    mealfood->pcf->z->value(0);
    }
   }
diff --git a/fltk/PCF.h b/fltk/PCF.h
index 93ee06f..b9b4e4a 100644
--- a/fltk/PCF.h
+++ b/fltk/PCF.h
@@ -37,7 +37,7 @@ void dropout(void);
 void gram_change(int index, double newvalue);
 static void refresh_values(void);
 void PCF_computation(void);
-Nut_ToggleButton *p, *c, *f, *t, *n, *e, *z;
+Nut_ToggleButton *p, *c, *f, *t, *n, *e, *l, *i, *k, *z;
 
 private:
 MealFood *mf;
diff --git a/fltk/PersonalOptions.cc b/fltk/PersonalOptions.cc
index e314821..a5125c2 100644
--- a/fltk/PersonalOptions.cc
+++ b/fltk/PersonalOptions.cc
@@ -27,7 +27,9 @@
 #include "recmeal.h"
 #include <FL/Fl.H>
 #include <FL/filename.H>
+#ifndef __hpux
 #include <stdint.h>
+#endif
 #include <math.h>
 #if FL_MAJOR_VERSION == 1 && FL_MINOR_VERSION == 1
 #include <stdlib.h>
@@ -45,7 +47,7 @@ char llabel[100], flabel[100];
 static void longterm_idle_cb(void *whatever)
 {
 struct dirent **namelist;
-int n, i, s, wdate[2000], realwdate[2000], counter = 0, earliest = 1, lastdate;
+int n, i, s, wdate[2000], realwdate[2000], measurementcount = 0, earliest = 1, lastdate;
 int datapoints, unit;
 char userfile[FL_PATH_MAX], userdir[FL_PATH_MAX], buffer[100], *xdate, cdate[9];
 char unitstring[6], chartlabel[20];
@@ -89,19 +91,19 @@ else
      xdate = strtok(NULL," ");
      strncpy(cdate,xdate,8);
      cdate[8] = '\0';
-     wdate[counter] = reverse_time_machine(cdate);
-     if (wdate[counter] < earliest) earliest = wdate[counter];
-     fat[counter] = weight * bf / 100;
-     lean[counter] = weight - fat[counter];
-     counter++;
+     wdate[measurementcount] = reverse_time_machine(cdate);
+     if (wdate[measurementcount] < earliest) earliest = wdate[measurementcount];
+     fat[measurementcount] = weight * bf / 100;
+     lean[measurementcount] = weight - fat[measurementcount];
+     measurementcount++;
      }
-    if (counter >= 2000) break;
+    if (measurementcount >= 2000) break;
     }
    fclose(fp);
    Fl::check();
-   if (counter >= 2000) break;
+   if (measurementcount >= 2000) break;
    }
-  if (counter >= 2000) break;
+  if (measurementcount >= 2000) break;
   }
 #if FL_MAJOR_VERSION == 1 && FL_MINOR_VERSION == 1
  for (i = n; i > 0;) free((void*)(namelist[--i]));
@@ -113,7 +115,7 @@ else
 for (i = 0; i < 2000; i++) realwdate[i] = 1;
 earliest *= -1;
 datapoints = earliest + 1;
-if (datapoints < 1)
+if (measurementcount < 1)
  {
  sprintf(llabel,"No Lean Mass Measurements");
  sprintf(flabel,"No Fat Mass Measurements");
@@ -121,7 +123,7 @@ if (datapoints < 1)
  our_charts->f->label(flabel);
  return;
  }
-for (i = 0; i < counter; i++)
+for (i = 0; i < measurementcount; i++)
  {
  realwdate[wdate[i] + earliest] = wdate[i];
  realfat[wdate[i] + earliest] = fat[i];
@@ -131,7 +133,7 @@ for (i = 0; i < counter; i++)
 lastdate = realwdate[0];
 leanavg = lastlean = realean[0];
 fatavg = lastfat = realfat[0];
-for (i = 1; i < counter; i++)
+for (i = 1; i < datapoints; i++)
  {
  if (realwdate[i] == 1)
   {
@@ -144,18 +146,8 @@ for (i = 1; i < counter; i++)
  lastfat = realfat[i];
  leanavg += realean[i];
  fatavg += realfat[i];
- if (lastdate == 0) break;
- }
-while (lastdate != 0)
- {
- realwdate[i] = lastdate + 1;
- realean[i] = lastlean;
- realfat[i] = lastfat;
- leanavg += realean[i];                 
- fatavg += realfat[i];
- i++;
- lastdate++;
  }
+
 leanavg /= datapoints;
 fatavg /= datapoints;
 for (i = 0; i < datapoints; i++)
diff --git a/fltk/RecordMeals.cc b/fltk/RecordMeals.cc
index e36a1b0..d36f51c 100644
--- a/fltk/RecordMeals.cc
+++ b/fltk/RecordMeals.cc
@@ -25,7 +25,9 @@
 #include "db.h"
 #include <FL/Fl.H>
 #include <stdlib.h>
+#ifndef __hpux
 #include <stdint.h>
+#endif
 #include <string.h>
 #include <ctype.h>
 
diff --git a/fltk/ServingMenuButton.cc b/fltk/ServingMenuButton.cc
index 39a3600..fca23ff 100644
--- a/fltk/ServingMenuButton.cc
+++ b/fltk/ServingMenuButton.cc
@@ -23,7 +23,9 @@
 #include "db.h"
 #include <string.h>
 #include <stdlib.h>
+#ifndef __hpux
 #include <stdint.h>
+#endif
 
 static Fl_Menu_Item pulldown[] = { {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0} , {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
 static char servdisp[20][81];
diff --git a/fltk/TheStory.cc b/fltk/TheStory.cc
index 4bc8808..c82fdbe 100644
--- a/fltk/TheStory.cc
+++ b/fltk/TheStory.cc
@@ -21,7 +21,9 @@
 
 #include "TheStory.h"
 #include <FL/Fl.H>
+#ifndef __hpux
 #include <stdint.h>
+#endif
 
 static TheStory *who_we_are;
 
diff --git a/fltk/TheUsualMenuButton.cc b/fltk/TheUsualMenuButton.cc
index 974d9a6..eb6f416 100644
--- a/fltk/TheUsualMenuButton.cc
+++ b/fltk/TheUsualMenuButton.cc
@@ -23,7 +23,9 @@
 #include "db.h"
 #include <FL/Fl.H>
 #include <string.h>
+#ifndef __hpux
 #include <stdint.h>
+#endif
 
 static TheUsualMenuButton *theusualobj[10];
 static int theusualobjcount = 0;
diff --git a/main.c b/main.c
index 709c222..b37660e 100644
--- a/main.c
+++ b/main.c
@@ -42,6 +42,5 @@ if ( version(0) == MAJVERSION && version(1) == MINVERSION && read_food_db() )
 else read_food_files();
 if (version(0) != MAJVERSION || version(1) != MINVERSION) write_version();
 menu();
-meal_export();
 exit(0);
 }
diff --git a/meal.c b/meal.c
index 79928d5..dd1b8a0 100644
--- a/meal.c
+++ b/meal.c
@@ -27,8 +27,8 @@
 #include <ctype.h>
 
 struct meal theusual_root, *new_theusual, meal_root, *new_meal;
-struct meal *pcfmeal[7] = { NULL,NULL,NULL,NULL,NULL,NULL,NULL };
-float pcfmatrix[7][9];
+struct meal *pcfmeal[10] = { NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL };
+float pcfmatrix[10][12];
 
 void no_op(void) {}
 
@@ -43,8 +43,11 @@ food_work.nutrient[PANTAC] += change * pcfmatrix[0][3];
 food_work.nutrient[VITE] += change * pcfmatrix[0][4];
 food_work.nutrient[CA] += change * pcfmatrix[0][5];
 food_work.nutrient[THIA] += change * pcfmatrix[0][6];
-food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[0][7];
-food_work.nutrient[FAT_KCAL] += change * pcfmatrix[0][8];
+food_work.nutrient[K] += change * pcfmatrix[0][7];
+food_work.nutrient[FE] += change * pcfmatrix[0][8];
+food_work.nutrient[ZN] += change * pcfmatrix[0][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[0][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[0][11];
 pcfmeal[0]->grams += 100 * change / options.mealsperday;
 }
 
@@ -59,15 +62,18 @@ food_work.nutrient[PANTAC] += change * pcfmatrix[1][3];
 food_work.nutrient[VITE] += change * pcfmatrix[1][4];
 food_work.nutrient[CA] += change * pcfmatrix[1][5];
 food_work.nutrient[THIA] += change * pcfmatrix[1][6];
-food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[1][7];
-food_work.nutrient[FAT_KCAL] += change * pcfmatrix[1][8];
+food_work.nutrient[K] += change * pcfmatrix[1][7];
+food_work.nutrient[FE] += change * pcfmatrix[1][8];
+food_work.nutrient[ZN] += change * pcfmatrix[1][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[1][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[1][11];
 pcfmeal[1]->grams += 100 * change / options.mealsperday;
 }
 
 void c_cal_func(void)
 {
 float change;
-change = (DV[ENERC_KCAL] - food_work.nutrient[ENERC_KCAL]) / pcfmatrix[1][7];
+change = (DV[ENERC_KCAL] - food_work.nutrient[ENERC_KCAL]) / pcfmatrix[1][10];
 food_work.nutrient[PROCNT] += change * pcfmatrix[1][0];
 food_work.nutrient[CHO_NONFIB] += change * pcfmatrix[1][1];
 food_work.nutrient[FAT] += change * pcfmatrix[1][2];
@@ -75,8 +81,11 @@ food_work.nutrient[PANTAC] += change * pcfmatrix[1][3];
 food_work.nutrient[VITE] += change * pcfmatrix[1][4];
 food_work.nutrient[CA] += change * pcfmatrix[1][5];
 food_work.nutrient[THIA] += change * pcfmatrix[1][6];
-food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[1][7];
-food_work.nutrient[FAT_KCAL] += change * pcfmatrix[1][8];
+food_work.nutrient[K] += change * pcfmatrix[1][7];
+food_work.nutrient[FE] += change * pcfmatrix[1][8];
+food_work.nutrient[ZN] += change * pcfmatrix[1][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[1][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[1][11];
 pcfmeal[1]->grams += 100 * change / options.mealsperday;
 }
 
@@ -91,15 +100,18 @@ food_work.nutrient[PANTAC] += change * pcfmatrix[2][3];
 food_work.nutrient[VITE] += change * pcfmatrix[2][4];
 food_work.nutrient[CA] += change * pcfmatrix[2][5];
 food_work.nutrient[THIA] += change * pcfmatrix[2][6];
-food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[2][7];
-food_work.nutrient[FAT_KCAL] += change * pcfmatrix[2][8];
+food_work.nutrient[K] += change * pcfmatrix[1][7];
+food_work.nutrient[FE] += change * pcfmatrix[1][8];
+food_work.nutrient[ZN] += change * pcfmatrix[1][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[2][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[2][11];
 pcfmeal[2]->grams += 100 * change / options.mealsperday;
 }
 
 void f_cal_func(void)
 {
 float change;
-change = (DV[ENERC_KCAL] - food_work.nutrient[ENERC_KCAL]) / pcfmatrix[2][7];
+change = (DV[ENERC_KCAL] - food_work.nutrient[ENERC_KCAL]) / pcfmatrix[2][10];
 food_work.nutrient[PROCNT] += change * pcfmatrix[2][0];
 food_work.nutrient[CHO_NONFIB] += change * pcfmatrix[2][1];
 food_work.nutrient[FAT] += change * pcfmatrix[2][2];
@@ -107,15 +119,18 @@ food_work.nutrient[PANTAC] += change * pcfmatrix[2][3];
 food_work.nutrient[VITE] += change * pcfmatrix[2][4];
 food_work.nutrient[CA] += change * pcfmatrix[2][5];
 food_work.nutrient[THIA] += change * pcfmatrix[2][6];
-food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[2][7];
-food_work.nutrient[FAT_KCAL] += change * pcfmatrix[2][8];
+food_work.nutrient[K] += change * pcfmatrix[2][7];
+food_work.nutrient[FE] += change * pcfmatrix[2][8];
+food_work.nutrient[ZN] += change * pcfmatrix[2][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[2][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[2][11];
 pcfmeal[2]->grams += 100 * change / options.mealsperday;
 }
 
 void f_cal30_func(void)
 {
 float change;
-change = (0.3 * DV[ENERC_KCAL] - food_work.nutrient[FAT_KCAL]) / pcfmatrix[2][8];
+change = (0.3 * DV[ENERC_KCAL] - food_work.nutrient[FAT_KCAL]) / pcfmatrix[2][11];
 food_work.nutrient[PROCNT] += change * pcfmatrix[2][0];
 food_work.nutrient[CHO_NONFIB] += change * pcfmatrix[2][1];
 food_work.nutrient[FAT] += change * pcfmatrix[2][2];
@@ -123,8 +138,11 @@ food_work.nutrient[PANTAC] += change * pcfmatrix[2][3];
 food_work.nutrient[VITE] += change * pcfmatrix[2][4];
 food_work.nutrient[CA] += change * pcfmatrix[2][5];
 food_work.nutrient[THIA] += change * pcfmatrix[2][6];
-food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[2][7];
-food_work.nutrient[FAT_KCAL] += change * pcfmatrix[2][8];
+food_work.nutrient[K] += change * pcfmatrix[2][7];
+food_work.nutrient[FE] += change * pcfmatrix[2][8];
+food_work.nutrient[ZN] += change * pcfmatrix[2][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[2][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[2][11];
 pcfmeal[2]->grams += 100 * change / options.mealsperday;
 }
 
@@ -139,8 +157,11 @@ food_work.nutrient[PANTAC] += change * pcfmatrix[3][3];
 food_work.nutrient[VITE] += change * pcfmatrix[3][4];
 food_work.nutrient[CA] += change * pcfmatrix[3][5];
 food_work.nutrient[THIA] += change * pcfmatrix[3][6];
-food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[3][7];
-food_work.nutrient[FAT_KCAL] += change * pcfmatrix[3][8];
+food_work.nutrient[K] += change * pcfmatrix[3][7];
+food_work.nutrient[FE] += change * pcfmatrix[3][8];
+food_work.nutrient[ZN] += change * pcfmatrix[3][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[3][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[3][11];
 pcfmeal[3]->grams += 100 * change / options.mealsperday;
 }
 
@@ -155,12 +176,15 @@ food_work.nutrient[PANTAC] += change * pcfmatrix[4][3];
 food_work.nutrient[VITE] += change * pcfmatrix[4][4];
 food_work.nutrient[CA] += change * pcfmatrix[4][5];
 food_work.nutrient[THIA] += change * pcfmatrix[4][6];
-food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[4][7];
-food_work.nutrient[FAT_KCAL] += change * pcfmatrix[4][8];
+food_work.nutrient[K] += change * pcfmatrix[4][7];
+food_work.nutrient[FE] += change * pcfmatrix[4][8];
+food_work.nutrient[ZN] += change * pcfmatrix[4][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[4][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[4][11];
 pcfmeal[4]->grams += 100 * change / options.mealsperday;
 }
 
-void z_func(void)
+void l_func(void)
 {
 float change;
 change = (DV[CA] - food_work.nutrient[CA]) / pcfmatrix[5][5];
@@ -171,8 +195,11 @@ food_work.nutrient[PANTAC] += change * pcfmatrix[5][3];
 food_work.nutrient[VITE] += change * pcfmatrix[5][4];
 food_work.nutrient[CA] += change * pcfmatrix[5][5];
 food_work.nutrient[THIA] += change * pcfmatrix[5][6];
-food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[5][7];
-food_work.nutrient[FAT_KCAL] += change * pcfmatrix[5][8];
+food_work.nutrient[K] += change * pcfmatrix[5][7];
+food_work.nutrient[FE] += change * pcfmatrix[5][8];
+food_work.nutrient[ZN] += change * pcfmatrix[5][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[5][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[5][11];
 pcfmeal[5]->grams += 100 * change / options.mealsperday;
 }
 
@@ -187,11 +214,71 @@ food_work.nutrient[PANTAC] += change * pcfmatrix[6][3];
 food_work.nutrient[VITE] += change * pcfmatrix[6][4];
 food_work.nutrient[CA] += change * pcfmatrix[6][5];
 food_work.nutrient[THIA] += change * pcfmatrix[6][6];
-food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[6][7];
-food_work.nutrient[FAT_KCAL] += change * pcfmatrix[6][8];
+food_work.nutrient[K] += change * pcfmatrix[6][7];
+food_work.nutrient[FE] += change * pcfmatrix[6][8];
+food_work.nutrient[ZN] += change * pcfmatrix[6][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[6][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[6][11];
 pcfmeal[6]->grams += 100 * change / options.mealsperday;
 }
 
+void k_func(void)
+{
+float change;
+change = (DV[K] - food_work.nutrient[K]) / pcfmatrix[7][7];
+food_work.nutrient[PROCNT] += change * pcfmatrix[7][0];
+food_work.nutrient[CHO_NONFIB] += change * pcfmatrix[7][1];
+food_work.nutrient[FAT] += change * pcfmatrix[7][2];
+food_work.nutrient[PANTAC] += change * pcfmatrix[7][3];
+food_work.nutrient[VITE] += change * pcfmatrix[7][4];
+food_work.nutrient[CA] += change * pcfmatrix[7][5];
+food_work.nutrient[THIA] += change * pcfmatrix[7][6];
+food_work.nutrient[K] += change * pcfmatrix[7][7];
+food_work.nutrient[FE] += change * pcfmatrix[7][8];
+food_work.nutrient[ZN] += change * pcfmatrix[7][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[7][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[7][11];
+pcfmeal[7]->grams += 100 * change / options.mealsperday;
+}
+
+void i_func(void)
+{
+float change;
+change = (DV[FE] - food_work.nutrient[FE]) / pcfmatrix[8][8];
+food_work.nutrient[PROCNT] += change * pcfmatrix[8][0];
+food_work.nutrient[CHO_NONFIB] += change * pcfmatrix[8][1];
+food_work.nutrient[FAT] += change * pcfmatrix[8][2];
+food_work.nutrient[PANTAC] += change * pcfmatrix[8][3];
+food_work.nutrient[VITE] += change * pcfmatrix[8][4];
+food_work.nutrient[CA] += change * pcfmatrix[8][5];
+food_work.nutrient[THIA] += change * pcfmatrix[8][6];
+food_work.nutrient[K] += change * pcfmatrix[8][7];
+food_work.nutrient[FE] += change * pcfmatrix[8][8];
+food_work.nutrient[ZN] += change * pcfmatrix[8][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[8][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[8][11];
+pcfmeal[8]->grams += 100 * change / options.mealsperday;
+}
+
+void z_func(void)
+{
+float change;
+change = (DV[ZN] - food_work.nutrient[ZN]) / pcfmatrix[9][9];
+food_work.nutrient[PROCNT] += change * pcfmatrix[9][0];
+food_work.nutrient[CHO_NONFIB] += change * pcfmatrix[9][1];
+food_work.nutrient[FAT] += change * pcfmatrix[9][2];
+food_work.nutrient[PANTAC] += change * pcfmatrix[9][3];
+food_work.nutrient[VITE] += change * pcfmatrix[9][4];
+food_work.nutrient[CA] += change * pcfmatrix[9][5];
+food_work.nutrient[THIA] += change * pcfmatrix[9][6];
+food_work.nutrient[K] += change * pcfmatrix[9][7];
+food_work.nutrient[FE] += change * pcfmatrix[9][8];
+food_work.nutrient[ZN] += change * pcfmatrix[9][9];
+food_work.nutrient[ENERC_KCAL] += change * pcfmatrix[9][10];
+food_work.nutrient[FAT_KCAL] += change * pcfmatrix[9][11];
+pcfmeal[9]->grams += 100 * change / options.mealsperday;
+}
+
 void order_new_meal()
 {
 struct meal *meal_ptr = &meal_root;
@@ -340,10 +427,13 @@ float newqty;
 if (qty != NULL && (*qty == 'P' || *qty == 'p')) nut = PROCNT;
 else if (qty != NULL && (*qty == 'C' || *qty == 'c')) nut = CHO_NONFIB;
 else if (qty != NULL && (*qty == 'F' || *qty == 'f')) nut = FAT;
+else if (qty != NULL && (*qty == 'T' || *qty == 't')) nut = THIA;
 else if (qty != NULL && (*qty == 'N' || *qty == 'n')) nut = PANTAC;
 else if (qty != NULL && (*qty == 'E' || *qty == 'e')) nut = VITE;
-else if (qty != NULL && (*qty == 'Z' || *qty == 'z')) nut = CA;
-else if (qty != NULL && (*qty == 'T' || *qty == 't')) nut = THIA;
+else if (qty != NULL && (*qty == 'L' || *qty == 'l')) nut = CA;
+else if (qty != NULL && (*qty == 'I' || *qty == 'i')) nut = FE;
+else if (qty != NULL && (*qty == 'K' || *qty == 'k')) nut = K;
+else if (qty != NULL && (*qty == 'Z' || *qty == 'z')) nut = ZN;
 if (nut != -1) while (meal_ptr->next != NULL)
  {
  if (strcmp(meal_date,meal_ptr->next->meal_date) == 0 && meal == meal_ptr->next->meal) 
@@ -456,7 +546,7 @@ pcfrun();
 void pcfrun(void)
 {
 typedef void (*xfunc)(void);
-xfunc pfunc = &no_op, cfunc = &no_op, ffunc = &no_op, nfunc = &no_op, efunc = &no_op, zfunc = &no_op, tfunc = &no_op;
+xfunc pfunc = &no_op, cfunc = &no_op, ffunc = &no_op, nfunc = &no_op, efunc = &no_op, lfunc = &no_op, tfunc = &no_op, kfunc = &no_op, ifunc = &no_op, zfunc = &no_op;
 int count = 0, iterate, savescreen;
 
 DVnotOK = 1;
@@ -471,8 +561,11 @@ if (pcfmeal[0] != NULL)
  pcfmatrix[0][4] = FoodIndex[pcfmeal[0]->food_no]->nutrient[VITE];
  pcfmatrix[0][5] = FoodIndex[pcfmeal[0]->food_no]->nutrient[CA];
  pcfmatrix[0][6] = FoodIndex[pcfmeal[0]->food_no]->nutrient[THIA];
- pcfmatrix[0][7] = FoodIndex[pcfmeal[0]->food_no]->nutrient[ENERC_KCAL];
- pcfmatrix[0][8] = FoodIndex[pcfmeal[0]->food_no]->nutrient[FAT_KCAL];
+ pcfmatrix[0][7] = FoodIndex[pcfmeal[0]->food_no]->nutrient[K];
+ pcfmatrix[0][8] = FoodIndex[pcfmeal[0]->food_no]->nutrient[FE];
+ pcfmatrix[0][9] = FoodIndex[pcfmeal[0]->food_no]->nutrient[ZN];
+ pcfmatrix[0][10] = FoodIndex[pcfmeal[0]->food_no]->nutrient[ENERC_KCAL];
+ pcfmatrix[0][11] = FoodIndex[pcfmeal[0]->food_no]->nutrient[FAT_KCAL];
  pfunc = &p_func;
  }
 if (pcfmeal[1] != NULL)
@@ -484,8 +577,11 @@ if (pcfmeal[1] != NULL)
  pcfmatrix[1][4] = FoodIndex[pcfmeal[1]->food_no]->nutrient[VITE];
  pcfmatrix[1][5] = FoodIndex[pcfmeal[1]->food_no]->nutrient[CA];
  pcfmatrix[1][6] = FoodIndex[pcfmeal[1]->food_no]->nutrient[THIA];
- pcfmatrix[1][7] = FoodIndex[pcfmeal[1]->food_no]->nutrient[ENERC_KCAL];
- pcfmatrix[1][8] = FoodIndex[pcfmeal[1]->food_no]->nutrient[FAT_KCAL];
+ pcfmatrix[1][7] = FoodIndex[pcfmeal[1]->food_no]->nutrient[K];
+ pcfmatrix[1][8] = FoodIndex[pcfmeal[1]->food_no]->nutrient[FE];
+ pcfmatrix[1][9] = FoodIndex[pcfmeal[1]->food_no]->nutrient[ZN];
+ pcfmatrix[1][10] = FoodIndex[pcfmeal[1]->food_no]->nutrient[ENERC_KCAL];
+ pcfmatrix[1][11] = FoodIndex[pcfmeal[1]->food_no]->nutrient[FAT_KCAL];
  if (options.abnuts[ENERC_KCAL] >= 0 && options.abnuts[CHO_NONFIB] == 0) cfunc = &c_cal_func; 
  else cfunc = &c_func;
  }
@@ -498,8 +594,11 @@ if (pcfmeal[2] != NULL)
  pcfmatrix[2][4] = FoodIndex[pcfmeal[2]->food_no]->nutrient[VITE];
  pcfmatrix[2][5] = FoodIndex[pcfmeal[2]->food_no]->nutrient[CA];
  pcfmatrix[2][6] = FoodIndex[pcfmeal[2]->food_no]->nutrient[THIA];
- pcfmatrix[2][7] = FoodIndex[pcfmeal[2]->food_no]->nutrient[ENERC_KCAL];
- pcfmatrix[2][8] = FoodIndex[pcfmeal[2]->food_no]->nutrient[FAT_KCAL];
+ pcfmatrix[2][7] = FoodIndex[pcfmeal[2]->food_no]->nutrient[K];
+ pcfmatrix[2][7] = FoodIndex[pcfmeal[2]->food_no]->nutrient[FE];
+ pcfmatrix[2][8] = FoodIndex[pcfmeal[2]->food_no]->nutrient[ZN];
+ pcfmatrix[2][10] = FoodIndex[pcfmeal[2]->food_no]->nutrient[ENERC_KCAL];
+ pcfmatrix[2][11] = FoodIndex[pcfmeal[2]->food_no]->nutrient[FAT_KCAL];
  if (options.abnuts[ENERC_KCAL] >= 0 && options.abnuts[FAT] == 0 && options.abnuts[CHO_NONFIB] != 0) ffunc = &f_cal_func; 
  else if (options.abnuts[ENERC_KCAL] >= 0 && options.abnuts[FAT] == 0 && options.abnuts[CHO_NONFIB] == 0) ffunc = &f_cal30_func; 
  else ffunc = &f_func;
@@ -513,8 +612,11 @@ if (pcfmeal[3] != NULL)
  pcfmatrix[3][4] = FoodIndex[pcfmeal[3]->food_no]->nutrient[VITE];
  pcfmatrix[3][5] = FoodIndex[pcfmeal[3]->food_no]->nutrient[CA];
  pcfmatrix[3][6] = FoodIndex[pcfmeal[3]->food_no]->nutrient[THIA];
- pcfmatrix[3][7] = FoodIndex[pcfmeal[3]->food_no]->nutrient[ENERC_KCAL];
- pcfmatrix[3][8] = FoodIndex[pcfmeal[3]->food_no]->nutrient[FAT_KCAL];
+ pcfmatrix[3][7] = FoodIndex[pcfmeal[3]->food_no]->nutrient[K];
+ pcfmatrix[3][8] = FoodIndex[pcfmeal[3]->food_no]->nutrient[FE];
+ pcfmatrix[3][9] = FoodIndex[pcfmeal[3]->food_no]->nutrient[ZN];
+ pcfmatrix[3][10] = FoodIndex[pcfmeal[3]->food_no]->nutrient[ENERC_KCAL];
+ pcfmatrix[3][11] = FoodIndex[pcfmeal[3]->food_no]->nutrient[FAT_KCAL];
  nfunc = &n_func;                                              
  }
 if (pcfmeal[4] != NULL)
@@ -526,8 +628,11 @@ if (pcfmeal[4] != NULL)
  pcfmatrix[4][4] = FoodIndex[pcfmeal[4]->food_no]->nutrient[VITE];
  pcfmatrix[4][5] = FoodIndex[pcfmeal[4]->food_no]->nutrient[CA];
  pcfmatrix[4][6] = FoodIndex[pcfmeal[4]->food_no]->nutrient[THIA];
- pcfmatrix[4][7] = FoodIndex[pcfmeal[4]->food_no]->nutrient[ENERC_KCAL];
- pcfmatrix[4][8] = FoodIndex[pcfmeal[4]->food_no]->nutrient[FAT_KCAL];
+ pcfmatrix[4][7] = FoodIndex[pcfmeal[4]->food_no]->nutrient[K];
+ pcfmatrix[4][8] = FoodIndex[pcfmeal[4]->food_no]->nutrient[FE];
+ pcfmatrix[4][9] = FoodIndex[pcfmeal[4]->food_no]->nutrient[ZN];
+ pcfmatrix[4][10] = FoodIndex[pcfmeal[4]->food_no]->nutrient[ENERC_KCAL];
+ pcfmatrix[4][11] = FoodIndex[pcfmeal[4]->food_no]->nutrient[FAT_KCAL];
  efunc = &e_func;
  }
 if (pcfmeal[5] != NULL)
@@ -539,9 +644,12 @@ if (pcfmeal[5] != NULL)
  pcfmatrix[5][4] = FoodIndex[pcfmeal[5]->food_no]->nutrient[VITE];
  pcfmatrix[5][5] = FoodIndex[pcfmeal[5]->food_no]->nutrient[CA];
  pcfmatrix[5][6] = FoodIndex[pcfmeal[5]->food_no]->nutrient[THIA];
- pcfmatrix[5][7] = FoodIndex[pcfmeal[5]->food_no]->nutrient[ENERC_KCAL];
- pcfmatrix[5][8] = FoodIndex[pcfmeal[5]->food_no]->nutrient[FAT_KCAL];
- zfunc = &z_func;
+ pcfmatrix[5][7] = FoodIndex[pcfmeal[5]->food_no]->nutrient[K];
+ pcfmatrix[5][8] = FoodIndex[pcfmeal[5]->food_no]->nutrient[FE];
+ pcfmatrix[5][9] = FoodIndex[pcfmeal[5]->food_no]->nutrient[ZN];
+ pcfmatrix[5][10] = FoodIndex[pcfmeal[5]->food_no]->nutrient[ENERC_KCAL];
+ pcfmatrix[5][11] = FoodIndex[pcfmeal[5]->food_no]->nutrient[FAT_KCAL];
+ lfunc = &l_func;
  }
 if (pcfmeal[6] != NULL)
  {
@@ -552,10 +660,61 @@ if (pcfmeal[6] != NULL)
  pcfmatrix[6][4] = FoodIndex[pcfmeal[6]->food_no]->nutrient[VITE];
  pcfmatrix[6][5] = FoodIndex[pcfmeal[6]->food_no]->nutrient[CA];
  pcfmatrix[6][6] = FoodIndex[pcfmeal[6]->food_no]->nutrient[THIA];
- pcfmatrix[6][7] = FoodIndex[pcfmeal[6]->food_no]->nutrient[ENERC_KCAL];
- pcfmatrix[6][8] = FoodIndex[pcfmeal[6]->food_no]->nutrient[FAT_KCAL];
+ pcfmatrix[6][7] = FoodIndex[pcfmeal[6]->food_no]->nutrient[K];
+ pcfmatrix[6][8] = FoodIndex[pcfmeal[6]->food_no]->nutrient[FE];
+ pcfmatrix[6][9] = FoodIndex[pcfmeal[6]->food_no]->nutrient[ZN];
+ pcfmatrix[6][10] = FoodIndex[pcfmeal[6]->food_no]->nutrient[ENERC_KCAL];
+ pcfmatrix[6][11] = FoodIndex[pcfmeal[6]->food_no]->nutrient[FAT_KCAL];
  tfunc = &t_func;
  }
+if (pcfmeal[7] != NULL)
+ {
+ pcfmatrix[7][0] = FoodIndex[pcfmeal[7]->food_no]->nutrient[PROCNT];
+ pcfmatrix[7][1] = FoodIndex[pcfmeal[7]->food_no]->nutrient[CHO_NONFIB];
+ pcfmatrix[7][2] = FoodIndex[pcfmeal[7]->food_no]->nutrient[FAT];
+ pcfmatrix[7][3] = FoodIndex[pcfmeal[7]->food_no]->nutrient[PANTAC];
+ pcfmatrix[7][4] = FoodIndex[pcfmeal[7]->food_no]->nutrient[VITE];
+ pcfmatrix[7][5] = FoodIndex[pcfmeal[7]->food_no]->nutrient[CA];
+ pcfmatrix[7][6] = FoodIndex[pcfmeal[7]->food_no]->nutrient[THIA];
+ pcfmatrix[7][7] = FoodIndex[pcfmeal[7]->food_no]->nutrient[K];
+ pcfmatrix[7][8] = FoodIndex[pcfmeal[7]->food_no]->nutrient[FE];
+ pcfmatrix[7][9] = FoodIndex[pcfmeal[7]->food_no]->nutrient[ZN];
+ pcfmatrix[7][10] = FoodIndex[pcfmeal[7]->food_no]->nutrient[ENERC_KCAL];
+ pcfmatrix[7][11] = FoodIndex[pcfmeal[7]->food_no]->nutrient[FAT_KCAL];
+ kfunc = &k_func;
+ }
+if (pcfmeal[8] != NULL)
+ {
+ pcfmatrix[8][0] = FoodIndex[pcfmeal[8]->food_no]->nutrient[PROCNT];
+ pcfmatrix[8][1] = FoodIndex[pcfmeal[8]->food_no]->nutrient[CHO_NONFIB];
+ pcfmatrix[8][2] = FoodIndex[pcfmeal[8]->food_no]->nutrient[FAT];
+ pcfmatrix[8][3] = FoodIndex[pcfmeal[8]->food_no]->nutrient[PANTAC];
+ pcfmatrix[8][4] = FoodIndex[pcfmeal[8]->food_no]->nutrient[VITE];
+ pcfmatrix[8][5] = FoodIndex[pcfmeal[8]->food_no]->nutrient[CA];
+ pcfmatrix[8][6] = FoodIndex[pcfmeal[8]->food_no]->nutrient[THIA];
+ pcfmatrix[8][7] = FoodIndex[pcfmeal[8]->food_no]->nutrient[K];
+ pcfmatrix[8][8] = FoodIndex[pcfmeal[8]->food_no]->nutrient[FE];
+ pcfmatrix[8][9] = FoodIndex[pcfmeal[8]->food_no]->nutrient[ZN];
+ pcfmatrix[8][10] = FoodIndex[pcfmeal[8]->food_no]->nutrient[ENERC_KCAL];
+ pcfmatrix[8][11] = FoodIndex[pcfmeal[8]->food_no]->nutrient[FAT_KCAL];
+ ifunc = &i_func;
+ }
+if (pcfmeal[9] != NULL)
+ {
+ pcfmatrix[9][0] = FoodIndex[pcfmeal[9]->food_no]->nutrient[PROCNT];
+ pcfmatrix[9][1] = FoodIndex[pcfmeal[9]->food_no]->nutrient[CHO_NONFIB];
+ pcfmatrix[9][2] = FoodIndex[pcfmeal[9]->food_no]->nutrient[FAT];
+ pcfmatrix[9][3] = FoodIndex[pcfmeal[9]->food_no]->nutrient[PANTAC];
+ pcfmatrix[9][4] = FoodIndex[pcfmeal[9]->food_no]->nutrient[VITE];
+ pcfmatrix[9][5] = FoodIndex[pcfmeal[9]->food_no]->nutrient[CA];
+ pcfmatrix[9][6] = FoodIndex[pcfmeal[9]->food_no]->nutrient[THIA];
+ pcfmatrix[9][7] = FoodIndex[pcfmeal[9]->food_no]->nutrient[K];
+ pcfmatrix[9][8] = FoodIndex[pcfmeal[9]->food_no]->nutrient[FE];
+ pcfmatrix[9][9] = FoodIndex[pcfmeal[9]->food_no]->nutrient[ZN];
+ pcfmatrix[9][10] = FoodIndex[pcfmeal[9]->food_no]->nutrient[ENERC_KCAL];
+ pcfmatrix[9][11] = FoodIndex[pcfmeal[9]->food_no]->nutrient[FAT_KCAL];
+ zfunc = &z_func;
+ }
 
 savescreen = options.screen;
 options.screen = 0;
@@ -572,12 +731,15 @@ for (iterate = 0; iterate < 3; iterate++)
   ffunc();
   nfunc();
   efunc();
-  zfunc();
+  lfunc();
   tfunc();
+  kfunc();
+  ifunc();
+  zfunc();
   }
  }
 
-for (count = 0; count < 5; count++) if (pcfmeal[count] != NULL)
+for (count = 0; count < 10; count++) if (pcfmeal[count] != NULL)
  {
  if (pcfmeal[count]->grams != pcfmeal[count]->grams) pcfmeal[count]->grams = 0;
  if (pcfmeal[count]->grams < -1000) pcfmeal[count]->grams = 0;
@@ -592,7 +754,7 @@ void pcftweak(int nut, struct meal *ptr)
 {
 int i;
 
-for (i = 0; i < 7; i++) if (ptr == pcfmeal[i])
+for (i = 0; i < 10; i++) if (ptr == pcfmeal[i])
  {
  FoodIndex[pcfmeal[i]->food_no]->pcf = ' ';
  pcfmeal[i] = NULL;
@@ -643,7 +805,7 @@ switch (nut)
   if (pcfmeal[5] != NULL) FoodIndex[pcfmeal[5]->food_no]->pcf = ' ';
   else if (i == 5) break;
   pcfmeal[5] = ptr;
-  FoodIndex[pcfmeal[5]->food_no]->pcf = 'z';
+  FoodIndex[pcfmeal[5]->food_no]->pcf = 'l';
   break;
  case THIA :
   if (pcfmeal[6] != NULL) FoodIndex[pcfmeal[6]->food_no]->pcf = ' ';
@@ -651,6 +813,24 @@ switch (nut)
   pcfmeal[6] = ptr;
   FoodIndex[pcfmeal[6]->food_no]->pcf = 't';
   break;
+ case K :
+  if (pcfmeal[7] != NULL) FoodIndex[pcfmeal[7]->food_no]->pcf = ' ';
+  else if (i == 7) break;
+  pcfmeal[7] = ptr;
+  FoodIndex[pcfmeal[7]->food_no]->pcf = 'k';
+  break;
+ case FE :
+  if (pcfmeal[8] != NULL) FoodIndex[pcfmeal[8]->food_no]->pcf = ' ';
+  else if (i == 8) break;
+  pcfmeal[8] = ptr;
+  FoodIndex[pcfmeal[8]->food_no]->pcf = 'i';
+  break;
+ case ZN :
+  if (pcfmeal[9] != NULL) FoodIndex[pcfmeal[9]->food_no]->pcf = ' ';
+  else if (i == 9) break;
+  pcfmeal[9] = ptr;
+  FoodIndex[pcfmeal[9]->food_no]->pcf = 'z';
+  break;
  default : break;
  }
 }
@@ -696,8 +876,23 @@ if (ptr == NULL)
   FoodIndex[pcfmeal[6]->food_no]->pcf = ' ';
   pcfmeal[6] = NULL;
   }
+ if (pcfmeal[7] != NULL)
+  {
+  FoodIndex[pcfmeal[7]->food_no]->pcf = ' ';
+  pcfmeal[7] = NULL;
+  }
+ if (pcfmeal[8] != NULL)
+  {
+  FoodIndex[pcfmeal[8]->food_no]->pcf = ' ';
+  pcfmeal[8] = NULL;
+  }
+ if (pcfmeal[9] != NULL)
+  {
+  FoodIndex[pcfmeal[9]->food_no]->pcf = ' ';
+  pcfmeal[9] = NULL;
+  }
  }
-else for (i = 0; i < 7; i++) if (pcfmeal[i] == ptr)
+else for (i = 0; i < 10; i++) if (pcfmeal[i] == ptr)
  {
  FoodIndex[pcfmeal[i]->food_no]->pcf = ' ';
  pcfmeal[i] = NULL;
diff --git a/nut.1 b/nut.1
index 89bf136..dedaacf 100644
--- a/nut.1
+++ b/nut.1
@@ -4,7 +4,7 @@
 .\" LP paragraph
 .\" IP indented paragraph
 .\" TP hanging label
-.TH "nut" "1" "2014.01.01" "" ""
+.TH "nut" "1" "2014.06.14" "" ""
 .SH "NAME"
 .B nut \- analyze meals with the USDA Nutrient Database
 .SH "SYNOPSIS"
@@ -80,9 +80,9 @@ food #5 is designated as a fat food, type "5 f" to remove the
 designation, or else type a new pcf command that does not include 
 food #5 as a fat food.
 There is also an extension to the feature to balance a meal for
-Thiamin "t", Pantothenic Acid "n", Vitamin E "e", and Calcium "z", but these commands have to be issued 
+Thiamin "t", Pantothenic Acid "n", Vitamin E "e", Calcium "l", Iron "i", Potassium "k", and Zinc "z", but these commands have to be issued 
 individually and not as part of a "pcf" command.
-These additional commands "t", "n", "e", and "z" are only valuable when meals habitually
+These additional commands "t", "n", "e", "l", "i", "k", and "z" are only valuable when meals habitually
 lack the specified nutrient and it makes sense to try to get some of the nutrient at
 every meal to avoid a large cumulative deficiency.
 
diff --git a/nut.html b/nut.html
index ba4642a..9f4d0b0 100644
--- a/nut.html
+++ b/nut.html
@@ -3,7 +3,7 @@ Content-type: text/html
 <HTML><HEAD><TITLE>Manpage of nut</TITLE>
 </HEAD><BODY>
 <H1>nut</H1>
-Section:  (1)<BR>Updated: 2014.01.01<BR><A HREF="#index">Index</A>
+Section:  (1)<BR>Updated: 2014.06.14<BR><A HREF="#index">Index</A>
 <A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
 
 <A NAME="lbAB"> </A>
@@ -95,9 +95,9 @@ food #5 is designated as a fat food, type "5 f" to remove the
 designation, or else type a new pcf command that does not include 
 food #5 as a fat food.
 There is also an extension to the feature to balance a meal for
-Thiamin "t", Pantothenic Acid "n", Vitamin E "e", and Calcium "z", but these commands have to be issued 
+Thiamin "t", Pantothenic Acid "n", Vitamin E "e", Calcium "l", Iron "i", Potassium "k", and Zinc "z", but these commands have to be issued 
 individually and not as part of a "pcf" command.
-These additional commands "t", "n", "e", and "z" are only valuable when meals habitually
+These additional commands "t", "n", "e", "l", "i", "k", and "z" are only valuable when meals habitually
 lack the specified nutrient and it makes sense to try to get some of the nutrient at
 every meal to avoid a large cumulative deficiency.
 <P>
@@ -411,6 +411,6 @@ Copyright (C) 1996-2014 by Jim Jozwiak.
 This document was created by
 <A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
 using the manual pages.<BR>
-Time: 02:03:00 GMT, December 12, 2013
+Time: 19:56:09 GMT, June 13, 2014
 </BODY>
 </HTML>
diff --git a/recmeal.c b/recmeal.c
index dbe3459..bc6a2e3 100644
--- a/recmeal.c
+++ b/recmeal.c
@@ -105,14 +105,20 @@ for ( ; ; )
     else if (strchr(tokenx,'C') != NULL) modify_meal(meal_date,meal,modfood,"c");
     else if (strchr(tokenx,'f') != NULL) modify_meal(meal_date,meal,modfood,"f");
     else if (strchr(tokenx,'F') != NULL) modify_meal(meal_date,meal,modfood,"f");
+    else if (strchr(tokenx,'t') != NULL) modify_meal(meal_date,meal,modfood,"t");
+    else if (strchr(tokenx,'T') != NULL) modify_meal(meal_date,meal,modfood,"t");
     else if (strchr(tokenx,'n') != NULL) modify_meal(meal_date,meal,modfood,"n");
     else if (strchr(tokenx,'N') != NULL) modify_meal(meal_date,meal,modfood,"n");
     else if (strchr(tokenx,'e') != NULL) modify_meal(meal_date,meal,modfood,"e");
     else if (strchr(tokenx,'E') != NULL) modify_meal(meal_date,meal,modfood,"e");
+    else if (strchr(tokenx,'l') != NULL) modify_meal(meal_date,meal,modfood,"l");
+    else if (strchr(tokenx,'L') != NULL) modify_meal(meal_date,meal,modfood,"l");
+    else if (strchr(tokenx,'i') != NULL) modify_meal(meal_date,meal,modfood,"i");
+    else if (strchr(tokenx,'I') != NULL) modify_meal(meal_date,meal,modfood,"i");
+    else if (strchr(tokenx,'k') != NULL) modify_meal(meal_date,meal,modfood,"k");
+    else if (strchr(tokenx,'K') != NULL) modify_meal(meal_date,meal,modfood,"k");
     else if (strchr(tokenx,'z') != NULL) modify_meal(meal_date,meal,modfood,"z");
     else if (strchr(tokenx,'Z') != NULL) modify_meal(meal_date,meal,modfood,"z");
-    else if (strchr(tokenx,'t') != NULL) modify_meal(meal_date,meal,modfood,"t");
-    else if (strchr(tokenx,'T') != NULL) modify_meal(meal_date,meal,modfood,"t");
     else modify_meal(meal_date,meal,modfood,token);
     }
    else modify_meal(meal_date,meal,modfood,token);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/nut-nutrition.git



More information about the debian-med-commit mailing list