array handling c functions - Mailing list pgsql-general

From Victor Ivanov
Subject array handling c functions
Date
Msg-id Pine.BSF.4.21.0009201208560.88917-100000@icon.icon-bg.net
Whole thread Raw
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----

Hello,

I'm (trying to) write a C function to search in array. The array is of
user-defined type (time interval, start and end minute of the day, and
start and end days of the week):

struct tzone {
  int begday, endday, begmin, endmin;
  int key;
};

(n1: i know begday and endday could be chars but i really hate that memory
alignment GCC does to my structs (and don't want to mess with
__attributes__))

(n2: the type is registered and there are functions tzone_in, tzone_out)

The problematic function should search for a tzone which includes a given
DATETIME.

I have PostrgeSQL 7.0.2 and have read most of the documents for
programming C functions postgresql. There is a table which describes how
sql types are named in C, and I can se DateTime * (structure?) for the
DATETIME type, defined in c.h and/or postgresql.h... but there is no
DateTime anywhere in the source :/

And there is no help about handling arrays from C.

Do I have to look deeper in the docs? Or should I browse the source? Or
there is easier way to implement this..

Sorry for the 'english' :)

Players win and Winners play
Have a lucky day

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.1i

iQCVAwUBOciHTfD9M5lef5W3AQF8DgQAn7nVmrG+w+he7zYKcfVTa3cA84op+IP9
PSllsXxtX8h/er0XcbTNoa8ucBAU0yQg6qGHjifUMdum8HEADrQJdYzRdEFI4/tn
IK1TSm072Jy3qdnBn9vwV5cuprzrXs7mSOXMdxdPn0QLnJdou6QwOuhcPD0+4Dbc
8QHC2l2NVJQ=
=AGv2
-----END PGP SIGNATURE-----



pgsql-general by date:

Previous
From: Zeljko Trogrlic
Date:
Subject: RE: Latest JDBC Driver? Where?
Next
From: Gilles DAROLD
Date:
Subject: Re: Proposal for new PL/Perl README