#--------------------------------------------------------------------
#database definition
-shared : libposql
+shared : libposql libmysql
mv -f libposql.so.1.0 ../shared
ln -nsf libposql.so.1.0 ../shared/libposql.so.1
+ mv -f libmysql.so.1.0 ../shared
+ ln -nsf libmysql.so.1.0 ../shared/libmysql.so.1
libposql: unipos.o
$(CC) -shared -Wl,-soname,$@.so.1 -o $@.so.1.0 unipos.o
+libmysql: unisql.o
+ $(CC) -shared -Wl,-soname,$@.so.1 -o $@.so.1.0 unisql.o
+
unipos.o: unipos.h
$(CC) $(CFLAGS) -c -fPIC -o $@ unipos.c
+unisql.o: unisql.h
+ $(CC) $(CFLAGS) -c -fPIC -o $@ unisql.c
+
#--------------------------------------------------------------------
#Equivalences
#--------------------------------------------------------------------
.PHONY: clean
#--------------------------------------------------------------------
#database USED POSQL->Postgresql, MYSQL->mysql|mariadb
-DATABASE= MYSQL
+DATABASE= POSQL
#--------------------------------------------------------------------
#definitions
#--------------------------------------------------------------------
--- /dev/null
+// vim: smarttab tabstop=8 shiftwidth=2 expandtab
+/********************************************************/
+/* */
+/* Low level subroutine implementation */
+/* to handle POSTGRES SQL request */
+/* */
+/********************************************************/
+#include "subrou.h"
+#include "unisql.h"
+
+/*
+\f
+*/
+/********************************************************/
+/* */
+/* Procedure to report database is not implemented */
+/* */
+/********************************************************/
+#ifndef MYSQL
+static void notavail()
+
+{
+char *cmt="Postgresql Database access is NOT implemented (config?)";
+
+(void) fprintf(stderr,"%s\n",cmt);
+}
+#endif
+/*
+\f
+*/
+/********************************************************/
+/* */
+/* Procedure to establish a link with the */
+/* postgresq SQL server. */
+/* */
+/********************************************************/
+PUBLIC SQLPTR *sql_opensql(const char *host,const char *sqlport,const char *dbname)
+
+{
+#define OPEP "unisql.c:sql_opensql,"
+
+SQLPTR *sqlptr;
+
+sqlptr=(SQLPTR *)0;
+#ifdef MYSQL
+ {
+ (void) fprintf(stderr,"%s\n","To be implemented");
+ }
+#else
+ {
+ (void) notavail();
+ }
+#endif
+return sqlptr;
+#undef OPEP
+}
+/*
+\f
+*/
+/********************************************************/
+/* */
+/* Procedure to close the link with the designated */
+/* postgresql SQL server. */
+/* */
+/********************************************************/
+PUBLIC SQLPTR *sql_closesql(SQLPTR *sqlptr)
+
+{
+#define OPEP "sqlpos.c:sql_closesql,"
+
+#ifdef MYSQL
+ {
+ (void) fprintf(stderr,"%s\n","To be implemented");
+ }
+#else
+ {
+ (void) notavail();
+ }
+#endif
+return sqlptr;
+#undef OPEP
+}
+
+
--- /dev/null
+// vim: smarttab tabstop=8 shiftwidth=2 expandtab
+/********************************************************/
+/* */
+/* Base level subroutine declaration */
+/* to handle MYSQL/MARIADB SQL request. */
+/* */
+/********************************************************/
+#ifndef UNISQL
+#define UNISQL
+
+//reference to a SQL pointer reference
+typedef void SQLPTR;
+
+//Opening a postscript database
+extern SQLPTR *sql_opensql(const char *host,const char *sqlport,const char *dbname);
+
+//closing a postscript database
+extern SQLPTR *sql_closesql(SQLPTR *sqlptr);
+
+#endif