10000 import changes from cbses · postgrespro/libblobstamper@622085e · GitHub
[go: up one dir, main page]

Skip to content

Commit 622085e

Browse files
import changes from cbses
1 parent a0638cd commit 622085e

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

libblobstamper.cpp

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ extern "C" {
152152
int
153153
poly_contain_prepare(char* in, int in_size, char ** res1, char ** res2)
154154
{
155-
char str[]="124567";
156-
155+
*res1 = NULL;
156+
*res2 = NULL;
157157
wflMemCtx * mctx;
158158
wflBlobDsc blob;
159159
wflBlobDsc * b2;
@@ -172,15 +172,15 @@ poly_contain_prepare(char* in, int in_size, char ** res1, char ** res2)
172172

173173
if (r1.empty())
174174
{
175-
fprintf(stderr,"Problema\n");
175+
fprintf(stderr,"Problema1\n");
176176
return 1;
177177
}
178178

179179
r2 = wflShiftPgPath(& blob);
180180

181181
if (r2.empty())
182182
{
183-
fprintf(stderr,"Problema\n");
183+
fprintf(stderr,"Problema2\n");
184184
return 1;
185185
}
186186

@@ -193,4 +193,41 @@ poly_contain_prepare(char* in, int in_size, char ** res1, char ** res2)
193193
return 0;
194194
}
195195

196+
int
197+
poly_center_prepare(char* in, int in_size, char ** res2)
198+
{
199+
// *res1 = NULL;
200+
*res2 = NULL;
201+
wflMemCtx * mctx;
202+
wflBlobDsc blob;
203+
wflBlobDsc * b2;
204+
205+
std::string r2;
206+
207+
mctx = wflCreateMemCtx();
208+
209+
blob.mctx = mctx;
210+
blob.data = in;
211+
blob.begin = 0;
212+
blob.end = in_size;
213+
214+
215+
216+
r2 = wflShiftPgPath(& blob);
217+
218+
if (r2.empty())
219+
{
220+
fprintf(stderr,"Problema2\n");
221+
return 1;
222+
}
223+
224+
// *res1 = (char *) malloc(strlen(r1.c_str()) + 1);
225+
// memcpy(*res1, r1.c_str(), strlen(r1.c_str()) + 1);
226+
227+
*res2 = (char *) malloc(strlen(r2.c_str())+1);
228+
memcpy(*res2, r2.c_str(), strlen(r2.c_str()) + 1);
229+
230+
return 0;
231+
}
232+
196233
}

libblobstamper.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ void wflBlobDump(wflBlobDsc* blob);
2323
void* wflMalloc(wflMemCtx * mctx, size_t size);
2424
void wflFree(wflMemCtx * mctx, void* ptr);
2525

26-
wflBlobDsc* wflShiftN(wflBlobDsc* blob, size_t n);
27-
std::string wflShiftDouble(wflBlobDsc* blob);
28-
std::string wflShiftPgPoint(wflBlobDsc* blob);
29-
std::string wflShiftPgPath(wflBlobDsc* blob);
26+
//wflBlobDsc* wflShiftN(wflBlobDsc* blob, size_t n);
27+
//std::string wflShiftDouble(wflBlobDsc* blob);
28+
//std::string wflShiftPgPoint(wflBlobDsc* blob);
29+
//std::string wflShiftPgPath(wflBlobDsc* blob);
3030

3131

3232

0 commit comments

Comments
 (0)
0