2 * start the file 'fname' (STDIN is stdin) as a new voice (cf.VFile) * return FALSE on success, TRUE if an error occurs (file cannot be opened) */
| 127 | * return FALSE on success, TRUE if an error occurs (file cannot be opened) |
| 128 | */ |
| 129 | BOOLEAN newFile(char *fname) |
| 130 | { |
| 131 | currentVoice->Next(); |
| 132 | //Print(":File%d(%s):%s(%x)\n", |
| 133 | // currentVoice->typ,BT_name[currentVoice->typ],fname,currentVoice); |
| 134 | currentVoice->filename = omStrDup(fname); |
| 135 | omMarkAsStaticAddr(currentVoice->filename); |
| 136 | if (strcmp(fname,"STDIN") == 0) |
| 137 | { |
| 138 | currentVoice->files = stdin; |
| 139 | currentVoice->sw = BI_stdin; |
| 140 | currentVoice->start_lineno = 1; |
| 141 | } |
| 142 | else |
| 143 | { |
| 144 | currentVoice->sw = BI_file; /* needed by exitVoice below */ |
| 145 | currentVoice->files = feFopen(fname,"r",NULL,TRUE); |
| 146 | if (currentVoice->files==NULL) |
| 147 | { |
| 148 | exitVoice(); |
| 149 | return TRUE; |
| 150 | } |
| 151 | currentVoice->start_lineno = 0; |
| 152 | } |
| 153 | yylineno=currentVoice->start_lineno; |
| 154 | //Voice *p=currentVoice; |
| 155 | //PrintS("-----------------\ncurr:"); |
| 156 | //do |
| 157 | //{ |
| 158 | //Print("voice fn:%s\n",p->filename); |
| 159 | //p=p->prev; |
| 160 | //} |
| 161 | //while (p!=NULL); |
| 162 | //PrintS("----------------\n"); |
| 163 | return FALSE; |
| 164 | } |
| 165 | |
| 166 | void newBuffer(char* s, feBufferTypes t, procinfo* pi, int lineno) |
| 167 | { |