home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / distributed-c-2.1 / part08 < prev    next >
Text File  |  1993-12-22  |  88KB  |  2,058 lines

  1. Newsgroups: comp.sources.unix
  2. From: pleierc@informatik.tu-muenchen.de (Christoph Pleier)
  3. Subject: v27i182: distributed-c-2.1 - Distributed C Development Environment, V2.1, Part08/18
  4. References: <1.756634932.28500@gw.home.vix.com>
  5. Sender: unix-sources-moderator@gw.home.vix.com
  6. Approved: vixie@gw.home.vix.com
  7.  
  8. Submitted-By: pleierc@informatik.tu-muenchen.de (Christoph Pleier)
  9. Posting-Number: Volume 27, Issue 182
  10. Archive-Name: distributed-c-2.1/part08
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 8 (of 18)."
  19. # Contents:  config/symb_program.c dcc/code_create.c dcc/makefile.c
  20. #   dcc/symb_debug.c examples/nullst/nullst.dc
  21. #   examples/test/creation.dc include/dcc.h include/functions.h
  22. # Wrapped by vixie@gw.home.vix.com on Thu Dec 23 00:12:00 1993
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'config/symb_program.c' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'config/symb_program.c'\"
  26. else
  27. echo shar: Extracting \"'config/symb_program.c'\" \(10681 characters\)
  28. sed "s/^X//" >'config/symb_program.c' <<'END_OF_FILE'
  29. X/***************************************************************************
  30. X *                                                                         *
  31. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  32. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  33. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  34. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  35. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  36. X *                                                                         *
  37. X *              A compiler for distributed programming with C              *
  38. X *                                                                         *
  39. X *                       s y m b _ p r o g r a m . c                       *
  40. X *                                                                         *
  41. X *                            Package : Configuration Files Parsers        *
  42. X *                            Version : 1.0                                *
  43. X *                       CreationDate : 26.02.92                           *
  44. X *                         LastUpDate : 27.02.92                           *
  45. X *                                                                         *
  46. X * All routines needed to manage the symbol table during parsing of        *
  47. X * program configuration files.                                            *
  48. X *                                                                         *
  49. X *               Copyright (C) 1992-1994 by Christoph Pleier               *
  50. X *                          All rights reserved!                           *
  51. X ***************************************************************************/
  52. X
  53. X/*
  54. X * This file is part of the Distributed C Development Environment (DCDE).
  55. X * DCDE is free software; you can redistribute it and/or modify
  56. X * it under the terms written in the README-file. 
  57. X * DCDE is distributed in the hope that it will be useful,
  58. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  59. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  60. X * See the file README for more details.
  61. X */
  62. X
  63. X#include <stdio.h>
  64. X#include "cfgparsers.h"
  65. X
  66. X/******************************************************************************
  67. X * generate_fsspec_info()                                                     *
  68. X *                                                                            *
  69. X * Generates and initializes a accessed filesystem info.                      *
  70. X *                                                                            *
  71. X * Return values: pointer to new element upon success / NULL upon error       *
  72. X ******************************************************************************/
  73. XFSSPECINFO *
  74. Xgenerate_fsspec_info(fs_symbol, freq, quant)
  75. XSYMBTABEL *fs_symbol;
  76. Xfloat freq, quant;
  77. X{
  78. X    register FSSPECINFO *ptr;
  79. X
  80. X    /* check type */
  81. X    if (fs_symbol->type != S_FIXED_DISK) {
  82. X    printf("Error: line %d at \"%s\": \"%s\" is not a fixed disk\n",
  83. X        yylineno, yytext, fs_symbol->name);
  84. X    exit(ERROR);
  85. X    }
  86. X
  87. X    ptr = (FSSPECINFO *) Malloc(sizeof(FSSPECINFO));
  88. X    ptr->filesys   = fs_symbol;
  89. X    ptr->frequency = freq;
  90. X    ptr->quantity  = quant;
  91. X    ptr->next      = NULL;
  92. X
  93. X    return(ptr);
  94. X} /* generate_fsspec_info */
  95. X
  96. X/******************************************************************************
  97. X * chain_fsspec_infos()                                                       *
  98. X *                                                                            *
  99. X * Chains accessed filesystems info 'accfs2' to the end of info 'accfs1'.     *
  100. X *                                                                            *
  101. X * Return values: pointer to resulting targetinfo upon success /              *
  102. X *                NULL upon error                                             *
  103. X ******************************************************************************/
  104. XFSSPECINFO *
  105. Xchain_fsspec_infos(accfs1, accfs2)
  106. XFSSPECINFO *accfs1, *accfs2;
  107. X{
  108. X    register FSSPECINFO *ptr;
  109. X
  110. X    for(ptr = accfs1; ptr->next; ptr = ptr->next)
  111. X    ;
  112. X    ptr->next = accfs2;
  113. X    return(accfs1);
  114. X} /* chain_fsspec_infos */
  115. X
  116. X/******************************************************************************
  117. X * generate_commp_info()                                                      *
  118. X *                                                                            *
  119. X * Generates and initializes a communication process info.                    *
  120. X *                                                                            *
  121. X * Return values: pointer to new element upon success / NULL upon error       *
  122. X ******************************************************************************/
  123. XCOMMPINFO *
  124. Xgenerate_commp_info(process, freq, quant)
  125. XSYMBTABEL *process;
  126. Xfloat freq, quant;
  127. X{
  128. X    register COMMPINFO *ptr;
  129. X
  130. X    ptr = (COMMPINFO *) Malloc(sizeof(COMMPINFO));
  131. X    ptr->Process   = process;
  132. X    ptr->frequency = freq;
  133. X    ptr->quantity  = quant;
  134. X    ptr->next      = NULL;
  135. X
  136. X    return(ptr);
  137. X} /* generate_commp_info */
  138. X
  139. X/******************************************************************************
  140. X * chain_commp_infos()                                                        *
  141. X *                                                                            *
  142. X * Chains communication process info 'cattr1' to the end of info 'cattr2'.    *
  143. X *                                                                            *
  144. X * Return values: pointer to resulting targetinfo upon success /              *
  145. X *                NULL upon error                                             *
  146. X ******************************************************************************/
  147. XCOMMPINFO *
  148. Xchain_commp_infos(cattr1, cattr2)
  149. XCOMMPINFO *cattr1, *cattr2;
  150. X{
  151. X    register COMMPINFO *ptr;
  152. X
  153. X    for(ptr = cattr1; ptr->next; ptr = ptr->next)
  154. X    ;
  155. X    ptr->next = cattr2;
  156. X    return(cattr1);
  157. X} /* chain_commp_infos */
  158. X
  159. X/******************************************************************************
  160. X * generate_process_attr_info()                                               *
  161. X *                                                                            *
  162. X * Generates and initializes a process attribute info.                        *
  163. X *                                                                            *
  164. X * Return values: pointer to new element upon success / NULL upon error       *
  165. X ******************************************************************************/
  166. XPATTRINFO *
  167. Xgenerate_process_attr_info(type, idlist, number, mode, fsspec, commps)
  168. Xint type;
  169. XIDENTLIST *idlist;
  170. Xfloat number;
  171. Xint mode;
  172. XFSSPECINFO *fsspec;
  173. XCOMMPINFO *commps;
  174. X{
  175. X    register PATTRINFO *ptr;
  176. X
  177. X    ptr = (PATTRINFO *) Malloc(sizeof(PATTRINFO));
  178. X
  179. X    ptr->type = type;
  180. X    switch(type) {
  181. X    case PA_PREFERRED:
  182. X    ptr->info.pref_hosts = idlist;
  183. X    break;
  184. X    case PA_RESTRICTED:
  185. X    ptr->info.rest_hosts = idlist;
  186. X    break;
  187. X    case PA_INTENSITY_INDEX:
  188. X    ptr->info.intensity_index = number;
  189. X    break;
  190. X    case PA_PHYS_MEM:
  191. X    ptr->mode = mode;
  192. X    ptr->info.phys_mem_size = number;
  193. X    break;
  194. X    case PA_VIRT_MEM:
  195. X    ptr->mode = mode;
  196. X    ptr->info.virt_mem_size = number;
  197. X    break;
  198. X    case PA_PERI_DEVICES:
  199. X    ptr->info.peri_dev = idlist;
  200. X    break;
  201. X    case PA_FILESYSTEMS:
  202. X    ptr->info.filesystems = fsspec;
  203. X    break;
  204. X    case PA_COMM_PROCESSES:
  205. X    ptr->info.commps = commps;
  206. X    break;
  207. X    case PA_VECTORIZATION:
  208. X    ptr->mode = mode;
  209. X    break;
  210. X    case PA_PARALLELIZATION:
  211. X    ptr->mode = mode;
  212. X    break;
  213. X    }
  214. X    ptr->next = NULL;
  215. X    
  216. X    return(ptr);
  217. X} /* generate_process_attr_info */
  218. X
  219. X/******************************************************************************
  220. X * chain_pattr_infos()                                                        *
  221. X *                                                                            *
  222. X * Chains process attribute info 'pattr1' to the end of info 'pattr2'.        *
  223. X *                                                                            *
  224. X * Return values: pointer to resulting targetinfo upon success /              *
  225. X *                NULL upon error                                             *
  226. X ******************************************************************************/
  227. XPATTRINFO *
  228. Xchain_pattr_infos(pattr1, pattr2)
  229. XPATTRINFO *pattr1, *pattr2;
  230. X{
  231. X    register PATTRINFO *ptr;
  232. X
  233. X    for(ptr = pattr1; ptr->next; ptr = ptr->next)
  234. X    ;
  235. X    ptr->next = pattr2;
  236. X    return(pattr1);
  237. X} /* chain_pattr_infos */
  238. X
  239. X/******************************************************************************
  240. X * enter_process_description()                                                *
  241. X *                                                                            *
  242. X * Enters the process description 'symbol' in the symbol table including all  *
  243. X * informations.                                                              *
  244. X *                                                                            *
  245. X * Return values: pointer to entered element upon success / NULL upon error   *
  246. X ******************************************************************************/SYMBTABEL *
  247. Xenter_process_description(symbol, pattrl)
  248. XSYMBTABEL *symbol;
  249. XPATTRINFO *pattrl;
  250. X{
  251. X    int intensityflag = FALSE;
  252. X    register PATTRINFO *ptr;
  253. X
  254. X    /* check symbol */
  255. X    if (symbol->type != UNDEFINED) {
  256. X        printf("Error: line %d at \"%s\": redefinition: \"%s\"\n",
  257. X            yylineno, yytext, symbol->name);
  258. X        return(NULL);
  259. X    }
  260. X
  261. X    symbol->type = S_PROCESS;
  262. X    symbol->info.Process.pref_hosts  = NULL;
  263. X    symbol->info.Process.rest_hosts  = NULL;
  264. X    symbol->info.Process.peri_dev    = NULL;
  265. X    symbol->info.Process.filesystems = NULL;
  266. X    symbol->info.Process.commps      = NULL;
  267. X    for(ptr = pattrl; ptr; ptr = ptr->next) {
  268. X    switch(ptr->type) {
  269. X    case PA_PREFERRED:
  270. X        symbol->info.Process.pref_hosts = ptr->info.pref_hosts;
  271. X        break;
  272. X    case PA_RESTRICTED:
  273. X        symbol->info.Process.rest_hosts = ptr->info.rest_hosts;
  274. X        break;
  275. X    case PA_PERI_DEVICES:
  276. X        symbol->info.Process.peri_dev = ptr->info.peri_dev;
  277. X        break;
  278. X    case PA_FILESYSTEMS:
  279. X        symbol->info.Process.filesystems = ptr->info.filesystems;
  280. X        break;
  281. X    case PA_COMM_PROCESSES:
  282. X        symbol->info.Process.commps = ptr->info.commps;
  283. X        break;
  284. X    case PA_INTENSITY_INDEX:
  285. X        symbol->info.Process.intensity_index = ptr->info.intensity_index;
  286. X        intensityflag = 1;
  287. X        break;
  288. X    } /* switch */
  289. X    } /* for(ptr) */
  290. X    symbol->info.Process.others = pattrl;
  291. X
  292. X    if (!intensityflag) {
  293. X        printf("Error: process specification \"%s\": no intensity index\n",
  294. X            symbol->name);
  295. X        return(NULL);
  296. X    }
  297. X    return(symbol);
  298. X} /* enter_process_description */
  299. X
  300. END_OF_FILE
  301. if test 10681 -ne `wc -c <'config/symb_program.c'`; then
  302.     echo shar: \"'config/symb_program.c'\" unpacked with wrong size!
  303. fi
  304. # end of 'config/symb_program.c'
  305. fi
  306. if test -f 'dcc/code_create.c' -a "${1}" != "-c" ; then 
  307.   echo shar: Will not clobber existing file \"'dcc/code_create.c'\"
  308. else
  309. echo shar: Extracting \"'dcc/code_create.c'\" \(9101 characters\)
  310. sed "s/^X//" >'dcc/code_create.c' <<'END_OF_FILE'
  311. X/***************************************************************************
  312. X *                                                                         *
  313. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  314. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  315. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  316. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  317. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  318. X *                                                                         *
  319. X *              A compiler for distributed programming with C              *
  320. X *                                                                         *
  321. X *                        c o d e _ c r e a t e . c                        *
  322. X *                                                                         *
  323. X *                            Package : Compiler                           *
  324. X *                            Version : 1.0                                *
  325. X *                       CreationDate : 04.09.90                           *
  326. X *                         LastUpDate : 09.03.92                           *
  327. X *                                                                         *
  328. X * The functions to generate the process creation routine and the process  *
  329. X * creation code.                                                          *
  330. X *                                                                         *
  331. X *                  Portions Copyright 1990 Franz Distler                  *
  332. X *               Copyright (C) 1990-1994 by Christoph Pleier               *
  333. X *                          All rights reserved!                           *
  334. X ***************************************************************************/
  335. X
  336. X/*
  337. X * This file is part of the Distributed C Development Environment (DCDE).
  338. X * DCDE is free software; you can redistribute it and/or modify
  339. X * it under the terms written in the README-file. 
  340. X * DCDE is distributed in the hope that it will be useful,
  341. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  342. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  343. X * See the file README for more details.
  344. X */
  345. X
  346. X#include <stdio.h>
  347. X#include <sys/types.h>
  348. X#include "config.h"
  349. X#include "extern.h"
  350. X#include "functions.h"
  351. X#include "com_Errno.h"
  352. X#include "timeout.h"
  353. X
  354. X/******************************************************************************
  355. X * gen_process_creation_routine()                                             *
  356. X *                                                                            *
  357. X * Generates the process creation routine for the process specified by the    *
  358. X * symbol table element 'symbol'. The generated process creation routine is   *
  359. X * called at runtime to create the specified process and pass the arguments.  *
  360. X *                                                                            *
  361. X * Return values: OK upon success / ERROR during error handling               *
  362. X ******************************************************************************/
  363. Xint
  364. Xgen_process_creation_routine(symbol)
  365. XSYMBTABEL *symbol;
  366. X{
  367. X    int          i,
  368. X                 length;
  369. X    char        *piname,
  370. X                *upiname;
  371. X    static char  processname[MAXFILENAMELEN+1];
  372. X    SYMBTABEL   *params;
  373. X
  374. X    if (errflag || !symbol)    /* error handling! */
  375. X        return(ERROR);
  376. X#ifdef CODEDEBUG
  377. X    fputs("[code] ***** gen_process_creation_routine():\n", debugfile);
  378. X    fprintf(debugfile, "[code]       params: symbol = %d\n", symbol);
  379. X#endif  /* CODEDEBUG /**/
  380. X    piname  = symbol->info.process.piname,
  381. X    upiname = symbol->info.process.upiname;
  382. X    strcpy(processname, symbol->info.process.filename);
  383. X    processname[strlen(processname)-2] = '\0';
  384. X
  385. X    if (infoflag) {
  386. X    printf("%s generating creation routine for process '%s'\n",
  387. X        infoprefix, symbol->name);
  388. X    fflush(stdout);
  389. X    }
  390. X
  391. X    if (!specflag) {
  392. X        strcpy(creatfilename, filenameprefix);
  393. X        length = MAXFILENAMELEN - strlen(SPECFILEEXT);
  394. X        if (strlen(filenameprefix) <= length)
  395. X        strcat(creatfilename, SPECFILEEXT);
  396. X        else
  397. X           strcpy(&creatfilename[length], SPECFILEEXT);
  398. X        if (!(creatfile = fopen(creatfilename, "w"))) {
  399. X        fprintf(stderr,"Error: impossible to open file for creation routines '%s'\n",
  400. X            creatfilename);
  401. X        exit(EXIT_FOPEN);
  402. X        }
  403. X        fprintf(creatfile, "/* %s */\n\n", creatfilename);
  404. X        fputs("/*\n", creatfile);
  405. X        for(i = 0; *headerstr[i]; ++i)
  406. X            fprintf(creatfile, " * %s\n", headerstr[i]);
  407. X        fputs(" */\n\n", creatfile);
  408. X        fprintf(creatfile, "#include \"%s\"\n", inclfilename);
  409. X    specflag = TRUE;
  410. X    }
  411. X    fprintf(creatfile, "\n/* specific creation routine to create process '%s' */\n",
  412. X        symbol->name);
  413. X    fprintf(creatfile, "PROCESSDESCR\ncreate_process_%s(location", piname);
  414. X    for(params=symbol->info.process.FirstParam; params; params=params->info.varorpar.NextParam) {
  415. X    fprintf(creatfile, ", %s", params->name);
  416. X    }
  417. X    fputs(")\n", creatfile);
  418. X    fputs("char *location;\n", creatfile);
  419. X    for(params = symbol->info.process.FirstParam; params;
  420. X                     params = params->info.varorpar.NextParam) {
  421. X        *convert_buffer = 0;
  422. X    convert_buffer = convert_ds_to_string(convert_buffer, params->info.varorpar.DataType),
  423. X    fprintf(creatfile, "%s %s;\n", convert_buffer, params->name);
  424. X    }
  425. X    fputs("{\n\tPROCESSDESCR result;\n", creatfile);
  426. X    fputs("\n\t/* create process and get process descriptor */\n", creatfile);
  427. X    fprintf(creatfile, "\tif (_create_process(\"%s\", \"%s\", location, &result))\n",
  428. X    symbol->name, processname);
  429. X    fprintf(creatfile, "\t\t_RuntimeError(\"creating process\");\n");
  430. X    if (symbol->info.process.FirstParam) {
  431. X        fputs("\t/* transmit arguments */\n", creatfile);
  432. X        for (params=symbol->info.process.FirstParam; params; params = params->info.varorpar.NextParam)
  433. X        fprintf(creatfile, "\tdcc_par.%s.%s = %s;\n", piname, params->name, 
  434. X            params->name);
  435. X        fprintf(creatfile, "\tif (_send_data");
  436. X#ifdef HETEROGENEOUS
  437. X        fprintf(creatfile, "_encoded");
  438. X#endif
  439. X        fprintf(creatfile, "(&_con_port, (char *) &dcc_par.%s, ", piname);
  440. X#if defined(SINGLE) || defined(HOMOGENEOUS)
  441. X    fprintf(creatfile, "sizeof(%s%s)", upiname, POSTFIXSPECPAR);
  442. X#else /* HETEROGENEOUS */
  443. X    fprintf(creatfile, "xdr_%s%s", upiname, POSTFIXSPECPAR);
  444. X#endif
  445. X        fprintf(creatfile, ", %d) < 0) {\n", CPTONPPARTIME);
  446. X        fputs("\t\tif (Errno == ETIMEOUT)\n", creatfile);
  447. X        fputs("\t\t\tErrno = ETCCPTONPPAR;\n", creatfile);
  448. X        fprintf(creatfile, "\t\t_RuntimeError(\"sending arguments\");\n");
  449. X        fputs("\t}\n", creatfile);
  450. X    }
  451. X    fputs("\tif (_close_connection(&_con_port))\n", creatfile);
  452. X    fputs("\t\t_RuntimeError(\"create_process_...()\");\n", creatfile);
  453. X    fputs("\treturn(result);\n", creatfile);
  454. X    fprintf(creatfile, "} /* create_process_%s */\n", piname);
  455. X    return(OK);
  456. X} /* gen_process_creation_routine */
  457. X
  458. X/******************************************************************************
  459. X * generate_process_creation_code()                                           *
  460. X *                                                                            *
  461. X * Generates the code for creating a particular process.                      *
  462. X *                                                                            *
  463. X * Return values: pointer to generated code string upon success /             *
  464. X *                NULL during error handling                                  *
  465. X ******************************************************************************/
  466. Xchar *
  467. Xgenerate_process_creation_code(symbol, arg, location)
  468. XSYMBTABEL *symbol;
  469. XARG_LIST  *arg;
  470. Xchar      *location;
  471. X{
  472. X    int        i;
  473. X    char      *cmd;
  474. X    ARG_LIST  *hptr;
  475. X    SYMBTABEL *params;
  476. X
  477. X    if (errflag || !symbol)    /* error handling! */
  478. X        return(NULL);
  479. X#ifdef CODEDEBUG
  480. X    fputs("[code] ***** generate_process_creation_code():\n", debugfile);
  481. X    fprintf(debugfile, "[code]       params: symbol = %d, arg = %d, location = %s\n",
  482. X        symbol, arg, location);
  483. X    fputs("[code]       the arguments are:", debugfile);
  484. X    for(hptr=arg, i=1; hptr; hptr=hptr->next, i++) 
  485. X        fprintf(debugfile, "[code]           arg %d: %s\n", i, hptr->code);
  486. X#endif  /* CODEDEBUG /**/
  487. X    if (symbol->type != PROCESSDECL) {
  488. X        strcpy(yytext, symbol->name);
  489. X        PRINTERROR("", ENOTSPECIFIED);
  490. X        /* (void) delete_arg_list(arg); */
  491. X        Free(location);
  492. X    return(strmalloc(""));
  493. X    }
  494. X    cmd = strmalloc("create_process_");
  495. X    cmd = Strcatmany(cmd, 3, symbol->info.process.piname, "(", location);
  496. X    for(params=symbol->info.process.FirstParam, hptr=arg; params;
  497. X            params=params->info.varorpar.NextParam, hptr=hptr->next) {
  498. X    if (!hptr) {
  499. X        strcpy(yytext, "");
  500. X        Errno = WPROCESSARGS;
  501. X        Warning("");
  502. X        break;
  503. X    }
  504. X    cmd = Strcatmany(cmd, 2, ", ", hptr->code);
  505. X    }
  506. X    cmd = Strcat(cmd, ")");
  507. X    Free(location);
  508. X    return(cmd);
  509. X} /* generate_process_creation_code */
  510. END_OF_FILE
  511. if test 9101 -ne `wc -c <'dcc/code_create.c'`; then
  512.     echo shar: \"'dcc/code_create.c'\" unpacked with wrong size!
  513. fi
  514. # end of 'dcc/code_create.c'
  515. fi
  516. if test -f 'dcc/makefile.c' -a "${1}" != "-c" ; then 
  517.   echo shar: Will not clobber existing file \"'dcc/makefile.c'\"
  518. else
  519. echo shar: Extracting \"'dcc/makefile.c'\" \(10994 characters\)
  520. sed "s/^X//" >'dcc/makefile.c' <<'END_OF_FILE'
  521. X/***************************************************************************
  522. X *                                                                         *
  523. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  524. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  525. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  526. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  527. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  528. X *                                                                         *
  529. X *              A compiler for distributed programming with C              *
  530. X *                                                                         *
  531. X *                           m a k e f i l e . c                           *
  532. X *                                                                         *
  533. X *                            Package : Compiler                           *
  534. X *                            Version : 1.0                                *
  535. X *                       CreationDate : 15.08.90                           *
  536. X *                         LastUpDate : 31.08.91                           *
  537. X *                                                                         *
  538. X *                  The routine to generate the makefile.                  *
  539. X *                                                                         *
  540. X *               Copyright (C) 1990-1994 by Christoph Pleier               *
  541. X *                          All rights reserved!                           *
  542. X ***************************************************************************/
  543. X
  544. X/*
  545. X * This file is part of the Distributed C Development Environment (DCDE).
  546. X * DCDE is free software; you can redistribute it and/or modify
  547. X * it under the terms written in the README-file. 
  548. X * DCDE is distributed in the hope that it will be useful,
  549. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  550. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  551. X * See the file README for more details.
  552. X */
  553. X
  554. X#include <stdio.h>
  555. X#include <sys/types.h>
  556. X#ifdef HETEROGENEOUS
  557. X# include <rpc/rpc.h>
  558. X#endif
  559. X#include <string.h>
  560. X#include "config.h"
  561. X#include "extern.h"
  562. X#include "functions.h"
  563. X#include "ipc.h"
  564. X#include "dcc.h"
  565. X
  566. X/******************************************************************************
  567. X * build_makefile()                                                           *
  568. X *                                                                            *
  569. X * Generates the makefile needed to manage the built files.                   *
  570. X *                                                                            *
  571. X * Return values: always OK for success                                       *
  572. X ******************************************************************************/
  573. Xint
  574. Xbuild_makefile()
  575. X{
  576. X    int i, j, flag;
  577. X    char mainstr[MAXFILENAMELEN+1], 
  578. X         specstr[MAXFILENAMELEN+1], 
  579. X         funcstr[MAXFILENAMELEN+1], 
  580. X#if defined(HETEROGENEOUS) || defined(CHECK_XDR)
  581. X         xdrstr[MAXFILENAMELEN+1],
  582. X#endif /* HETEROGENEOUS /**/
  583. X         *incdir, *libdir, *cflags, *lflags, *libs, *cb, *cbflags,
  584. X         *hosts, *hp1, *targets, *makec;
  585. X    struct process_list *ptr;
  586. X    struct include_list *inclptr;
  587. X    struct include_path_list *pathptr;
  588. X    struct cpp_def_list *cppdefptr;
  589. X
  590. X#ifdef DEBUG
  591. X    fputs("[debg] ***** build_makefile():\n", debugfile);
  592. X#endif /* DEBUG /**/
  593. X
  594. X    if (infoflag) {
  595. X    printf("%s building the makefile\n", infoprefix);
  596. X    fflush(stdout);
  597. X    }
  598. X
  599. X    if (!(makefile = fopen(makefilename, "w"))) {
  600. X    fprintf(stderr, "Error: impossible to open makefile '%s'\n",
  601. X        makefilename);
  602. X    exit(EXIT_FOPEN);
  603. X    }
  604. X    fprintf(makefile, "# %s - Makefile for '%s'\n", makefilename,
  605. X    inputfilename);
  606. X    fputs("#\n", makefile);
  607. X    for(i = 0; *headerstr[i]; ++i)
  608. X        fprintf(makefile, "# %s\n", headerstr[i]);
  609. X    fputs("\n", makefile);
  610. X
  611. X    makec = (char *) getenv("DCC_MAKE");  
  612. X    if (makec == NULL || *makec == '\0')
  613. X    makec = "make";
  614. X
  615. X    cflags = (char *) getenv("DCC_CFLAGS");  
  616. X    if (cflags == NULL || *cflags == '\0')
  617. X    cflags = "";
  618. X
  619. X    lflags = (char *) getenv("DCC_LFLAGS");  
  620. X    if (lflags == NULL || *lflags == '\0')
  621. X    lflags = "";
  622. X
  623. X    libs = (char *) getenv("DCC_LIBS");  
  624. X    if (libs == NULL || *libs == '\0')
  625. X    libs = "";
  626. X
  627. X    cb = (char *) getenv("DCC_CB");  
  628. X    if (cb == NULL || *cb == '\0')
  629. X    cb = "undefined";
  630. X
  631. X    cbflags = (char *) getenv("DCC_CBFLAGS");  
  632. X    if (cbflags == NULL || *cbflags == '\0')
  633. X    cbflags = "";
  634. X
  635. X    targets = (char *) getenv("DCC_TARGETS");  
  636. X    if (targets == NULL || *targets == '\0')
  637. X#ifdef SINGLE
  638. X    targets = "-target local";
  639. X#else /* HOMOGENEOUS || HETEROGENEOUS */
  640. X    targets = "-target all";
  641. X#endif /* SINGLE /**/
  642. X
  643. X    fprintf(makefile, "   MAKE = @%s -f %s\n", makec, makefilename);
  644. X    fprintf(makefile, "   ECHO = @echo\n");
  645. X    fprintf(makefile, "  TOUCH = @touch\n");
  646. X    fprintf(makefile, "     CC = dcinstall\n");
  647. X    fprintf(makefile, " CFLAGS = $(TARGETS) %s", cflags);
  648. X    for(pathptr = first_inclpathname; pathptr; pathptr = pathptr->next)
  649. X        fprintf(makefile, "\\\n          -I%s ", pathptr->path);
  650. X    for(cppdefptr = first_cppdef; cppdefptr; cppdefptr = cppdefptr->next)
  651. X        fprintf(makefile, "\\\n          -D%s ", cppdefptr->def);
  652. X    if (cflags != NULL && *cflags != 0 && cflagsstr != NULL && *cflagsstr != 0)
  653. X        fprintf(makefile, "\\\n          %s %s\n", cflags, cflagsstr);
  654. X    else
  655. X    fprintf(makefile, "\n");
  656. X    fprintf(makefile, "     LD = dcinstall\n");
  657. X    fprintf(makefile, " LFLAGS = $(TARGETS) %s %s\n", lflags, lflagsstr);
  658. X    fprintf(makefile, "   LIBS = %s %s\n", libs, libsstr);
  659. X    fprintf(makefile, "     CB = %s\n", cb);
  660. X    fprintf(makefile, "CBFLAGS = %s\n\n", cbflags);
  661. X    fprintf(makefile, "TARGETS = %s\n\n", targets);
  662. X
  663. X    if (mainflag) {
  664. X        strcpy(mainstr, outputfilename);
  665. X        mainstr[strlen(mainstr)-2] = '\0';
  666. X    }
  667. X
  668. X    if (specflag) {
  669. X        strcpy(specstr, creatfilename);
  670. X        specstr[strlen(specstr)-2] = '\0';
  671. X    }
  672. X
  673. X#if defined(HETEROGENEOUS) || defined(CHECK_XDR)
  674. X    if (xdrflag) {
  675. X        strcpy(xdrstr, xdrfilename);
  676. X        xdrstr[strlen(xdrstr)-2] = '\0';
  677. X    }
  678. X#endif /* HETEROGENEOUS /**/
  679. X
  680. X    if (funcflag) {
  681. X        strcpy(funcstr, funcfilename);
  682. X        funcstr[strlen(funcstr)-2] = '\0';
  683. X    }
  684. X
  685. X    if (mainflag)
  686. X        fprintf(makefile, "BIN =\t%s ", filenameprefix); 
  687. X    else
  688. X        fprintf(makefile, "BIN ="); 
  689. X    for(ptr = first_processname; ptr; ptr = ptr->next) {
  690. X    ptr->name[strlen(ptr->name)-2] = '\0';
  691. X    fprintf(makefile, "\\\n\t%s ", ptr->name);
  692. X    }
  693. X
  694. X    fprintf(makefile, "\n\nFILES = %s.h ", filenameprefix);
  695. X    if (mainflag)
  696. X        fprintf(makefile, "\\\n        %s ", outputfilename);
  697. X    if (specflag)
  698. X        fprintf(makefile, "\\\n        %s ", creatfilename);
  699. X#if defined(HETEROGENEOUS) || defined(CHECK_XDR)
  700. X    if (xdrflag)
  701. X        fprintf(makefile, "\\\n        %s ", xdrfilename);
  702. X#endif /* HETEROGENEOUS /**/
  703. X    if (funcflag)
  704. X        fprintf(makefile, "\\\n        %s ", funcfilename);
  705. X    for(ptr = first_processname; ptr; ptr = ptr->next)
  706. X    fprintf(makefile, "\\\n        %s.c ", ptr->name);
  707. X    if (mainflag)
  708. X        fprintf(makefile, "\\\n        %s.c", mainstr); 
  709. X
  710. X    fputs("\n\nOBJS =\t", makefile);
  711. X    if (specflag)
  712. X        fprintf(makefile, "%s.o", specstr);
  713. X#ifdef HETEROGENEOUS
  714. X    if (xdrflag)
  715. X        fprintf(makefile, " %s.o", xdrstr);
  716. X#endif /* HETEROGENEOUS /**/
  717. X    if (funcflag)
  718. X        fprintf(makefile, " %s.o", funcstr);
  719. X
  720. X    fputs("\n\n.c.o:\n\t$(ECHO) \"***** Compiling $<\"\n", makefile);
  721. X    fputs("\t$(CC) $(CFLAGS) -c $<\n", makefile);
  722. X    fputs("\t$(TOUCH) $@\n", makefile);
  723. X
  724. X    fputs("\nall:\n\t$(MAKE) $(BIN)\n", makefile);
  725. X    fprintf(makefile, "\t$(ECHO) \"\"\n");
  726. X    fprintf(makefile, "\t$(ECHO) all stuff done for '%s'!\n\n",inputfilename);
  727. X
  728. X    if (mainflag) {
  729. X        fprintf(makefile, "%s: incl $(OBJS) %s.o\n", filenameprefix, mainstr);
  730. X        fprintf(makefile, "\t$(ECHO) \"***** Building $@\"\n");
  731. X        fprintf(makefile, "\t$(LD) -o %s $(LFLAGS) $(OBJS) %s.o $(LIBS)\n",
  732. X        filenameprefix, mainstr);
  733. X        fprintf(makefile, "\t$(TOUCH) $@\n");
  734. X    }
  735. X
  736. X    for(ptr = first_processname; ptr; ptr = ptr->next) {
  737. X    fprintf(makefile, "\n%s: incl $(OBJS) %s.o\n", ptr->name, ptr->name);
  738. X        fputs("\t$(ECHO) \"***** Building $@\"\n", makefile);
  739. X    fprintf(makefile, "\t$(LD) -o %s $(LFLAGS) $(OBJS) %s.o $(LIBS)\n",
  740. X        ptr->name, ptr->name);
  741. X        fprintf(makefile, "\t$(TOUCH) $@\n");
  742. X    }
  743. X
  744. X    fprintf(makefile, "\nincl: %s.h\n", filenameprefix);
  745. X    fprintf(makefile, "\t$(CC) $(CFLAGS) %s.h\n", filenameprefix);
  746. X    fprintf(makefile, "\t$(TOUCH) $@\n\n");
  747. X
  748. X    if (specflag)
  749. X        fprintf(makefile, "%s.o: %s.h %s.c\n", specstr, filenameprefix, specstr);
  750. X
  751. X#ifdef HETEROGENEOUS
  752. X    if (xdrflag)
  753. X        fprintf(makefile, "%s.o: %s.h %s.c\n", xdrstr, filenameprefix, xdrstr);
  754. X#endif /* HETEROGENEOUS /**/
  755. X
  756. X    if (funcflag)
  757. X        fprintf(makefile, "%s.o: %s.h %s.c\n", funcstr, filenameprefix, funcstr);
  758. X
  759. X    for(ptr = first_processname; ptr; ptr = ptr->next) {
  760. X    fprintf(makefile, "%s.o: %s.h %s.c\n", ptr->name, filenameprefix, ptr->name);
  761. X    }
  762. X
  763. X    if (mainflag)
  764. X        fprintf(makefile, "%s.o: %s.h %s.c\n", mainstr, filenameprefix, mainstr);
  765. X
  766. X    fputs("\nnew:\n", makefile);
  767. X    fprintf(makefile, "\ttouch %s.h\n", filenameprefix);
  768. X    fprintf(makefile, "\t$(MAKE) all\n");
  769. X
  770. X    fputs("\nbeautify:\n", makefile);
  771. X    fprintf(makefile, "\t$(ECHO) \"beautifying the generated files of '%s'\"\n",
  772. X    inputfilename);
  773. X    fputs("\t@for name in $(FILES); \\\n", makefile);
  774. X    fputs("\tdo \\\n", makefile);
  775. X#ifdef CONVEX
  776. X    /* use indent to beautify files */
  777. X    fputs("\t    $(CB) $(CBFLAGS) $${name}; \\\n",
  778. X    makefile);
  779. X#else
  780. X    /* use cb to beautify files */
  781. X    fputs("\t    mv $${name} cb.tmp; $(CB) $(CBFLAGS) cb.tmp > $${name}; \\\n",
  782. X    makefile);
  783. X#endif 
  784. X    fputs("\tdone\n", makefile);
  785. X#ifndef CONVEX
  786. X    fputs("\t-@\\rm cb.tmp\n", makefile);
  787. X#endif
  788. X    fputs("\t$(ECHO) done!\n", makefile);
  789. X
  790. X    fputs("\nclean:\n", makefile);
  791. X    fprintf(makefile, "\t-@\\rm -f %s.h \\\n", filenameprefix);
  792. X    if (specflag)
  793. X        fprintf(makefile, "\t         %s \\\n", creatfilename);
  794. X#if defined(HETEROGENEOUS) || defined(CHECK_XDR)
  795. X    if (xdrflag)
  796. X        fprintf(makefile, "\t         %s \\\n", xdrfilename);
  797. X#endif /* HETEROGENEOUS /**/
  798. X    if (funcflag)
  799. X        fprintf(makefile, "\t         %s \\\n", funcfilename);
  800. X    if (mainflag) {
  801. X        fprintf(makefile, "\t         %s \\\n", outputfilename);
  802. X        fprintf(makefile, "\t         %s ", filenameprefix);
  803. X    }
  804. X    for(ptr = first_processname; ptr; ptr = ptr->next) {
  805. X        fprintf(makefile, "\\\n\t         %s.c ", ptr->name, ptr->name);
  806. X        fprintf(makefile, "\\\n\t         %s ", ptr->name, ptr->name);
  807. X    }
  808. X    fprintf(makefile, "\\\n\t         %s \\\n", makefilename);
  809. X    fputs("\t         *.o incl\n", makefile);
  810. X
  811. X    return(OK);
  812. X} /* build_makefile */
  813. END_OF_FILE
  814. if test 10994 -ne `wc -c <'dcc/makefile.c'`; then
  815.     echo shar: \"'dcc/makefile.c'\" unpacked with wrong size!
  816. fi
  817. # end of 'dcc/makefile.c'
  818. fi
  819. if test -f 'dcc/symb_debug.c' -a "${1}" != "-c" ; then 
  820.   echo shar: Will not clobber existing file \"'dcc/symb_debug.c'\"
  821. else
  822. echo shar: Extracting \"'dcc/symb_debug.c'\" \(9368 characters\)
  823. sed "s/^X//" >'dcc/symb_debug.c' <<'END_OF_FILE'
  824. X/***************************************************************************
  825. X *                                                                         *
  826. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  827. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  828. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  829. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  830. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  831. X *                                                                         *
  832. X *              A compiler for distributed programming with C              *
  833. X *                                                                         *
  834. X *                         s y m b _ d e b u g . c                         *
  835. X *                                                                         *
  836. X *                            Package : Compiler                           *
  837. X *                            Version : 1.0                                *
  838. X *                       CreationDate : 13.09.91                           *
  839. X *                         LastUpDate : 13.09.91                           *
  840. X *                                                                         *
  841. X *        Special routines for symbol table debugging purpose only.        *
  842. X *                                                                         *
  843. X *               Copyright (C) 1991-1994 by Christoph Pleier               *
  844. X *                          All rights reserved!                           *
  845. X ***************************************************************************/
  846. X
  847. X/*
  848. X * This file is part of the Distributed C Development Environment (DCDE).
  849. X * DCDE is free software; you can redistribute it and/or modify
  850. X * it under the terms written in the README-file. 
  851. X * DCDE is distributed in the hope that it will be useful,
  852. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  853. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  854. X * See the file README for more details.
  855. X */
  856. X
  857. X#include <stdio.h>
  858. X#include <ctype.h>
  859. X#include "config.h"
  860. X#include "extern.h"
  861. X#include "functions.h"
  862. X#include "y.tab.h" 
  863. X#include "com_Errno.h"
  864. X
  865. X#ifdef DEBUGFLAG
  866. X
  867. X/******************************************************************************
  868. X * display_symbtab_entry()                                              OK    *
  869. X *                                                                            *
  870. X * Displays the specific information of the symbol table element pointed to   *
  871. X * by 'ptr'.                                                                  *
  872. X *                                                                            *
  873. X * Return values: none!                                                       *
  874. X ******************************************************************************/
  875. Xint
  876. Xdisplay_symbtab_entry(ptr)
  877. XSYMBTABEL *ptr;
  878. X{
  879. X    int i, j;
  880. X    SYMBTABEL *hptr, *hptr2;
  881. X
  882. X    if (!ptr) /* error handling! */
  883. X    return(ERROR);
  884. X    fprintf(debugfile, "[symb] ***** display_symbtab_entry(): ptr = %d\n",
  885. X    ptr);
  886. X    fprintf(debugfile, "[symb]       name = %s, blknum = %d\n",
  887. X    ptr->name, ptr->blknum);
  888. X    fprintf(debugfile, "[symb]       WasInSysIncl = %s, type = ",
  889. X    (ptr->WasInSysIncl) ? "TRUE" : "FALSE");
  890. X    switch(ptr->type) {
  891. X    case UDEC:
  892. X    fputs("UDEC\n", debugfile);
  893. X    break;
  894. X    case FUNCTIONDEF:
  895. X    fputs("FUNCTIONDEF\n", debugfile);
  896. X    break;
  897. X    case PROCESSDECL:
  898. X    fprintf(debugfile, "PROCESSDECL\n[symb] IsSpec = %s\n", 
  899. X        (ptr->info.process.IsSpec) ? "TRUE" : "FALSE");
  900. X    if (hptr = ptr->info.process.FirstParam) {
  901. X        fputs("[symb] parameter list:\n", debugfile);
  902. X        for(i=1; hptr; hptr = hptr->info.varorpar.NextParam, i++) {
  903. X        *convert_buffer = 0;
  904. X        convert_buffer = convert_ds_to_string(convert_buffer, 
  905. X            hptr->info.varorpar.DataType);
  906. X            fprintf(debugfile, "[symb]     param %d: name = %s, type = %s\n",
  907. X            i, hptr->name, convert_buffer);
  908. X        }
  909. X    } else 
  910. X        fputs("[symb] no process parameters declared!\n", debugfile);
  911. X    if (hptr = ptr->info.process.FirstTrans) {
  912. X        fputs("[symb] transaction list:\n", debugfile);
  913. X        for(i=1; hptr; hptr = hptr->info.trans.NextTrans, i++) {
  914. X        *convert_buffer = 0;
  915. X        convert_buffer = convert_ds_to_string(convert_buffer,
  916. X            hptr->info.trans.ReturnType);
  917. X            fprintf(debugfile, "[symb]     trans %d: name = %s, ReturnType = %s\n",
  918. X            i, hptr->name, convert_buffer);
  919. X                if (hptr2 = hptr->info.trans.FirstParam) {
  920. X                fputs("[symb]         parameter list:\n", debugfile);
  921. X                    for(j=1; hptr2; hptr2=hptr2->info.varorpar.NextParam, j++) {
  922. X            *convert_buffer = 0;
  923. X            convert_buffer = convert_ds_to_string(convert_buffer,
  924. X                hptr2->info.varorpar.DataType);
  925. X                fprintf(debugfile, "[symb]         param %d: name = %s, type = %s\n",
  926. X                    j, hptr2->name, convert_buffer);
  927. X                }
  928. X        } else
  929. X                fputs("[symb]         no transaction parameters declared!\n", debugfile);
  930. X        } /* for */
  931. X    } else
  932. X        fputs("[symb] no transactions declared!\n", debugfile);
  933. X    break;
  934. X    case VARORPAR:
  935. X    *convert_buffer = 0;
  936. X    convert_buffer = convert_ds_to_string(convert_buffer, ptr->info.varorpar.DataType);
  937. X    fprintf(debugfile, "VARORPAR\n[symb] Type = %s, NextParam = %d\n",
  938. X        convert_buffer, ptr->info.varorpar.NextParam);
  939. X    break;
  940. X    case TRANSACTION:
  941. X    fprintf(debugfile, "TRANSACTION\n[symb] IsDecl = %s\n", 
  942. X        (ptr->info.trans.IsDecl) ? "TRUE" : "FALSE");
  943. X    fprintf(debugfile, "[symb] ptiname = %s, uptiname = %s\n",
  944. X        ptr->info.trans.ptiname, ptr->info.trans.uptiname);
  945. X    *convert_buffer = 0;
  946. X    convert_buffer = convert_ds_to_string(convert_buffer, ptr->info.trans.ReturnType);
  947. X    fprintf(debugfile, "[symb] ReturnType = %s, Process = %d(\"%s\")\n",
  948. X        convert_buffer, ptr->info.trans.Process, (ptr->info.trans.Process)->name);
  949. X        if (hptr = ptr->info.trans.FirstParam) {
  950. X        fputs("[symb] parameter list:\n", debugfile);
  951. X            for(j=1; hptr; hptr=hptr->info.varorpar.NextParam, j++) {
  952. X        *convert_buffer = 0;
  953. X        convert_buffer = convert_ds_to_string(convert_buffer, hptr->info.varorpar.DataType);
  954. X        fprintf(debugfile, "[symb]     param %d: name = %s, type = %s\n",
  955. X            j, hptr->name, convert_buffer);
  956. X        }
  957. X    } else
  958. X        fputs("[symb] no transaction parameters declared!\n", debugfile);
  959. X    break;
  960. X    case PROCESSVAR:
  961. X    fputs("PROCESSVAR\n", debugfile);
  962. X    break;
  963. X    case TYPEDEFNAME:
  964. X    fputs("TYPEDEFNAME\n", debugfile);
  965. X    fprintf(debugfile, "[symb] IsPointer = %s, BuildXDRRoutine = %s\n",
  966. X        (ptr->info.typedefname.IsPointer) ? "TRUE" : "FALSE", 
  967. X        (ptr->info.typedefname.BuildXDRRoutine) ? "TRUE" : "FALSE");
  968. X    break;
  969. X    case STRUCTDECL:
  970. X    fputs("STRUCTDECL\n", debugfile);
  971. X    fprintf(debugfile, "[symb] IsStruct = %s, BuildXDRRoutine = %s\n",
  972. X        (ptr->info.structdecl.IsStruct) ? "TRUE" : "FALSE", 
  973. X        (ptr->info.structdecl.BuildXDRRoutine) ? "TRUE" : "FALSE");
  974. X    break;
  975. X    default:
  976. X    fputs("UNKNOWN!\n", debugfile);
  977. X    } /* switch */
  978. X} /* display_symbtab_entry */
  979. X
  980. X/******************************************************************************
  981. X * display_symbol_table()                                                OK   *
  982. X *                                                                            *
  983. X * Displays the symbol table with all entries.                                *
  984. X *                                                                            *
  985. X * Return values: none!                                                       *
  986. X ******************************************************************************/
  987. Xint
  988. Xdisplay_symbol_table()
  989. X{
  990. X    register int i;
  991. X    register SYMBTABEL *ptr;
  992. X
  993. X    fputs("[symb] ***** display_symbol_table():\n", debugfile);
  994. X    for(i = blknum; i >= 0; i--) {
  995. X        fprintf(debugfile, "[symb] ---------- symbol table - block depth %2d ----------\n", i);
  996. X        for(ptr = symbtab.PstTab[i]; ptr; ptr = ptr->PstNext)
  997. X            display_symbtab_entry(ptr);
  998. X    }
  999. X    fputs("[symb] ---------------------------------------------------\n", debugfile);
  1000. X} /* display_symbol_table */
  1001. X
  1002. X/******************************************************************************
  1003. X * display_struct_type_list                                              OK   *
  1004. X *                                                                            *
  1005. X * Displays the list containing the structure and type definitions.           *
  1006. X *                                                                            *
  1007. X * Return values: none!                                                       *
  1008. X ******************************************************************************/
  1009. Xint
  1010. Xdisplay_struct_type_list()
  1011. X{
  1012. X    register int i;
  1013. X    struct struct_type_list *ptr;
  1014. X    SYMBTABEL *symbol;
  1015. X
  1016. X    fputs("[symb] ***** display_struct_type_list():\n", debugfile);
  1017. X    for(ptr = first_structtype, i = 1; ptr; ptr = ptr->next, i++) {
  1018. X    symbol = ptr->symbol;
  1019. X        fprintf(debugfile, "[symb]       [%d] ", i);
  1020. X    switch(symbol->type) {
  1021. X    case TYPEDEFNAME:
  1022. X        fprintf(debugfile, "typedef ");
  1023. X        break;
  1024. X    case STRUCTDECL:
  1025. X        fprintf(debugfile, "struct ");
  1026. X        break;
  1027. X    default:
  1028. X        fprintf(debugfile, "illegal entry (type = %d)", symbol->type);
  1029. X    } /* switch */
  1030. X    fprintf(debugfile, " \"%s\"\n", symbol->name);
  1031. X    } /* for(ptr) */
  1032. X} /* display_struct_type_list */
  1033. X
  1034. X#endif /* DEBUGFLAG /**/
  1035. END_OF_FILE
  1036. if test 9368 -ne `wc -c <'dcc/symb_debug.c'`; then
  1037.     echo shar: \"'dcc/symb_debug.c'\" unpacked with wrong size!
  1038. fi
  1039. # end of 'dcc/symb_debug.c'
  1040. fi
  1041. if test -f 'examples/nullst/nullst.dc' -a "${1}" != "-c" ; then 
  1042.   echo shar: Will not clobber existing file \"'examples/nullst/nullst.dc'\"
  1043. else
  1044. echo shar: Extracting \"'examples/nullst/nullst.dc'\" \(10721 characters\)
  1045. sed "s/^X//" >'examples/nullst/nullst.dc' <<'END_OF_FILE'
  1046. X/***************************************************************************
  1047. X *                                                                         *
  1048. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  1049. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  1050. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  1051. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  1052. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  1053. X *                                                                         *
  1054. X *              A compiler for distributed programming with C              *
  1055. X *                                                                         *
  1056. X *                           n u l l s t . d c                             *
  1057. X *                                                                         *
  1058. X *                 Version 1.0      CreationDate: 29.08.90                 *
  1059. X *                                    LastUpDate: 18.10.90                 *
  1060. X *                                                                         *
  1061. X *Berechnung der Nullstellen einer Funktion mittels der Halbierungsmethode.*
  1062. X *                                                                         *
  1063. X *        Copyright (C) 1990 by Franz Distler and Christoph Pleier.        *
  1064. X *                          All rights reserved!                           *
  1065. X ***************************************************************************/
  1066. X
  1067. X/*
  1068. X * Dieses Programm berechnet die Nullstellen einer Funktion in einem best.
  1069. X * Intervall mittels der Halbierungsmethode.
  1070. X * Das Gesamtintervall wird in Teilintervalle untergliedert. Diese Teil-
  1071. X * intervalle werden auf mehreren Rechnern parallel berechnet.
  1072. X * Die zu untersuchende Funktion und die Genauigkeit der Berechnung werden
  1073. X * zur Uebersetzungszeit festgelegt.
  1074. X * Die Intervallgrenzen, die Schrittweite der Startnaeherung sowie die An-
  1075. X * zahl der Teilintervalle werden zur Laufzeit eingegeben.
  1076. X */
  1077. X
  1078. X#include <stdio.h>
  1079. X#undef stdin
  1080. X#undef stdout
  1081. X#undef stderr
  1082. X#include <math.h>
  1083. X
  1084. X/* Die Definition von DEMO konfiguriert eine Demonstrationsumgebung */
  1085. X/* #define DEMO /**/
  1086. X
  1087. X/* Die Definition von DEBUG bewirkt die zusaetzlich Ausgabe von Meldungen */
  1088. X/* #define DEBUG /**/
  1089. X
  1090. X/* maximale Anzahl von Berechnungsprozessen */
  1091. X#define MAXPROCESSANZ    100
  1092. X
  1093. X/* maximale Anzahl von Nullstellen pro Prozess */
  1094. X#define MAXENTRY    10000
  1095. X
  1096. X/* Genauigkeit der Nullstellenbestimmung: Abbruchkriterium. */
  1097. X#define LIMIT        1.0E-10 /* for HP 9000/720 */
  1098. X
  1099. X/* die zu untersuchende Funktion als Zeichenkette */
  1100. X#define FKTSTR        "sin(1/x)"
  1101. X
  1102. X#ifdef DEBUG
  1103. X# define DEBUGOUT(msg)    {printf("%s: %s\n", _processprefix, msg); \
  1104. X            fflush(stdout);}
  1105. X# define DEBUGPRINT(x)    {printf x; \
  1106. X             fflush(stdout);}
  1107. X#else
  1108. X# define DEBUGOUT(msg)  /* nothing */
  1109. X# define DEBUGPRINT(x)  /* nothing */
  1110. X#endif /* DEBUG /**/
  1111. X
  1112. X/* In dieser Struktur werden die Ergebnisse gesammelt und an das 
  1113. X * Hauptprogramm ueber die Transaktion 'ReturnResult' uebergeben.
  1114. X */
  1115. Xstruct nullst {
  1116. X    int num;
  1117. X    double x[MAXENTRY];
  1118. X};
  1119. X
  1120. X/****************************************************************************
  1121. X *         Name : f                                                         *
  1122. X *          Art : Funktionsdefinition                                       *
  1123. X *    Returntyp : double                                                    *
  1124. X *    Parameter : double x                                                  *
  1125. X * Beschreibung : Vereinbarung der zu untersuchenden Funktion               *
  1126. X ****************************************************************************/
  1127. Xdouble f(x)
  1128. Xdouble x;
  1129. X{
  1130. X#ifdef DEMO
  1131. X    return( (x == 0) ? 1 : sin(1/x) );
  1132. X#else
  1133. X    return( (x == 0) ? 1 : sin(1/x) );
  1134. X#endif /* DEMO /**/
  1135. X} /* f */
  1136. X
  1137. X/****************************************************************************
  1138. X *         Name : get_it                                                    *
  1139. X *          Art : Funktionsdefinition                                       *
  1140. X *    Returntyp : double                                                    *
  1141. X *    Parameter : double xl, double xr                                      *
  1142. X * Beschreibung : Bestimmung der Nullstelle im Intervall [xl,xr].           *
  1143. X ****************************************************************************/
  1144. Xdouble get_it(xl, xr)
  1145. Xdouble xl, xr;
  1146. X{
  1147. X    double xn;
  1148. X
  1149. X    DEBUGPRINT(("%s get_it(%lf, %lf):\n", _processprefix, xl, xr));
  1150. X    while(xr - xl > LIMIT) {
  1151. X        xn = xl + (xr - xl) / 2;
  1152. X        if (f(xl)*f(xn) <= 0)
  1153. X            xr = xn;
  1154. X        else 
  1155. X            xl = xn;
  1156. X    }
  1157. X    DEBUGPRINT(("%s Result = %lf\n", _processprefix, xn));
  1158. X    return(xn);
  1159. X} /* get_it */
  1160. X
  1161. X/****************************************************************************
  1162. X *         Name : DisplayHelpMessage                                        *
  1163. X *          Art : Funktionsdefinition                                       *
  1164. X *    Returntyp : int                                                       *
  1165. X *    Parameter : keine                                                     *
  1166. X * Beschreibung : Ausgabe einer kurzen Programmbeschreibung.                *
  1167. X ****************************************************************************/
  1168. Xint DisplayHelpMessage()
  1169. X{
  1170. X    printf("Dieses Programm bestimmt zu einer Funktion die Nullstellen mittels der\n");
  1171. X    printf("Halbierungsmethode. Die Funktion ist vor der Uebersetzung des Programmes\n");
  1172. X    printf("im Quelltext anzugeben. Zur Laufzeit wird das zu untersuchende Intervall\n");
  1173. X    printf("und die Schrittweite der Startnaeherung eingegeben und anschliessend die\n");
  1174. X    printf("Nullstellen bestimmt.\n\n");
  1175. X} /* DisplayHelpMessage */
  1176. X
  1177. X/****************************************************************************
  1178. X *         Name : Nullstellen                                               *
  1179. X *          Art : Prozesspezifikation                                       *
  1180. X *    Returntyp : keiner                                                    *
  1181. X *    Parameter : double ug, double og, double step                         *
  1182. X * Beschreibung : Spezifikation des Prozesses und seiner Transaktionen.     *
  1183. X ****************************************************************************/
  1184. Xprocess spec Nullstellen(double ug, double og, double step)
  1185. X{
  1186. X    trans struct nullst ReturnResult();
  1187. X}
  1188. X
  1189. X/****************************************************************************
  1190. X *         Name : Nullstellen                                               *
  1191. X *          Art : Prozessdefinition                                         *
  1192. X *    Returntyp : keiner                                                    *
  1193. X *    Parameter : ug, og, step                                              *
  1194. X * Beschreibung : Definition des Prozessrumpfes sowie des accept - Rumpfes  *
  1195. X *                der Transaktion.                                          *
  1196. X ****************************************************************************/
  1197. Xprocess body Nullstellen(ug, og, step)
  1198. X{
  1199. X    int count = 0;
  1200. X    double xl, xr;
  1201. X    struct nullst result;
  1202. X
  1203. X    printf("%s Berechne Nullstellen im Intervall [%f,%f]...\n", 
  1204. X        _processprefix, ug, og); 
  1205. X    fflush(stdout);
  1206. X
  1207. X    /* 
  1208. X     * Berechne die Nullstellen im Intervall [ug,og]
  1209. X     */
  1210. X
  1211. X    xl = ug;
  1212. X    xr = xl + step;
  1213. X    while(xl <= og) {
  1214. X        if (f(xl)*f(xr) <= 0) {
  1215. X            result.x[count] = get_it(xl, xr);
  1216. X            xr = result.x[count++] + LIMIT;
  1217. X            if (count >= MAXENTRY) {
  1218. X                    printf("%s Fehler: weitere Nullstellen nicht speicherbar\n",
  1219. X                    _processprefix);
  1220. X            }
  1221. X        }
  1222. X        xl = xr;
  1223. X        xr += step;
  1224. X    }
  1225. X    result.num = count;
  1226. X
  1227. X    printf("%s fertig!\n", _processprefix); 
  1228. X    fflush(stdout);
  1229. X
  1230. X    /*
  1231. X     * Warte auf Abholen der Ergebnisse und sende sie zurueck
  1232. X     */
  1233. X
  1234. X    DEBUGOUT("accepting ReturnResult()");
  1235. X    accept ReturnResult() { 
  1236. X        treturn(result); 
  1237. X    }
  1238. X
  1239. X    printf("%s terminiere!\n", _processprefix); 
  1240. X    fflush(stdout);
  1241. X    /* Prozesse sollten mit exit() beendet werden!!! */
  1242. X    exit(0);
  1243. X} /* process body Nullstellen */
  1244. X
  1245. X/****************************************************************************
  1246. X *         Name : main                                                      *
  1247. X *          Art : Funktionsdefinition                                       *
  1248. X *    Returntyp : int                                                       *
  1249. X *    Parameter : keine                                                     *
  1250. X * Beschreibung : Definition der Funktion main, die das Hauptprogramm bildet*
  1251. X ****************************************************************************/
  1252. Xmain(argc,argv)
  1253. X{
  1254. X    int i, j, ranz, nanz;
  1255. X    double ug, og, step, xl, xr, d;
  1256. X    struct nullst erg;
  1257. X    process Nullstellen N[MAXPROCESSANZ];
  1258. X
  1259. X    printf("Parallele Nullstellenbestimmung nach der Halbierungmethode\n");
  1260. X    printf("Realisiert in Distributed C von Christoph Pleier\n\n");
  1261. X
  1262. X    if (argc > 1) {
  1263. X        DisplayHelpMessage();
  1264. X        exit(-1);
  1265. X    }
  1266. X
  1267. X#ifdef DEMO
  1268. X    printf("Demonstrationsmodus aktiviert\n\n");
  1269. X    printf("Zu untersuchende Funktion f(x) = sin(1/x)\n");
  1270. X    printf("Zu untersuchendes Intervall = [%f,%f]\n", 
  1271. X        ug = -1.0, og = 1.0); 
  1272. X    printf("Schrittweite bei der Startnaeherung = %.8\n", 
  1273. X        step = 1E-07);
  1274. X#else
  1275. X    printf("Funktion: f(x) = %s\n", FKTSTR);
  1276. X    printf("Intervall:\n");
  1277. X    printf("   Untergrenze = ");
  1278. X    scanf("%lf", &ug);
  1279. X    printf("   Obergrenze  = ");
  1280. X    scanf("%lf", &og);
  1281. X    printf("Schrittweite bei der Startnaeherung = ");
  1282. X    scanf("%lf", &step);
  1283. X#endif /* DEMO /**/
  1284. X
  1285. X    printf("Wieviele Einzelprozesse sollen gestartet werden (max. %d)? ", 
  1286. X        MAXPROCESSANZ);
  1287. X    do {
  1288. X        scanf("%d", &ranz);
  1289. X    } while(ranz < 1 || ranz > MAXPROCESSANZ);
  1290. X
  1291. X    /* 
  1292. X     * Verteile Berechnungen auf die einzelnen Rechner 
  1293. X     * waehle Zielrechner entsprechend Standard-Konfigurationsdatei
  1294. X     */
  1295. X
  1296. X    d = (og - ug) / ranz;
  1297. X
  1298. X    for(i = 1; i < ranz; i++) {
  1299. X        printf("Starte Prozesse...\n");
  1300. X        DEBUGPRINT(("%s Starte Prozess %d\n", _processprefix, i));
  1301. X        DEBUGPRINT(("%s     Intervall: [%f,%f], Schrittweite: %f\"\n", 
  1302. X            _processprefix, ug, ug+d, step));
  1303. X        N[i] = create Nullstellen(ug, ug+d, step);
  1304. X        ug += d + LIMIT;
  1305. X    }
  1306. X    DEBUGPRINT(("%s Starte Prozess %d\n", _processprefix, i));
  1307. X    DEBUGPRINT(("%s     Intervall: [%f,%f], Schrittweite: %f\"\n", 
  1308. X        _processprefix, ug, og, step));
  1309. X    N[i] = create Nullstellen(ug, og, step);
  1310. X
  1311. X    /* 
  1312. X     * Hole Ergebnisse ab, gib sie aus und beende den Hauptprozess
  1313. X     */
  1314. X
  1315. X    DEBUGOUT("Warte auf Ergebnisse");
  1316. X    nanz = 0;
  1317. X    for(i = 1; i <= ranz; i++) {
  1318. X        erg = N[i]@ReturnResult();
  1319. X        nanz += erg.num;
  1320. X        for(j = 0; j < erg.num && erg.x[j] < og; ++j) {
  1321. X            printf("Nullstelle bei x = %+10.20f, f(x) = %+.10f\n",
  1322. X                erg.x[j], f(erg.x[j]));
  1323. X        }
  1324. X    }
  1325. X
  1326. X    printf("Anzahl der Nullstellen im Intervall [%f,%f] : %d\n", 
  1327. X        ug, og, nanz);
  1328. X
  1329. X    /* exit() sollte immer am Endpunkten von main bzw. von Prozesses
  1330. X     * stehen, damit der Verwaltungsprozess bei Termination benach-
  1331. X     * richtigt wird!
  1332. X     */
  1333. X    exit(0);
  1334. X
  1335. X} /* main */
  1336. END_OF_FILE
  1337. if test 10721 -ne `wc -c <'examples/nullst/nullst.dc'`; then
  1338.     echo shar: \"'examples/nullst/nullst.dc'\" unpacked with wrong size!
  1339. fi
  1340. # end of 'examples/nullst/nullst.dc'
  1341. fi
  1342. if test -f 'examples/test/creation.dc' -a "${1}" != "-c" ; then 
  1343.   echo shar: Will not clobber existing file \"'examples/test/creation.dc'\"
  1344. else
  1345. echo shar: Extracting \"'examples/test/creation.dc'\" \(9266 characters\)
  1346. sed "s/^X//" >'examples/test/creation.dc' <<'END_OF_FILE'
  1347. X/***************************************************************************
  1348. X *                                                                         *
  1349. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  1350. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  1351. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  1352. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  1353. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  1354. X *                                                                         *
  1355. X *              A compiler for distributed programming with C              *
  1356. X *                                                                         *
  1357. X *                        c r e a t i o n . d c                            *
  1358. X *                                                                         *
  1359. X *                 Version 1.0      CreationDate: 20.09.90                 *
  1360. X *                                    LastUpDate: 22.10.90                 *
  1361. X *                                                                         *
  1362. X *              Special program to test the process creation.              *
  1363. X *                                                                         *
  1364. X *      Copyright (C) 1990-1993 by Franz Distler and Christoph Pleier.     *
  1365. X *                          All rights reserved!                           *
  1366. X ***************************************************************************/
  1367. X
  1368. X/* define ONE of the following */
  1369. X/* #define iPSC        /* for Intel Hypercube */
  1370. X/* #define XENIX     /* for Xenix System V */
  1371. X#define BSD        /* for BSD or compatibles */
  1372. X
  1373. X/****************************************************************************
  1374. X *         name : Message                                                   *
  1375. X *         type : function definition                                       *
  1376. X *   returntype : int                                                       *
  1377. X *   parameters : char * action                                             *
  1378. X *  description : This function displays the message action with an prefix  *
  1379. X *                specifying the calling process.                           *
  1380. X ****************************************************************************/
  1381. Xint Message(action)
  1382. Xchar *action;
  1383. X{
  1384. X#ifdef iPSC
  1385. X    printf("%-15s | %-8ld | %-8ld | %-30s\n", _processname, mynode(), 
  1386. X    _mypid(), action);
  1387. X#else
  1388. X    printf("%-15s | %-15s | %-10d | %-30s\n", _processname,
  1389. X# ifdef XENIX
  1390. X    "local",
  1391. X# else
  1392. X    _own_port.hostname,
  1393. X# endif /* XENIX /**/
  1394. X    getpid(), action);
  1395. X#endif /* iPSC /**/
  1396. X    fflush(stdout);
  1397. X} /* Message */
  1398. X
  1399. X/****************************************************************************
  1400. X *         name : P1                                                        *
  1401. X *         type : process specification                                     *
  1402. X *   returntype : none                                                      *
  1403. X *   parameters : none                                                      *
  1404. X *  description : Specification of the process P1.                          *
  1405. X ****************************************************************************/
  1406. Xprocess spec P1();
  1407. X
  1408. X/****************************************************************************
  1409. X *         name : P2                                                        *
  1410. X *         type : process specification                                     *
  1411. X *   returntype : none                                                      *
  1412. X *   parameters : struct P2_par par                                         *
  1413. X *  description : Specification of the process P1.                          *
  1414. X ****************************************************************************/
  1415. Xprocess spec P2(int id);
  1416. X
  1417. X/****************************************************************************
  1418. X *         name : P3                                                        *
  1419. X *         type : process specification                                     *
  1420. X *   returntype : none                                                      *
  1421. X *   parameters : none                                                      *
  1422. X *  description : Specification of the process P3.                          *
  1423. X ****************************************************************************/
  1424. Xprocess spec P3();
  1425. X
  1426. X/****************************************************************************
  1427. X *         name : P4                                                        *
  1428. X *         type : process specification                                     *
  1429. X *   returntype : none                                                      *
  1430. X *   parameters : double x, double y                                        *
  1431. X *  description : Specification of the process P4.                          *
  1432. X ****************************************************************************/
  1433. Xprocess spec P4(double x, double y);
  1434. X
  1435. X/****************************************************************************
  1436. X *         name : P1                                                        *
  1437. X *         type : process definition                                        *
  1438. X *   returntype : none                                                      *
  1439. X *   parameters : none                                                      *
  1440. X *  description : Definition of the process P1.                             *
  1441. X ****************************************************************************/
  1442. Xprocess body P1()
  1443. X{
  1444. X    process P2 p;
  1445. X
  1446. X    Message("RUNNING");
  1447. X    Message("STARTING P2");
  1448. X    p = create P2(1);
  1449. X    sleep(10);
  1450. X    Message("TERMINATING");
  1451. X    exit(0);
  1452. X} /* process body P1 */
  1453. X
  1454. X/****************************************************************************
  1455. X *         name : P2                                                        *
  1456. X *         type : process definition                                        *
  1457. X *   returntype : none                                                      *
  1458. X *   parameters : none                                                      *
  1459. X *  description : Definition of the process P2.                             *
  1460. X ****************************************************************************/
  1461. Xprocess body P2(id)
  1462. X{
  1463. X    process P2 p2; 
  1464. X    process P3 p3;
  1465. X
  1466. X    Message("RUNNING");
  1467. X    if (id <= 3) {
  1468. X        Message("STARTING P2");
  1469. X    p2 = create P2(id + 1);
  1470. X    } else {
  1471. X        Message("STARTING P3");
  1472. X        p3 = create P3();
  1473. X    }
  1474. X    sleep(5);
  1475. X    Message("TERMINATING");
  1476. X    exit(0);
  1477. X} /* process body P2 */
  1478. X
  1479. X/****************************************************************************
  1480. X *         name : P3                                                        *
  1481. X *         type : process definition                                        *
  1482. X *   returntype : none                                                      *
  1483. X *   parameters : none                                                      *
  1484. X *  description : Definition of the process P3.                             *
  1485. X ****************************************************************************/
  1486. Xprocess body P3()
  1487. X{
  1488. X    process P4 p;
  1489. X
  1490. X    Message("RUNNING");
  1491. X    Message("STARTING P4");
  1492. X    p = create P4(1.0, 1.1);
  1493. X    sleep(8);
  1494. X    Message("TERMINATING");
  1495. X    exit(0);
  1496. X} /* process body P3 */
  1497. X
  1498. X/****************************************************************************
  1499. X *         name : P4                                                        *
  1500. X *         type : process definition                                        *
  1501. X *   returntype : none                                                      *
  1502. X *   parameters : none                                                      *
  1503. X *  description : Definition of the process P4.                             *
  1504. X ****************************************************************************/
  1505. Xprocess body P4()
  1506. X{
  1507. X    Message("RUNNING");
  1508. X    sleep(10);
  1509. X    Message("TERMINATING");
  1510. X    exit(0);
  1511. X} /* process body P4 */
  1512. X
  1513. X/****************************************************************************
  1514. X *         name : main                                                      *
  1515. X *         type : function definition                                       *
  1516. X *   returntype : int                                                       *
  1517. X *   parameters : none                                                      *
  1518. X *  description : Definition of the main function building the main program.*
  1519. X ****************************************************************************/
  1520. Xmain()
  1521. X{
  1522. X    process P1 p1;
  1523. X    process P4 p4;
  1524. X
  1525. X    puts("This program tests the process creation facilities of the");
  1526. X    puts("distributed C package.");
  1527. X    puts("The following processes will be created:");
  1528. X    puts("    1 x P1, 4 x P2, 1 x P3, 2 x P4\n");
  1529. X#ifdef iPSC
  1530. X    printf("%-15s | %-8s | %-8s | %-30s\n", "PROCESS", "NODE", "PID", "ACTION");
  1531. X#else
  1532. X    printf("%-15s | %-15s | %-10s | %-30s\n", "PROCESS", "HOST", "PID", "ACTION");
  1533. X#endif /* iPSC /**/
  1534. X    puts("----------------|-----------------|------------|------------------------------");
  1535. X    Message("STARTING P1");
  1536. X    p1 = create P1();
  1537. X    Message("STARTING P4");
  1538. X    p4 = create P4(2.1, 3.2);
  1539. X    Message("TERMINATING");
  1540. X    exit(0);
  1541. X} /* main */
  1542. END_OF_FILE
  1543. if test 9266 -ne `wc -c <'examples/test/creation.dc'`; then
  1544.     echo shar: \"'examples/test/creation.dc'\" unpacked with wrong size!
  1545. fi
  1546. # end of 'examples/test/creation.dc'
  1547. fi
  1548. if test -f 'include/dcc.h' -a "${1}" != "-c" ; then 
  1549.   echo shar: Will not clobber existing file \"'include/dcc.h'\"
  1550. else
  1551. echo shar: Extracting \"'include/dcc.h'\" \(10529 characters\)
  1552. sed "s/^X//" >'include/dcc.h' <<'END_OF_FILE'
  1553. X/***************************************************************************
  1554. X *                                                                         *
  1555. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  1556. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  1557. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  1558. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  1559. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  1560. X *                                                                         *
  1561. X *              A compiler for distributed programming with C              *
  1562. X *                                                                         *
  1563. X *                                d c c . h                                *
  1564. X *                                                                         *
  1565. X *                            Package : Include files                      *
  1566. X *                            Version : 1.0                                *
  1567. X *                       CreationDate : 14.08.90                           *
  1568. X *                         LastUpDate : 06.12.93                           *
  1569. X *                                                                         *
  1570. X *      Special definitions and declarations mainly used at runtime.       *
  1571. X *                                                                         *
  1572. X *                  Portions Copyright 1990 Franz Distler                  *
  1573. X *               Copyright (C) 1990-1994 by Christoph Pleier               *
  1574. X *                          All rights reserved!                           *
  1575. X ***************************************************************************/
  1576. X
  1577. X/*
  1578. X * This file is part of the Distributed C Development Environment (DCDE).
  1579. X * DCDE is free software; you can redistribute it and/or modify
  1580. X * it under the terms written in the README-file. 
  1581. X * DCDE is distributed in the hope that it will be useful,
  1582. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1583. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  1584. X * See the file README for more details.
  1585. X */
  1586. X
  1587. X#ifndef __dcc_h
  1588. X#define __dcc_h
  1589. X
  1590. X#if !defined(FILE) && !defined(RPC_XDR)
  1591. X# include <stdio.h>
  1592. X#endif
  1593. X#include "ipc.h"
  1594. X
  1595. X/* maximal length of */
  1596. X#define MAXPATHNAMELEN    256    /* a process pathname */
  1597. X#define MAXFILENAMELEN    14    /* a process filename */
  1598. X#ifndef MAXHOSTNAMELEN
  1599. X# define MAXHOSTNAMELEN 256    /* a hostname */
  1600. X#endif
  1601. X
  1602. X/* connection types */
  1603. X#define CREATION_CONNECTION    1
  1604. X#define TRANSACTION_CONNECTION    2
  1605. X#define ACCEPT_CONNECTION    3
  1606. X#define ABORT_CONNECTION    4
  1607. X
  1608. X/* constants for the transaction call protocoll */
  1609. X#define TRANS_ACCEPT        5    /* transaction accepted */
  1610. X#define TRANS_DENIED        6    /* transaction denied */
  1611. X
  1612. X/* transaction calling modes */
  1613. X#define CALL            7    /* call process as well */
  1614. X#define DONTCALL        8    /* don't call process */
  1615. X
  1616. X/* #ifdef iPSC */
  1617. X/* where to create the administration process */
  1618. X# define ADMIN_NODE    1L
  1619. X# define ADMIN_PID    1L
  1620. X/* #endif /* iPSC /**/
  1621. X
  1622. X/* constants specifying administration process' services */
  1623. X#define NOTIFY_START        0
  1624. X#define NOTIFY_END        1
  1625. X#define NOTIFY_ERROR        2
  1626. X#define NOTIFY_ACCORTER_ON    3
  1627. X#define NOTIFY_ACCORTER_OFF    4
  1628. X#define NOTIFY_GETLOCATION    5
  1629. X
  1630. X/* the type of a process descriptor */
  1631. Xstruct PROCESSDESCR {
  1632. X    char      processname[MAXPATHNAMELEN]; /* process name */
  1633. X    long      pid;                         /* process id */
  1634. X    PORTDESCR port;                        /* process port */
  1635. X};
  1636. X
  1637. X#ifndef RPC_XDR
  1638. Xtypedef struct PROCESSDESCR PROCESSDESCR;
  1639. X#endif /* !RPC_XDR /**/
  1640. X
  1641. X/* the type of a request sent to the administration process */
  1642. Xstruct ADMINREQUEST {
  1643. X    int request_type;    /* the request type */
  1644. X};
  1645. X
  1646. X#ifndef RPC_XDR
  1647. Xtypedef struct ADMINREQUEST ADMINREQUEST;
  1648. X#endif /* !RPC_XDR /**/
  1649. X
  1650. X/* the type used for sending the configfilename to the administration process */
  1651. Xstruct ADMINCFGINFO {
  1652. X    char filename[MAXFILENAMELEN];
  1653. X};
  1654. X
  1655. X#ifndef RPC_XDR
  1656. Xtypedef struct ADMINCFGINFO ADMINCFGINFO;
  1657. X#endif /* !RPC_XDR /**/
  1658. X
  1659. X/* the type used for getting location info from the administration process */
  1660. Xstruct ADMINLOCINFO {
  1661. X    char processname[80];                  /* name of process */
  1662. X    char processfilename[MAXFILENAMELEN];  /* corresponding file name */
  1663. X    char creator_location[MAXHOSTNAMELEN]; /* location of creator process */
  1664. X    char hostname[MAXHOSTNAMELEN];           /* target host name */
  1665. X};
  1666. X
  1667. X#ifndef RPC_XDR
  1668. Xtypedef struct ADMINLOCINFO ADMINLOCINFO;
  1669. X#endif /* !RPC_XDR /**/
  1670. X
  1671. X#ifdef iPSC
  1672. X/* port informations of creator and administration process */
  1673. Xtypedef struct {
  1674. X    PORTDESCR creator_port;
  1675. X    PORTDESCR admin_port;
  1676. X} PORTSDATA;
  1677. X#endif
  1678. X
  1679. X/* specific informations of a process */
  1680. Xstruct PROCESSDATA {
  1681. X    char      processname[MAXPATHNAMELEN]; /* process name */
  1682. X    long      pid;                         /* process pid */
  1683. X    PORTDESCR port;                        /* process port */
  1684. X    int       error;                       /* error flag */
  1685. X};
  1686. X
  1687. X#ifndef RPC_XDR
  1688. Xtypedef struct PROCESSDATA PROCESSDATA;
  1689. X#endif /* !RPC_XDR /**/
  1690. X
  1691. X/* specific informations of a process
  1692. X * NOTE: request size mus be greater than MAXIDLEN of config.h! 
  1693. X */
  1694. Xstruct TRANSDATA {
  1695. X    char request[40]; /* transaction request */
  1696. X    int  reply;       /* transaction reply */
  1697. X};
  1698. X
  1699. X#ifndef RPC_XDR
  1700. Xtypedef struct TRANSDATA TRANSDATA;
  1701. X#endif /* !RPC_XDR /**/
  1702. X
  1703. X#ifndef RPC_XDR
  1704. X
  1705. X/* macro to determine the maximum of x and y */
  1706. X#define MAX(x,y)    ((x >= y) ? x : y)
  1707. X
  1708. X#define XDRRESIZE(s)    s * 4 + 100
  1709. X
  1710. X#define SIZEOFLONG    64
  1711. X
  1712. X/* 
  1713. X * library functions in alphabetic order 
  1714. X */
  1715. X
  1716. X#if defined(__STDC__) && !defined(NO_PROTOTYPE)
  1717. X# define FUNCPROTO(type,id,args)    extern type id args
  1718. X#else
  1719. X# define FUNCPROTO(type,id,args)    extern type id()
  1720. X#endif /* __STDC__ /**/
  1721. X
  1722. XFUNCPROTO(int, accept_connection, (CONNECTIONDESCR *, PORTDESCR *, unsigned));
  1723. X#if defined(HPUX) || defined(UNICOS) || defined(LINUX)
  1724. XFUNCPROTO(void, _catch, (int));
  1725. X#else
  1726. XFUNCPROTO(int, _catch, (int));
  1727. X#endif /* HPUX || UNICOS || LINUX /**/
  1728. XFUNCPROTO(int, _check_process, (PROCESSDESCR));
  1729. XFUNCPROTO(int, _choose_host, (PORTDESCR *, char *));
  1730. XFUNCPROTO(int, _close_connection, (CONNECTIONDESCR *));
  1731. XFUNCPROTO(int, _convert_argv_to_port, (PORTDESCR *, PORTDESCR *, char **));
  1732. XFUNCPROTO(int, _convert_port_to_argv, (char **, PORTDESCR, PORTDESCR));
  1733. XFUNCPROTO(int, _create_port, (PORTDESCR *));
  1734. X#ifndef iPSC
  1735. XFUNCPROTO(int, _create_dcadmin, (char *, char *));
  1736. X#endif /* !iPSC /**/
  1737. XFUNCPROTO(int, _create_process, (char *, char *, char *, PROCESSDESCR *));
  1738. X#ifdef HETEROGENEOUS
  1739. XFUNCPROTO(int, _decode, (char *, bool_t (*)()));
  1740. X#endif /* HETEROGENEOUS /**/
  1741. XFUNCPROTO(int, _delete_port, (PORTDESCR *));
  1742. XFUNCPROTO(int, _destroy_process, (PROCESSDESCR, int));
  1743. XFUNCPROTO(int, _display_connection_port_info, (char *, char *, CONNECTIONDESCR));
  1744. XFUNCPROTO(int, _display_port_info, (char *, char *, PORTDESCR));
  1745. XFUNCPROTO(int, _display_processdata_info, (char *, char *, PROCESSDATA));
  1746. XFUNCPROTO(int, _display_processdescr_info, (char *, char *, PROCESSDESCR));
  1747. X#ifdef HETEROGENEOUS
  1748. XFUNCPROTO(int, _encode, (char *, bool_t (*)(), unsigned long *));
  1749. X#endif /* HETEROGENEOUS /**/
  1750. XFUNCPROTO(int, _get_location_from_admin, (char *, char *, char **));
  1751. X#ifdef iPSC
  1752. XFUNCPROTO(int, _get_ports, (CONNECTIONDESCR *));
  1753. X#endif /* iPSC /**/
  1754. XFUNCPROTO(int, _get_transaction_call, (char *));
  1755. XFUNCPROTO(int, _input_port_info, (PORTDESCR *));
  1756. XFUNCPROTO(int, _make_connection, (CONNECTIONDESCR *, PORTDESCR *, PORTDESCR *, unsigned));
  1757. XFUNCPROTO(int, _make_transaction_call, (PORTDESCR, char *, int));
  1758. XFUNCPROTO(int, _receive_connection_type_or_answer, ());
  1759. X#ifdef iPSC
  1760. XFUNCPROTO(int, _receive_ports_data, ());
  1761. X#endif /* iPSC /**/
  1762. XFUNCPROTO(int, _receive_process_data, (PROCESSDATA *));
  1763. XFUNCPROTO(int, _recv_data, (CONNECTIONDESCR *, char *, int, unsigned));
  1764. XFUNCPROTO(int, _recv_data_encoded, (CONNECTIONDESCR *, char *, int (*)(), int));
  1765. X#ifndef iPSC
  1766. XFUNCPROTO(int, _report_back, ());
  1767. X#endif /* !iPSC /**/
  1768. XFUNCPROTO(int, _send_connection_type_or_answer, (int));
  1769. XFUNCPROTO(int, _send_data, (CONNECTIONDESCR *, char *, int, unsigned));
  1770. XFUNCPROTO(int, _send_data_encoded, (CONNECTIONDESCR *, char *, int (*)(), int));
  1771. XFUNCPROTO(int, _send_process_data, ());
  1772. XFUNCPROTO(int, _set_signals, ());
  1773. XFUNCPROTO(int, _notify_admin_process, (int));
  1774. X#ifdef HETEROGENEOUS
  1775. XFUNCPROTO(bool_t, xdr_PORTDESCR,       (XDR *, PORTDESCR *));
  1776. XFUNCPROTO(bool_t, xdr_CONNECTIONDESCR, (XDR *, CONNECTIONDESCR *));
  1777. XFUNCPROTO(bool_t, xdr_PROCESSDESCR,    (XDR *, PROCESSDESCR *));
  1778. XFUNCPROTO(bool_t, xdr_ADMINREQUEST,    (XDR *, ADMINREQUEST *));
  1779. XFUNCPROTO(bool_t, xdr_ADMINLOCINFO,    (XDR *, ADMINLOCINFO *));
  1780. XFUNCPROTO(bool_t, xdr_ADMINCFGINFO,    (XDR *, ADMINCFGINFO *));
  1781. XFUNCPROTO(bool_t, xdr_PROCESSDATA,     (XDR *, PROCESSDATA *));
  1782. XFUNCPROTO(bool_t, xdr_TRANSDATA,       (XDR *, TRANSDATA *));
  1783. X#endif /* HETEROGENEOUS /**/
  1784. XFUNCPROTO(int, _RuntimeError, (char *));
  1785. XFUNCPROTO(int, _SendTransCallReply, (int));
  1786. X
  1787. X/*
  1788. X * external declarations of global variables
  1789. X */
  1790. X
  1791. Xextern int
  1792. X    Errno,
  1793. X    errno,
  1794. X    _debugflush;
  1795. X
  1796. Xextern char 
  1797. X     _processprefix[],
  1798. X    *_programname,
  1799. X    *_processname,
  1800. X    *sys_errlist[];
  1801. X
  1802. Xextern PORTDESCR 
  1803. X    _own_port,
  1804. X    _creator_port,
  1805. X    _admin_port;
  1806. X
  1807. Xextern CONNECTIONDESCR
  1808. X    _con_port;
  1809. X
  1810. Xextern FILE
  1811. X    *_debugout;
  1812. X
  1813. X#ifdef HETEROGENEOUS
  1814. Xextern char 
  1815. X    *_dcc_buf,
  1816. X    *_xdr_size_buf;
  1817. Xextern unsigned long
  1818. X    _xdr_size;
  1819. Xextern XDR 
  1820. X    encode_xdrs,
  1821. X    decode_xdrs,
  1822. X    _xdr_encode_size_xdrs,
  1823. X    _xdr_decode_size_xdrs;
  1824. X#endif /* HETEROGENEOUS /**/
  1825. X
  1826. X/* 
  1827. X * special utilities for debug purpose only 
  1828. X */
  1829. X
  1830. Xextern int
  1831. X    _debug_ipc,
  1832. X    _debug_convert,
  1833. X    _debug_control,
  1834. X    _debug_creation,
  1835. X    _debug_kill,
  1836. X    _debug_transaction;
  1837. X
  1838. X#define PRINT_DEBUG_ALL            {_debug_ipc = 1; \
  1839. X                    _debug_convert = 1; \
  1840. X                    _debug_control = 1; \
  1841. X                    _debug_creation = 1; \
  1842. X                    _debug_kill = 1; \
  1843. X                    _debug_transaction = 1;}
  1844. X#define PRINT_DEBUG_IPC_ON        _debug_ipc         = 1
  1845. X#define PRINT_DEBUG_IPC_OFF        _debug_ipc         = 0
  1846. X#define PRINT_DEBUG_CONVERT_ON        _debug_convert     = 1
  1847. X#define PRINT_DEBUG_CONVERT_OFF        _debug_convert     = 0
  1848. X#define PRINT_DEBUG_CONTROL_ON        _debug_control     = 1
  1849. X#define PRINT_DEBUG_CONTROL_OFF        _debug_control     = 0
  1850. X#define PRINT_DEBUG_CREATION_ON        _debug_creation    = 1
  1851. X#define PRINT_DEBUG_CREATION_OFF    _debug_creation    = 0
  1852. X#define PRINT_DEBUG_KILL_ON        _debug_kill        = 1
  1853. X#define PRINT_DEBUG_KILL_OFF        _debug_kill        = 0
  1854. X#define PRINT_DEBUG_TRANSACTION_ON    _debug_transaction = 1
  1855. X#define PRINT_DEBUG_TRANSACTION_OFF    _debug_transaction = 0
  1856. X
  1857. X#endif /* !RPC_XDR /**/
  1858. X
  1859. X#endif /* !__dcc_h /**/
  1860. END_OF_FILE
  1861. if test 10529 -ne `wc -c <'include/dcc.h'`; then
  1862.     echo shar: \"'include/dcc.h'\" unpacked with wrong size!
  1863. fi
  1864. # end of 'include/dcc.h'
  1865. fi
  1866. if test -f 'include/functions.h' -a "${1}" != "-c" ; then 
  1867.   echo shar: Will not clobber existing file \"'include/functions.h'\"
  1868. else
  1869. echo shar: Extracting \"'include/functions.h'\" \(10104 characters\)
  1870. sed "s/^X//" >'include/functions.h' <<'END_OF_FILE'
  1871. X/***************************************************************************
  1872. X *                                                                         *
  1873. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  1874. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  1875. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  1876. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  1877. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  1878. X *                                                                         *
  1879. X *              A compiler for distributed programming with C              *
  1880. X *                                                                         *
  1881. X *                          f u n c t i o n s . h                          *
  1882. X *                                                                         *
  1883. X *                            Package : Include files                      *
  1884. X *                            Version : 2.0                                *
  1885. X *                       CreationDate : 19.08.90                           *
  1886. X *                         LastUpDate : 04.11.91                           *
  1887. X *                                                                         *
  1888. X *           Compiler functions with parameter and return types.           *
  1889. X *                                                                         *
  1890. X *     Copyright (C) 1990-1994 by Franz Distler and Christoph Pleier.      *
  1891. X *                          All rights reserved!                           *
  1892. X ***************************************************************************/
  1893. X
  1894. X/*
  1895. X * This file is part of the Distributed C Development Environment (DCDE).
  1896. X * DCDE is free software; you can redistribute it and/or modify
  1897. X * it under the terms written in the README-file. 
  1898. X * DCDE is distributed in the hope that it will be useful,
  1899. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1900. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  1901. X * See the file README for more details.
  1902. X */
  1903. X
  1904. X#ifndef __functions_h
  1905. X#define __functions_h
  1906. X
  1907. XFUNCPROTO(SELECTATTR *, add_guard_to_attr, (SELECTATTR *, char *));
  1908. XFUNCPROTO(int         , add_includefile_to_list, (char *));
  1909. XFUNCPROTO(IDL_ATTR   *, add_init_declarator_list, (IDL_ATTR *, IDL_ATTR *));
  1910. XFUNCPROTO(SYMBTABEL  *, add_parm_type, (DS_ATTR *, SYMBTABEL *));
  1911. XFUNCPROTO(SYMBTABEL  *, add_process_info, (SYMBTABEL *, SYMBTABEL *, SYMBTABEL *));
  1912. XFUNCPROTO(SQL_ATTR   *, add_spec_qual_list, (SQL_ATTR *, SQL_ATTR *));
  1913. XFUNCPROTO(STL_ATTR   *, add_struct_declaration, (STL_ATTR *, STL_ATTR *));
  1914. XFUNCPROTO(SDL_ATTR   *, add_struct_declarator, (SDL_ATTR *, SDL_ATTR *));
  1915. XFUNCPROTO(SYMBTABEL  *, add_struct_or_union_info, (SU_ATTR *, SYMBTABEL *, STL_ATTR *));
  1916. XFUNCPROTO(SYMBTABEL  *, add_transaction_info, (SYMBTABEL *, DS_ATTR *, SYMBTABEL *));
  1917. XFUNCPROTO(SYMBTABEL  *, add_transaction_label, (SYMBTABEL *));
  1918. XFUNCPROTO(SYMBTABEL  *, add_trans_info, (SYMBTABEL *, SYMBTABEL *));
  1919. XFUNCPROTO(TQL_ATTR   *, add_type_qualifier, (TQL_ATTR *, TQL_ATTR *));
  1920. XFUNCPROTO(int         , append_file, (FILE *, FILE *));
  1921. XFUNCPROTO(int         , blk_pop, ());
  1922. XFUNCPROTO(int         , blk_push, ());
  1923. XFUNCPROTO(int         , build_includefile, ());
  1924. XFUNCPROTO(int         , build_makefile, ());
  1925. XFUNCPROTO(int         , build_xdrfile, ());
  1926. XFUNCPROTO(SYMBTABEL  *, check_transaction, (SYMBTABEL *));
  1927. XFUNCPROTO(char        , choose_void_type, ());
  1928. XFUNCPROTO(int         , close_files, ());
  1929. XFUNCPROTO(char       *, convert_d_to_string, (char *, D_ATTR *));
  1930. XFUNCPROTO(char       *, convert_dd_to_string, (char *, DD_ATTR *));
  1931. XFUNCPROTO(char       *, convert_ds_to_string, (char *, DS_ATTR *));
  1932. XFUNCPROTO(char       *, convert_id_to_string, (char *, ID_ATTR *));
  1933. XFUNCPROTO(char       *, convert_idl_to_string, (char *, IDL_ATTR *));
  1934. XFUNCPROTO(char       *, convert_p_to_string, (char *, P_ATTR *));
  1935. XFUNCPROTO(char       *, convert_scs_to_string, (char *, SCS_ATTR *));
  1936. XFUNCPROTO(char       *, convert_sd_to_string, (char *, SD_ATTR *));
  1937. XFUNCPROTO(char       *, convert_sdl_to_string, (char *, SDL_ATTR *));
  1938. XFUNCPROTO(char       *, convert_sql_to_string, (char *, SQL_ATTR *));
  1939. XFUNCPROTO(char       *, convert_st_to_string, (char *, ST_ATTR *));
  1940. XFUNCPROTO(char       *, convert_stl_to_string, (char *, STL_ATTR *));
  1941. XFUNCPROTO(char       *, convert_su_to_string, (char *, SU_ATTR *));
  1942. XFUNCPROTO(char       *, convert_sus_to_string, (char *, SUS_ATTR *, char));
  1943. XFUNCPROTO(char       *, convert_tq_to_string, (char *, TQ_ATTR *));
  1944. XFUNCPROTO(char       *, convert_tql_to_string, (char *, TQL_ATTR *));
  1945. XFUNCPROTO(char       *, convert_ts_to_string, (char *, TS_ATTR *, char));
  1946. XFUNCPROTO(ACCEPTATTR *, create_accept_attribute, (SYMBTABEL *, COMPATTR *));
  1947. XFUNCPROTO(ARG_LIST   *, create_arg_list_elem, (char *));
  1948. XFUNCPROTO(COMPATTR   *, create_compound_attribute, (char *, char *));
  1949. XFUNCPROTO(POSTATTR   *, create_post_expr_attr, (char *));
  1950. XFUNCPROTO(SELECTATTR *, create_select_attribute, (int, ACCEPTATTR *, char *));
  1951. XFUNCPROTO(TRANSATTR  *, create_trans_attr, (POSTATTR *, SYMBTABEL *, ARG_LIST *));
  1952. XFUNCPROTO(int         , display_comp_attribute, (COMPATTR *));
  1953. XFUNCPROTO(int         , display_help, ());
  1954. XFUNCPROTO(int         , display_select_attribute, (SELECTATTR *));
  1955. X#ifdef DEBUGFLAG
  1956. XFUNCPROTO(int         , display_struct_type_list, ());
  1957. XFUNCPROTO(int         , display_symbol_table, ());
  1958. XFUNCPROTO(int         , display_symbtab_entry, (SYMBTABEL *));
  1959. X#endif /* DEBUGFLAG /**/
  1960. XFUNCPROTO(int         , display_usage, ());
  1961. XFUNCPROTO(int         , display_version, ());
  1962. XFUNCPROTO(SYMBTABEL  *, enter_symbtabel, (char *));
  1963. XFUNCPROTO(char       *, evaluate_declaration, (DS_ATTR *, IDL_ATTR *));
  1964. XFUNCPROTO(char       *, gencode_function, (DS_ATTR *, D_ATTR *, char *, COMPATTR *));
  1965. XFUNCPROTO(char       *, generate_destroy_process_code, (char *));
  1966. XFUNCPROTO(int         , gencode_process_body, (SYMBTABEL *, COMPATTR *));
  1967. XFUNCPROTO(char       *, generate_call_transaction_code, (char *, char *, SYMBTABEL *, ARG_LIST *, char *));
  1968. XFUNCPROTO(char       *, generate_process_creation_code, (SYMBTABEL *, ARG_LIST *, char *));
  1969. XFUNCPROTO(char       *, generate_select_code, (SELECTATTR *));
  1970. XFUNCPROTO(char       *, generate_transaction_code, (ACCEPTATTR *));
  1971. XFUNCPROTO(char       *, generate_treturn_code, (char *));
  1972. XFUNCPROTO(int         , gen_call_transaction_routines, (SYMBTABEL *));
  1973. XFUNCPROTO(ES_ATTR    *, gen_enum_specifier_attr, (char *));
  1974. XFUNCPROTO(DS_ATTR    *, gen_declaration_specifiers_attr, (SCS_ATTR *, TS_ATTR *, TQ_ATTR *, DS_ATTR *));
  1975. XFUNCPROTO(D_ATTR     *, gen_declarator_attr, (P_ATTR *, DD_ATTR *));
  1976. XFUNCPROTO(DD_ATTR    *, gen_direct_decl_attr, (char, SYMBTABEL *, D_ATTR *, DD_ATTR *, char *));
  1977. XFUNCPROTO(ID_ATTR    *, gen_init_declarator_attr, (D_ATTR *, char *));
  1978. XFUNCPROTO(IDL_ATTR   *, gen_init_declarator_list_attr, (ID_ATTR *));
  1979. XFUNCPROTO(P_ATTR     *, gen_pointer_attr, (int, TQL_ATTR *, P_ATTR *));
  1980. XFUNCPROTO(int         , gen_process_creation_routine, (SYMBTABEL *));
  1981. XFUNCPROTO(SYMBTABEL  *, gen_process_file, (SYMBTABEL *));
  1982. XFUNCPROTO(SQL_ATTR   *, gen_spec_qual_list_attr, (TS_ATTR *, TQ_ATTR *));
  1983. XFUNCPROTO(SCS_ATTR   *, gen_storage_class_spec_attr, (char));
  1984. XFUNCPROTO(ST_ATTR    *, gen_struct_declaration_attr, (SQL_ATTR *, SDL_ATTR *));
  1985. XFUNCPROTO(SD_ATTR    *, gen_struct_declarator_attr, (D_ATTR *, char *));
  1986. XFUNCPROTO(SDL_ATTR   *, gen_struct_declarator_list_attr, (SD_ATTR *));
  1987. XFUNCPROTO(SU_ATTR    *, gen_struct_or_union_attr, (char));
  1988. XFUNCPROTO(SUS_ATTR   *, gen_struct_or_union_spec_attr, (SU_ATTR *, SYMBTABEL *, STL_ATTR *));
  1989. XFUNCPROTO(STL_ATTR   *, gen_stru_declaration_list_attr, (ST_ATTR *));
  1990. XFUNCPROTO(TQ_ATTR    *, gen_type_qualifier_attr, (char));
  1991. XFUNCPROTO(TQL_ATTR   *, gen_type_qualifier_list_attr, (TQ_ATTR *));
  1992. XFUNCPROTO(TS_ATTR    *, gen_type_specifier_attr, (int, ES_ATTR *, SUS_ATTR *, SYMBTABEL *));
  1993. XFUNCPROTO(SYMBTABEL  *, get_process, (SYMBTABEL *));
  1994. XFUNCPROTO(int         , hash, (char *));
  1995. XFUNCPROTO(int         , init_symbtab, ());
  1996. XFUNCPROTO(void        , is_process, (SYMBTABEL *));
  1997. XFUNCPROTO(void        , is_transaction, (SYMBTABEL *));
  1998. XFUNCPROTO(ARG_LIST   *, link_arguments, (ARG_LIST *, ARG_LIST *));
  1999. XFUNCPROTO(SYMBTABEL  *, link_parameters, (SYMBTABEL *, SYMBTABEL *));
  2000. XFUNCPROTO(SELECTATTR *, link_select_attributes, (SELECTATTR *, SELECTATTR *));
  2001. XFUNCPROTO(SYMBTABEL  *, link_transactions, (SYMBTABEL *, SYMBTABEL *));
  2002. XFUNCPROTO(SYMBTABEL  *, lookup_symbtabel, (char *));
  2003. XFUNCPROTO(SYMBTABEL  *, make_function, (DS_ATTR *, D_ATTR *));
  2004. XFUNCPROTO(SYMBTABEL  *, make_parameter, (SYMBTABEL *));
  2005. XFUNCPROTO(SYMBTABEL  *, make_process, (SYMBTABEL *));
  2006. XFUNCPROTO(SYMBTABEL  *, make_process_def, (SYMBTABEL *));
  2007. XFUNCPROTO(SYMBTABEL  *, make_structure, (SYMBTABEL *));
  2008. XFUNCPROTO(int         , make_structure_definition, (DS_ATTR *, IDL_ATTR *));
  2009. XFUNCPROTO(SYMBTABEL  *, make_transaction, (SYMBTABEL *));
  2010. XFUNCPROTO(int         , make_typedef_name, (DS_ATTR *, IDL_ATTR *));
  2011. XFUNCPROTO(DS_ATTR    *, mark_struct_or_type_def_for_XDR, (DS_ATTR *));
  2012. XFUNCPROTO(int         , parse_options, (int , char **));
  2013. XFUNCPROTO(void        , reenter_process_comps, (SYMBTABEL *));
  2014. XFUNCPROTO(void        , reenter_transactions, (IDENTCHAIN *));
  2015. XFUNCPROTO(void        , reenter_transaction_params, (SYMBTABEL *));
  2016. XFUNCPROTO(SYMBTABEL  *, store_struct_or_type_def, (SYMBTABEL *));
  2017. XFUNCPROTO(char       *, strmalloc, (char *));
  2018. XFUNCPROTO(char       *, strsave, (char *));
  2019. XFUNCPROTO(IDENTCHAIN *, update_post_expr_attr, (IDENTCHAIN *, SYMBTABEL *));
  2020. XFUNCPROTO(int         , yyerror, (char *));
  2021. XFUNCPROTO(int         , yymark, ());
  2022. XFUNCPROTO(char       *, yytoken, ());
  2023. XFUNCPROTO(char       *, yywhere, ());
  2024. XFUNCPROTO(int         , yywrap, ());
  2025. XFUNCPROTO(int         , Error, (char *, char *));
  2026. XFUNCPROTO(int         , Free, (char *));
  2027. XFUNCPROTO(char       *, Malloc, (unsigned));
  2028. XFUNCPROTO(int         , Panic, (char *));
  2029. XFUNCPROTO(int         , SetSignals, ());
  2030. XFUNCPROTO(char       *, Strcat, (char *, char *));
  2031. XFUNCPROTO(char       *, Strcatmany, ());
  2032. XFUNCPROTO(int         , Warning, (char *));
  2033. X
  2034. X#endif /* !__functions_h /**/
  2035. END_OF_FILE
  2036. if test 10104 -ne `wc -c <'include/functions.h'`; then
  2037.     echo shar: \"'include/functions.h'\" unpacked with wrong size!
  2038. fi
  2039. # end of 'include/functions.h'
  2040. fi
  2041. echo shar: End of archive 8 \(of 18\).
  2042. cp /dev/null ark8isdone
  2043. MISSING=""
  2044. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
  2045.     if test ! -f ark${I}isdone ; then
  2046.     MISSING="${MISSING} ${I}"
  2047.     fi
  2048. done
  2049. if test "${MISSING}" = "" ; then
  2050.     echo You have unpacked all 18 archives.
  2051.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2052. else
  2053.     echo You still need to unpack the following archives:
  2054.     echo "        " ${MISSING}
  2055. fi
  2056. ##  End of shell archive.
  2057. exit 0
  2058.