delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/08/28/11:30:25

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <004c01c24ea7$e6c99230$46ca09c0@aniraj>
Reply-To: "Niraj Agarwal" <niraja AT npi DOT stpn DOT soft DOT net>
From: "Niraj Agarwal" <niraja AT npi DOT stpn DOT soft DOT net>
To: "cygwin" <cygwin AT cygwin DOT com>
References: <002501c24ea2$79a52610$46ca09c0 AT aniraj>
Subject: Re: Inclusion of windows dll into cygwin code
Date: Wed, 28 Aug 2002 21:00:55 +0530
MIME-Version: 1.0
X-Priority: 1
X-MSMail-Priority: High
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Virus-Scanned: by AMaViS perl-11

------=_NextPart_000_004A_01C24ED6.00678F70
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: base64

SGkgQWxsLA0KDQpQbGVhc2UgZmluZCB0aGUgYXR0YWNoZWQgY29kZSBhbmQgbWFrZSBmaWxlLiAN
Cg0KSSBhbSB0cnlpbmcgdG8gdXNlIE9yYWNsZSBETEwgaW50byBteSBjIHByb2dyYW0gdXNpbmcg
YSBwcm9jLg0KDQpFdmVydGhpbmcgaXMgZ29pbmcgc21vb3RobHkgYW5kIGkgYW0gYWJsZSB0byBn
ZW5lcmF0ZSB0aGUgZXhlLg0KDQpBcyBpIHJ1biB0aGUgZXhlIGkgYW0gZ2V0dGluZyB0aGlzIGVy
cm9yLg0KDQptLkFsbG9jYXRpb25CYXNlIDB4MCwgbS5CYXNlQWRkcmVzcyA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IHJlcG9ydGluZzogICAgICAgICBodHRwOi8vY3lnd2luLmNvbS9idWdzLmh0bWwNCj4g
RG9jdW1lbnRhdGlvbjogICAgICAgICBodHRwOi8vY3lnd2luLmNvbS9kb2NzLmh0bWwNCj4gRkFR
OiAgICAgICAgICAgICAgICAgICBodHRwOi8vY3lnd2luLmNvbS9mYXEvDQo=

------=_NextPart_000_004A_01C24ED6.00678F70
Content-Type: application/octet-stream;
	name="Makefile"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Makefile"

include defs.mk=0A=
#=0A=
# makefile for vuit generated applications.=0A=
#=0A=
=0A=
#=0A=
# Need extra suffixes for uid file compilation.=0A=
#=0A=
.SUFFIXES: .pc=0A=
=0A=
CINCLUDES =3D	-I. -I$(PCCINCLUDE) =0A=
LOCALCFLAGS =3D	-g $(CINCLUDES)   =0A=
=0A=
LINTFLAGS=3D	$(CINCLUDES)=0A=
=0A=
=0A=
LIBS =3D	=0A=
=0A=
SRCS =3D main.c=0A=
=0A=
SRCPCS =3D example.pc =0A=
=0A=
OBJS =3D example.o =0A=
=0A=
IMAGE =3D  my_example =0A=
=0A=
                                                                        =0A=
all : $(IMAGE) =0A=
=0A=
=0A=
$(IMAGE) : $(OBJS) =0A=
	$(CC) -g -o $(IMAGE) $(OBJS) $(LDFLAGS) $(LIBS) $(ORALIBS) =0A=
	echo "Completed"=0A=
=0A=
#main.o: main.c =0A=
=0A=
example.o: example.pc example.c =0A=
=0A=
=0A=
#.DEFAULT:=0A=
#	co $<=0A=
=0A=
clean:=0A=
	rm -f *.o $(IMAGE) $(SRCPCS:.pc=3D.c)=0A=
=0A=
=0A=
=0A=
# DO NOT DELETE THIS LINE -- make depend depends on it.=0A=

