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

  1. Newsgroups: comp.sources.unix
  2. From: pleierc@informatik.tu-muenchen.de (Christoph Pleier)
  3. Subject: v27i181: distributed-c-2.1 - Distributed C Development Environment, V2.1, Part07/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 181
  10. Archive-Name: distributed-c-2.1/part07
  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 7 (of 18)."
  19. # Contents:  config/debug.c config/system.y dcadmin/Status.c
  20. #   dcinstall/Compile.c dcinstall/ParseOptions.c dcinstall/main.c
  21. #   include/com_Errno.h include/globals.h include/run_errlist.h
  22. #   ipc/p1.c
  23. # Wrapped by vixie@gw.home.vix.com on Thu Dec 23 00:12:00 1993
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. if test -f 'config/debug.c' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'config/debug.c'\"
  27. else
  28. echo shar: Extracting \"'config/debug.c'\" \(9082 characters\)
  29. sed "s/^X//" >'config/debug.c' <<'END_OF_FILE'
  30. X/***************************************************************************
  31. X *                                                                         *
  32. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  33. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  34. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  35. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  36. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  37. X *                                                                         *
  38. X *              A compiler for distributed programming with C              *
  39. X *                                                                         *
  40. X *                              d e b u g . c                              *
  41. X *                                                                         *
  42. X *                            Package : Configuration Files Parsers        *
  43. X *                            Version : 1.0                                *
  44. X *                       CreationDate : 26.02.92                           *
  45. X *                         LastUpDate : 26.02.92                           *
  46. X *                                                                         *
  47. X * All routines needed to display additional informations for debugging    *
  48. X * perpose only.                                                           *
  49. X *                                                                         *
  50. X *               Copyright (C) 1992-1994 by Christoph Pleier               *
  51. X *                          All rights reserved!                           *
  52. X ***************************************************************************/
  53. X
  54. X/*
  55. X * This file is part of the Distributed C Development Environment (DCDE).
  56. X * DCDE is free software; you can redistribute it and/or modify
  57. X * it under the terms written in the README-file. 
  58. X * DCDE is distributed in the hope that it will be useful,
  59. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  60. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  61. X * See the file README for more details.
  62. X */
  63. X
  64. X#include <stdio.h>
  65. X#include "cfgparsers.h"
  66. X
  67. X#define DEBUG
  68. X
  69. X#ifdef DEBUG
  70. X
  71. X/******************************************************************************
  72. X * DisplaySymbtabel()                                                         *
  73. X *                                                                            *
  74. X * Displays the components of the symbol table element pointed to by 'symbol'.*
  75. X *                                                                            *
  76. X * Return values: none!                                                       *
  77. X ******************************************************************************/
  78. Xint
  79. XDisplaySymbtabel(symbol)
  80. XSYMBTABEL *symbol;
  81. X{
  82. X    TARGETINFO *target;
  83. X    SYMBTABEL  *p_symb;
  84. X    ACCFSINFO  *afs;
  85. X    IDENTLIST  *idl;
  86. X    FSSPECINFO *fsl;
  87. X    COMMPINFO  *csl;
  88. X    PATTRINFO  *pattrl;
  89. X    PHOSTLIST  *phost;
  90. X    COSTINFO   *costl;
  91. X
  92. X    printf("name : \"%s\"\n", symbol->name);
  93. X    printf("type : ");
  94. X    switch(symbol->type) {
  95. X    case UNDEFINED:
  96. X        puts("UNDEFINED");
  97. X    break;
  98. X    case S_HOST:
  99. X        puts("S_HOST");
  100. X    printf("installed operating system : %s\n", symbol->info.Host.os->name);
  101. X    printf("             computer type : %s\n", symbol->info.Host.type->name);
  102. X    printf("           physical memory : %f MB\n", symbol->info.Host.phys_mem);
  103. X    printf("            virtual memory : %f MB\n", symbol->info.Host.virt_mem);
  104. X    printf("         performance index : %f\n", symbol->info.Host.perf_index);
  105. X    if (symbol->info.Host.multiprocessor) {
  106. X        printf("            multiprocessor : TRUE\n");
  107. X        printf("      number of processors : %d\n", symbol->info.Host.processors);
  108. X        printf("               memory type : %s memory\n", 
  109. X            (symbol->info.Host.memory_type == SHARED_MEMORY) ? "shared" : "distributed");
  110. X        printf("has parallelizing compiler : %s\n", (symbol->info.Host.has_par_compiler) ? "TRUE" : "FALSE");
  111. X    } else 
  112. X        printf("            multiprocessor : FALSE\n");
  113. X    printf("        is vector computer : %s\n", (symbol->info.Host.is_vector_computer) ? "TRUE" : "FALSE");
  114. X
  115. X    printf("peripheral devices:\n    ");
  116. X    for(idl = symbol->info.Host.p_devices; idl; idl = idl->next)
  117. X        printf("%s ", idl->symbol->name);
  118. X    puts("");
  119. X
  120. X    printf("accessible filesystems:\n    ");
  121. X    for(afs = symbol->info.Host.f_systems; afs; afs = afs->next)
  122. X        printf("%s (%f) ", afs->filesystem->name, afs->acc_time);
  123. X    puts("");
  124. X
  125. X    printf("compilation information:\n");
  126. X    for(target = symbol->info.Host.compinfo; target; target = target->next){
  127. X        printf("    target type : \"%s\"\n", target->type);
  128. X        printf("    target os   : \"%s\"\n", target->os);
  129. X        printf("        cc      : \"%s\"\n", target->cc);
  130. X        printf("        cflags  : \"%s\"\n", target->cflags);
  131. X        printf("        ldflags : \"%s\"\n", target->ldflags);
  132. X        printf("        libs    : \"%s\"\n", target->libs);
  133. X    }
  134. X
  135. X    printf("cost informations:\n");
  136. X    for(costl = symbol->info.Host.costinfo; costl; costl = costl->next) 
  137. X        printf("    -> %15s : %3.2f, %3.2f\n", costl->dest_host->name, costl->crea_val, costl->comm_val);
  138. X    printf("internal informations:\n");
  139. X    printf("prob_load : %f\n", symbol->info.Host.prob_load);
  140. X    printf(" pcreated : %d\n", symbol->info.Host.pcreated);
  141. X    break;
  142. X    case S_COMPUTER_TYPE:
  143. X        puts("S_COMPUTER_TYPE");
  144. X    break;
  145. X    case S_OPERATING_SYSTEM:
  146. X        puts("S_OPERATING_SYSTEM");
  147. X    break;
  148. X    case S_FIXED_DISK:
  149. X        puts("S_FIXED_DISK");
  150. X    printf("disk located in host \"%s\"\n", symbol->info.disk.location->name);
  151. X    printf("disk size = %f MB\n", symbol->info.disk.size);
  152. X    printf("disk access time = %f ms\n", symbol->info.disk.speed);
  153. X    break;
  154. X    case S_PROCESS:
  155. X    puts("S_PROCESS");
  156. X    printf("  intensity index : %f\n", symbol->info.Process.intensity_index);
  157. X    if (symbol->info.Process.pref_hosts) {
  158. X        printf("  preferred hosts : ");
  159. X        for(idl = symbol->info.Process.pref_hosts; idl; idl = idl->next)
  160. X        printf("%s ", idl->symbol->name);
  161. X        puts("");
  162. X    }
  163. X    if (symbol->info.Process.rest_hosts) {
  164. X        printf(" restricted hosts : ");
  165. X        for(idl = symbol->info.Process.rest_hosts; idl; idl = idl->next)
  166. X        printf("%s ", idl->symbol->name);
  167. X        puts("");
  168. X    }
  169. X    if (symbol->info.Process.peri_dev) {
  170. X        printf("accesses peripheral devices :\n"); 
  171. X        for(idl = symbol->info.Process.peri_dev; idl; idl = idl->next)
  172. X        printf("%s ", idl->symbol->name);
  173. X        puts("");
  174. X    }
  175. X    if (symbol->info.Process.filesystems) {
  176. X        printf("accesses filesystems:\n"); 
  177. X        for(fsl = symbol->info.Process.filesystems; fsl; fsl = fsl->next)
  178. X        printf("    name: %s, freq: %f, quant: %f\n", 
  179. X            fsl->filesys->name, fsl->frequency, fsl->quantity);
  180. X    }
  181. X    if (symbol->info.Process.commps) {
  182. X        printf("communicates with:\n"); 
  183. X        for(csl = symbol->info.Process.commps; csl; csl = csl->next)
  184. X        printf("    name: %s, freq: %f, quant: %f\n", 
  185. X            csl->Process->name, csl->frequency, csl->quantity);
  186. X    }
  187. X    for(pattrl = symbol->info.Process.others; pattrl; pattrl = pattrl->next) {
  188. X        switch(pattrl->type) {
  189. X        case PA_PHYS_MEM:
  190. X        printf("%s physical memory: %f MB\n", (pattrl->mode == MODE_WISHES) ? "whishes" : "requires",
  191. X            pattrl->info.phys_mem_size);
  192. X        break;
  193. X        case PA_VIRT_MEM:
  194. X        printf("%s virtual memory: %f MB\n", (pattrl->mode == MODE_WISHES) ? "whishes" : "requires",
  195. X            pattrl->info.virt_mem_size);
  196. X        break;
  197. X        case PA_VECTORIZATION:
  198. X        printf("%s vectorization\n", (pattrl->mode == MODE_WISHES) ? "whishes" : "requires");
  199. X        break;
  200. X        case PA_PARALLELIZATION:
  201. X        printf("%s parallelization\n", (pattrl->mode == MODE_WISHES) ? "whishes" : "requires");
  202. X        break;
  203. X        }
  204. X    } /* for(pattrl) */
  205. X    if (symbol->info.Process.phostlist) {
  206. X        printf("priority hostlist:\n"); 
  207. X        for(phost = symbol->info.Process.phostlist; phost; phost = phost->next)
  208. X        printf("    host: %10s, pref: %d, w_val: %3d, load: %2.2f, overall: %2.2f\n",
  209. X                    phost->Host->name, phost->preferred, phost->wished_val, 
  210. X            phost->load, phost->overall_index);
  211. X    }
  212. X    default:
  213. X        puts("unknown");
  214. X    } /* switch */
  215. X} /* DisplaySymbtabel */
  216. X
  217. X/******************************************************************************
  218. X * DisplaySymbolTable()                                                       *
  219. X *                                                                            *
  220. X * Displays the complete symbol table.                                        *
  221. X *                                                                            *
  222. X * Return values: none!                                                       *
  223. X ******************************************************************************/
  224. Xint
  225. XDisplaySymbolTable()
  226. X{
  227. X    int i;
  228. X    register SYMBTABEL *symbol;
  229. X
  230. X    puts("Symbol table:");
  231. X    puts("=============\n");
  232. X    for(symbol = symbtab, i = 1; symbol; symbol = symbol->next, i++) {
  233. X    printf("Entry %3d:\n", i);
  234. X    printf("----------\n");
  235. X    DisplaySymbtabel(symbol);
  236. X    puts("");
  237. X    }
  238. X} /* DisplaySymbolTable */
  239. X
  240. X#endif /* DEBUG /**/
  241. END_OF_FILE
  242. if test 9082 -ne `wc -c <'config/debug.c'`; then
  243.     echo shar: \"'config/debug.c'\" unpacked with wrong size!
  244. fi
  245. # end of 'config/debug.c'
  246. fi
  247. if test -f 'config/system.y' -a "${1}" != "-c" ; then 
  248.   echo shar: Will not clobber existing file \"'config/system.y'\"
  249. else
  250. echo shar: Extracting \"'config/system.y'\" \(8845 characters\)
  251. sed "s/^X//" >'config/system.y' <<'END_OF_FILE'
  252. X/***************************************************************************
  253. X *                                                                         *
  254. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  255. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  256. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  257. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  258. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  259. X *                                                                         *
  260. X *              A compiler for distributed programming with C              *
  261. X *                                                                         *
  262. X *                             s y s t e m . y                             *
  263. X *                                                                         *
  264. X *                            Package : Configuration Files Parsers        *
  265. X *                            Version : 2.0                                *
  266. X *                       CreationDate : 20.11.91                           *
  267. X *                         LastUpDate : 20.12.93                           *
  268. X *                                                                         *
  269. X *   The grammar specifying the syntax of the system configuration file.   *
  270. X *                                                                         *
  271. X *               Copyright (C) 1991-1994 by Christoph Pleier               *
  272. X *                          All rights reserved!                           *
  273. X ***************************************************************************/
  274. X
  275. X/*
  276. X * This file is part of the Distributed C Development Environment (DCDE).
  277. X * DCDE is free software; you can redistribute it and/or modify
  278. X * it under the terms written in the README-file. 
  279. X * DCDE is distributed in the hope that it will be useful,
  280. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  281. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  282. X * See the file README for more details.
  283. X */
  284. X
  285. X%{
  286. X#include <stdio.h>
  287. X#include <stdlib.h>
  288. X#include <sys/types.h>
  289. X#include "cfgparsers.h"
  290. X%}
  291. X
  292. X/* the type of the value stack */
  293. X%union {
  294. X    char        *y_str;        /* a string */
  295. X    SYMBTABEL   *y_symb;        /* a pointer to a symbol table element */
  296. X    float        y_float;    /* a number */
  297. X    MULTIINFO   *y_multi;    
  298. X    OPTCOMPINFO *y_ocomp;
  299. X    COMPSPEINFO *y_comsp;
  300. X    TARGETINFO  *y_target;   /* a pointer to a target information */
  301. X    ACCFSINFO   *y_accfs;
  302. X    IDENTLIST   *y_idlist;   /* a pointer to an identifier list */
  303. X}
  304. X
  305. X/* characters */
  306. X%token ',' ';' ':' '.' '+' '-' '*' '/' '%' '~' '!' '&' '|' '^'
  307. X%token '=' '<' '>' '{' '}' '[' ']' '(' ')' '\"' '\'' '\\' '@'
  308. X
  309. X/* special characters
  310. X * NOTE: The token definition must be defined exactly like in program.y
  311. X */
  312. X%token ACCESSES ACCESSIBLE COMMUNICATES COMPILATION COMPILER COMPUTER COSTS 
  313. X%token CREATION DEVICES DISKS DISTRIBUTED EXECUTABLES FILESYSTEMS FIXED FOR 
  314. X%token GENERAL HOST HOSTS HOSTNAMES INDEX INFORMATIONS INTENSITY LISTS LOCATION 
  315. X%token MEMORY MULTIPROCESSOR OPERATING PARALLELIZING PERFORMANCE PERIPHERAL 
  316. X%token PHYSICAL PREFERRED PRIORITY PROCESS PROCESSORS REQUIRES RESTRICTED 
  317. X%token SHARED SIZE SPECIFICATION SPEED STORAGE SYSTEM TARGET TYPE TYPES 
  318. X%token VARIANTS VECTOR VIRTUAL WISHES WITH
  319. X%token VECTORIZATION PARALLELIZATION
  320. X%token MS NS KB MB GB
  321. X%token CC CFLAGS LD LDFLAGS LIBS
  322. X%token IDENT STRING NUMBER
  323. X
  324. X%type <y_str>    STRING
  325. X%type <y_symb>   IDENT operating_system_definition
  326. X%type <y_float>  NUMBER size_specification time_specification
  327. X%type <y_float>  optional_disk_size_definition optional_disk_speed_definition
  328. X%type <y_multi>  multiprocessor_specification
  329. X%type <y_ocomp>  optional_computer_attribute_list optional_computer_attribute
  330. X%type <y_comsp>  computer_specification
  331. X%type <y_target> target_specification target_list compilation_specification 
  332. X%type <y_accfs>  filesystem_definition filesystems_list
  333. X%type <y_accfs>  accessible_filesystems_definition
  334. X%type <y_idlist> ident_list peripheral_devices_definition
  335. X
  336. X%start system_configuration
  337. X
  338. X%%
  339. X
  340. Xsystem_configuration: 
  341. X      declaration_list
  342. X    ;
  343. X
  344. Xdeclaration_list:
  345. X      declaration
  346. X    | declaration_list declaration
  347. X    ;
  348. X
  349. Xdeclaration:
  350. X      hostnames_definition
  351. X    | computer_types_definition
  352. X    | operating_system_variants_definition
  353. X    | fixed_disks_definition
  354. X    | host_specification
  355. X    | compilation_hosts_definition
  356. X    | costs_definition
  357. X    ;
  358. X
  359. Xhostnames_definition:
  360. X      HOSTNAMES '=' '{' ident_list '}'
  361. X        {mark_symbols($4, S_HOST);}
  362. X    ;
  363. X
  364. Xcomputer_types_definition:
  365. X      COMPUTER TYPES '=' '{' ident_list '}'
  366. X        {mark_symbols($5, S_COMPUTER_TYPE);}
  367. X    ;
  368. X
  369. Xoperating_system_variants_definition:
  370. X      OPERATING SYSTEM VARIANTS '=' '{' ident_list '}'
  371. X        {mark_symbols($6, S_OPERATING_SYSTEM);}
  372. X    ;
  373. X
  374. Xfixed_disks_definition:
  375. X      FIXED DISKS '=' '{' disk_definition_list '}'
  376. X    ;
  377. X
  378. Xdisk_definition_list:
  379. X      disk_definition
  380. X    | disk_definition_list disk_definition
  381. X    ;
  382. X
  383. Xdisk_definition:
  384. X      IDENT '=' '{' 
  385. X          LOCATION ':' IDENT
  386. X          optional_disk_size_definition
  387. X          optional_disk_speed_definition
  388. X      '}'
  389. X        {enter_disk_definition($1, $6, $7, $8);}
  390. X    ;
  391. X
  392. Xoptional_disk_size_definition:
  393. X      /* empty */
  394. X        {$$ = 0.0;}
  395. X    | SIZE ':' size_specification
  396. X        {$$ = $3;}
  397. X    ;
  398. X
  399. Xoptional_disk_speed_definition:
  400. X      /* empty */
  401. X        {$$ = 0.0;}
  402. X    | SPEED ':' time_specification
  403. X        {$$ = $3;}
  404. X    ;
  405. X
  406. Xhost_specification:
  407. X      HOST ident_list '=' '{' 
  408. X        operating_system_definition
  409. X        computer_specification
  410. X        peripheral_devices_definition
  411. X        compilation_specification
  412. X        accessible_filesystems_definition
  413. X      '}'
  414. X        {enter_host_specification($2, $5, $6, $7, $8, $9);}
  415. X    ;
  416. X
  417. Xoperating_system_definition:
  418. X      OPERATING SYSTEM ':' IDENT
  419. X        {$$ = $4;}
  420. X    ;
  421. X
  422. Xcomputer_specification:
  423. X      COMPUTER SPECIFICATION '{'
  424. X          TYPE ':' IDENT
  425. X        PHYSICAL MEMORY ':' size_specification
  426. X        VIRTUAL MEMORY ':' size_specification
  427. X        PERFORMANCE INDEX ':' NUMBER
  428. X          STORAGE FOR EXECUTABLES ':' IDENT
  429. X      '}'
  430. X        {$$ = generate_comp_spec_info($6, $10, $14, $18, NULL, $23);}
  431. X    | COMPUTER SPECIFICATION '{'
  432. X          TYPE ':' IDENT
  433. X        PHYSICAL MEMORY ':' size_specification
  434. X        VIRTUAL MEMORY ':' size_specification
  435. X        PERFORMANCE INDEX ':' NUMBER
  436. X        optional_computer_attribute_list
  437. X          STORAGE FOR EXECUTABLES ':' IDENT
  438. X      '}'
  439. X        {$$ = generate_comp_spec_info($6, $10, $14, $18, $19, $24);}
  440. X    ;
  441. X
  442. Xoptional_computer_attribute_list:
  443. X      optional_computer_attribute
  444. X    | optional_computer_attribute_list optional_computer_attribute
  445. X        {$$ = add_opt_comp_attr_info($1, $2);}
  446. X    ;
  447. X
  448. Xoptional_computer_attribute:
  449. X      multiprocessor_specification
  450. X        {$$ = generate_opt_comp_attr_info($1, 0);}
  451. X    | VECTOR COMPUTER
  452. X        {$$ = generate_opt_comp_attr_info(NULL, VECTOR_COMPUTER);}
  453. X    | PARALLELIZING COMPILER
  454. X        {$$ = generate_opt_comp_attr_info(NULL, PAR_COMPILER);}
  455. X    ;
  456. X
  457. Xmultiprocessor_specification:
  458. X      MULTIPROCESSOR SYSTEM ':' NUMBER PROCESSORS ',' SHARED MEMORY
  459. X        {$$ = generate_multi_info($4, SHARED_MEMORY);}
  460. X    | MULTIPROCESSOR SYSTEM ':' NUMBER PROCESSORS ',' DISTRIBUTED MEMORY
  461. X        {$$ = generate_multi_info($4, DISTRIBUTED_MEMORY);}
  462. X    ;
  463. X
  464. Xperipheral_devices_definition:
  465. X      /* empty */
  466. X        {$$ = NULL;}
  467. X    | PERIPHERAL DEVICES '=' '{' ident_list '}'
  468. X        {$$ = $5;}
  469. X    ;
  470. X
  471. Xcompilation_specification:
  472. X      COMPILATION '{' target_list '}'
  473. X        {$$ = $3;}
  474. X    ;
  475. X
  476. Xtarget_list:
  477. X      target_specification 
  478. X    | target_list target_specification
  479. X        {$$ = chain_targetinfos($1, $2);}
  480. X    ;
  481. X      
  482. Xtarget_specification:
  483. X      TARGET ':' IDENT '(' IDENT ')' '{'
  484. X        CC      '=' STRING
  485. X        CFLAGS  '=' STRING
  486. X        LDFLAGS '=' STRING
  487. X        LIBS    '=' STRING 
  488. X      '}'
  489. X        {$$ = generate_targetinfo($3, $5, $10, $13, $16, $19);}
  490. X    ;
  491. X
  492. Xaccessible_filesystems_definition:
  493. X      /* empty */
  494. X        {$$ = NULL;}
  495. X    | ACCESSIBLE FILESYSTEMS '=' '{' filesystems_list '}'
  496. X        {$$ = $5;}
  497. X    ;
  498. X
  499. Xfilesystems_list:
  500. X      filesystem_definition
  501. X    | filesystems_list ',' filesystem_definition
  502. X        {$$ = chain_accfs_infos($1, $3);}
  503. X    ;
  504. X
  505. Xfilesystem_definition:
  506. X      IDENT '(' time_specification ')'
  507. X        {$$ = generate_accfs_info($1, $3);}
  508. X    ;
  509. X
  510. Xcompilation_hosts_definition:
  511. X      COMPILATION HOSTS PRIORITY LISTS '{'
  512. X        compilation_hosts_priority_list
  513. X      '}'
  514. X    ;
  515. X
  516. Xcompilation_hosts_priority_list:
  517. X      /* empty */
  518. X    | compilation_hosts_specification_list
  519. X    | GENERAL ':' ident_list
  520. X    ;
  521. X
  522. Xcompilation_hosts_specification_list:
  523. X      IDENT ':' ident_list
  524. X    | compilation_hosts_specification_list IDENT ':' ident_list
  525. X    ;
  526. X
  527. Xcosts_definition:
  528. X      COSTS INFORMATIONS '{' costs_definition_list '}'
  529. X    ;
  530. X
  531. Xcosts_definition_list:
  532. X      cost_definition
  533. X    | costs_definition_list cost_definition
  534. X    ;
  535. X
  536. Xcost_definition:
  537. X      IDENT '-' '>' IDENT ':' NUMBER ',' NUMBER
  538. X        {enter_cost_definition($1, $4, $6, $8);}
  539. X    ;
  540. X
  541. Xident_list:
  542. X      IDENT
  543. X        {$$ = store_ident_in_list($1);}
  544. X    | ident_list ',' IDENT 
  545. X        {$$ = chain_ident_lists($1, store_ident_in_list($3));}
  546. X    ;
  547. X
  548. Xsize_specification:
  549. X      NUMBER MB
  550. X    | NUMBER GB
  551. X        {$$ = $1 * 1024;}
  552. X    ;
  553. X
  554. Xtime_specification:
  555. X      NUMBER MS
  556. X    ;
  557. X
  558. X%%
  559. END_OF_FILE
  560. if test 8845 -ne `wc -c <'config/system.y'`; then
  561.     echo shar: \"'config/system.y'\" unpacked with wrong size!
  562. fi
  563. # end of 'config/system.y'
  564. fi
  565. if test -f 'dcadmin/Status.c' -a "${1}" != "-c" ; then 
  566.   echo shar: Will not clobber existing file \"'dcadmin/Status.c'\"
  567. else
  568. echo shar: Extracting \"'dcadmin/Status.c'\" \(7800 characters\)
  569. sed "s/^X//" >'dcadmin/Status.c' <<'END_OF_FILE'
  570. X/***************************************************************************
  571. X *                                                                         *
  572. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  573. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  574. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  575. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  576. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  577. X *                                                                         *
  578. X *              A compiler for distributed programming with C              *
  579. X *                                                                         *
  580. X *                             S t a t u s . c                             *
  581. X *                                                                         *
  582. X *                            Package : Administration Process             *
  583. X *                            Version : 1.0                                *
  584. X *                       CreationDate : 16.09.90                           *
  585. X *                         LastUpDate : 06.12.93                           *
  586. X *                                                                         *
  587. X * All routines needed for storing new process states and for displaying   *
  588. X * them.                                                                   *
  589. X *                                                                         *
  590. X *               Copyright (C) 1990-1994 by Christoph Pleier               *
  591. X *                          All rights reserved!                           *
  592. X ***************************************************************************/
  593. X
  594. X/*
  595. X * This file is part of the Distributed C Development Environment (DCDE).
  596. X * DCDE is free software; you can redistribute it and/or modify
  597. X * it under the terms written in the README-file. 
  598. X * DCDE is distributed in the hope that it will be useful,
  599. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  600. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  601. X * See the file README for more details.
  602. X */
  603. X
  604. X#include <stdio.h>
  605. X#include <sys/types.h>
  606. X#ifdef HETEROGENEOUS
  607. X# include <rpc/rpc.h>
  608. X#endif
  609. X#include <signal.h>
  610. X#include <time.h>
  611. X#ifndef UNICOS
  612. X# include <sys/timeb.h>
  613. X#endif
  614. X#include <errno.h>
  615. X#ifdef BSD
  616. X# include <sys/wait.h>
  617. X#endif /* BSD /**/
  618. X#include "ipc.h"
  619. X#include "dcc.h"
  620. X#include "timeout.h"
  621. X#include "dcadmin.h"
  622. X
  623. X#define EXIT(v)            fprintf(stderr, "dcadmin: Terminating!\n"); \
  624. X                exit(v)
  625. X
  626. X/******************************************************************************
  627. X * ChangeProcessStatus()                                                      *
  628. X *                                                                            *
  629. X * Change the state of a process to 'accept or terminate' or 'running'.       *
  630. X *                                                                            *
  631. X * Return values: OK upon success / ERROR upon error                          *
  632. X ******************************************************************************/
  633. Xint
  634. XChangeProcessStatus(state)
  635. Xint state;
  636. X{
  637. X    PROCESSDATA p_data;
  638. X    register struct pdat_list *aptr;
  639. X
  640. X    /* Receive the process information of the process */
  641. X    if (_receive_process_data(&p_data)) {
  642. X    error("dcadmin: receiving process data");
  643. X    EXIT(ERROR);
  644. X    }
  645. X    /* Search entry in list and change the state if there is one.
  646. X     * Otherwise return an error.
  647. X     */
  648. X    for(aptr = pdat_first; aptr; aptr = aptr->next) {
  649. X        if (!strcmp(aptr->p_descr.processname, p_data.processname)
  650. X#ifdef iPSC
  651. X       && aptr->p_descr.port.node == p_data.port.node
  652. X       && aptr->p_descr.port.pid  == p_data.port.pid) {
  653. X#else
  654. X# ifdef SINGLE
  655. X       && aptr->p_descr.pid == p_data.pid) {
  656. X# else /* HOMOGENEOUS || HETEROGENEOUS */
  657. X       && !strcmp(aptr->p_descr.port.hostname, p_data.port.hostname)
  658. X       && aptr->p_descr.port.portnum == p_data.port.portnum) {
  659. X# endif /* SINGLE /**/
  660. X#endif /* iPSC /**/
  661. X        aptr->status = (state == NOTIFY_ACCORTER_ON) ? ACCORTER : RUNNING;
  662. X#ifdef ADMINDEBUG
  663. X            fprintf(dfile, "[dbg] %s state of process %s with pid %d modified to %s\n",
  664. X            _processprefix, aptr->p_descr.processname, aptr->p_descr.pid, 
  665. X            (state == NOTIFY_ACCORTER_ON) ? "accept or terminate" : 
  666. X            "running");
  667. X            if (_debugflush)
  668. X            fflush(dfile);
  669. X#endif /* ADMINDEBUG /**/
  670. X        if (state == NOTIFY_ACCORTER_ON)
  671. X            CheckAcceptOrTerminate();
  672. X        return(OK);
  673. X    }
  674. X    } /* for */
  675. X    error("Process to change state not found in process data list");
  676. X    return(ERROR);
  677. X} /* ChangeProcessStatus */
  678. X
  679. X/******************************************************************************
  680. X * DisplayStatus()                                                            *
  681. X *                                                                            *
  682. X * Displays the status of all processes of the 'process data list'.           *
  683. X *                                                                            *
  684. X * Return values: OK upon success / ERROR upon error                          *
  685. X ******************************************************************************/
  686. Xint
  687. XDisplayStatus()
  688. X{
  689. X    register struct pdat_list *ptr;
  690. X
  691. X#ifdef DO_NOT_COMPILE
  692. X    switch(fork()) {
  693. X    case -1:
  694. X    error("dcadmin: fork()");
  695. X    EXIT(ERROR);
  696. X    /* break; */
  697. X    case 0:
  698. X    /* child! */
  699. X        printf("\n%-20s |", "PROCESSNAME");
  700. X#ifdef iPSC
  701. X        printf(" %-15s |", "NODE");
  702. X#else
  703. X# ifndef SINGLE
  704. X        printf(" %-20s |", "HOST");
  705. X# endif /* !SINGLE /**/
  706. X#endif /* iPSC /**/
  707. X        printf(" %-10s | %-15s\n", "PID", "STATUS");
  708. X        for(ptr = pdat_first; ptr; ptr = ptr->next) {
  709. X            printf("%-20s |", ptr->p_descr.processname);
  710. X#ifdef iPSC
  711. X            printf(" %-15ld |", ptr->p_descr.port.node);
  712. X#else
  713. X# ifndef SINGLE
  714. X            printf(" %-20s |", ptr->p_descr.port.hostname);
  715. X# endif /* !SINGLE /**/
  716. X#endif /* iPSC /**/
  717. X            printf(" %-10d | ", ptr->p_descr.pid);
  718. X        switch(ptr->status) {
  719. X        case RUNNING:
  720. X                printf("%-15s\n", "running");
  721. X        break;
  722. X        case ACCORTER:
  723. X                printf("%-15s\n", "accept or terminate");
  724. X        break;
  725. X        default:
  726. X                printf("%-15s\n", "UNKNOWN");
  727. X        break;
  728. X        } /* switch */
  729. X        } /* for */
  730. X    exit(OK);
  731. X    break;
  732. X    default:
  733. X    /* parent! */
  734. X    Intr = 1;
  735. X        signal(SIGTERM, DisplayStatus);
  736. X    } /* switch */
  737. X#endif
  738. X    return(OK);
  739. X} /* DisplayStatus */
  740. X
  741. X/******************************************************************************
  742. X * GetChildStatus()                                                           *
  743. X *                                                                            *
  744. X * Get status of terminating children to avoid zombies!                       * 
  745. X *                                                                            *
  746. X * Return values: none                                                        *
  747. X ******************************************************************************/
  748. Xint
  749. XGetChildStatus()
  750. X{
  751. X    int              pid,
  752. X                     status;
  753. X    struct pid_list *pptr,
  754. X                    *lptr;
  755. X#ifdef SYSTEM_V
  756. X    pid = wait(&status);
  757. X#else /* BSD */
  758. X    union wait       wstatus;
  759. X
  760. X    pid    = wait3(&wstatus, WNOHANG, NULL);
  761. X    status = wstatus.w_status;
  762. X#endif /* SYSTEM_V /**/
  763. X#ifdef DO_NOT_COMPILE
  764. X    if (status == 0xB1) {
  765. X            fputs(": process was stopped!\n", pfile);
  766. X    } else {
  767. X        if (!(status & 0xFF))
  768. X            fprintf(pfile, " by exit call. Exit code = %d\n",
  769. X                (status & 0xFF00) >> 8);
  770. X        else
  771. X            fprintf(pfile, " by signal %d\n", status);
  772. X        }
  773. X    fflush(pfile);
  774. X    }
  775. X#endif
  776. X    /* set signal again */
  777. X    /* signal(SIGCLD, GetChildStatus); */
  778. X    Intr = 1;
  779. X} /* GetChildStatus */
  780. X
  781. END_OF_FILE
  782. if test 7800 -ne `wc -c <'dcadmin/Status.c'`; then
  783.     echo shar: \"'dcadmin/Status.c'\" unpacked with wrong size!
  784. fi
  785. # end of 'dcadmin/Status.c'
  786. fi
  787. if test -f 'dcinstall/Compile.c' -a "${1}" != "-c" ; then 
  788.   echo shar: Will not clobber existing file \"'dcinstall/Compile.c'\"
  789. else
  790. echo shar: Extracting \"'dcinstall/Compile.c'\" \(8377 characters\)
  791. sed "s/^X//" >'dcinstall/Compile.c' <<'END_OF_FILE'
  792. X/***************************************************************************
  793. X *                                                                         *
  794. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  795. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  796. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  797. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  798. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  799. X *                                                                         *
  800. X *              A compiler for distributed programming with C              *
  801. X *                                                                         *
  802. X *                            C o m p i l e . c                            *
  803. X *                                                                         *
  804. X *                            Package : Installer Program                  *
  805. X *                            Version : 1.0                                *
  806. X *                       CreationDate : 20.11.91                           *
  807. X *                         LastUpDate : 03.12.93                           *
  808. X *                                                                         *
  809. X * The routine 'CompileFiles' which performs the complete compilation,     *
  810. X * linking and loading of programs.                                        *
  811. X *                                                                         *
  812. X *               Copyright (C) 1991-1994 by Christoph Pleier               *
  813. X *                          All rights reserved!                           *
  814. X ***************************************************************************/
  815. X
  816. X/*
  817. X * This file is part of the Distributed C Development Environment (DCDE).
  818. X * DCDE is free software; you can redistribute it and/or modify
  819. X * it under the terms written in the README-file. 
  820. X * DCDE is distributed in the hope that it will be useful,
  821. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  822. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  823. X * See the file README for more details.
  824. X */
  825. X
  826. X#include <stdio.h>
  827. X#include <pwd.h>
  828. X#include "cfgparsers.h"
  829. X#include "dcinstall.h"
  830. X
  831. X/******************************************************************************
  832. X * CompileFiles()                                                             *
  833. X *                                                                            *
  834. X * Compiles, links and loads the files from the local host 'src' specified as *
  835. X * command line arguments on the destination host 'dest'.                     *
  836. X * NOTE: For local compilation 'src' equals 'dest'.                           *
  837. X *                                                                            *
  838. X * Return values: OK upon success / ERROR upon error                          *
  839. X ******************************************************************************/
  840. Xint
  841. XCompileFiles(src, dest)
  842. XSYMBTABEL *src;        /* source host      */
  843. XSYMBTABEL *dest;    /* destination host */
  844. X{
  845. X    int mounted;        /* src and dest share one filesystem or not */
  846. X    static char cmd[1000];    /* to store the command */
  847. X    FILENAMELIST *fptr;        /* pointer for file list (xxx.c) */
  848. X    OPTIONLIST *optr;        /* pointer for option list */
  849. X    SYMBTABEL *symbol;        /* loop pointer for symbol table elements */
  850. X    SYMBTABEL *symbol2;        /* loop pointer for symbol table elements */
  851. X    SYMBTABEL *class;        /* destination compilation class */
  852. X    TARGETINFO *targets;    /* all targets the local system can build */
  853. X
  854. X    if (!c_flag && !o_flag)
  855. X    return(OK);
  856. X
  857. X#ifndef DEBUG
  858. X    printf("    Compiling    files on %s (%s)\n",
  859. X        dest->name, dest->info.Host.ex_storage->name);
  860. X#endif /* Not DEBUG /**/
  861. X
  862. X    /* Determine access mode:
  863. X     * If source-host equals destination host or source and dest host
  864. X     * share one disk the access mode is mounted. Otherwise if dest is
  865. X     * accessed via network, it is not mounted!
  866. X     */
  867. X    if (src == dest || src->info.Host.ex_storage->info.disk.location == dest->info.Host.ex_storage->info.disk.location)
  868. X        mounted = TRUE;
  869. X    else
  870. X        mounted = FALSE;
  871. X
  872. X    if (mounted)
  873. X    sprintf(cmd, "cd %s/dcc/compile ;", gethomedir(getLogin()));
  874. X    else
  875. X    sprintf(cmd, "%s %s cd dcc/compile \";\"", RSH, dest->name);
  876. X
  877. X    for(targets = dest->info.Host.compinfo; targets; targets = targets->next) 
  878. X    if (!strcmp(targets->type, dest->info.Host.type->name)
  879. X            && !strcmp(targets->os, dest->info.Host.os->name))
  880. X        break;
  881. X
  882. X    if (!targets) {
  883. X    fprintf(stderr, "Error: target specification for computer type \"%s\" of operating",
  884. X            dest->info.Host.type->name);
  885. X        fprintf(stderr, "       system \"%s\" of host \"%s\" not found \n",
  886. X            dest->info.Host.os->name, dest->name);
  887. X        fprintf(stderr, "       in system configuration file \"%s\"\n",
  888. X            cfgfilename);
  889. X    exit(ERROR);
  890. X    }
  891. X
  892. X    strcat(cmd, " ");
  893. X    strcat(cmd, targets->cc);
  894. X    strcat(cmd, " -I. -I../include ");
  895. X    strcat(cmd, targets->cflags);
  896. X    strcat(cmd, " ");
  897. X
  898. X    if (o_flag) {
  899. X    strcat(cmd, "-o ");
  900. X    strcat(cmd, targetname);
  901. X    strcat(cmd, " ");
  902. X    }
  903. X
  904. X    if (c_flag) {
  905. X    strcat(cmd, "-c ");
  906. X    strcat(cmd, " ");
  907. X    }
  908. X
  909. X    for(fptr = first_file; fptr; fptr = fptr->next) {
  910. X    strcat(cmd, fptr->name);
  911. X    strcat(cmd, " ");
  912. X    }
  913. X
  914. X    for(optr = first_opt; optr; optr = optr->next) {
  915. X        strcat(cmd, optr->option);
  916. X    strcat(cmd, " ");
  917. X    }
  918. X
  919. X    if (o_flag) {
  920. X    strcat(cmd, " ../lib/");
  921. X    strcat(cmd,  dest->info.Host.type->name);
  922. X    strcat(cmd, "/dcc.a ");
  923. X    }
  924. X
  925. X    strcat(cmd, targets->libs);
  926. X
  927. X    if (o_flag) {
  928. X    if (mounted)
  929. X        strcat(cmd, " ; mv ");
  930. X    else
  931. X        strcat(cmd, " \";\" mv ");
  932. X    strcat(cmd, targetname);
  933. X    strcat(cmd, " ");
  934. X    strcat(cmd, "../bin/");
  935. X    strcat(cmd,  dest->info.Host.type->name);
  936. X    strcat(cmd, "/");
  937. X    strcat(cmd, targetname);
  938. X    }
  939. X
  940. X    if (verbose)
  941. X        printf("    Compilation  command: %s\n", cmd);
  942. X
  943. X    if (!noexecute) 
  944. X        if (system(cmd)) {
  945. X            fprintf(stderr, "\nError compiling the files for host \"%s\"\n", 
  946. X        dest->name);
  947. X            fprintf(stderr, "The following command caused the error:\n");
  948. X            fprintf(stderr, "\"%s\"\n", cmd);
  949. X            exit(ERROR);
  950. X        }
  951. X
  952. X    dest->info.Host.wasmade = TRUE;
  953. X
  954. X    /* check the remainding hosts */
  955. X    for(symbol = symbtab; symbol; symbol = symbol->next) {
  956. X
  957. X    if (symbol->type == S_HOST
  958. X        && symbol->info.Host.type == dest->info.Host.type
  959. X                && symbol->info.Host.os   == dest->info.Host.os) {
  960. X
  961. X        if (!symbol->info.Host.istarget || symbol->info.Host.wasmade)
  962. X        continue;
  963. X
  964. X        if (symbol->info.Host.ex_storage == dest->info.Host.ex_storage) {
  965. X        /* Host shares files with compilation host => nothing to do! */
  966. X            symbol->info.Host.wasmade = TRUE;
  967. X        } else {
  968. X        /* Host has own filesystem => distribute generated executables 
  969. X         */
  970. X        if (o_flag) {
  971. X#ifndef DEBUG
  972. X                printf("    Distributing files %s (%s) -> %s (%s)\n",
  973. X                    dest->name, dest->info.Host.ex_storage->info.disk.location->name, 
  974. X                symbol->name, symbol->info.Host.ex_storage->info.disk.location->name);
  975. X#endif /* Not DEBUG /**/
  976. X            sprintf(cmd, "rcp %s/dcc/bin/%s/%s %s@%s:dcc/bin/%s/%s",
  977. X            gethomedir(getLogin()), dest->info.Host.type->name,
  978. X            targetname, getLogin(), symbol->name, 
  979. X            dest->info.Host.type->name, targetname);
  980. X            if (verbose)
  981. X                printf("Distribution command: %s\n", cmd);
  982. X            if (!noexecute)
  983. X                        if (system(cmd)) {
  984. X                        fprintf(stderr, "\nError distributing the files to host \"%s\"\n", 
  985. X                    symbol->name);
  986. X                        fprintf(stderr, "The following command caused the error:\n");
  987. X                        fprintf(stderr, "\"%s\"\n", cmd);
  988. X                        exit(ERROR);
  989. X                    }
  990. X        }
  991. X            /* all hosts of this filesystem and the same class are also 
  992. X         * marked 
  993. X         */
  994. X            for(symbol2 = symbtab; symbol2; symbol2 = symbol2->next) {
  995. X            if (symbol2->type == S_HOST 
  996. X                && symbol2->info.Host.type == symbol->info.Host.type
  997. X                            && symbol2->info.Host.os   == symbol->info.Host.os
  998. X                            && symbol2->info.Host.ex_storage == symbol->info.Host.ex_storage) {
  999. X            symbol2->info.Host.wasmade = TRUE;
  1000. X            }
  1001. X        } /* for */
  1002. X        }
  1003. X    }
  1004. X
  1005. X    } /* for(symbol) */
  1006. X
  1007. X    return(OK);
  1008. X
  1009. X} /* CompileFiles */
  1010. END_OF_FILE
  1011. if test 8377 -ne `wc -c <'dcinstall/Compile.c'`; then
  1012.     echo shar: \"'dcinstall/Compile.c'\" unpacked with wrong size!
  1013. fi
  1014. # end of 'dcinstall/Compile.c'
  1015. fi
  1016. if test -f 'dcinstall/ParseOptions.c' -a "${1}" != "-c" ; then 
  1017.   echo shar: Will not clobber existing file \"'dcinstall/ParseOptions.c'\"
  1018. else
  1019. echo shar: Extracting \"'dcinstall/ParseOptions.c'\" \(8792 characters\)
  1020. sed "s/^X//" >'dcinstall/ParseOptions.c' <<'END_OF_FILE'
  1021. X/***************************************************************************
  1022. X *                                                                         *
  1023. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  1024. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  1025. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  1026. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  1027. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  1028. X *                                                                         *
  1029. X *              A compiler for distributed programming with C              *
  1030. X *                                                                         *
  1031. X *                       P a r s e O p t i o n s . c                       *
  1032. X *                                                                         *
  1033. X *                            Package : Installer Program                  *
  1034. X *                            Version : 1.1                                *
  1035. X *                       CreationDate : 20.11.91                           *
  1036. X *                         LastUpDate : 25.02.92                           *
  1037. X *                                                                         *
  1038. X *             Parses and interprets the command line options.             *
  1039. X *                                                                         *
  1040. X *               Copyright (C) 1991-1994 by Christoph Pleier               *
  1041. X *                          All rights reserved!                           *
  1042. X ***************************************************************************/
  1043. X
  1044. X/*
  1045. X * This file is part of the Distributed C Development Environment (DCDE).
  1046. X * DCDE is free software; you can redistribute it and/or modify
  1047. X * it under the terms written in the README-file. 
  1048. X * DCDE is distributed in the hope that it will be useful,
  1049. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1050. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  1051. X * See the file README for more details.
  1052. X */
  1053. X
  1054. X#include <stdio.h>
  1055. X#include <string.h>
  1056. X#include <sys/types.h>
  1057. X#include "cfgparsers.h"
  1058. X#include "dcinstall.h"
  1059. X
  1060. X/******************************************************************************
  1061. X * ParseOptions()                                                             *
  1062. X *                                                                            *
  1063. X * Parses and interprets the command line options.                            *
  1064. X *                                                                            *
  1065. X * Return values: OK upon success / ERROR upon error                          *
  1066. X ******************************************************************************/
  1067. Xint
  1068. XParseOptions(argc, argv)
  1069. Xint   argc;
  1070. Xchar *argv[];
  1071. X{
  1072. X    int          i;
  1073. X    int          length;
  1074. X    char         *suffix;
  1075. X    char          localhostname[MAXHOSTNAMELEN];
  1076. X    char          input[80];
  1077. X    FILENAMELIST *fptr;
  1078. X    OPTIONLIST   *optr;
  1079. X    SYMBTABEL    *symbol;
  1080. X
  1081. X    for(i = 1; i < argc; i++) {
  1082. X
  1083. X    if (!strcmp(argv[i], "-f")) {
  1084. X        /* this option was already managed! */
  1085. X        ++i;
  1086. X        continue;
  1087. X    }
  1088. X
  1089. X    if (!strcmp(argv[i], "-c")) {
  1090. X        /* Option: "-c" */
  1091. X        if (o_flag) {
  1092. X        fputs("Error: Option '-o' and '-c' combined\n", stderr);
  1093. X        exit(ERROR);
  1094. X        }
  1095. X        c_flag = TRUE;
  1096. X#ifdef DEBUG
  1097. X        printf("Option recognized: \"-c\"\n");
  1098. X#endif /* DEBUG /**/
  1099. X        continue;
  1100. X    }
  1101. X
  1102. X    if (!strcmp(argv[i], "-o")) {
  1103. X        /* Option: "-o" */
  1104. X        if (c_flag) {
  1105. X        fputs("Error: Option '-c' and '-o' combined\n", stderr);
  1106. X        exit(ERROR);
  1107. X        }
  1108. X        o_flag = TRUE;
  1109. X        targetname = argv[++i];
  1110. X#ifdef DEBUG
  1111. X        printf("Option recognized: \"-o %s\"\n", targetname);
  1112. X#endif /* DEBUG /**/
  1113. X        continue;
  1114. X    }
  1115. X
  1116. X    if (!strcmp(argv[i], "-target")) {
  1117. X        if (!strcmp(argv[++i], "all")) {
  1118. X        /* Option: "-target all" */
  1119. X        alltargets = TRUE;
  1120. X#ifdef DEBUG
  1121. X        printf("Option recognized: \"-target all\"\n");
  1122. X#endif /* DEBUG /**/
  1123. X            for(symbol = symbtab; symbol; symbol = symbol->next) {
  1124. X                if (symbol->type == S_HOST)
  1125. X                symbol->info.Host.istarget = TRUE;
  1126. X        }
  1127. X        continue;
  1128. X        } else {
  1129. X        /* Option: "-target local" or "-target hostname" */
  1130. X        if (!strcmp(argv[i], "local")) {
  1131. X            localtarget = TRUE;
  1132. X            if (gethostname(localhostname, MAXHOSTNAMELEN)) {
  1133. X            fputs("Error: can't determine name of local host\n", stderr);
  1134. X            exit(ERROR);
  1135. X            }
  1136. X            symbol = lookup_symbtabel(localhostname);
  1137. X        } else {
  1138. X            symbol = lookup_symbtabel(argv[i]);
  1139. X        }
  1140. X        if (symbol == NULL) {
  1141. X            fprintf(stderr, "Error: target system for hostname \"%s\" is not defined in\n", 
  1142. X                (localtarget) ? localhostname : argv[i]);
  1143. X            fprintf(stderr, "       system configuration file \"%s\"\n", 
  1144. X                cfgfilename);
  1145. X            exit(ERROR);
  1146. X        }
  1147. X        if (symbol->type != S_HOST) {
  1148. X            fprintf(stderr, "Error: target system for hostname \"%s\" is not defined as\n",
  1149. X                argv[i]);
  1150. X            fprintf(stderr, "       hostname in system configuration file \"%s\"\n", 
  1151. X            cfgfilename);
  1152. X            exit(ERROR);
  1153. X        }
  1154. X        symbol->info.Host.istarget = TRUE;
  1155. X        }
  1156. X#ifdef DEBUG
  1157. X        printf("Option recognized: \"-target %s\"\n", argv[i]);
  1158. X#endif /* DEBUG /**/
  1159. X        continue;
  1160. X    }
  1161. X
  1162. X    if (!strcmp(argv[i], "-prepare")) {
  1163. X        /* Option: "-prepare" */
  1164. X        prepare = TRUE;
  1165. X#ifdef DEBUG
  1166. X        printf("Option recognized: \"-prepare\"\n");
  1167. X#endif /* DEBUG /**/
  1168. X        if (!noexecute) {
  1169. X            puts("WARNING: The option \"-prepare\" causes the destruction of all data");
  1170. X            puts("         in the directory \"dcc\" including all subdirectories at");
  1171. X            puts("         all specified hosts!");
  1172. X            printf("Do you really want to continue? (y/n) ");
  1173. X            scanf("%s", input);
  1174. X            if (input[0] != 'y' && input[0] != 'Y')
  1175. X            exit(OK);
  1176. X        }
  1177. X        continue;
  1178. X    }
  1179. X
  1180. X    if (!strcmp(argv[i], "-clean")) {
  1181. X        /* Option: "-clean" */
  1182. X        clean = TRUE;
  1183. X#ifdef DEBUG
  1184. X        printf("Option recognized: \"-clean\"\n");
  1185. X#endif /* DEBUG /**/
  1186. X        continue;
  1187. X    }
  1188. X
  1189. X    if (!strcmp(argv[i], "-crosscompile")) {
  1190. X        /* Option: "-crosscompile" */
  1191. X        crosscompile = TRUE;
  1192. X#ifdef DEBUG
  1193. X        printf("Option recognized: \"-crosscompile\"\n");
  1194. X#endif /* DEBUG /**/
  1195. X        fputs("Error: Option 'crosscompile' not yet implemented\n", stderr);
  1196. X        fputs("This will be done in a future release.\n", stderr);
  1197. X        exit(ERROR);
  1198. X        continue;
  1199. X    }
  1200. X
  1201. X    if (!strcmp(argv[i], "-checktargets")) {
  1202. X        /* Option: "-checktargets" */
  1203. X        checktargets = TRUE;
  1204. X#ifdef DEBUG
  1205. X        printf("Option recognized: \"-checktargets\"\n");
  1206. X#endif /* DEBUG /**/
  1207. X        fputs("Error: Option 'checktargets' not yet implemented\n", stderr);
  1208. X        fputs("This will be done in a future release.\n", stderr);
  1209. X        exit(ERROR);
  1210. X        continue;
  1211. X    }
  1212. X
  1213. X    if (!strcmp(argv[i], "-verbose")) {
  1214. X        /* Option: "-verbose" */
  1215. X        verbose = TRUE;
  1216. X#ifdef DEBUG
  1217. X        printf("Option recognized: \"-verbose\"\n");
  1218. X#endif /* DEBUG /**/
  1219. X        continue;
  1220. X    }
  1221. X
  1222. X    if (!strcmp(argv[i], "-noexecute")) {
  1223. X        /* Option: "-noexecute" */
  1224. X        noexecute = TRUE;
  1225. X#ifdef DEBUG
  1226. X        printf("Option recognized: \"-noexecute\"\n");
  1227. X#endif /* DEBUG /**/
  1228. X        continue;
  1229. X    }
  1230. X
  1231. X#ifdef YYDEBUG
  1232. X    if (!strcmp(argv[i], "-yydebug")) {
  1233. X        /* Option: "-yydebug" */
  1234. X# ifdef DEBUG
  1235. X        printf("Option recognized: \"-yydebug\"\n");
  1236. X# endif /* DEBUG /**/
  1237. X        yydebug = 1;
  1238. X        continue;
  1239. X    }
  1240. X#endif /* YYDEBUG /**/
  1241. X
  1242. X    length = strlen(argv[i]);
  1243. X    suffix = argv[i] + length - 2;
  1244. X
  1245. X    if (!strncmp(suffix, ".c", 2)) {
  1246. X        /* Option: "<name>.c" */
  1247. X#ifdef DEBUG
  1248. X        printf("Option recognized: filename \"%s\"\n", argv[i]);
  1249. X#endif /* DEBUG /**/
  1250. X        /* store filename in filename list */
  1251. X        fptr = (FILENAMELIST *) Malloc(sizeof(FILENAMELIST));
  1252. X        fptr->name = argv[i];
  1253. X        fptr->next = NULL;
  1254. X        if (first_file == NULL) 
  1255. X        first_file = last_file = fptr;
  1256. X        else {
  1257. X        last_file->next = fptr;
  1258. X        last_file = fptr;
  1259. X        }
  1260. X        continue;
  1261. X    }
  1262. X
  1263. X    if (!strncmp(suffix, ".h", 2)) {
  1264. X        /* Option: "<name>.h" */
  1265. X#ifdef DEBUG
  1266. X        printf("Option recognized: include filename \"%s\"\n", argv[i]);
  1267. X#endif /* DEBUG /**/
  1268. X        /* store include filename in include filename list */
  1269. X        fptr = (FILENAMELIST *) Malloc(sizeof(FILENAMELIST));
  1270. X        fptr->name = argv[i];
  1271. X        fptr->next = NULL;
  1272. X        if (first_incl_file == NULL) 
  1273. X        first_incl_file = last_incl_file = fptr;
  1274. X        else {
  1275. X        last_incl_file->next = fptr;
  1276. X        last_incl_file = fptr;
  1277. X        }
  1278. X        continue;
  1279. X    }
  1280. X
  1281. X#ifdef DEBUG
  1282. X    printf("Storing unknown Option: \"%s\"\n", argv[i]);
  1283. X#endif /* DEBUG /**/
  1284. X    /* store option in option list */
  1285. X    optr = (OPTIONLIST *) Malloc(sizeof(OPTIONLIST));
  1286. X    optr->option = argv[i];
  1287. X    optr->next = NULL;
  1288. X    if (first_opt == NULL) 
  1289. X        first_opt = last_opt = optr;
  1290. X    else {
  1291. X        last_opt->next = optr;
  1292. X        last_opt = optr;
  1293. X    }
  1294. X
  1295. X    } /* for(i) */
  1296. X
  1297. X    return(OK);
  1298. X} /* ParseOptions */
  1299. END_OF_FILE
  1300. if test 8792 -ne `wc -c <'dcinstall/ParseOptions.c'`; then
  1301.     echo shar: \"'dcinstall/ParseOptions.c'\" unpacked with wrong size!
  1302. fi
  1303. # end of 'dcinstall/ParseOptions.c'
  1304. fi
  1305. if test -f 'dcinstall/main.c' -a "${1}" != "-c" ; then 
  1306.   echo shar: Will not clobber existing file \"'dcinstall/main.c'\"
  1307. else
  1308. echo shar: Extracting \"'dcinstall/main.c'\" \(7420 characters\)
  1309. sed "s/^X//" >'dcinstall/main.c' <<'END_OF_FILE'
  1310. X/***************************************************************************
  1311. X *                                                                         *
  1312. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  1313. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  1314. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  1315. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  1316. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  1317. X *                                                                         *
  1318. X *              A compiler for distributed programming with C              *
  1319. X *                                                                         *
  1320. X *                               m a i n . c                               *
  1321. X *                                                                         *
  1322. X *                            Package : Installer Program                  *
  1323. X *                            Version : 1.1                                *
  1324. X *                       CreationDate : 20.11.91                           *
  1325. X *                         LastUpDate : 25.02.92                           *
  1326. X *                                                                         *
  1327. X *              The routine 'main' and the global variables.               *
  1328. X *                                                                         *
  1329. X *               Copyright (C) 1991-1994 by Christoph Pleier               *
  1330. X *                          All rights reserved!                           *
  1331. X ***************************************************************************/
  1332. X
  1333. X/*
  1334. X * This file is part of the Distributed C Development Environment (DCDE).
  1335. X * DCDE is free software; you can redistribute it and/or modify
  1336. X * it under the terms written in the README-file. 
  1337. X * DCDE is distributed in the hope that it will be useful,
  1338. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1339. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  1340. X * See the file README for more details.
  1341. X */
  1342. X
  1343. X#include <stdio.h>
  1344. X#include "cfgparsers.h"
  1345. X#include "dcinstall.h"
  1346. X#include "version.h"
  1347. X
  1348. X/*
  1349. X * global variables
  1350. X */
  1351. X
  1352. Xint alltargets;            /* perform actions for all targets */
  1353. Xint checkfile;             /* check configuration file only or not */
  1354. Xint checktargets;         /* check targets or not */
  1355. Xint c_flag;            /* option '-c' or not */
  1356. Xint clean;                /* clean targets' remote compilation dirs */
  1357. Xint crosscompile;         /* use cross compilation if possible or not */
  1358. Xint localtarget;            /* perform actions for local host only */
  1359. Xint noexecute;             /* execute commands or not */
  1360. Xint o_flag;            /* option '-o' or not */
  1361. Xint prepare;            /* install runtime library or not */
  1362. Xint verbose;             /* print commands or not */
  1363. Xchar cfgfilename[MAXPATHNAMELEN]; /* name of configuration file */
  1364. Xchar *targetname;        /* name of compilation target */
  1365. XFILENAMELIST *first_file;       /* pointer to beginning of file list (xxx.c) */
  1366. XFILENAMELIST *last_file;        /* pointer to end       of file list (xxx.c) */
  1367. XFILENAMELIST *first_incl_file;     /* pointer to beginning of file list (xxx.h) */
  1368. XFILENAMELIST *last_incl_file;    /* pointer to end       of file list (xxx.h) */
  1369. XOPTIONLIST *first_opt;        /* pointer to beginning of option list */
  1370. XOPTIONLIST *last_opt;        /* pointer to end       of option list */
  1371. XSYMBTABEL *symbtab;        /* pointer to beginning of symbol table */
  1372. XSYMBTABEL *last_symb;        /* pointer to end       of symbol table */
  1373. X#ifdef LINUX
  1374. Xint yylineno;
  1375. X#endif 
  1376. X
  1377. X/******************************************************************************
  1378. X * main()                                                                     *
  1379. X *                                                                            *
  1380. X * The function main.                                                         *
  1381. X *                                                                            *
  1382. X * Return values: OK upon success / ERROR upon error                          *
  1383. X ******************************************************************************/
  1384. Xmain(argc, argv)
  1385. Xint   argc;
  1386. Xchar *argv[];
  1387. X{
  1388. X    int i;
  1389. X    char localhostname[MAXHOSTNAMELEN];
  1390. X    SYMBTABEL *local_host, *dummy, *class, *symbol, 
  1391. X              *acthost, *actfsys, *cc_host;
  1392. X    char *descr;
  1393. X
  1394. X    /* some initializations */
  1395. X    prepare = clean = o_flag = c_flag = alltargets = FALSE;
  1396. X    crosscompile = checkfile = checktargets = FALSE;
  1397. X    localtarget = noexecute = verbose = FALSE;
  1398. X    symbtab = NULL;
  1399. X    targetname = NULL;
  1400. X    first_incl_file = last_incl_file = NULL;
  1401. X    cfgfilename[0] = 0;
  1402. X
  1403. X    /* is there any job? */
  1404. X    if (argc == 1) {
  1405. X        fprintf(stderr, "%s\n%s\n%s\n\n", progname, version, copyright);
  1406. X    fputs("Error: nothing to do\n\n", stderr);
  1407. X    DisplayUsage();
  1408. X    exit(ERROR);
  1409. X    }
  1410. X
  1411. X    /* check command line for '-f' option */
  1412. X    for(i = 1; i < argc; i++) {
  1413. X    if (!strcmp(argv[i], "-f")) {
  1414. X        /* Option: "-f filename" */
  1415. X        strcpy(cfgfilename, argv[++i]);
  1416. X#ifdef DEBUG
  1417. X        printf("Option recognized: \"-f %s\"\n", cfgfilename);
  1418. X#endif /* DEBUG /**/
  1419. X        break;
  1420. X    }
  1421. X    } /* for */
  1422. X
  1423. X    /* search default file in home directory */
  1424. X    if (cfgfilename[0] == 0)
  1425. X    sprintf(cfgfilename, "%s/%s", getenv("HOME"), CFGFILENAME);
  1426. X
  1427. X    /* interpret system configuration file */
  1428. X    if (!(yyin = fopen(cfgfilename, "r"))) {
  1429. X    fprintf(stderr, "Error: can't open system configuration file \"%s\"\n",
  1430. X        cfgfilename);
  1431. X    exit(ERROR);
  1432. X    } else {
  1433. X        (void) parse_system();
  1434. X        (void) close(yyin);
  1435. X    }
  1436. X
  1437. X    /* parse command line (must follow reading of cfg file!!!) */
  1438. X    if (ParseOptions(argc, argv)) {
  1439. X    DisplayUsage();
  1440. X    exit(ERROR);
  1441. X    }
  1442. X
  1443. X    /* determine hostname of local host */
  1444. X    if (gethostname(localhostname, MAXHOSTNAMELEN)) {
  1445. X        fputs("Error: can't determine name of local host!\n", stderr);
  1446. X    exit(ERROR);
  1447. X    }
  1448. X
  1449. X    /* determine host informtion of local host */
  1450. X    if (!(local_host = lookup_symbtabel(localhostname))) {
  1451. X    fputs("Error: local hostname is not defined in configuration file\n", stderr);
  1452. X    exit(ERROR);
  1453. X    }
  1454. X
  1455. X    if (localtarget)
  1456. X    local_host->info.Host.istarget = TRUE;
  1457. X
  1458. X    /* prepare all target hosts if specified as command line option */
  1459. X    if (prepare) {
  1460. X        for(acthost = symbtab; acthost; acthost = acthost->next) {
  1461. X        if (acthost->type != S_HOST || acthost->info.Host.ex_storage->info.disk.wasprepared)
  1462. X        continue;
  1463. X        PrepareTarget(local_host, acthost);
  1464. X    }
  1465. X    }
  1466. X
  1467. X    /* generate the requested object files or executables for all targets
  1468. X     * specified in the command line
  1469. X     */
  1470. X    if (c_flag || o_flag || first_file || first_incl_file) {
  1471. X        for(dummy = symbtab; dummy; dummy = dummy->next) {
  1472. X
  1473. X        if (dummy->type != S_HOST || !dummy->info.Host.istarget || dummy->info.Host.wasmade)
  1474. X            continue;
  1475. X
  1476. X        TransferFiles(local_host, dummy);
  1477. X    
  1478. X        CompileFiles(local_host, dummy);
  1479. X
  1480. X        dummy->info.Host.wasmade = TRUE;
  1481. X
  1482. X        } /* for(dummy) */
  1483. X    }
  1484. X
  1485. X    /* clean all target hosts if specified as command line option */
  1486. X    if (clean) {
  1487. X        for(acthost = symbtab; acthost; acthost = acthost->next) {
  1488. Xif (acthost->type != S_HOST || acthost->info.Host.ex_storage->info.disk.wasprepared)
  1489. X        if (acthost->type != S_HOST || !acthost->info.Host.istarget 
  1490. X                || acthost->info.Host.ex_storage->info.disk.wascleaned)
  1491. X        continue;
  1492. X        CleanTarget(local_host, acthost);
  1493. X    }
  1494. X    }
  1495. X
  1496. X    exit(OK);
  1497. X} /* main */
  1498. END_OF_FILE
  1499. if test 7420 -ne `wc -c <'dcinstall/main.c'`; then
  1500.     echo shar: \"'dcinstall/main.c'\" unpacked with wrong size!
  1501. fi
  1502. # end of 'dcinstall/main.c'
  1503. fi
  1504. if test -f 'include/com_Errno.h' -a "${1}" != "-c" ; then 
  1505.   echo shar: Will not clobber existing file \"'include/com_Errno.h'\"
  1506. else
  1507. echo shar: Extracting \"'include/com_Errno.h'\" \(7384 characters\)
  1508. sed "s/^X//" >'include/com_Errno.h' <<'END_OF_FILE'
  1509. X/***************************************************************************
  1510. X *                                                                         *
  1511. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  1512. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  1513. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  1514. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  1515. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  1516. X *                                                                         *
  1517. X *              A compiler for distributed programming with C              *
  1518. X *                                                                         *
  1519. X *                         c o m _ E r r n o . h                           *
  1520. X *                                                                         *
  1521. X *                            Package : Include files                      *
  1522. X *                            Version : 1.0                                *
  1523. X *                       CreationDate : 10.07.90                           *
  1524. X *                         LastUpDate : 30.08.91                           *
  1525. X *                                                                         *
  1526. X *                     Error codes of compiler errors.                     *
  1527. X *                                                                         *
  1528. X *      Copyright (C) 1990-1994 by Franz Distler and Christoph Pleier.     *
  1529. X *                          All rights reserved!                           *
  1530. X ***************************************************************************/
  1531. X
  1532. X/*
  1533. X * This file is part of the Distributed C Development Environment (DCDE).
  1534. X * DCDE is free software; you can redistribute it and/or modify
  1535. X * it under the terms written in the README-file. 
  1536. X * DCDE is distributed in the hope that it will be useful,
  1537. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1538. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  1539. X * See the file README for more details.
  1540. X */
  1541. X
  1542. X#ifndef __com_Errno_h
  1543. X#define __com_Errno_h
  1544. X
  1545. X/* syntax error */
  1546. X#define ESYNTAX        0
  1547. X
  1548. X/* redefinition of an identifier */
  1549. X#define EREDEFINITION    1
  1550. X
  1551. X/* definition or creation of not specified process */
  1552. X#define ENOTSPECIFIED    2
  1553. X
  1554. X/* redefinition of a process body */
  1555. X#define EREDEFINED    3
  1556. X
  1557. X/* creation of not defined process */
  1558. X#define ENOTDEFINED    4
  1559. X
  1560. X/* call of not specified transaction */
  1561. X#define EILLTRANSCALL    5
  1562. X
  1563. X/* badly placed accept statement */
  1564. X#define EBADLYACCEPT    6
  1565. X
  1566. X/* no variable and no parameter */
  1567. X#define ENOVARORPAR    7
  1568. X
  1569. X/* error in process specification */
  1570. X#define EINPROCSPEC    8
  1571. X
  1572. X/* process parameter expected */
  1573. X#define EPROCPAREXP    9
  1574. X
  1575. X/* process parameter expected */
  1576. X#define EPROCPAREXP2    10
  1577. X
  1578. X/* error in process parameter declaration */
  1579. X#define EINPROCPARAM    11
  1580. X
  1581. X/* process transaction expected */
  1582. X#define EPROCTRANSEXP    12
  1583. X
  1584. X/* process transaction expected */
  1585. X#define EPROCTRANSEXP2    13
  1586. X
  1587. X/* error in process transaction declaration */
  1588. X#define EINTRANSDECL    14
  1589. X
  1590. X/* error in process transaction declaration */
  1591. X#define EINTRANSDECL2    15
  1592. X
  1593. X/* error in process transaction declaration */
  1594. X#define EINTRANSDECL3    16
  1595. X
  1596. X/* error in process definition */
  1597. X#define EINPROCDEF    17
  1598. X
  1599. X/* error in accept statement */
  1600. X#define EINACCSTAT    18
  1601. X
  1602. X/* error in accept statement */
  1603. X#define EINACCSTAT2    19
  1604. X
  1605. X/* error in accept statement */
  1606. X#define EINACCSTAT3    20
  1607. X
  1608. X/* error in accept statement */
  1609. X#define EINACCSTAT4    21
  1610. X
  1611. X/* error in select statement */
  1612. X#define EINSELSTAT    22
  1613. X
  1614. X/* error in select statement */
  1615. X#define EINSELSTAT2    23
  1616. X
  1617. X/* error in select part */
  1618. X#define EINSELPART    24
  1619. X
  1620. X/* error in accept alternative */
  1621. X#define EINACCALTERN    25
  1622. X
  1623. X/* error in destroy statement */
  1624. X#define EINDESTRSTAT    26
  1625. X
  1626. X/* error in timed transaction call */
  1627. X#define EINTIMEDTRANS    27
  1628. X
  1629. X/* error in process creation */
  1630. X#define EINPROCCREATE    28
  1631. X
  1632. X/* error in process creation */
  1633. X#define EINPROCCREATE2    29
  1634. X
  1635. X/* error in process creation */
  1636. X#define EINPROCCREATE3    30
  1637. X
  1638. X/* error in process arguments */
  1639. X#define EINPROCARGS    31
  1640. X
  1641. X/* error in process location */
  1642. X#define EINPROCLOC    32
  1643. X
  1644. X/* error in transaction call */
  1645. X#define EINTRANSCALL    33
  1646. X
  1647. X/* error: 'const' is not allowed in structure definitions */
  1648. X#define EILLCONST    34
  1649. X
  1650. X/* error: 'volatile' is not allowed in structure definitions */
  1651. X#define EILLVOLATILE    35
  1652. X
  1653. X/* error: 'void' is not allowed in structure definitions */
  1654. X#define EILLVOID    36
  1655. X
  1656. X/* error: too many type specifiers at 'char' */
  1657. X#define EILLCHAR    37
  1658. X
  1659. X/* error: too many type specifiers at 'short' */
  1660. X#define EILLSHORT    38
  1661. X
  1662. X/* error: too many type specifiers at 'int' */
  1663. X#define EILLINT        39
  1664. X
  1665. X/* error: too many type specifiers at 'long' */
  1666. X#define EILLLONG    40
  1667. X
  1668. X/* error: too many type specifiers at 'float' */
  1669. X#define EILLFLOAT    41
  1670. X
  1671. X/* error: too many type specifiers at 'double' */
  1672. X#define EILLDOUBLE    42
  1673. X
  1674. X/* error: too many type specifiers at 'process' */
  1675. X#define EILLPROCESS    43
  1676. X
  1677. X/* error: badly placed 'signed' */
  1678. X#define EILLSIGNED    44
  1679. X
  1680. X/* error: badly placed 'unsigned' */
  1681. X#define EILLUNSIGNED    45
  1682. X
  1683. X/* error: enumerations are not allowed in special used structures */
  1684. X#define EILLENUM    46
  1685. X
  1686. X/* error: bitfields are not allowed in special used structures */
  1687. X#define EILLBITFIELD    47
  1688. X
  1689. X/* error: illegal pointer */
  1690. X#define EILLPOINTER    48
  1691. X
  1692. X/* error: too many pointers in special used structure */
  1693. X#define EMANYPOINTER    49
  1694. X
  1695. X/* error: type qualifier in combination with pointer is not allowed here */
  1696. X#define EILLPOINTQUAL    50
  1697. X
  1698. X/* error: function definitions are not allowed in special used structures */
  1699. X#define EILLFUNCTION    51
  1700. X
  1701. X/* error: arrays are not allowed in special used structures */
  1702. X#define EILLARRAY    52
  1703. X
  1704. X/* error: unknown array size */
  1705. X#define EARRAYSIZE    53
  1706. X
  1707. X/* error: braces '(' ')' are not allowed in combination with arrays */
  1708. X#define EILLARRBRACES    54
  1709. X
  1710. X/* error: function definitions are not allowed before arrays */
  1711. X#define EILLARRFUNCT       55
  1712. X
  1713. X/* error: multiple dimensional arrays are not allowed here */
  1714. X#define EMULTIARRAY       56
  1715. X
  1716. X/* error: braces '(' ')' are not allowed in special used structures */
  1717. X#define EILLBRACES    57
  1718. X
  1719. X/* error: typedef names are not allowed in special used structures */
  1720. X#define EILLTYPENAME    58
  1721. X
  1722. X/* error: 'auto' is not allowed in special used typedefs */
  1723. X#define EILLAUTO    59
  1724. X
  1725. X/* error: 'register' is not allowed in special used typedefs */
  1726. X#define EILLREGISTER    60
  1727. X
  1728. X/* error: 'static' is not allowed in special used typedefs */
  1729. X#define EILLSTATIC    61
  1730. X
  1731. X/* error: 'extern' is not allowed in special used typedefs */
  1732. X#define EILLEXTERN    62
  1733. X
  1734. X/* error: illegal typedef */
  1735. X#define EILLTYPEDEF    63
  1736. X
  1737. X/* error: 'const' is not allowed in special used typedefs */
  1738. X#define EILLCONST2    64
  1739. X
  1740. X/* error: 'volatile' is not allowed in special used typedefs */
  1741. X#define EILLVOLATILE2    65
  1742. X
  1743. X/* error: 'void' is not allowed in special used typedefs */
  1744. X#define EILLVOID2    66
  1745. X
  1746. X/* error: enumerations are not allowed in special used typedefs */
  1747. X#define EILLENUM2    67
  1748. X
  1749. X/* error: structure definition inside of struct definition requires tag name */
  1750. X#define EISTRUCTTAG    68
  1751. X
  1752. X/* error: structure definition of type definition requires tag name */
  1753. X#define ETSTRUCTTAG    69
  1754. X
  1755. X/* fatal error: cannot recover from errors */
  1756. X#define FCANTRECOVER    70
  1757. X
  1758. X/* warning, too few arguments for process creation */
  1759. X#define WPROCESSARGS    71
  1760. X
  1761. X/* warning, too few arguments for transaction call */
  1762. X#define WTRANSARGS    72
  1763. X
  1764. X#endif /* !__com_Errno_h */
  1765. END_OF_FILE
  1766. if test 7384 -ne `wc -c <'include/com_Errno.h'`; then
  1767.     echo shar: \"'include/com_Errno.h'\" unpacked with wrong size!
  1768. fi
  1769. # end of 'include/com_Errno.h'
  1770. fi
  1771. if test -f 'include/globals.h' -a "${1}" != "-c" ; then 
  1772.   echo shar: Will not clobber existing file \"'include/globals.h'\"
  1773. else
  1774. echo shar: Extracting \"'include/globals.h'\" \(7825 characters\)
  1775. sed "s/^X//" >'include/globals.h' <<'END_OF_FILE'
  1776. X/***************************************************************************
  1777. X *                                                                         *
  1778. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  1779. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  1780. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  1781. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  1782. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  1783. X *                                                                         *
  1784. X *              A compiler for distributed programming with C              *
  1785. X *                                                                         *
  1786. X *                          g l o b a l s . h                              *
  1787. X *                                                                         *
  1788. X *                            Package : Include files                      *
  1789. X *                            Version : 1.0                                *
  1790. X *                       CreationDate : 14.08.90                           *
  1791. X *                         LastUpDate : 06.12.93                           *
  1792. X *                                                                         *
  1793. X *                      Global variables and tables.                       *
  1794. X *                                                                         *
  1795. X *      Copyright (C) 1990-1994 by Franz Distler and Christoph Pleier.     *
  1796. X *                          All rights reserved!                           *
  1797. X ***************************************************************************/
  1798. X
  1799. X/*
  1800. X * This file is part of the Distributed C Development Environment (DCDE).
  1801. X * DCDE is free software; you can redistribute it and/or modify
  1802. X * it under the terms written in the README-file. 
  1803. X * DCDE is distributed in the hope that it will be useful,
  1804. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1805. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  1806. X * See the file README for more details.
  1807. X */
  1808. X
  1809. X/* the symbol table */
  1810. XSYMBTAB symbtab;
  1811. X
  1812. X/* the global variable to store the actual error */
  1813. Xint Errno = -1;
  1814. X
  1815. X/* the flag controlling error handling.
  1816. X * while errflag is set, the semantical functions are not executed!
  1817. X */
  1818. Xshort errflag = FALSE;
  1819. X
  1820. X/* the flag indicating an error during a process specification */
  1821. Xshort specerr = FALSE;
  1822. X
  1823. X/* the flag controlling creation of code.
  1824. X * while outcodeflag is set, the creation of code is stopped!
  1825. X */
  1826. Xshort outcodeflag = FALSE;
  1827. X
  1828. X/* the flag indicating parsing of a process body or not */
  1829. Xshort bodyflag = FALSE;
  1830. X
  1831. X/* the flag indicating function main() was declared or not */
  1832. Xshort mainflag = FALSE;
  1833. X
  1834. X/* this flag controls code generation in include files.
  1835. X * while sysinclflag is set, no code will be stored using Strcat(), 
  1836. X * Strcatmany() * or strmalloc()!
  1837. X */
  1838. Xshort sysinclflag = FALSE;
  1839. X
  1840. X/* the functions are collected in a special function file. The appropriate
  1841. X * file header may only be written once to this file. funcflag is used to
  1842. X * indicate if the header has already be written or not.
  1843. X */
  1844. Xshort funcflag = FALSE;
  1845. X
  1846. X/* the functions to create processes and to perform transactions are collected
  1847. X * in a special file. The appropriate file header may only be written once to
  1848. X * this file. specflag is used to indicate if the header has already be written
  1849. X * or not.
  1850. X */
  1851. Xshort specflag = FALSE;
  1852. X
  1853. X#if defined(HETEROGENEOUS) || defined(CHECK_XDR)
  1854. X/* the xdr routines to encode and decode data are collected in a special file. 
  1855. X * The appropriate file header may only be written once to this file. xdrflag 
  1856. X * is used to indicate if the header has already be written or not.
  1857. X */
  1858. Xshort xdrflag = FALSE;
  1859. X#endif /* HETEROGENEOUS /**/
  1860. X
  1861. X/* this flags control the various passes */
  1862. Xshort allflag     = FALSE,    /* compile and link files or not */
  1863. X      beautyflag  = FALSE,    /* beautify generated files or not */
  1864. X      infoflag    = FALSE,    /* display infos about internal actions */
  1865. X      cppflag      = FALSE;    /* preprocess source files only or not */
  1866. X
  1867. X#ifndef YYDEBUG
  1868. X/* the flag indicating output of additional parsing information. If yydebug
  1869. X * equals 1 additional information will be displayed.
  1870. X */
  1871. X# ifdef UNICOS
  1872. Xlong yydebug = 0;
  1873. X# else
  1874. Xint yydebug = 0;
  1875. X# endif /* UNICOS /**/
  1876. X#endif /* YYDEBUG /**/
  1877. X
  1878. X/* the actual line number in the parsed file */
  1879. X#ifdef LINUX
  1880. Xint yylineno;
  1881. X#endif /* LINUX /**/
  1882. X
  1883. X#ifdef HETEROGENEOUS
  1884. X/* the flag indicating if code shall be generated to determine the buffer size 
  1885. X * of the encode/decode buffer or to use a fixed value.
  1886. X */
  1887. Xshort determine_dcc_buf_size = TRUE;
  1888. X
  1889. X/* the size specified as command line option */
  1890. Xchar *encode_decode_buf_size = NULL;
  1891. X
  1892. X/* print warning only one times */
  1893. Xshort encode_warning = FALSE;
  1894. X#endif /* HETEROGENEOUS /**/
  1895. X
  1896. X/* files */
  1897. XFILE *yyerrfile = NULL,        /* for error messages */
  1898. X     *outfile   = NULL,        /* for main program */
  1899. X     *inclfile  = NULL,        /* for dynamic includefile */
  1900. X     *funcfile  = NULL,        /* for functions */
  1901. X     *creatfile = NULL,        /* for specific process creation routines */
  1902. X#if defined(HETEROGENEOUS) || defined(CHECK_XDR)
  1903. X     *xdrfile   = NULL,        /* for xdr routines */
  1904. X#endif
  1905. X     *makefile  = NULL,        /* for makefile */
  1906. X     *debugfile = NULL;        /* for debug messages */
  1907. X
  1908. X/* filenames */
  1909. Xchar *inputfilename,
  1910. X     *yyerrfilename,
  1911. X      outputfilename[MAXFILENAMELEN],
  1912. X      funcfilename[MAXFILENAMELEN],
  1913. X      inclfilename[MAXFILENAMELEN],
  1914. X      creatfilename[MAXFILENAMELEN],
  1915. X#if defined(HETEROGENEOUS) || defined(CHECK_XDR)
  1916. X      xdrfilename[MAXFILENAMELEN],
  1917. X#endif
  1918. X      makefilename[MAXFILENAMELEN],
  1919. X      filenameprefix[MAXFILENAMELEN];
  1920. X
  1921. X/* strings to store special data temporary */
  1922. Xchar *crextstr,        /* the extern declarations of the creation routines */
  1923. X     *trextstr,        /* the declarations of the transaction call routines */    
  1924. X#if defined(HETEROGENEOUS) || defined(CHECK_XDR)
  1925. X     *xdrextstr,    /* the extern declarations of the xdr routines */
  1926. X#endif
  1927. X     *fnextstr,        /* the extern declarations of functions */    
  1928. X     *errormesg;    /* error message utility */
  1929. X
  1930. X/* string to store specified makefile options to pass to the generated 
  1931. X * makefile
  1932. X */
  1933. Xchar  *libsstr   = "",    /* libraries */
  1934. X      *cflagsstr = "",    /* compiler flags */
  1935. X      *lflagsstr = "";    /* loader flags */
  1936. X
  1937. X/* counters */
  1938. Xint phase      = 0,    /* compiler phase */
  1939. X    blknum     = 0,    /* block depth counter */
  1940. X    processnum = 0,    /* process counter */
  1941. X    transnum   = 0,    /* transaction counter */
  1942. X    yynwarns   = 0,    /* compiler warnings */
  1943. X    translabel = 0;    /* transaction labels */
  1944. X
  1945. X/* during parsing of the declaration of process variables processptr points to 
  1946. X * the symbol table entry containing the corresponding process declaration.
  1947. X */
  1948. XSYMBTABEL *processptr;
  1949. X
  1950. X/* buffer to store the result of convert attribute to string routines */
  1951. Xchar *convert_buffer;
  1952. X
  1953. X/* prefix for displaying informations about internal actions */
  1954. Xchar *infoprefix = "***";
  1955. X
  1956. X/* the include files for processes and the main program */
  1957. Xchar *includefiles[] =
  1958. X    { "\"/usr/include/stdio.h\"", 
  1959. X      "\"/usr/include/sys/types.h\"", 
  1960. X      "" 
  1961. X    };
  1962. X
  1963. X/* anchors of process list */
  1964. Xstruct process_list *first_processname = NULL,
  1965. X            *last_processname  = NULL;
  1966. X
  1967. X/* anchors of include list */
  1968. Xstruct include_list *first_includename = NULL,
  1969. X            *last_includename  = NULL;
  1970. X
  1971. X/* anchors of additional include paths */
  1972. Xstruct include_path_list *first_inclpathname = NULL,
  1973. X                         *last_inclpathname  = NULL;
  1974. X
  1975. X/* anchors of additional preprocessor definitions */
  1976. Xstruct cpp_def_list *first_cppdef = NULL,
  1977. X                    *last_cppdef  = NULL;
  1978. X
  1979. X/* anchors of list of symbol table entries of structure and type definitions */
  1980. Xstruct struct_type_list *first_structtype = NULL,
  1981. X                        *last_structtype  = NULL;
  1982. END_OF_FILE
  1983. if test 7825 -ne `wc -c <'include/globals.h'`; then
  1984.     echo shar: \"'include/globals.h'\" unpacked with wrong size!
  1985. fi
  1986. # end of 'include/globals.h'
  1987. fi
  1988. if test -f 'include/run_errlist.h' -a "${1}" != "-c" ; then 
  1989.   echo shar: Will not clobber existing file \"'include/run_errlist.h'\"
  1990. else
  1991. echo shar: Extracting \"'include/run_errlist.h'\" \(7317 characters\)
  1992. sed "s/^X//" >'include/run_errlist.h' <<'END_OF_FILE'
  1993. X/***************************************************************************
  1994. X *                                                                         *
  1995. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  1996. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  1997. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  1998. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  1999. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  2000. X *                                                                         *
  2001. X *              A compiler for distributed programming with C              *
  2002. X *                                                                         *
  2003. X *                      r u n _ e r r l i s t . h                          *
  2004. X *                                                                         *
  2005. X *                            Package : Include files                      *
  2006. X *                            Version : 1.0                                *
  2007. X *                       CreationDate : 14.08.90                           *
  2008. X *                         LastUpDate : 12.03.92                           *
  2009. X *                                                                         *
  2010. X *            The table containing the runtime error messages.             *
  2011. X *                                                                         *
  2012. X *      Copyright (C) 1990-1994 by Franz Distler and Christoph Pleier.     *
  2013. X *                          All rights reserved!                           *
  2014. X ***************************************************************************/
  2015. X
  2016. X/*
  2017. X * This file is part of the Distributed C Development Environment (DCDE).
  2018. X * DCDE is free software; you can redistribute it and/or modify
  2019. X * it under the terms written in the README-file. 
  2020. X * DCDE is distributed in the hope that it will be useful,
  2021. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2022. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  2023. X * See the file README for more details.
  2024. X */
  2025. X
  2026. X#ifndef __run_errlist_h
  2027. X#define __run_errlist_h
  2028. X
  2029. X/* the names in braces mean:
  2030. X *    AP  - Administration Process
  2031. X *    CP  - Creator Process
  2032. X *    NP  - New created Process
  2033. X *    TC  - Transaction Caller
  2034. X *    TA  - Transaction Acceptor
  2035. X *    TAS - Transaction Acceptor during Select
  2036. X *    P   - any Process
  2037. X */
  2038. X
  2039. Xchar *runtime_errlist[] = { 
  2040. X
  2041. X   /* EFATAL */
  2042. X   "fatal error",
  2043. X
  2044. X   /* ESYSTEMDPNT */
  2045. X   "system dependent error",
  2046. X
  2047. X   /* ECREATEPORT */
  2048. X   "unable to create a new port",
  2049. X
  2050. X   /* EDELETEPORT */
  2051. X   "unable to delete specified port",
  2052. X
  2053. X   /* EACPTCON    */
  2054. X   "error accepting connection",
  2055. X
  2056. X   /* EMAKECON    */
  2057. X   "error making connection",
  2058. X
  2059. X   /* ECLOSECON */
  2060. X   "error closing connection",
  2061. X
  2062. X   /* ERECVDATA */
  2063. X   "error receiving data",
  2064. X
  2065. X   /* ESENDDATA */
  2066. X   "error sending data",
  2067. X
  2068. X   /* ECONREFUSED */
  2069. X   "connection refused",
  2070. X
  2071. X   /* ETIMEOUT    */
  2072. X   "operation timed out",
  2073. X
  2074. X   /* ETCCPTONPACC */
  2075. X   "Timeout error: (CP) created process doesn't report back",
  2076. X
  2077. X   /* ETCCPTONPCON */
  2078. X   "Timeout error: (CP) can't connect to new created process",
  2079. X
  2080. X   /* ETCCPTONPRCV */
  2081. X   "Timeout error: (CP) new process doesn't send process data",
  2082. X
  2083. X   /* ETCCPTONPPAR */
  2084. X   "Timeout error: (CP) can't send initial parameters to new process",
  2085. X
  2086. X   /* ETCCPTONPPDAT */
  2087. X   "Timeout error: (CP) can't send port information to new process",
  2088. X
  2089. X   /* ETCCPTOAPCON */
  2090. X   "Timeout error: (CP) can't connect to administration process",
  2091. X
  2092. X   /* ETCCPTOAPREQ */
  2093. X   "Timeout error: (CP) can't send location request to administration process",
  2094. X
  2095. X   /* ETCCPTOAPSND */
  2096. X   "Timeout error: (CP) can't send processname to administration process",
  2097. X
  2098. X   /* ETCCPTOAPRCV */
  2099. X   "Timeout error: (CP) can't get location info from administration process",
  2100. X
  2101. X   /* ETCNPTOAPCON */
  2102. X   "Timeout error: (NP) can't connect to administration process",
  2103. X
  2104. X   /* ETCNPTOAPREQ */
  2105. X   "Timeout error: (NP) can't send request to administration process",
  2106. X
  2107. X   /* ETCNPTOAPSND */
  2108. X   "Timeout error: (NP) can't send process data to administration process",
  2109. X
  2110. X   /* ETCNPTOCPCON */
  2111. X   "Timeout error: (NP) can't connect to creator process",
  2112. X
  2113. X   /* ETCNPTOCPACC */
  2114. X   "Timeout error: (NP) creator process doesen't request connection",
  2115. X
  2116. X   /* ETCNPTOCPSND */
  2117. X   "Timeout error: (NP) can't send process data back to creator",
  2118. X
  2119. X   /* ETCNPGETPARA */
  2120. X   "Timeout error: (NP) can't receive parameters from creator process",
  2121. X
  2122. X   /* ETCNPGETPDAT */
  2123. X   "Timeout error: (NP) can't receive port information from creator process",
  2124. X
  2125. X   /* ETTCONTOPROC */
  2126. X   "Timeout error: (TC) can't connect to called process",
  2127. X
  2128. X   /* ETTSNDREQUEST */
  2129. X   "Timeout error: (TC) can't send transaction request message",
  2130. X
  2131. X   /* ETTRCVREPLY */
  2132. X   "Timeout error: (TC) called process doesn't send reply message",
  2133. X
  2134. X   /* ETTSENDARGS */
  2135. X   "Timeout error: (TC) can't send transaction arguments to called process",
  2136. X
  2137. X   /* ETTRCVRESULT */
  2138. X   "Timeout error: (TC) can't receive transaction result",
  2139. X
  2140. X   /* ETAACCEPTCON */
  2141. X   "Timeout error: (TA) can't accept transaction request connection",
  2142. X
  2143. X   /* ETARCVREQUEST */
  2144. X   "Timeout error: (TA) can't receive transaction request message",
  2145. X
  2146. X   /* ETASENDREPLY */
  2147. X   "Timeout error: (TA) can't send transaction reply message",
  2148. X
  2149. X   /* ETARCVPARAMS */
  2150. X   "Timeout error: (TA) can't receive transaction parameters",
  2151. X
  2152. X   /* ETASNDRESULT */
  2153. X   "Timeout error: (TA) can't send transaction result",
  2154. X
  2155. X   /* ETSACCEPTCON */
  2156. X   "Timeout error: (TAS) can't accept transaction request connection",
  2157. X
  2158. X   /* ETSRCVREQUEST */
  2159. X   "Timeout error: (TAS) can't receive transaction request message",
  2160. X
  2161. X   /* ETSSENDREPLY */
  2162. X   "Timeout error: (TAS) can't send transaction reply message",
  2163. X
  2164. X   /* ETSRCVPARAMS */
  2165. X   "Timeout error: (TAS) can't receive transaction parameters",
  2166. X
  2167. X   /* ETSSNDRESULT */
  2168. X   "Timeout error: (TAS) can't send transaction result",
  2169. X
  2170. X   /* ETCAPTOCPCON */
  2171. X   "Timeout error: (AP) can't connect to creator process", 
  2172. X
  2173. X   /* ETCAPTOCPACC */
  2174. X   "Timeout error: (AP) can't get connection to receive config filename", 
  2175. X
  2176. X   /* ETCAPTOCPRCV */
  2177. X   "Timeout error: (AP) can't receive config filename", 
  2178. X
  2179. X   /* ETCADRCVNAME */
  2180. X   "Timeout error: (AP) can't receive process name to determine location of",
  2181. X
  2182. X   /* ETCADSNDLOC */
  2183. X   "Timeout error: (AP) can't send process creation location result",
  2184. X
  2185. X    /* ETCONNTYPESND */
  2186. X    "Timeout error: (P) can't send connection type",
  2187. X
  2188. X    /* ETCONNTYPERCV */
  2189. X    "Timeout error: (P) can't receive connection type",
  2190. X
  2191. X   /* EPROCSTOPPED */
  2192. X   "(TA) called process terminated during transaction execution",
  2193. X
  2194. X   /* EPROCESSCREAT */
  2195. X   "(P) can't create new process",
  2196. X
  2197. X   /* EPROCESSKILL */
  2198. X   "(P) can't kill process",
  2199. X
  2200. X   /* EEXECPROCESS */
  2201. X   "(P) can't transform process using execv",
  2202. X
  2203. X   /* EHOSTNAME */
  2204. X   "(P) can't determine hostname by gethostname()",
  2205. X
  2206. X   /* EMALLOCBUF */
  2207. X   "error allocating heap space for encode/decode buffer",
  2208. X
  2209. X   /* EENCODE */
  2210. X   "(P) error encoding data. Perhaps only '_dcc_buf_size' is too little!",
  2211. X
  2212. X   /* EENCODESIZE */
  2213. X   "(P) resulting size of converted data is too large. Resize '_dcc_buf_size'.",
  2214. X
  2215. X   /* EDECODE */
  2216. X   "(P) error decoding data. Perhaps only '_dcc_buf_size' is too little!",
  2217. X
  2218. X   /* EXDRSETPOS */
  2219. X   "(P) error: xdr_setpos() does not work!"
  2220. X};
  2221. X
  2222. X#endif /* !__run_errlist_h /**/
  2223. END_OF_FILE
  2224. if test 7317 -ne `wc -c <'include/run_errlist.h'`; then
  2225.     echo shar: \"'include/run_errlist.h'\" unpacked with wrong size!
  2226. fi
  2227. # end of 'include/run_errlist.h'
  2228. fi
  2229. if test -f 'ipc/p1.c' -a "${1}" != "-c" ; then 
  2230.   echo shar: Will not clobber existing file \"'ipc/p1.c'\"
  2231. else
  2232. echo shar: Extracting \"'ipc/p1.c'\" \(8046 characters\)
  2233. sed "s/^X//" >'ipc/p1.c' <<'END_OF_FILE'
  2234. X/***************************************************************************
  2235. X *                                                                         *
  2236. X * @@@@  @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@  @   @ @@@@@ @@@@@ @@@@       @@@  *
  2237. X * @   @  @  @       @   @   @  @  @   @ @   @   @   @     @   @     @   @ *
  2238. X * @   @  @  @@@@@   @   @@@@@  @  @@@@@ @   @   @   @@@@@ @   @     @     *
  2239. X * @   @  @      @   @   @ @    @  @   @ @   @   @   @     @   @     @   @ *
  2240. X * @@@@  @@@ @@@@@   @   @  @  @@@ @@@@  @@@@@   @   @@@@@ @@@@       @@@  *
  2241. X *                                                                         *
  2242. X *            A precompiler for distributed programming with C             *
  2243. X *                                                                         *
  2244. X *                                p 1 . c                                  *
  2245. X *                                                                         *
  2246. X *                 Version 1.0      CreationDate: 15.07.90                 *
  2247. X *                                    LastUpDate: 24.09.90                 *
  2248. X *                                                                         *
  2249. X *           Process 1 for testing the communication primitives.           *
  2250. X *                                                                         *
  2251. X *        Copyright (C) 1990 by Franz Distler and Christoph Pleier.        *
  2252. X *                          All rights reserved!                           *
  2253. X ***************************************************************************/
  2254. X
  2255. X/*
  2256. X * This file is part of the Distributed C Development Environment (DCDE).
  2257. X * DCDE is free software; you can redistribute it and/or modify
  2258. X * it under the terms written in the README-file. 
  2259. X * DCDE is distributed in the hope that it will be useful,
  2260. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2261. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  2262. X * See the file README for more details.
  2263. X */
  2264. X
  2265. X#include <stdio.h>
  2266. X#include <sys/types.h>
  2267. X#include "run_Errno.h"
  2268. X#include "ipc.h"
  2269. X
  2270. X#ifdef SYSTEM_V
  2271. X# define u_short    int
  2272. X#endif /* SYSTEM_V /**/
  2273. X
  2274. X#define DELAY        10
  2275. X#define MSGNUM        100
  2276. X
  2277. Xint         Errno;
  2278. XPORTDESCR      own_port1,
  2279. X         own_port2,
  2280. X         P2_port;
  2281. XCONNECTIONDESCR     con_port1,
  2282. X         con_port2;
  2283. X
  2284. X/* global variables needed for the library functions! */
  2285. Xchar            *_programname = "p1",
  2286. X                *_processname = "P1";
  2287. XPORTDESCR      _own_port, 
  2288. X                 _creator_port,    /* unused, but needed! */
  2289. X                 _admin_port;    /* unused, but needed! */
  2290. XCONNECTIONDESCR     _con_port;
  2291. X
  2292. Xmain()
  2293. X{
  2294. X    int  i, res;
  2295. X    char buffer[100], buffer2[100];
  2296. X
  2297. X    puts("dcc - distributed c compiler");
  2298. X    puts("Copyright (C) 1990 by Franz Distler and Christoph Pleier\n");
  2299. X    puts("Process p1 used for testing the communication primitives");
  2300. X    puts("Remark: the starting order is: p1, p2, p3");
  2301. X    if (_create_port(&own_port1))
  2302. X        _RuntimeError("P1: Error creating own port 1");
  2303. X#ifndef iPSC
  2304. X    _display_port_info("P1: port 1", own_port1);
  2305. X#endif /* iPSC /**/
  2306. X
  2307. X#ifdef iPSC
  2308. X    P2_port.node = 6;
  2309. X    P2_port.pid  = 101;
  2310. X#else
  2311. X    puts("P1: Enter port information of port 1 of process P2:");
  2312. X    _input_port_info(&P2_port);
  2313. X#endif /* iPSC /**/
  2314. X
  2315. X    puts("\nP1: Testing Rendezvous"); 
  2316. X    puts("P1:    Test 1a: accept_connection(...,'P1',0)");
  2317. X    if (_accept_connection(&con_port1, own_port1, 0))
  2318. X        _RuntimeError("P1: Error accepting connection");
  2319. X    puts("P1:    Test 1a: receiving 2 messages");
  2320. X    if (_recv_data(con_port1, buffer, 18, 0) < 0)
  2321. X        _RuntimeError("P1: Error in recv_data 1");
  2322. X        if (strcmp(buffer, "Test 1: Message 1")) {
  2323. X        puts("P1: Error: wrong message received!");
  2324. X        _close_connection(con_port1);
  2325. X        _delete_port(own_port1);
  2326. X        exit(-1);
  2327. X    }
  2328. X    if (_recv_data(con_port1, buffer, 18, 0) < 0)
  2329. X        _RuntimeError("P1: Error in recv_data 2");
  2330. X        if (strcmp(buffer, "Test 1: Message 2")) {
  2331. X        puts("P1: Error: wrong message received!");
  2332. X        _close_connection(con_port1);
  2333. X        _delete_port(own_port1);
  2334. X        exit(-1);
  2335. X    }
  2336. X    puts("P1:    Test 1a: sending 1 message");
  2337. X    strcpy(buffer, "Test 1: Message 3");
  2338. X    if (_send_data(con_port1, buffer, 18, 10) < 0)
  2339. X        _RuntimeError("P1: Error in send_data 1");
  2340. X    puts("P1:    Test 1a: receiving 1 message");
  2341. X    if (_recv_data(con_port1, buffer, 18, 10) < 0)
  2342. X        _RuntimeError("P1: Error in recv_data 3");
  2343. X        if (strcmp(buffer, "Test 1: Message 4")) {
  2344. X        puts("P1: Error: wrong message received!");
  2345. X        _close_connection(con_port1);
  2346. X        _delete_port(own_port1);
  2347. X        exit(-1);
  2348. X    }
  2349. X    if (_close_connection(con_port1))
  2350. X        _RuntimeError("P1: Error closing connection");
  2351. X    puts("P1:    Test 1b: make_connection(...,'P1','P2',0)");
  2352. X    if (_make_connection(&con_port1, own_port1, P2_port, 0))
  2353. X        _RuntimeError("P1: Error making connection");
  2354. X    puts("P1:    Test 1b: receiving 2 messages");
  2355. X    if (_recv_data(con_port1, buffer, 18, 0) < 0)
  2356. X        _RuntimeError("P1: Error in recv_data 1");
  2357. X        if (strcmp(buffer, "Test 1: Message 1")) {
  2358. X        puts("P1: Error: wrong message received!");
  2359. X        _close_connection(con_port1);
  2360. X        _delete_port(own_port1);
  2361. X        exit(-1);
  2362. X    }
  2363. X    if (_recv_data(con_port1, buffer, 18, 0) < 0)
  2364. X        _RuntimeError("P1: Error in recv_data 2");
  2365. X        if (strcmp(buffer, "Test 1: Message 2")) {
  2366. X        puts("P1: Error: wrong message received!");
  2367. X        _close_connection(con_port1);
  2368. X        _delete_port(own_port1);
  2369. X        exit(-1);
  2370. X    }
  2371. X    puts("P1:    Test 1b: sending 1 message");
  2372. X    strcpy(buffer, "Test 1: Message 3");
  2373. X    if (_send_data(con_port1, buffer, 18, 10) < 0)
  2374. X        _RuntimeError("P1: Error in send_data 1");
  2375. X    puts("P1:    Test 1b: receiving 1 message");
  2376. X    if (_recv_data(con_port1, buffer, 18, 10) < 0)
  2377. X        _RuntimeError("P1: Error in recv_data 3");
  2378. X        if (strcmp(buffer, "Test 1: Message 4")) {
  2379. X        puts("P1: Error: wrong message received!");
  2380. X        _close_connection(con_port1);
  2381. X        _delete_port(own_port1);
  2382. X        exit(-1);
  2383. X    }
  2384. X    if (_close_connection(con_port1))
  2385. X        _RuntimeError("P1: Error closing connection");
  2386. X    puts("P1: Rendezvous is OK");  
  2387. X
  2388. X    puts("\nP1: Testing timeouts");
  2389. X    puts("P1:    Test 2a: accept_connection(...,'P1',5)");
  2390. X    res = _accept_connection(&con_port1, own_port1, 5);
  2391. X    if (res < 0 && Errno != ETIMEOUT)
  2392. X        _RuntimeError("P1: Error accepting connection");
  2393. X
  2394. X    if (_create_port(&own_port2))
  2395. X        _RuntimeError("P1: Error creating dummy port");
  2396. X    puts("P1:    Test 2b: make_connection(...,'P1','dummy',5)");
  2397. X    res = _make_connection(&con_port1, own_port1, own_port2, 5);
  2398. X    if (res < 0 && Errno != ETIMEOUT)
  2399. X        _RuntimeError("P1: Error making connection");
  2400. X    _delete_port(own_port2);
  2401. X
  2402. X    puts("P1:    Test 2c: make_connection(...,'P1','P2',0)");
  2403. X    if (_make_connection(&con_port1, own_port1, P2_port, 0))
  2404. X        _RuntimeError("P1: Error making connection");
  2405. X    puts("P1:    Test 2c: recv_data(..., ..., ..., 5)");
  2406. X    res = _recv_data(con_port1, buffer, 10, 5);
  2407. X    if (res < 0 && Errno != ETIMEOUT)
  2408. X        _RuntimeError("P1: Error reading data");
  2409. X    if (res >= 0) {
  2410. X        puts("P1: Error in implementation of recv_data: message received!");
  2411. X        _close_connection(con_port1);
  2412. X            _delete_port(own_port1);
  2413. X        exit(-1);
  2414. X    }
  2415. X
  2416. X#ifdef iPSC
  2417. X    printf("P1:    Test 2d: waiting %d seconds\n", DELAY);
  2418. X    sleep(DELAY);
  2419. X#endif /* iPSC /**/
  2420. X
  2421. X    puts("P1:    Test 2d: send_data(..., ..., ..., 5)");
  2422. X    res = _send_data(con_port2, buffer, 10, 5);
  2423. X    if (res < 0 && Errno != ETIMEOUT)
  2424. X        _RuntimeError("P1: Error writing data");
  2425. X    if (res >= 0) {
  2426. X        puts("P1: Error in implementation of send_data: message sent!");
  2427. X            _delete_port(own_port1);
  2428. X        exit(-1);
  2429. X    }
  2430. X    puts("P1: timeouts are OK");  
  2431. X
  2432. X    puts("\nP1: Testing mutual exclusion of connections");
  2433. X    printf("P1:    Test 3: receiving %d messages\n", MSGNUM);
  2434. X    for (i=1; i<=100; i++) {
  2435. X        if (_recv_data(con_port1, buffer, 22, 0) < 0)
  2436. X            _RuntimeError("P1: Error in recv_data");
  2437. X        sprintf(buffer2, "Test 3: Message %3d", i);
  2438. X            if (strcmp(buffer, buffer2)) {
  2439. X            puts("P1: Error: wrong message received!");
  2440. X            _close_connection(con_port1);
  2441. X            _delete_port(own_port1);
  2442. X            exit(-1);
  2443. X        }
  2444. X    }
  2445. X    puts("P1: mutual exclusion of connections is OK");
  2446. X
  2447. X
  2448. X    puts("\nP1: The test was successful.");
  2449. X    puts("P1: The communication primitives seem to be correct implemented");
  2450. X    sleep(10);
  2451. X    _delete_port(own_port1);
  2452. X    puts("\nP1: Done!");
  2453. X    exit(0);
  2454. X} /* main */
  2455. END_OF_FILE
  2456. if test 8046 -ne `wc -c <'ipc/p1.c'`; then
  2457.     echo shar: \"'ipc/p1.c'\" unpacked with wrong size!
  2458. fi
  2459. # end of 'ipc/p1.c'
  2460. fi
  2461. echo shar: End of archive 7 \(of 18\).
  2462. cp /dev/null ark7isdone
  2463. MISSING=""
  2464. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
  2465.     if test ! -f ark${I}isdone ; then
  2466.     MISSING="${MISSING} ${I}"
  2467.     fi
  2468. done
  2469. if test "${MISSING}" = "" ; then
  2470.     echo You have unpacked all 18 archives.
  2471.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2472. else
  2473.     echo You still need to unpack the following archives:
  2474.     echo "        " ${MISSING}
  2475. fi
  2476. ##  End of shell archive.
  2477. exit 0
  2478.