Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit910f9aa

Browse files
committed
:1,$ s/JsQueryItemR/JsQueryItem/g; :1,$ s/JsQueryItem/JsQueryParseItem/g
1 parent341eed5 commit910f9aa

12 files changed

+235
-233
lines changed

‎jsonb_gin_ops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ typedef struct
5959
staticuint32get_bloom_value(uint32hash);
6060
staticuint32get_path_bloom(PathHashStack*stack);
6161
staticGINKey*make_gin_key(JsonbValue*v,uint32hash);
62-
staticGINKey*make_gin_query_key(JsQueryItemR*value,uint32hash);
62+
staticGINKey*make_gin_query_key(JsQueryItem*value,uint32hash);
6363
staticGINKey*make_gin_query_key_minus_inf(uint32hash);
6464
staticint32compare_gin_key_value(GINKey*arg1,GINKey*arg2);
6565
staticintadd_entry(Entries*e,Datumkey,Pointerextra,boolpmatch);
@@ -281,7 +281,7 @@ make_gin_key(JsonbValue *v, uint32 hash)
281281
}
282282

283283
staticGINKey*
284-
make_gin_query_key(JsQueryItemR*value,uint32hash)
284+
make_gin_query_key(JsQueryItem*value,uint32hash)
285285
{
286286
GINKey*key;
287287
int32len;
@@ -851,7 +851,7 @@ make_hash_entry_handler(ExtractedNode *node, Pointer extra)
851851
{
852852
if (node->bounds.exact->type==jqiAny)
853853
{
854-
JsQueryItemRvalue;
854+
JsQueryItemvalue;
855855

856856
value.type=jqiNull;
857857
value.nextPos=0;

‎jsquery.h

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,24 @@ typedef enum JsQueryItemType {
5454
jqiIn='I'
5555
}JsQueryItemType;
5656

57-
typedefstructJsQueryItemR {
57+
typedefstructJsQueryItem {
5858
JsQueryItemTypetype;
5959
int32nextPos;
6060
char*base;
6161

6262
union {
6363
struct {
64-
char*data;
65-
intdatalen;/* filled only for string */
64+
char*data;/* for bool, numeric and string/key */
65+
intdatalen;/* filled only for string/key */
6666
}value;
6767

6868
struct {
6969
int32left;
7070
int32right;
7171
}args;
72+
7273
int32arg;
74+
7375
struct {
7476
intnelems;
7577
intcurrent;
@@ -78,37 +80,37 @@ typedef struct JsQueryItemR {
7880
};
7981

8082

81-
}JsQueryItemR;
83+
}JsQueryItem;
8284

83-
externvoidjsqInit(JsQueryItemR*v,JsQuery*js);
84-
externvoidjsqInitByBuffer(JsQueryItemR*v,char*base,int32pos);
85-
externbooljsqGetNext(JsQueryItemR*v,JsQueryItemR*a);
86-
externvoidjsqGetArg(JsQueryItemR*v,JsQueryItemR*a);
87-
externvoidjsqGetLeftArg(JsQueryItemR*v,JsQueryItemR*a);
88-
externvoidjsqGetRightArg(JsQueryItemR*v,JsQueryItemR*a);
89-
externNumericjsqGetNumeric(JsQueryItemR*v);
90-
externbooljsqGetBool(JsQueryItemR*v);
91-
externchar*jsqGetString(JsQueryItemR*v,int32*len);
92-
externvoidjsqIterateInit(JsQueryItemR*v);
93-
externbooljsqIterateArray(JsQueryItemR*v,JsQueryItemR*e);
85+
externvoidjsqInit(JsQueryItem*v,JsQuery*js);
86+
externvoidjsqInitByBuffer(JsQueryItem*v,char*base,int32pos);
87+
externbooljsqGetNext(JsQueryItem*v,JsQueryItem*a);
88+
externvoidjsqGetArg(JsQueryItem*v,JsQueryItem*a);
89+
externvoidjsqGetLeftArg(JsQueryItem*v,JsQueryItem*a);
90+
externvoidjsqGetRightArg(JsQueryItem*v,JsQueryItem*a);
91+
externNumericjsqGetNumeric(JsQueryItem*v);
92+
externbooljsqGetBool(JsQueryItem*v);
93+
externchar*jsqGetString(JsQueryItem*v,int32*len);
94+
externvoidjsqIterateInit(JsQueryItem*v);
95+
externbooljsqIterateArray(JsQueryItem*v,JsQueryItem*e);
9496

9597
/*
9698
* Parsing
9799
*/
98100

99-
typedefstructJsQueryItemJsQueryItem;
101+
typedefstructJsQueryParseItemJsQueryParseItem;
100102

101-
structJsQueryItem {
103+
structJsQueryParseItem {
102104
JsQueryItemTypetype;
103-
JsQueryItem*next;/* next in path */
105+
JsQueryParseItem*next;/* next in path */
104106

105107
union {
106108
struct {
107-
JsQueryItem*left;
108-
JsQueryItem*right;
109+
JsQueryParseItem*left;
110+
JsQueryParseItem*right;
109111
}args;
110112

111-
JsQueryItem*arg;
113+
JsQueryParseItem*arg;
112114

113115
Numericnumeric;
114116
boolboolean;
@@ -118,13 +120,13 @@ struct JsQueryItem {
118120
}string;
119121

120122
struct {
121-
intnelems;
122-
JsQueryItem**elems;
123+
intnelems;
124+
JsQueryParseItem**elems;
123125
}array;
124126
};
125127
};
126128

127-
externJsQueryItem*parsejsquery(constchar*str,intlen);
129+
externJsQueryParseItem*parsejsquery(constchar*str,intlen);
128130

129131
voidalignStringInfoInt(StringInfobuf);
130132

@@ -173,9 +175,9 @@ struct ExtractedNode
173175
boolinequality;
174176
boolleftInclusive;
175177
boolrightInclusive;
176-
JsQueryItemR*exact;
177-
JsQueryItemR*leftBound;
178-
JsQueryItemR*rightBound;
178+
JsQueryItem*exact;
179+
JsQueryItem*leftBound;
180+
JsQueryItem*rightBound;
179181
}bounds;
180182
intentryNum;
181183
};

‎jsquery_constr.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#include"jsquery.h"
2121

2222
staticint32
23-
copyJsQuery(StringInfobuf,JsQueryItemR*jsq)
23+
copyJsQuery(StringInfobuf,JsQueryItem*jsq)
2424
{
25-
JsQueryItemRelem;
25+
JsQueryItemelem;
2626
int32next,chld;
2727
int32resPos=buf->len-VARHDRSZ;/* position from begining of jsquery data */
2828

@@ -128,7 +128,7 @@ copyJsQuery(StringInfo buf, JsQueryItemR *jsq)
128128
casejqiAnyKey:
129129
break;
130130
default:
131-
elog(ERROR,"UnknownJsQueryItemtype: %d",jsq->type);
131+
elog(ERROR,"Unknown type: %d",jsq->type);
132132
}
133133

134134
if (jsqGetNext(jsq,&elem))
@@ -143,7 +143,7 @@ joinJsQuery(JsQueryItemType type, JsQuery *jq1, JsQuery *jq2)
143143
JsQuery*out;
144144
StringInfoDatabuf;
145145
int32left,right,chld;
146-
JsQueryItemRv;
146+
JsQueryItemv;
147147

148148
initStringInfo(&buf);
149149
enlargeStringInfo(&buf,VARSIZE_ANY(jq1)+VARSIZE_ANY(jq2)+4*sizeof(int32)+VARHDRSZ);
@@ -217,7 +217,7 @@ jsquery_not(PG_FUNCTION_ARGS)
217217
JsQuery*out;
218218
StringInfoDatabuf;
219219
int32arg,chld;
220-
JsQueryItemRv;
220+
JsQueryItemv;
221221

222222
initStringInfo(&buf);
223223
enlargeStringInfo(&buf,VARSIZE_ANY(jq)+4*sizeof(int32)+VARHDRSZ);

‎jsquery_extract.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include"miscadmin.h"
88
#include"jsquery.h"
99

10-
staticExtractedNode*recursiveExtract(JsQueryItemR*jsq,boolindirect,PathItem*path);
10+
staticExtractedNode*recursiveExtract(JsQueryItem*jsq,boolindirect,PathItem*path);
1111
staticintcoundChildren(ExtractedNode*node,ExtractedNodeTypetype,boolfirst,bool*found);
1212
staticvoidfillChildren(ExtractedNode*node,ExtractedNodeTypetype,boolfirst,ExtractedNode**items,int*i);
1313
staticvoidflatternTree(ExtractedNode*node);
@@ -16,14 +16,14 @@ static ExtractedNode *makeEntries(ExtractedNode *node, MakeEntryHandler handler,
1616
staticintcompareNodes(constvoid*a1,constvoid*a2);
1717
staticvoidprocessGroup(ExtractedNode*node,intstart,intend);
1818
staticvoidsimplifyRecursive(ExtractedNode*node);
19-
staticintcompareJsQueryItemR(JsQueryItemR*v1,JsQueryItemR*v2);
19+
staticintcompareJsQueryItem(JsQueryItem*v1,JsQueryItem*v2);
2020

2121
staticExtractedNode*
22-
recursiveExtract(JsQueryItemR*jsq,boolindirect,PathItem*path)
22+
recursiveExtract(JsQueryItem*jsq,boolindirect,PathItem*path)
2323
{
2424
ExtractedNode*leftNode,*rightNode,*result;
2525
PathItem*pathItem;
26-
JsQueryItemRelem,e;
26+
JsQueryItemelem,e;
2727

2828
check_stack_depth();
2929

@@ -112,7 +112,7 @@ recursiveExtract(JsQueryItemR *jsq,bool indirect, PathItem *path)
112112
result->path=path;
113113
result->indirect=indirect;
114114
result->bounds.inequality= false;
115-
result->bounds.exact= (JsQueryItemR*)palloc(sizeof(JsQueryItemR));
115+
result->bounds.exact= (JsQueryItem*)palloc(sizeof(JsQueryItem));
116116
jsqGetArg(jsq,result->bounds.exact);
117117
returnresult;
118118
casejqiIn:
@@ -146,7 +146,7 @@ recursiveExtract(JsQueryItemR *jsq,bool indirect, PathItem *path)
146146
item->path=pathItem;
147147

148148
item->bounds.inequality= false;
149-
item->bounds.exact= (JsQueryItemR*)palloc(sizeof(JsQueryItemR));
149+
item->bounds.exact= (JsQueryItem*)palloc(sizeof(JsQueryItem));
150150
*item->bounds.exact=e;
151151
result->args.items[result->args.count]=item;
152152
result->args.count++;
@@ -166,14 +166,14 @@ recursiveExtract(JsQueryItemR *jsq,bool indirect, PathItem *path)
166166
{
167167
result->bounds.leftInclusive= (jsq->type==jqiGreaterOrEqual);
168168
result->bounds.rightBound=NULL;
169-
result->bounds.leftBound= (JsQueryItemR*)palloc(sizeof(JsQueryItemR));
169+
result->bounds.leftBound= (JsQueryItem*)palloc(sizeof(JsQueryItem));
170170
jsqGetArg(jsq,result->bounds.leftBound);
171171
}
172172
else
173173
{
174174
result->bounds.rightInclusive= (jsq->type==jqiLessOrEqual);
175175
result->bounds.leftBound=NULL;
176-
result->bounds.rightBound= (JsQueryItemR*)palloc(sizeof(JsQueryItemR));
176+
result->bounds.rightBound= (JsQueryItem*)palloc(sizeof(JsQueryItem));
177177
jsqGetArg(jsq,result->bounds.rightBound);
178178
}
179179
returnresult;
@@ -319,7 +319,7 @@ compareNodes(const void *a1, const void *a2)
319319
}
320320

321321
staticint
322-
compareJsQueryItemR(JsQueryItemR*v1,JsQueryItemR*v2)
322+
compareJsQueryItem(JsQueryItem*v1,JsQueryItem*v2)
323323
{
324324
char*s1,*s2;
325325
int32len1,len2,cmp;
@@ -358,7 +358,7 @@ static void
358358
processGroup(ExtractedNode*node,intstart,intend)
359359
{
360360
inti;
361-
JsQueryItemR*leftBound=NULL,*rightBound=NULL,*exact=NULL;
361+
JsQueryItem*leftBound=NULL,*rightBound=NULL,*exact=NULL;
362362
boolleftInclusive= false,rightInclusive= false;
363363
ExtractedNode*child;
364364

@@ -391,7 +391,7 @@ processGroup(ExtractedNode *node, int start, int end)
391391
leftBound=child->bounds.leftBound;
392392
leftInclusive=child->bounds.leftInclusive;
393393
}
394-
cmp=compareJsQueryItemR(child->bounds.leftBound,leftBound);
394+
cmp=compareJsQueryItem(child->bounds.leftBound,leftBound);
395395
if (cmp>0)
396396
{
397397
leftBound=child->bounds.leftBound;
@@ -409,7 +409,7 @@ processGroup(ExtractedNode *node, int start, int end)
409409
rightBound=child->bounds.rightBound;
410410
rightInclusive=child->bounds.rightInclusive;
411411
}
412-
cmp=compareJsQueryItemR(child->bounds.rightBound,rightBound);
412+
cmp=compareJsQueryItem(child->bounds.rightBound,rightBound);
413413
if (cmp>0)
414414
{
415415
rightBound=child->bounds.rightBound;
@@ -593,7 +593,7 @@ ExtractedNode *
593593
extractJsQuery(JsQuery*jq,MakeEntryHandlerhandler,Pointerextra)
594594
{
595595
ExtractedNode*root;
596-
JsQueryItemRjsq;
596+
JsQueryItemjsq;
597597

598598
jsqInit(&jsq,jq);
599599
root=recursiveExtract(&jsq, false,NULL);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp