MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / CPR_get_text

Function CPR_get_text

src/gpre/gpre.cpp:1100–1132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1098//
1099
1100void CPR_get_text( TEXT* buffer, const gpre_txt* text)
1101{
1102 SLONG start = text->txt_position;
1103 int length = text->txt_length;
1104
1105 // On PC-like platforms, '\n' will be 2 bytes. The txt_position
1106 // will be incorrect for fseek. The position is not adjusted
1107 // just for PC-like platforms because, we use fseek () and
1108 // getc to position ourselves at the token position.
1109 // We should keep both character position and byte position
1110 // and use them appropriately. for now use getc ()
1111
1112#if (defined WIN_NT)
1113 if (fseek(trace_file, 0L, 0))
1114#else
1115 if (fseek(trace_file, start, 0))
1116#endif
1117 {
1118 fseek(trace_file, 0L, 2);
1119 CPR_error("fseek failed for trace file");
1120 }
1121#if (defined WIN_NT)
1122 // move forward to actual position
1123
1124 while (start--)
1125 getc(trace_file);
1126#endif
1127
1128 TEXT* p = buffer;
1129 while (length--)
1130 *p++ = getc(trace_file);
1131 fseek(trace_file, (SLONG) 0, 2);
1132}
1133
1134
1135//____________________________________________________________

Callers 8

alter_domainFunction · 0.85
alter_tableFunction · 0.85
create_check_constraintFunction · 0.85
create_domainFunction · 0.85
create_domain_constraintFunction · 0.85
create_tableFunction · 0.85
create_viewFunction · 0.85
put_computed_sourceFunction · 0.85

Calls 3

fseekFunction · 0.85
CPR_errorFunction · 0.85
getcFunction · 0.85

Tested by

no test coverage detected