Changeset 41341 for trunk/Ohana/src/opihi/cmd.data/spline_commands.c
- Timestamp:
- Apr 16, 2020, 2:04:27 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
r41340 r41341 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"); 30 35 return FALSE; 31 36 } … … 93 98 } 94 99 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 95 122 int spline_load (int argc, char **argv) { 96 123 … … 109 136 int spline_delete (int argc, char **argv) { 110 137 111 int status; 112 Spline *spline; 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 } 113 145 114 146 if (argc != 2) { … … 117 149 } 118 150 119 spline = FindSpline (argv[1]);151 Spline *spline = FindSpline (argv[1]); 120 152 if (spline == NULL) { 153 if (QUIET) return TRUE; 121 154 gprint (GP_ERR, "spline %s not found\n", argv[1]); 122 155 return FALSE; … … 130 163 int spline_rename (int argc, char **argv) { 131 164 132 Spline *spline;133 134 165 if (argc != 3) { 135 166 gprint (GP_ERR, "USAGE: spline rename (spline) (newname)\n"); … … 137 168 } 138 169 139 spline = FindSpline (argv[1]);170 Spline *spline = FindSpline (argv[1]); 140 171 if (spline == NULL) { 141 172 gprint (GP_ERR, "spline %s not found\n", argv[1]); 142 173 return FALSE; 174 } 175 176 Spline *newname = FindSpline (argv[2]); 177 if (newname != NULL) { 178 DeleteSpline (newname); 143 179 } 144 180 … … 147 183 return TRUE; 148 184 } 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.
