Changeset 41340 for trunk/Ohana/src/opihi/cmd.data/spline_commands.c
- Timestamp:
- Apr 16, 2020, 1:54:47 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.data/spline_commands.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.data/spline_commands.c
r41164 r41340 28 28 if (xvec->Nelements != yvec->Nelements) { 29 29 gprint (GP_ERR, "x and y vectors must be the same length\n"); 30 return FALSE;31 }32 33 if (xvec->Nelements < 3) {34 gprint (GP_ERR, "cannot make a spline with fewer than 3 knots\n");35 30 return FALSE; 36 31 } … … 98 93 } 99 94 100 int spline_print (int argc, char **argv) {101 102 int i;103 104 if (argc != 2) {105 gprint (GP_ERR, "USAGE: spline print (name)\n");106 return FALSE;107 }108 109 Spline *myspline = FindSpline (argv[1]);110 if (!myspline) {111 gprint (GP_ERR, "spline %s not found\n", argv[1]);112 return (FALSE);113 }114 115 for (i = 0; i < myspline->Nknots; i++) {116 gprint (GP_LOG, "%lf : %lf : %lf\n", myspline->xk[i], myspline->yk[i], myspline->y2[i]);117 }118 119 return TRUE;120 }121 122 95 int spline_load (int argc, char **argv) { 123 96 … … 136 109 int spline_delete (int argc, char **argv) { 137 110 138 int N, status; 139 140 int QUIET = FALSE; 141 if ((N = get_argument (argc, argv, "-q"))) { 142 QUIET = TRUE; 143 remove_argument (N, &argc, argv); 144 } 111 int status; 112 Spline *spline; 145 113 146 114 if (argc != 2) { … … 149 117 } 150 118 151 Spline *spline = FindSpline (argv[1]);119 spline = FindSpline (argv[1]); 152 120 if (spline == NULL) { 153 if (QUIET) return TRUE;154 121 gprint (GP_ERR, "spline %s not found\n", argv[1]); 155 122 return FALSE; … … 163 130 int spline_rename (int argc, char **argv) { 164 131 132 Spline *spline; 133 165 134 if (argc != 3) { 166 135 gprint (GP_ERR, "USAGE: spline rename (spline) (newname)\n"); … … 168 137 } 169 138 170 Spline *spline = FindSpline (argv[1]);139 spline = FindSpline (argv[1]); 171 140 if (spline == NULL) { 172 141 gprint (GP_ERR, "spline %s not found\n", argv[1]); 173 142 return FALSE; 174 }175 176 Spline *newname = FindSpline (argv[2]);177 if (newname != NULL) {178 DeleteSpline (newname);179 143 } 180 144 … … 183 147 return TRUE; 184 148 } 149 150 /* 151 int spline_listspline (int argc, char **argv) { 152 153 Spline *spline; 154 155 if (argc != 2) { 156 gprint (GP_ERR, "USAGE: spline listspline (spline)\n"); 157 return FALSE; 158 } 159 160 spline = FindSpline (argv[1]); 161 if (spline == NULL) { 162 gprint (GP_ERR, "spline %s not found\n", argv[1]); 163 return FALSE; 164 } 165 166 ListPages (spline); 167 return TRUE; 168 } 169 */ 170
Note:
See TracChangeset
for help on using the changeset viewer.
