#include <stdbool.h>
#include <stdio.h>
#include <stdint.h> 

/*
 * #include "access/xact.h"
#include "commands/event_trigger.h"
#include "commands/trigger.h"
#include "executor/spi.h"
*/

#define MAXIMUM_ALIGNOF 8

#define TYPEALIGN(ALIGNVAL,LEN)  \
       (((uintptr_t) (LEN) + ((ALIGNVAL) - 1)) & ~((uintptr_t) ((ALIGNVAL) - 1)))
#define MAXALIGN(LEN) TYPEALIGN(MAXIMUM_ALIGNOF, (LEN))

/*
 *   * Datum array node types
 *     */
typedef enum PLpgSQL_datum_type
{
  PLPGSQL_DTYPE_VAR,
  PLPGSQL_DTYPE_ROW,
  PLPGSQL_DTYPE_REC,
  PLPGSQL_DTYPE_RECFIELD,
  PLPGSQL_DTYPE_ARRAYELEM,
  PLPGSQL_DTYPE_EXPR
} PLpgSQL_datum_type;

/*
 *   * Scalar variable
 *     */
typedef struct PLpgSQL_var
{
    PLpgSQL_datum_type dtype;
    int         dno;
    char       *refname;
    int         lineno;

/*    PLpgSQL_type *datatype; */
    char *datatype; 

    bool        isconst;
    bool        notnull;
/*    PLpgSQL_expr *default_val;
    PLpgSQL_expr *cursor_explicit_expr; */
    char        *default_val;
    char        *cursor_explicit_expr;

    int         cursor_explicit_argrow;
    int         cursor_options;

    bool        isnull;
    bool        freeval;
} PLpgSQL_var;

int main(void)
	 {
		 int i = MAXALIGN(sizeof(PLpgSQL_var));
		 printf( "MAXALIGN(sizeof(PLpgSQL_var)=%i\n", i);
		 
		 return 0;
	 }