------=_NextPart_000_004A_01C24ED6.00678F70
Content-Type: application/octet-stream;
	name="defs.mk"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="defs.mk"

# default.alpha.mk=0A=
=0A=
.SUFFIXES: .gen .mth .cxpc .cxx .pc .o .h .c=0A=
=0A=
_V6COMP=3DDBMS=3DNATIVE=0A=
=0A=
=0A=
CC =3D gcc =0A=
#$(X_LIB_INCLUDES) -D_SUNCC=0A=
#CXX =3D cxx -fno-strict-prototype $(X_LIB_INCLUDES) -D_SUNCC=0A=
=0A=
OPTIM =3D -O -Olimit 2000=0A=
DEBUG =3D -g=0A=
=0A=
CFLAGS =3D $(DEBUG)=0A=
LOCALCFLAGS=3D=0A=
CXXFLAGS =3D $(DEBUG)=0A=
LOCALCXXFLAGS=3D=0A=
=0A=
PCCINCLUDE=3D$(ORACLE_BASE)/precomp/public=0A=
SQLCHECK=3Dsqlcheck=3Dfull userid=3Dhotdb/hotdb AT sladb=0A=
PROCFLAGS=3Direclen=3D1024 oreclen=3D1024 ltype=3Dnone select_error=3Dno =
$(SQLCHECK) $(_V6COMP) MAXOPENCURSORS=3D255=0A=
PROCXXFLAGS=3Direclen=3D1024 oreclen=3D1024 ltype=3Dnone =
select_error=3Dno $(SQLCHECK) $(_V6COMP) MAXOPENCURSORS=3D255 code=3Dcpp=0A=
=0A=
LOCALPROCFLAGS=3Dinclude=3D. include=3D$(PCCINCLUDE) =0A=
=0A=
#ORA_LIB_DIR=3D$(ORACLE_HOME)/PRO22/C/INCLUDE=0A=
ORALIBS=3D$(ORACLE_BASE)/precomp/LIB/MSVC/oraSQL8.LIB=0A=
=0A=
=0A=
=0A=
.pc.o :=0A=
	rm -f $(<:.pc=3D.c)=0A=
	(proc $(PROCFLAGS) $(LOCALPROCFLAGS) iname=3D$< oname=3D$(<:.pc=3D.c) )=0A=
	rm -f $(<:.pc=3D.lis)=0A=
	dos2unix $(<:.pc=3D.c)=0A=
	chmod a-w $(<:.pc=3D.c)=0A=
	$(CC) -g -c $(CFLAGS) $(LOCALCFLAGS) -I$(PCCINCLUDE) $(<:.pc=3D.c)=0A=
=0A=
=0A=
.c.o :=0A=
	$(CC) -g -c $(CFLAGS) $(LOCALCFLAGS) $<=0A=
=0A=
.pc.c : =0A=
	rm -f $(<:.pc=3D.c)=0A=
	(proc $(PROCFLAGS) $(LOCALPROCFLAGS) iname=3D$< oname=3D$(<:.pc=3D.c) )=0A=
	rm -f $(<:.pc=3D.lis)=0A=
	dos2unix $(<:.pc=3D.c)=0A=
	chmod a-w $(<:.pc=3D.c)=0A=
=0A=
=0A=
=0A=
=0A=
=0A=

------=_NextPart_000_004A_01C24ED6.00678F70
Content-Type: application/octet-stream;
	name="dos2unix"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="dos2unix"

chmod +rw $1 =0A=
cat $1 | tr -d '\r' > /tmp/$1 =0A=
cat /tmp/$1 >  $1=0A=

------=_NextPart_000_004A_01C24ED6.00678F70
Content-Type: application/octet-stream;
	name="example.pc"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="example.pc"

=0A=
#include <stdio.h>=0A=
#include <string.h>=0A=
#include <stdlib.h>=0A=
#include <sqlda.h>=0A=
=0A=
=0A=
/* Include the SQL Communications Area.=0A=
   You can use #include or EXEC SQL INCLUDE. */=0A=
