My nutrients tracking program has two parts:
nutrients.c, which takes the input on what you've eaten, and newday.c, which initializes your nutrients data file at the start of each day.

Alternatively you can use the Cron-o-meter, a nutrients tracking program which is available for free online. My program is more work to use but more flexible than the Cron-o-meter, because you make your own database of foods and their nutrient content. You choose which nutrients to track. So you can hunt up values and make estimates yourself, if necessary.

To run it, you need a C compiler. I downloaded gcc.

Also you need to understand C, so you can tweak the program if needed. For example, a flag is set for each nutrient. The flag is turned on when your nutrient intake is below the target amount that you've specified. If the flag is turned on, then the program displays the amount of that nutrient in the food item you're entering.

But sometimes, you'd want to either hardwire the flags to false (= 0), or true (=1). I have a section in the program where that's done. If I start supplementing a nutrient, I don't care how much I get from my diet, so I set the flag for that nutrient to 0.

You can choose to smooth the nutrient intake over several days, using the "smoth" array. Each nutrient has its own smoothing time. If "smoth" is set to 0 for a nutrient, the program adds up your intake separately for each day, and there's no smoothing.

It's nice to do smoothing, because it doesn't matter if your diet is short of a nutrient for one particular day. What matters is if you're chronically short.

For the mathy among you, what the program does is a decaying-exponential smoothing, and "smoth" gives the timescale of the smoothing. If "smoth" is set to 0.871, that means that your nutrient intake from 5 days ago is half as important in the average as your nutrient intake today, since 0.871 is the fifth root of 1/2. "smoth" has to be >= 0 and less than 1. "smoth" is set in both nutrients.c and newday.c.

The program uses two data files. The table.food file gives nutrient contents for the foods you eat.

The variable "no" in nutrients.c and newday.c gives the number of nutrients the program is tracking. "no" is set to 23 in my version.

The table.food file starts with a line of target values (RDA's) for each nutrient. They're numbers, separated by spaces.

The next line has the name of each nutrient. The names are separated by commas.

After that, there are lines for each individual food. The name of the food can't include the digits 0-9. So when I wanted to enter 100 grams of artichoke, I wrote it as "artichoke hgm" to avoid digits.

After the name of the food, you enter the nutrient content for each individual food, separated by spaces.

The other file is called day. It keeps track of your total nutrient history. The "day" file just has a string of numbers in it, one for each nutrient you're tracking.

There's also a log file called "day in food".