From: | dakotali kasap <dakotalidavid(at)yahoo(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | cannot add to postgresql project my own source files |
Date: | 2006-12-23 14:35:10 |
Message-ID: | 20061223143510.81029.qmail@web31302.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
I want to write a function that takes the raw parsetree and rewrites it according to my rules, then produce new raw parsetrees.
I will call this function inside backend/tcop/postgres.c . I wrote an header file called my_rewriter.h and include this inside postgres.c.
my_writer.h looks like:
-------------------------------------------------
#ifndef UWSDREWRITE_H
#define UWSDREWRITE_H
#include "nodes/pg_list.h"
#include "nodes/nodes.h"
typedef struct my_Projection
{
char *relname;
List attnames;
char *result_relname;
} my_Projection;
.
.
.
extern void my_analyze(Node *parsetree);
extern void my_rewrite(List *parsetree_list);
#endif UWSDREWRITE_H
---------------------------------------------
Then I wrote a C file called my_writer.c, and do the implementation of my_analyze(Node *parsetree) and my_rewrite(List *parsetree_list) functions. I need Node and List structures here, but when I include the necessary header files (#include "nodes/pg_list.h", #include "nodes/nodes.h"), I got errors at compile time like:
---------------------------------------
../../../src/include/nodes/nodes.h:359: error: syntax error before ‘Node’
../../../src/include/nodes/nodes.h:398: error: syntax error before ‘equal’
../../../src/include/nodes/nodes.h:398: warning: type defaults to ‘int’ in declaration of ‘equal’
../../../src/include/nodes/nodes.h:398: warning: data definition has no type or storage class
----------------------------------------
So, I think there is a problem with the Makefiles but I do not know what. I added the object file my_writer.o to the Makefile inside backend/parser/Makefile and configured again, but it did not work, what else should I do?
regards,
dakotali
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | ohp | 2006-12-23 14:45:19 | libxml on unixware |
Previous Message | Shane Ambler | 2006-12-23 11:07:30 | Re: Strange pgsql crash on MacOSX |