Changeset b8856f in git


Ignore:
Timestamp:
Mar 29, 2000, 3:56:27 PM (24 years ago)
Author:
Kai Krüger <krueger@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '648d28f488f6ff08f5607ff229b9ad9e4a5b93c2')
Children:
8e39b4c74f2c180f33f5b7292220739f88c5df9a
Parents:
251a2ac0b5cc0fbe92de78d4a127f1c0444023f2
Message:
Changed creation pathnames


git-svn-id: file:///usr/local/Singular/svn/trunk@4228 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
modules/modgen
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • modules/modgen/creat_top.cc

    r251a2a rb8856f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: creat_top.cc,v 1.8 2000-03-29 09:31:41 krueger Exp $ */
     4/* $Id: creat_top.cc,v 1.9 2000-03-29 13:56:26 krueger Exp $ */
    55/*
    66* ABSTRACT: lib parsing
     
    122122    )
    123123{
    124   char *filename;
     124  char filename[512];
    125125
    126   filename = (char *)malloc(strlen(module->name)+5+4);
    127   sprintf(filename, "tmp/%s.cc", module->name);
     126  mkdir(module->name, 0755);
     127  strcpy(filename, build_filename(module, module->name, 1));
    128128 
    129129  fflush(module->fmtfp);
    130130
    131131  if( (module->modfp = fopen(filename, "w")) == NULL) {
    132     free(filename);
     132    //free(filename);
    133133    return -1;
    134134  }
     
    146146 
    147147 
    148   sprintf(filename, "tmp/%s.h", module->name);
     148  strcpy(filename, build_filename(module, module->name, 2));
     149  //sprintf(filename, "%s/%s.h", module->name, module->name);
    149150  if( (module->modfp_h = fopen(filename, "w")) == NULL) {
    150     free(filename);
     151    //free(filename);
    151152    return -1;
    152153  }
     
    154155  mod_write_header(module->modfp_h, module->name, 'h');
    155156
    156   free(filename);
     157  //free(filename);
    157158//  write_enter_id(module->modfp);
    158159  return 0;
  • modules/modgen/makefile.cc

    r251a2a rb8856f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: makefile.cc,v 1.3 2000-03-28 07:14:25 krueger Exp $ */
     4/* $Id: makefile.cc,v 1.4 2000-03-29 13:56:27 krueger Exp $ */
    55/*
    66* ABSTRACT: lib parsing
     
    4141{
    4242  FILE *fp;
    43   fp = fopen("tmp/Makefile", "w");
     43
     44  mkdir(module->name, 0755);
     45  fp = fopen(build_filename(module, "Makefile", 0), "w");
    4446  cfilesv cf = module->files;
    4547  int i;
  • modules/modgen/modgen.h

    r251a2a rb8856f  
    11/*
    2  *  $Id: modgen.h,v 1.9 2000-03-29 09:31:43 krueger Exp $
     2 *  $Id: modgen.h,v 1.10 2000-03-29 13:56:27 krueger Exp $
    33 *
    44 */
     
    165165/* from utils.cc */
    166166extern int create_tmpfile(moddefv module_def, int which = 0);
     167extern char *build_filename(moddefv module, char *text, int what);
    167168
    168169/* from proc_setup.cc */
  • modules/modgen/proc.cc

    r251a2a rb8856f  
    11/*
    2  * $Id: proc.cc,v 1.10 2000-03-29 09:31:42 krueger Exp $
     2 * $Id: proc.cc,v 1.11 2000-03-29 13:56:27 krueger Exp $
    33 */
    44
     
    190190
    191191        default:
    192           fprintf(module->modfp_h, "%s %s(", type_conv[pi->return_val.typ],
     192          fprintf(module->modfp_h, "//%s %s(", type_conv[pi->return_val.typ],
    193193                  pi->funcname);
    194194    }
     
    504504{
    505505  if(module->binfp==NULL) {
    506     char *filename;
    507 
    508     filename = (char *)malloc(strlen(module->name)+5+4);
    509     sprintf(filename, "tmp/%s.bin", module->name);
     506    char filename[512];
     507
     508    //filename = (char *)malloc(strlen(module->name)+5+4);
     509    //sprintf(filename, "tmp/%s.bin", module->name);
     510    strcpy(filename, build_filename(module, module->name, 3));
    510511
    511512    if( (module->binfp = fopen(filename, "w")) == NULL) {
    512       free(filename);
     513      //free(filename);
    513514      return -1;
    514515    }
    515516    printf("Creating %s, ", filename);fflush(stdout);
    516517
    517     free(filename);
     518    //free(filename);
    518519  }
    519520 
  • modules/modgen/utils.cc

    r251a2a rb8856f  
    11/*
    2  * $Id: utils.cc,v 1.6 2000-03-29 09:31:42 krueger Exp $
     2 * $Id: utils.cc,v 1.7 2000-03-29 13:56:27 krueger Exp $
    33 */
    44
     
    8888
    8989/*========================================================================*/
     90char *build_filename(
     91  moddefv module,
     92  char *text,
     93  int what
     94)
     95{
     96  char p[512];
     97
     98  switch(what)
     99    {
     100        case 1:
     101          snprintf(p, sizeof(p), "%s/%s.cc", module->name, text);
     102          break;
     103        case 2:
     104          snprintf(p, sizeof(p), "%s/%s.h", module->name, text);
     105          break;
     106        case 3:
     107          snprintf(p, sizeof(p), "%s/%s.bin", module->name, text);
     108          break;
     109        default:
     110          snprintf(p, sizeof(p), "%s/%s", module->name, text);
     111          break;
     112    }
     113 
     114  return p;
     115}
     116
     117/*========================================================================*/
    90118void myyyerror(
    91119  char *fmt, ...
Note: See TracChangeset for help on using the changeset viewer.