#include <sqlca.h>=0A=
=0A=
/* Declare error handling function. */=0A=
void sql_error(msg)=0A=
    char *msg;=0A=
{=0A=
    char err_msg[128];=0A=
    size_t buf_len, msg_len;=0A=
=0A=
    EXEC SQL WHENEVER SQLERROR CONTINUE;=0A=
=0A=
    printf("\n%s\n", msg);=0A=
    buf_len =3D sizeof (err_msg);=0A=
    sqlglm(err_msg, &buf_len, &msg_len);=0A=
    printf("%.*s\n", msg_len, err_msg);=0A=
=0A=
    EXEC SQL ROLLBACK RELEASE;=0A=
    exit(EXIT_FAILURE);=0A=
}=0A=
=0A=
void example_proc()=0A=
{=0A=
=0A=
EXEC SQL BEGIN DECLARE SECTION;=0A=
=0A=
varchar     username[80];  =0A=
varchar     the_nomacc[20]; =0A=
varchar     temp[20]; =0A=
=0A=
EXEC SQL END DECLARE SECTION;=0A=
=0A=
/* Include the SQL Communications Area.=0A=
   You can use #include or EXEC SQL INCLUDE. */=0A=
#include <sqlca.h>=0A=
=0A=
=0A=
/* Connect to ORACLE--=0A=
 * Copy the username into the VARCHAR.=0A=
 */=0A=
    strcpy((char *) username.arr, "hotdb/hotdb AT sladb");=0A=
=0A=
/* Set the length component of the VARCHAR. */=0A=
    username.len =3D =0A=
      (unsigned short) strlen((char *) username.arr);=0A=
=0A=
=0A=
/* Register sql_error() as the error handler. */=0A=
    EXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE error--\n");=0A=
=0A=
/* Connect to ORACLE.  Program will call sql_error()=0A=
 * if an error occurs when connecting to the  database.=0A=
 */=0A=
=0A=
    EXEC SQL CONNECT :username;=0A=
=0A=
    printf("\nConnected to ORACLE as user: %s\n", username.arr);=0A=
=0A=
=0A=
=0A=
  	EXEC SQL SELECT to_char(sysdate,'DD-MON-YYYY') into :temp=0A=
	from dual;=0A=
	=0A=
=0A=
        temp.arr[temp.len] =3D '\0';=0A=
=0A=
        printf("ORACLE date is:%s\n", temp.arr);=0A=
=0A=
/* Branch to the notfound label when the=0A=
 * 1403 ("No data found") condition occurs.=0A=
 */=0A=
        EXEC SQL WHENEVER NOT FOUND GOTO notfound;=0A=
=0A=
=0A=
/*=0A=
        EXEC SQL SELECT nomacc =0A=
            INTO :the_nomacc=0A=
            FROM INTERPRETE =0A=
            WHERE matricule =3D 510022;=0A=
=0A=
*/=0A=
/* Null-terminate the output string data. */=0A=
        the_nomacc.arr[the_nomacc.len] =3D '\0';=0A=
        printf("%s\n",=0A=
            the_nomacc.arr);=0A=
=0A=
    	//EXEC SQL ROLLBACK WORK RELEASE;=0A=
=0A=
	return;=0A=
=0A=
notfound:=0A=
        printf("\nNomacc not found - try again.\n");=0A=
=0A=
=0A=
=0A=
/* Disconnect from ORACLE. */=0A=
    //EXEC SQL ROLLBACK WORK RELEASE;=0A=
=0A=
/*=0A=
    exit(EXIT_SUCCESS);=0A=
*/=0A=
}=0A=
=0A=
main()=0A=
{=0A=
	example_proc();=0A=
}=0A=
=0A=


------=_NextPart_000_004A_01C24ED6.00678F70
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
------=_NextPart_000_004A_01C24ED6.00678F70--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019