Skip to content

Commit bfa87d1

Browse files
committed
make beauty
1 parent 910f9aa commit bfa87d1

File tree

5 files changed

+50
-18
lines changed

5 files changed

+50
-18
lines changed

jsonb_gin_ops.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* jsonb_gin_ops.c
4+
* Support GIN over jsonb with jsquery operation
5+
*
6+
* Copyright (c) 2014, PostgreSQL Global Development Group
7+
* Author: Alexander Korotkov <aekorotkov@gmail.com>
8+
*
9+
* IDENTIFICATION
10+
* contrib/jsquery/jsonb_gin_ops.c
11+
*
12+
*-------------------------------------------------------------------------
13+
*/
14+
115
#include "postgres.h"
216

317
#include "access/hash.h"

jsquery.h

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

57+
/*
58+
* Support functions to parse/construct binary value
59+
*/
60+
5761
typedef struct JsQueryItem {
5862
JsQueryItemType type;
5963
int32 nextPos;
@@ -94,6 +98,8 @@ extern char * jsqGetString(JsQueryItem *v, int32 *len);
9498
extern void jsqIterateInit(JsQueryItem *v);
9599
extern bool jsqIterateArray(JsQueryItem *v, JsQueryItem *e);
96100

101+
void alignStringInfoInt(StringInfo buf);
102+
97103
/*
98104
* Parsing
99105
*/
@@ -128,8 +134,6 @@ struct JsQueryParseItem {
128134

129135
extern JsQueryParseItem* parsejsquery(const char *str, int len);
130136

131-
void alignStringInfoInt(StringInfo buf);
132-
133137
/* jsquery_extract.c */
134138

135139
typedef enum

jsquery_extract.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* jsquery_extract.c
4+
* Functions and operations to support jsquery in indexes
5+
*
6+
* Copyright (c) 2014, PostgreSQL Global Development Group
7+
* Author: Alexander Korotkov <aekorotkov@gmail.com>
8+
*
9+
* IDENTIFICATION
10+
* contrib/jsquery/jsquery_extract.c
11+
*
12+
*-------------------------------------------------------------------------
13+
*/
14+
115
#include "postgres.h"
216

317
#include "access/gin.h"

jsquery_io.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,6 @@
2222

2323
PG_MODULE_MAGIC;
2424

25-
void
26-
alignStringInfoInt(StringInfo buf)
27-
{
28-
switch(INTALIGN(buf->len) - buf->len)
29-
{
30-
case 3:
31-
appendStringInfoCharMacro(buf, 0);
32-
case 2:
33-
appendStringInfoCharMacro(buf, 0);
34-
case 1:
35-
appendStringInfoCharMacro(buf, 0);
36-
default:
37-
break;
38-
}
39-
}
40-
4125
static int
4226
flattenJsQueryParseItem(StringInfo buf, JsQueryParseItem *item)
4327
{

jsquery_support.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@
2626
(p) += sizeof(int32); \
2727
} while(0) \
2828

29+
void
30+
alignStringInfoInt(StringInfo buf)
31+
{
32+
switch(INTALIGN(buf->len) - buf->len)
33+
{
34+
case 3:
35+
appendStringInfoCharMacro(buf, 0);
36+
case 2:
37+
appendStringInfoCharMacro(buf, 0);
38+
case 1:
39+
appendStringInfoCharMacro(buf, 0);
40+
default:
41+
break;
42+
}
43+
}
44+
2945
void
3046
jsqInit(JsQueryItem *v, JsQuery *js)
3147
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy