Skip to content

Commit 668a074

Browse files
committed
Update to MQ 9.1.5; include filtered headerfile for complete build experience
1 parent 0a6ef3e commit 668a074

File tree

16 files changed

+1542
-37
lines changed

16 files changed

+1542
-37
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
History (newest at top)
33
=======================
4+
Apr 2020 (v5.2.1)
5+
* Update for MQ V9.1.5
6+
* Include mqsmfstruc.h so you can build without copying a header from z/OS
47

58
Dec 2019 (v5.2.0)
69
* Add support for MQ 9.1.4 encrypted datasets and logs

bin/aix/convH

1.51 KB
Binary file not shown.

bin/aix/mqsmfcsv

-48.8 KB
Binary file not shown.

bin/linux/convH

2.74 KB
Binary file not shown.

bin/linux/mqsmfcsv

2.63 KB
Binary file not shown.

bin/win/convH.exe

2 KB
Binary file not shown.

bin/win/mqsmfcsv.exe

-278 KB
Binary file not shown.

mqsmfcsv.doc

-7 KB
Binary file not shown.

src/M

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/ksh
1+
#!/bin/sh
22

33
plat=`uname`
44

@@ -26,7 +26,7 @@ else
2626
flags="$flags $optim"
2727
fi
2828

29-
export PLATFLAGS=$flags CC=$cc VERS=914
29+
export PLATFLAGS=$flags CC=$cc VERS=915
3030
make -e -f Makefile.unix $*
3131

3232
rm -f $targdir/convH $targdir/mqsmfcsv

src/Makefile.gcc.win

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CC=i686-w64-mingw32-gcc
33
# CFLAGS= -I. -m32 -fpack-struct=8 -DPLATFORM_WINDOWS
44
CFLAGS= -I. -m32 -DPLATFORM_WINDOWS
55
PLATFLAGS=
6-
VERS=914
6+
VERS=915
77
SRC = mqsmf.c \
88
smfDDL.c \
99
smfDate.c \
@@ -49,16 +49,16 @@ sizeTest: mqsmfcsv.exe
4949
diff -b sizes.tmp sizes.master
5050

5151
shipTest: mqsmfcsv.exe
52-
cd ../testing/shipTest;./shipTest.sh
52+
cd ../testing/shipTest;./shipTest.sh csv sql json
5353

54-
mqsmfcsv.exe: $(SRC) $(HDR) Makefile.gcc.win dummy
54+
mqsmfcsv.exe: $(SRC) $(HDR) Makefile.gcc.win dummy
5555
-rm -f $@
5656
$(CC) $(PLATFLAGS) -o $@ $(SRC) $(CFLAGS) -DCSQDSMF_VERSION=$(VERS)
5757
-mkdir out >/dev/null 2>&1 || true
5858
cp $@ ../bin/win
5959

60-
mqsmfstruc.h: csqdsmfc-$(VERS).h convH.exe dummy
61-
./convH.exe < csqdsmfc-$(VERS).h > $@
60+
mqsmfstruc.h: convH.exe dummy
61+
./convH.exe $(VERS) < csqdsmfc-$(VERS).h > $@
6262

6363
convH.exe: convH64.c
6464
$(CC) $(CFLAGS) -o $@ convH64.c

src/Makefile.unix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ sizeTest: mqsmfcsv
4949
diff -b sizes.tmp sizes.master
5050

5151
shipTest: mqsmfcsv
52-
cd ../testing/shipTest;./shipTest.sh
52+
cd ../testing/shipTest;./shipTest.sh csv sql json
5353

5454
mqsmfcsv: $(SRC) $(HDR) Makefile.unix dummy
5555
$(CC) $(PLATFLAGS) -o $@ $(SRC) $(CFLAGS) -DCSQDSMF_VERSION=$(VERS)
5656

57-
mqsmfstruc.h: csqdsmfc-$(VERS).h convH dummy
58-
convH < csqdsmfc-$(VERS).h > $@
57+
mqsmfstruc.h: convH csqdsmfc-$(VERS).h
58+
convH $(VERS) < csqdsmfc-$(VERS).h > $@
5959

60-
convH: convH64.c dummy
60+
convH: convH64.c dummy
6161
$(CC) -o $@ convH64.c
6262

6363

src/Makefile.win

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CFLAGS=-nologo /D_CRT_SECURE_NO_WARNINGS /Zp1 /J /O2 /DPLATFORM_WINDOWS
2-
VERS=914
2+
VERS=915
33
SRC = mqsmf.c \
44
smfDDL.c \
55
smfDate.c \
@@ -46,8 +46,8 @@ mqsmfcsv.exe: $(SRC) $(HDR) Makefile.win
4646
del /q *.obj
4747
copy $@ ..\bin\win
4848

49-
mqsmfstruc.h: csqdsmfc-$(VERS).h convH.exe dummy
50-
convH < csqdsmfc-$(VERS).h > $@
49+
mqsmfstruc.h: convH.exe dummy
50+
convH $(VERS) < csqdsmfc-$(VERS).h > $@
5151

5252
convH.exe: convH64.c
5353
$(CC) $(CFLAGS) /Fe$@ convH64.c

src/convH64.c

Lines changed: 79 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019 IBM Corporation and other Contributors.
2+
* Copyright (c) 2016, 2020 IBM Corporation and other Contributors.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
@@ -35,6 +35,7 @@
3535
#include <stdio.h>
3636
#include <stdint.h>
3737
#include <string.h>
38+
#include <fcntl.h>
3839

