MCPcopy Create free account
hub / github.com/OSGeo/PROJ / process

Function process

src/apps/proj.cpp:63–198  ·  view source on GitHub ↗

file processing function */

Source from the content-addressed store, hash-verified

61
62/* file processing function */
63static void process(FILE *fid) {
64 char line[MAX_LINE + 3], *s = nullptr, pline[40];
65 PJ_COORD data;
66
67 for (;;) {
68 int facs_bad = 0;
69 ++emess_dat.File_line;
70
71 if (bin_in) { /* binary input */
72 if (fread(&data, sizeof(PJ_UV), 1, fid) != 1)
73 break;
74 } else { /* ascii input */
75 if (!(s = fgets(line, MAX_LINE, fid)))
76 break;
77
78 if (!strchr(s, '\n')) { /* overlong line */
79 int c;
80 (void)strcat(s, "\n");
81 /* gobble up to newline */
82 while ((c = fgetc(fid)) != EOF && c != '\n')
83 ;
84 }
85
86 if (*s == tag) {
87 if (!bin_out)
88 (void)fputs(line, stdout);
89 continue;
90 }
91
92 if (reversein) {
93 data.uv.v = (*informat)(s, &s);
94 data.uv.u = (*informat)(s, &s);
95 } else {
96 data.uv.u = (*informat)(s, &s);
97 data.uv.v = (*informat)(s, &s);
98 }
99
100 if (data.uv.v == HUGE_VAL)
101 data.uv.u = HUGE_VAL;
102
103 if (!*s && (s > line))
104 --s; /* assumed we gobbled \n */
105 if (!bin_out && echoin) {
106 char t;
107 t = *s;
108 *s = '\0';
109 (void)fputs(line, stdout);
110 *s = t;
111 putchar('\t');
112 }
113 }
114
115 if (data.uv.u != HUGE_VAL) {
116 PJ_COORD coord;
117 coord.lp = data.lp;
118 if (prescale) {
119 data.uv.u *= fscale;
120 data.uv.v *= fscale;

Callers 1

mainFunction · 0.70

Calls 6

proj_factorsFunction · 0.85
proj_errnoFunction · 0.85
rtodmsFunction · 0.85
proj_angular_inputFunction · 0.85
proj_angular_outputFunction · 0.85

Tested by

no test coverage detected