triplesF = Partition[Flatten[Table[{i, j, k},
{i, 0, #}, {j, 0, If[i == #, #2, i]}, {k, 0, If[i == #, Min[j, #3], j]}]], 3] &;
Examples:
(* {{0, 0, 0}, {1, 0, 0}, {1, 1, 0}} *)
triplesF[1, 1, 1]
(* {{0,0,0},{1,0,0},{1,1,0},{1,1,1}} *)
triplesF[2, 1, 0]
(* {{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {2, 0, 0}, {2, 1, 0}}*)
triplesF[2, 2, 0]
(* {{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {2, 0, 0}, {2, 1, 0}, {2, 2, 0}}*)
triplesF[3, 2, 0]
(* {{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {2, 0, 0}, {2, 1, 0}, {2, 1, 1},
{2, 2, 0}, {2, 2, 1}, {2, 2, 2}, {3, 0, 0}, {3, 1, 0}, {3, 2, 0}} *)
triplesF[3, 1, 0]
(* {{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {2, 0, 0}, {2, 1, 0}, {2, 1, 1},
{2, 2, 0}, {2, 2, 1}, {2, 2, 2}, {3, 0, 0}, {3, 1, 0}} *)
Update: Some timing comparisons
First@AbsoluteTiming[res1 = triplesF[10, 10, 10];]
(* 0.001001 *)
First@AbsoluteTiming[res2 = c[10, 10, 10];]
(* 0.006004 *)
Complement[res1, res2]
(* {{0, 0, 0}} *)
First@AbsoluteTiming[res1 = triplesF[100, 100, 100];]
(* 0.097286 *)
First@AbsoluteTiming[res2 = c[100, 100, 100];]
(* 3.400685 *)
Complement[res1, res2]
(* {{0, 0, 0}} *)
First@AbsoluteTiming[res1 = triplesF[200, 100, 100];]
(* 0.660541 *)
First@AbsoluteTiming[res2 = c[200, 100, 100];]
(* 26.008599 *)
Complement[res1, res2]
(* {{0, 0, 0}} *)
Update 2: Faster version using Join@@Join@@
instead of Partition[Flatten[...],3]
(thanks: Mr.Wizard)
triplesFb = Join @@ Join @@ Table[{i, j, k}, {i, 0, #},
{j, 0, If[i == #, #2, i]}, {k, 0, If[i == #, Min[#3, j], j]}] &;
First[AbsoluteTiming[resb = triplesFb[100, 100, 100];]]
(* 0.073053 *)
First[AbsoluteTiming[res1 = triplesF[100, 100, 100];]]
(* 0.094067 *)
resb == res1
(* True *)
{First[AbsoluteTiming[resb = triplesFb[500, 100, 100];]], Length[resb]}
(* {11.780317,20963651} *)