3940

4041
/**********************************************************************/
@@ -77,6 +78,9 @@
7778
#define REPLACE_UINT16 "uint16_t "
7879
#define REPLACE_EXTRAINT " "
7980

81+
#define BITFIELD_ACCT (1)
82+
#define BITFIELD_QWHS (2)
83+
8084
/**********************************************************************/
8185
/* Newer compiler versions on some platforms have also */
8286
/* affected how bitfields are laid out. This program now */
@@ -95,11 +99,27 @@
9599
int inBitfieldReplace = 0;
96100
void bitfieldReprint(int c);
97101
void datatypeReplace(char *);
102+
char *stripLine(char *);
103+
void printHeader(char *);
98104

99105
int main(int argc, char **argv)
100106
{
101107
char line[256] = {0};
102108
char *c;
109+
char *p;
110+
char *v;
111+
112+
if (argc > 1) {
113+
v = argv[1];
114+
} else {
115+
v = "UNKNOWN";
116+
}
117+
118+
#if defined(PLATFORM_WINDOWS)
119+
setmode(fileno(stdout),O_BINARY);
120+
#endif
121+
122+
printHeader(v);
103123

104124
/******************************************************/
105125
/* Need a portable pragma that works on all platforms */
@@ -123,14 +143,16 @@ int main(int argc, char **argv)
123143
/****************************************************/
124144
else if (strstr(line,"\?\?="))
125145
continue;
146+
else if (strncmp(line," /*",3) == 0)
147+
continue;
126148
else
127149
{
128150
if (BITFIELDREPRINTNEEDED) {
129151
if (strstr(line,"fNoAcctg")) {
130-
bitfieldReprint(1);
152+
bitfieldReprint(BITFIELD_ACCT);
131153
}
132154
if (strstr(line,"qwhssmfc")) {
133-
bitfieldReprint(2);
155+
bitfieldReprint(BITFIELD_QWHS);
134156
}
135157
}
136158

@@ -142,10 +164,12 @@ int main(int argc, char **argv)
142164

143165
if (!inBitfieldReplace) {
144166
datatypeReplace(line);
145-
146-
printf("%s",line);
147-
if (line[strlen(line)-1] != '\n')
148-
printf("\n");
167+
p = stripLine(line);
168+
if (strlen(p) > 1) {
169+
printf("%s",p);
170+
if (p[strlen(p)-1] != '\n')
171+
printf("\n");
172+
}
149173
}
150174

151175
}
@@ -156,19 +180,46 @@ int main(int argc, char **argv)
156180
return 0;
157181
}
158182

183+
/* Remove trailing comments and leading spaces */
184+
char *stripLine(char *l) {
185+
char *p = l;
186+
char *e;
187+
char *cmtStart;
188+
char *cmtEnd;
189+
190+
while (*p == ' ') p++;
191+
192+
cmtStart = strstr(p,"/*");
193+
cmtEnd = strstr(p,"*/\n");
194+
195+
/* There are a few multi-line macros that have comments embedded
196+
* so we can't just strip to end of line ... if the line ends in
197+
* a continuation marker then leave the comments alone
198+
*/
199+
if (cmtStart != NULL && cmtEnd != NULL && p[strlen(p)-2] != '\\') {
200+
*cmtStart = 0;
201+
}
202+
e = &p[strlen(p) -1];
203+
while (*e == ' ' && e > p) {
204+
*e = 0;
205+
e--;
206+
}
207+
return p;
208+
}
209+
159210
void bitfieldReprint(int c) {
160211
inBitfieldReplace = 1;
161212
switch (c) {
162-
case 1:
163-
printf(" unsigned char fNoAcctg : 1;\n");
164-
printf(" unsigned char fTopic : 1;\n");
165-
printf(" unsigned char fAcctqC : 1;\n");
166-
printf(" unsigned char spare : 5;\n");
167-
printf(" unsigned char spare2 : 8;\n");
213+
case BITFIELD_ACCT:
214+
printf("unsigned char fNoAcctg : 1;\n");
215+
printf("unsigned char fTopic : 1;\n");
216+
printf("unsigned char fAcctqC : 1;\n");
217+
printf("unsigned char spare : 5;\n");
218+
printf("unsigned char spare2 : 8;\n");
168219
break;
169-
case 2:
170-
printf(" unsigned char qwhssmfc : 1;\n");
171-
printf(" unsigned char qwhspad1 : 7;\n");
220+
case BITFIELD_QWHS:
221+
printf("unsigned char qwhssmfc : 1;\n");
222+
printf("unsigned char qwhspad1 : 7;\n");
172223
break;
173224
default:
174225
break;
@@ -309,3 +360,15 @@ void datatypeReplace(char *line) {
309360

310361
return;
311362
}
363+
364+
void printHeader(char *version)
365+
{
366+
printf("/*\n");
367+
printf(" * This file was generated from cqsdsmfc.h version %s\n",version);
368+
printf(" * by the convH program (convH64.c) in the src directory\n");
369+
printf(" * Do not try to edit this header manually.\n");
370+
printf(" * \n");
371+
printf(" * (C) Copyright IBM Corp. 1993, 2020 All Rights Reserved.\n");
372+
printf(" * \n");
373+
printf(" */\n");
374+
}

0 commit comments

Comments
 (0)