Commit d79feb72 authored by claes's avatar claes

Template for includes inserted at structfile generation

parent 2d012953
/*
* Proview $Id: cnv_wbltoh.cpp,v 1.9 2006-01-16 14:59:23 claes Exp $
* Proview $Id: cnv_wbltoh.cpp,v 1.10 2007-08-24 13:59:54 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -28,6 +28,7 @@
extern "C" {
#include "pwr.h"
#include "pwr_version.h"
#include "co_dcli.h"
#include "co_cdh.h"
}
......@@ -43,6 +44,7 @@ int CnvWblToH::init( char *first)
{
pwr_tFileName struct_filename;
pwr_tFileName fname;
pwr_tFileName found_file;
int sts;
get_filename( ctx->rw, struct_filename, ctx->hpp);
......@@ -75,7 +77,9 @@ int CnvWblToH::init( char *first)
}
fp_struct <<
"/* Generated by co_convert */" << endl <<
"/* Proview " << pwrv_cPwrVersionStr << " " << struct_filename << " */" << endl << endl <<
"/* Generated by co_convert. */" << endl <<
"/* Do not edit this file. */" << endl << endl <<
"#ifndef " << fname << endl <<
"#define " << fname << endl <<
endl <<
......@@ -85,6 +89,26 @@ endl <<
endl <<
endl;
// If there is a template file on the source dir, insert this file here
strcpy( fname, ctx->rw->source_dir);
strcat( fname, "/");
strcat( fname, struct_filename);
strcat( fname, "_template");
sts = dcli_search_file( fname, found_file, DCLI_DIR_SEARCH_INIT);
if ( EVEN(sts))
return 1;
dcli_search_file( fname, found_file, DCLI_DIR_SEARCH_END);
FILE *fp_template = fopen( found_file, "r");
char c;
while( (c = fgetc( fp_template)) != EOF)
fp_struct.put(c);
fclose( fp_template);
fp_struct << endl;
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment