@@ -172,15 +172,15 @@ network_out(inet *src, bool is_cidr)
172172Datum
173173inet_out (PG_FUNCTION_ARGS )
174174{
175- inet * src = PG_GETARG_INET_P (0 );
175+ inet * src = PG_GETARG_INET_PP (0 );
176176
177177 PG_RETURN_CSTRING (network_out (src , false));
178178}
179179
180180Datum
181181cidr_out (PG_FUNCTION_ARGS )
182182{
183- inet * src = PG_GETARG_INET_P (0 );
183+ inet * src = PG_GETARG_INET_PP (0 );
184184
185185 PG_RETURN_CSTRING (network_out (src , true));
186186}
@@ -299,15 +299,15 @@ network_send(inet *addr, bool is_cidr)
299299Datum
300300inet_send (PG_FUNCTION_ARGS )
301301{
302- inet * addr = PG_GETARG_INET_P (0 );
302+ inet * addr = PG_GETARG_INET_PP (0 );
303303
304304 PG_RETURN_BYTEA_P (network_send (addr , false));
305305}
306306
307307Datum
308308cidr_send (PG_FUNCTION_ARGS )
309309{
310- inet * addr = PG_GETARG_INET_P (0 );
310+ inet * addr = PG_GETARG_INET_PP (0 );
311311
312312 PG_RETURN_BYTEA_P (network_send (addr , true));
313313}
@@ -316,7 +316,7 @@ cidr_send(PG_FUNCTION_ARGS)
316316Datum
317317inet_to_cidr (PG_FUNCTION_ARGS )
318318{
319- inet * src = PG_GETARG_INET_P (0 );
319+ inet * src = PG_GETARG_INET_PP (0 );
320320 inet * dst ;
321321 int bits ;
322322 int byte ;
@@ -357,7 +357,7 @@ inet_to_cidr(PG_FUNCTION_ARGS)
357357Datum
358358inet_set_masklen (PG_FUNCTION_ARGS )
359359{
360- inet * src = PG_GETARG_INET_P (0 );
360+ inet * src = PG_GETARG_INET_PP (0 );
361361 int bits = PG_GETARG_INT32 (1 );
362362 inet * dst ;
363363
@@ -381,7 +381,7 @@ inet_set_masklen(PG_FUNCTION_ARGS)
381381Datum
382382cidr_set_masklen (PG_FUNCTION_ARGS )
383383{
384- inet * src = PG_GETARG_INET_P (0 );
384+ inet * src = PG_GETARG_INET_PP (0 );
385385 int bits = PG_GETARG_INT32 (1 );
386386 inet * dst ;
387387 int byte ;
@@ -457,8 +457,8 @@ network_cmp_internal(inet *a1, inet *a2)
457457Datum
458458network_cmp (PG_FUNCTION_ARGS )
459459{
460- inet * a1 = PG_GETARG_INET_P (0 );
461- inet * a2 = PG_GETARG_INET_P (1 );
460+ inet * a1 = PG_GETARG_INET_PP (0 );
461+ inet * a2 = PG_GETARG_INET_PP (1 );
462462
463463 PG_RETURN_INT32 (network_cmp_internal (a1 , a2 ));
464464}
@@ -469,53 +469,53 @@ network_cmp(PG_FUNCTION_ARGS)
469469Datum
470470network_lt (PG_FUNCTION_ARGS )
471471{
472- inet * a1 = PG_GETARG_INET_P (0 );
473- inet * a2 = PG_GETARG_INET_P (1 );
472+ inet * a1 = PG_GETARG_INET_PP (0 );
473+ inet * a2 = PG_GETARG_INET_PP (1 );
474474
475475 PG_RETURN_BOOL (network_cmp_internal (a1 , a2 ) < 0 );
476476}
477477
478478Datum
479479network_le (PG_FUNCTION_ARGS )
480480{
481- inet * a1 = PG_GETARG_INET_P (0 );
482- inet * a2 = PG_GETARG_INET_P (1 );
481+ inet * a1 = PG_GETARG_INET_PP (0 );
482+ inet * a2 = PG_GETARG_INET_PP (1 );
483483
484484 PG_RETURN_BOOL (network_cmp_internal (a1 , a2 ) <= 0 );
485485}
486486
487487Datum
488488network_eq (PG_FUNCTION_ARGS )
489489{
490- inet * a1 = PG_GETARG_INET_P (0 );
491- inet * a2 = PG_GETARG_INET_P (1 );
490+ inet * a1 = PG_GETARG_INET_PP (0 );
491+ inet * a2 = PG_GETARG_INET_PP (1 );
492492
493493 PG_RETURN_BOOL (network_cmp_internal (a1 , a2 ) == 0 );
494494}
495495
496496Datum
497497network_ge (PG_FUNCTION_ARGS )
498498{
499- inet * a1 = PG_GETARG_INET_P (0 );
500- inet * a2 = PG_GETARG_INET_P (1 );
499+ inet * a1 = PG_GETARG_INET_PP (0 );
500+ inet * a2 = PG_GETARG_INET_PP (1 );
501501
502502 PG_RETURN_BOOL (network_cmp_internal (a1 , a2 ) >= 0 );
503503}
504504
505505Datum
506506network_gt (PG_FUNCTION_ARGS )
507507{
508- inet * a1 = PG_GETARG_INET_P (0 );
509- inet * a2 = PG_GETARG_INET_P (1 );
508+ inet * a1 = PG_GETARG_INET_PP (0 );
509+ inet * a2 = PG_GETARG_INET_PP (1 );
510510
511511 PG_RETURN_BOOL (network_cmp_internal (a1 , a2 ) > 0 );
512512}
513513
514514Datum
515515network_ne (PG_FUNCTION_ARGS )
516516{
517- inet * a1 = PG_GETARG_INET_P (0 );
518- inet * a2 = PG_GETARG_INET_P (1 );
517+ inet * a1 = PG_GETARG_INET_PP (0 );
518+ inet * a2 = PG_GETARG_INET_PP (1 );
519519
520520 PG_RETURN_BOOL (network_cmp_internal (a1 , a2 ) != 0 );
521521}
@@ -526,7 +526,7 @@ network_ne(PG_FUNCTION_ARGS)
526526Datum
527527hashinet (PG_FUNCTION_ARGS )
528528{
529- inet * addr = PG_GETARG_INET_P (0 );
529+ inet * addr = PG_GETARG_INET_PP (0 );
530530 int addrsize = ip_addrsize (addr );
531531
532532 /* XXX this assumes there are no pad bytes in the data structure */
@@ -539,8 +539,8 @@ hashinet(PG_FUNCTION_ARGS)
539539Datum
540540network_sub (PG_FUNCTION_ARGS )
541541{
542- inet * a1 = PG_GETARG_INET_P (0 );
543- inet * a2 = PG_GETARG_INET_P (1 );
542+ inet * a1 = PG_GETARG_INET_PP (0 );
543+ inet * a2 = PG_GETARG_INET_PP (1 );
544544
545545 if (ip_family (a1 ) == ip_family (a2 ))
546546 {
@@ -554,8 +554,8 @@ network_sub(PG_FUNCTION_ARGS)
554554Datum
555555network_subeq (PG_FUNCTION_ARGS )
556556{
557- inet * a1 = PG_GETARG_INET_P (0 );
558- inet * a2 = PG_GETARG_INET_P (1 );
557+ inet * a1 = PG_GETARG_INET_PP (0 );
558+ inet * a2 = PG_GETARG_INET_PP (1 );
559559
560560 if (ip_family (a1 ) == ip_family (a2 ))
561561 {
@@ -569,8 +569,8 @@ network_subeq(PG_FUNCTION_ARGS)
569569Datum
570570network_sup (PG_FUNCTION_ARGS )
571571{
572- inet * a1 = PG_GETARG_INET_P (0 );
573- inet * a2 = PG_GETARG_INET_P (1 );
572+ inet * a1 = PG_GETARG_INET_PP (0 );
573+ inet * a2 = PG_GETARG_INET_PP (1 );
574574
575575 if (ip_family (a1 ) == ip_family (a2 ))
576576 {
@@ -584,8 +584,8 @@ network_sup(PG_FUNCTION_ARGS)
584584Datum
585585network_supeq (PG_FUNCTION_ARGS )
586586{
587- inet * a1 = PG_GETARG_INET_P (0 );
588- inet * a2 = PG_GETARG_INET_P (1 );
587+ inet * a1 = PG_GETARG_INET_PP (0 );
588+ inet * a2 = PG_GETARG_INET_PP (1 );
589589
590590 if (ip_family (a1 ) == ip_family (a2 ))
591591 {
@@ -602,7 +602,7 @@ network_supeq(PG_FUNCTION_ARGS)
602602Datum
603603network_host (PG_FUNCTION_ARGS )
604604{
605- inet * ip = PG_GETARG_INET_P (0 );
605+ inet * ip = PG_GETARG_INET_PP (0 );
606606 char * ptr ;
607607 char tmp [sizeof ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128" )];
608608
@@ -628,7 +628,7 @@ network_host(PG_FUNCTION_ARGS)
628628Datum
629629network_show (PG_FUNCTION_ARGS )
630630{
631- inet * ip = PG_GETARG_INET_P (0 );
631+ inet * ip = PG_GETARG_INET_PP (0 );
632632 int len ;
633633 char tmp [sizeof ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128" )];
634634
@@ -651,7 +651,7 @@ network_show(PG_FUNCTION_ARGS)
651651Datum
652652inet_abbrev (PG_FUNCTION_ARGS )
653653{
654- inet * ip = PG_GETARG_INET_P (0 );
654+ inet * ip = PG_GETARG_INET_PP (0 );
655655 char * dst ;
656656 char tmp [sizeof ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128" )];
657657
@@ -669,7 +669,7 @@ inet_abbrev(PG_FUNCTION_ARGS)
669669Datum
670670cidr_abbrev (PG_FUNCTION_ARGS )
671671{
672- inet * ip = PG_GETARG_INET_P (0 );
672+ inet * ip = PG_GETARG_INET_PP (0 );
673673 char * dst ;
674674 char tmp [sizeof ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128" )];
675675
@@ -687,15 +687,15 @@ cidr_abbrev(PG_FUNCTION_ARGS)
687687Datum
688688network_masklen (PG_FUNCTION_ARGS )
689689{
690- inet * ip = PG_GETARG_INET_P (0 );
690+ inet * ip = PG_GETARG_INET_PP (0 );
691691
692692 PG_RETURN_INT32 (ip_bits (ip ));
693693}
694694
695695Datum
696696network_family (PG_FUNCTION_ARGS )
697697{
698- inet * ip = PG_GETARG_INET_P (0 );
698+ inet * ip = PG_GETARG_INET_PP (0 );
699699
700700 switch (ip_family (ip ))
701701 {
@@ -714,7 +714,7 @@ network_family(PG_FUNCTION_ARGS)
714714Datum
715715network_broadcast (PG_FUNCTION_ARGS )
716716{
717- inet * ip = PG_GETARG_INET_P (0 );
717+ inet * ip = PG_GETARG_INET_PP (0 );
718718 inet * dst ;
719719 int byte ;
720720 int bits ;
@@ -763,7 +763,7 @@ network_broadcast(PG_FUNCTION_ARGS)
763763Datum
764764network_network (PG_FUNCTION_ARGS )
765765{
766- inet * ip = PG_GETARG_INET_P (0 );
766+ inet * ip = PG_GETARG_INET_PP (0 );
767767 inet * dst ;
768768 int byte ;
769769 int bits ;
@@ -807,7 +807,7 @@ network_network(PG_FUNCTION_ARGS)
807807Datum
808808network_netmask (PG_FUNCTION_ARGS )
809809{
810- inet * ip = PG_GETARG_INET_P (0 );
810+ inet * ip = PG_GETARG_INET_PP (0 );
811811 inet * dst ;
812812 int byte ;
813813 int bits ;
@@ -849,7 +849,7 @@ network_netmask(PG_FUNCTION_ARGS)
849849Datum
850850network_hostmask (PG_FUNCTION_ARGS )
851851{
852- inet * ip = PG_GETARG_INET_P (0 );
852+ inet * ip = PG_GETARG_INET_PP (0 );
853853 inet * dst ;
854854 int byte ;
855855 int bits ;
@@ -1218,7 +1218,7 @@ inet_server_port(PG_FUNCTION_ARGS)
12181218Datum
12191219inetnot (PG_FUNCTION_ARGS )
12201220{
1221- inet * ip = PG_GETARG_INET_P (0 );
1221+ inet * ip = PG_GETARG_INET_PP (0 );
12221222 inet * dst ;
12231223
12241224 dst = (inet * ) palloc0 (sizeof (inet ));
@@ -1243,8 +1243,8 @@ inetnot(PG_FUNCTION_ARGS)
12431243Datum
12441244inetand (PG_FUNCTION_ARGS )
12451245{
1246- inet * ip = PG_GETARG_INET_P (0 );
1247- inet * ip2 = PG_GETARG_INET_P (1 );
1246+ inet * ip = PG_GETARG_INET_PP (0 );
1247+ inet * ip2 = PG_GETARG_INET_PP (1 );
12481248 inet * dst ;
12491249
12501250 dst = (inet * ) palloc0 (sizeof (inet ));
@@ -1275,8 +1275,8 @@ inetand(PG_FUNCTION_ARGS)
12751275Datum
12761276inetor (PG_FUNCTION_ARGS )
12771277{
1278- inet * ip = PG_GETARG_INET_P (0 );
1279- inet * ip2 = PG_GETARG_INET_P (1 );
1278+ inet * ip = PG_GETARG_INET_PP (0 );
1279+ inet * ip2 = PG_GETARG_INET_PP (1 );
12801280 inet * dst ;
12811281
12821282 dst = (inet * ) palloc0 (sizeof (inet ));
@@ -1359,7 +1359,7 @@ internal_inetpl(inet *ip, int64 addend)
13591359Datum
13601360inetpl (PG_FUNCTION_ARGS )
13611361{
1362- inet * ip = PG_GETARG_INET_P (0 );
1362+ inet * ip = PG_GETARG_INET_PP (0 );
13631363 int64 addend = PG_GETARG_INT64 (1 );
13641364
13651365 PG_RETURN_INET_P (internal_inetpl (ip , addend ));
@@ -1369,7 +1369,7 @@ inetpl(PG_FUNCTION_ARGS)
13691369Datum
13701370inetmi_int8 (PG_FUNCTION_ARGS )
13711371{
1372- inet * ip = PG_GETARG_INET_P (0 );
1372+ inet * ip = PG_GETARG_INET_PP (0 );
13731373 int64 addend = PG_GETARG_INT64 (1 );
13741374
13751375 PG_RETURN_INET_P (internal_inetpl (ip , - addend ));
@@ -1379,8 +1379,8 @@ inetmi_int8(PG_FUNCTION_ARGS)
13791379Datum
13801380inetmi (PG_FUNCTION_ARGS )
13811381{
1382- inet * ip = PG_GETARG_INET_P (0 );
1383- inet * ip2 = PG_GETARG_INET_P (1 );
1382+ inet * ip = PG_GETARG_INET_PP (0 );
1383+ inet * ip2 = PG_GETARG_INET_PP (1 );
13841384 int64 res = 0 ;
13851385
13861386 if (ip_family (ip ) != ip_family (ip2 ))
0 commit comments