MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / psl_remove_spaces

Function psl_remove_spaces

src/postscriptlight.c:1127–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1125}
1126
1127static void psl_remove_spaces (char *label[], int n_labels, int m[]) {
1128 int i, k, j, n_tot = n_labels;
1129
1130 if (m)
1131 for (i = 0; i < n_labels; i++) n_tot += m[i]; /* Count number of labels */
1132
1133 for (i = 0; i < n_tot; i++) { /* Strip leading and trailing blanks */
1134 for (k = 0; label[i][k] == ' '; k++); /* Count # of leading blanks */
1135 if (k > 0) { /* Shift text to start, eliminating spaces */
1136 j = 0;
1137 while (label[i][k]) {
1138 label[i][j] = label[i][j+k];
1139 j++;
1140 }
1141 label[i][j] = 0;
1142 }
1143 /* Then strip off trailing blanks, if any */
1144 for (j = (int)strlen (label[i]) - 1; label[i][j] == ' '; j--) label[i][j] = 0;
1145 }
1146}
1147
1148static void psl_prepare_buffer (struct PSL_CTRL *C, size_t len) {
1149 /* Ensure buffer is large enough to accept additional text of length len */

Callers 1

PSL_plottextlineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected