cpp2.c 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. /******************************************************************************
  2. Copyright (c) 1999 Daniel Stenberg
  3. Permission is hereby granted, free of charge, to any person obtaining a copy
  4. of this software and associated documentation files (the "Software"), to deal
  5. in the Software without restriction, including without limitation the rights
  6. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. copies of the Software, and to permit persons to whom the Software is
  8. furnished to do so, subject to the following conditions:
  9. The above copyright notice and this permission notice shall be included in
  10. all copies or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  17. SOFTWARE.
  18. ******************************************************************************/
  19. #include <stdio.h>
  20. #include <ctype.h>
  21. #include "cppdef.h"
  22. #include "cpp.h"
  23. #ifdef _AMIGA
  24. #include <proto/dos.h>
  25. #endif
  26. FILE_LOCAL void fpp_dump_line(struct Global *, int *);
  27. FILE_LOCAL ReturnCode fpp_doif(struct Global *, int);
  28. INLINE FILE_LOCAL ReturnCode fpp_doinclude(struct Global *);
  29. INLINE FILE_LOCAL int fpp_hasdirectory(char *, char *);
  30. /*
  31. * Generate (by hand-inspection) a set of unique values for each control
  32. * operator. Note that this is not guaranteed to work for non-Ascii
  33. * machines. CPP won't compile if there are hash conflicts.
  34. */
  35. #define L_assert ('a' + ('s' << 1))
  36. #define L_define ('d' + ('f' << 1))
  37. #define L_elif ('e' + ('i' << 1))
  38. #define L_else ('e' + ('s' << 1))
  39. #define L_endif ('e' + ('d' << 1))
  40. #define L_error ('e' + ('r' << 1))
  41. #define L_if ('i' + (EOS << 1))
  42. #define L_ifdef ('i' + ('d' << 1))
  43. #define L_ifndef ('i' + ('n' << 1))
  44. #define L_include ('i' + ('c' << 1))
  45. #define L_line ('l' + ('n' << 1))
  46. #define L_nogood (EOS + (EOS << 1)) /* To catch #i */
  47. #define L_pragma ('p' + ('a' << 1))
  48. #define L_undef ('u' + ('d' << 1))
  49. ReturnCode fpp_control( struct Global *global,
  50. int *counter ) /* Pending newline counter */
  51. {
  52. /*
  53. * Process #control lines. Simple commands are processed inline,
  54. * while complex commands have their own subroutines.
  55. *
  56. * The counter is used to force out a newline before #line, and
  57. * #pragma commands. This prevents these commands from ending up at
  58. * the end of the previous line if cpp is invoked with the -C option.
  59. */
  60. int c;
  61. char *tp;
  62. int hash;
  63. char *ep;
  64. ReturnCode ret;
  65. c = fpp_skipws( global );
  66. if( c == '\n' || c == EOF_CHAR )
  67. {
  68. (*counter)++;
  69. return(FPP_OK);
  70. }
  71. if( !isdigit(c) )
  72. fpp_scanid( global, c ); /* Get #word to tokenbuf */
  73. else
  74. {
  75. fpp_unget( global ); /* Hack -- allow #123 as a */
  76. strcpy( global->tokenbuf, "line" ); /* synonym for #line 123 */
  77. }
  78. hash = (global->tokenbuf[1] == EOS) ? L_nogood : (global->tokenbuf[0] + (global->tokenbuf[2] << 1));
  79. switch( hash )
  80. {
  81. case L_assert:
  82. tp = "assert";
  83. break;
  84. case L_define:
  85. tp = "define";
  86. break;
  87. case L_elif:
  88. tp = "elif";
  89. break;
  90. case L_else:
  91. tp = "else";
  92. break;
  93. case L_endif:
  94. tp = "endif";
  95. break;
  96. case L_error:
  97. tp = "error";
  98. break;
  99. case L_if:
  100. tp = "if";
  101. break;
  102. case L_ifdef:
  103. tp = "ifdef";
  104. break;
  105. case L_ifndef:
  106. tp = "ifndef";
  107. break;
  108. case L_include:
  109. tp = "include";
  110. break;
  111. case L_line:
  112. tp = "line";
  113. break;
  114. case L_pragma:
  115. tp = "pragma";
  116. break;
  117. case L_undef:
  118. tp = "undef";
  119. break;
  120. default:
  121. hash = L_nogood;
  122. case L_nogood:
  123. tp = "";
  124. break;
  125. }
  126. if( !streq( tp, global->tokenbuf ) )
  127. hash = L_nogood;
  128. /*
  129. * hash is set to a unique value corresponding to the
  130. * control keyword (or L_nogood if we think it's nonsense).
  131. */
  132. if( global->infile->fp == NULL )
  133. fpp_cwarn( global, WARN_CONTROL_LINE_IN_MACRO, global->tokenbuf );
  134. if( !compiling )
  135. { /* Not compiling now */
  136. switch( hash )
  137. {
  138. case L_if: /* These can't turn */
  139. case L_ifdef: /* compilation on, but */
  140. case L_ifndef: /* we must nest #if's */
  141. if( ++global->ifptr >= &global->ifstack[BLK_NEST] )
  142. {
  143. fpp_cfatal( global, FATAL_TOO_MANY_NESTINGS, global->tokenbuf );
  144. return( FPP_TOO_MANY_NESTED_STATEMENTS );
  145. }
  146. *global->ifptr = 0; /* !WAS_COMPILING */
  147. case L_line: /* Many */
  148. /*
  149. * Are pragma's always processed?
  150. */
  151. case L_pragma: /* options */
  152. case L_include: /* are uninteresting */
  153. case L_define: /* if we */
  154. case L_undef: /* aren't */
  155. case L_assert: /* compiling. */
  156. case L_error:
  157. fpp_dump_line( global, counter ); /* Ignore rest of line */
  158. return(FPP_OK);
  159. }
  160. }
  161. /*
  162. * Make sure that #line and #pragma are output on a fresh line.
  163. */
  164. if( *counter > 0 && (hash == L_line || hash == L_pragma) )
  165. {
  166. fpp_Putchar( global, '\n' );
  167. (*counter)--;
  168. }
  169. switch( hash )
  170. {
  171. case L_line:
  172. /*
  173. * Parse the line to update the line number and "progname"
  174. * field and line number for the next input line.
  175. * Set wrongline to force it out later.
  176. */
  177. c = fpp_skipws( global );
  178. global->workp = global->work; /* Save name in work */
  179. while( c != '\n' && c != EOF_CHAR )
  180. {
  181. if( (ret = fpp_save( global, c )) )
  182. return(ret);
  183. c = fpp_get( global );
  184. }
  185. fpp_unget( global );
  186. if( (ret = fpp_save( global, EOS )) )
  187. return(ret);
  188. /*
  189. * Split #line argument into <line-number> and <name>
  190. * We subtract 1 as we want the number of the next line.
  191. */
  192. global->line = atoi(global->work) - 1; /* Reset line number */
  193. for( tp = global->work; isdigit(*tp) || type[(unsigned)*tp] == SPA; tp++)
  194. ; /* Skip over digits */
  195. if( *tp != EOS )
  196. {
  197. /* Got a filename, so: */
  198. if( *tp == '"' && (ep = strrchr(tp + 1, '"')) != NULL )
  199. {
  200. tp++; /* Skip over left quote */
  201. *ep = EOS; /* And ignore right one */
  202. }
  203. if( global->infile->progname != NULL )
  204. /* Give up the old name if it's allocated. */
  205. free( global->infile->progname );
  206. global->infile->progname = fpp_savestring( global, tp );
  207. }
  208. global->wrongline = FPP_TRUE; /* Force output later */
  209. break;
  210. case L_include:
  211. ret = fpp_doinclude( global );
  212. if( ret )
  213. return(ret);
  214. break;
  215. case L_define:
  216. ret = fpp_dodefine( global );
  217. if( ret )
  218. return(ret);
  219. break;
  220. case L_undef:
  221. fpp_doundef( global );
  222. break;
  223. case L_else:
  224. if( global->ifptr == &global->ifstack[0] )
  225. {
  226. fpp_cerror( global, ERROR_STRING_MUST_BE_IF, global->tokenbuf );
  227. fpp_dump_line( global, counter );
  228. return( FPP_OK );
  229. }
  230. else if( (*global->ifptr & ELSE_SEEN) != 0 )
  231. {
  232. fpp_cerror( global, ERROR_STRING_MAY_NOT_FOLLOW_ELSE, global->tokenbuf );
  233. fpp_dump_line( global, counter );
  234. return( FPP_OK );
  235. }
  236. *global->ifptr |= ELSE_SEEN;
  237. if( (*global->ifptr & WAS_COMPILING) != 0 )
  238. {
  239. if( compiling || (*global->ifptr & FPP_TRUE_SEEN) != 0 )
  240. compiling = FPP_FALSE;
  241. else
  242. {
  243. compiling = FPP_TRUE;
  244. }
  245. }
  246. break;
  247. case L_elif:
  248. if( global->ifptr == &global->ifstack[0] )
  249. {
  250. fpp_cerror( global, ERROR_STRING_MUST_BE_IF, global->tokenbuf );
  251. fpp_dump_line( global, counter );
  252. return( FPP_OK );
  253. }
  254. else if( (*global->ifptr & ELSE_SEEN) != 0 )
  255. {
  256. fpp_cerror( global, ERROR_STRING_MAY_NOT_FOLLOW_ELSE, global->tokenbuf );
  257. fpp_dump_line( global, counter );
  258. return( FPP_OK );
  259. }
  260. if( (*global->ifptr & (WAS_COMPILING | FPP_TRUE_SEEN)) != WAS_COMPILING )
  261. {
  262. compiling = FPP_FALSE; /* Done compiling stuff */
  263. fpp_dump_line( global, counter ); /* Skip this clause */
  264. return( FPP_OK );
  265. }
  266. ret = fpp_doif( global, L_if );
  267. if( ret )
  268. return(ret);
  269. break;
  270. case L_error:
  271. fpp_cerror(global, ERROR_ERROR);
  272. break;
  273. case L_if:
  274. case L_ifdef:
  275. case L_ifndef:
  276. if( ++global->ifptr < &global->ifstack[BLK_NEST] )
  277. {
  278. *global->ifptr = WAS_COMPILING;
  279. ret = fpp_doif( global, hash );
  280. if( ret )
  281. return(ret);
  282. break;
  283. }
  284. fpp_cfatal( global, FATAL_TOO_MANY_NESTINGS, global->tokenbuf );
  285. return( FPP_TOO_MANY_NESTED_STATEMENTS );
  286. case L_endif:
  287. if( global->ifptr == &global->ifstack[0] )
  288. {
  289. fpp_cerror( global, ERROR_STRING_MUST_BE_IF, global->tokenbuf );
  290. fpp_dump_line( global, counter );
  291. return(FPP_OK);
  292. }
  293. if( !compiling && (*global->ifptr & WAS_COMPILING) != 0 )
  294. global->wrongline = FPP_TRUE;
  295. compiling = ((*global->ifptr & WAS_COMPILING) != 0);
  296. --global->ifptr;
  297. break;
  298. case L_assert:
  299. {
  300. int result;
  301. ret = fpp_eval( global, &result );
  302. if(ret)
  303. return(ret);
  304. if( result == 0 )
  305. fpp_cerror( global, ERROR_PREPROC_FAILURE );
  306. }
  307. break;
  308. case L_pragma:
  309. /*
  310. * #pragma is provided to pass "options" to later
  311. * passes of the compiler. cpp doesn't have any yet.
  312. */
  313. fpp_Putstring( global, "#pragma " );
  314. while( (c = fpp_get( global ) ) != '\n' && c != EOF_CHAR )
  315. fpp_Putchar( global, c );
  316. fpp_unget( global );
  317. fpp_Putchar( global, '\n' );
  318. break;
  319. default:
  320. /*
  321. * Undefined #control keyword.
  322. * Note: the correct behavior may be to warn and
  323. * pass the line to a subsequent compiler pass.
  324. * This would allow #asm or similar extensions.
  325. */
  326. if( global->warnillegalcpp )
  327. fpp_cwarn( global, WARN_ILLEGAL_COMMAND, global->tokenbuf );
  328. fpp_Putchar( global, '#' );
  329. fpp_Putstring( global, global->tokenbuf );
  330. fpp_Putchar( global, ' ' );
  331. while( (c = fpp_get( global ) ) != '\n' && c != EOF_CHAR )
  332. fpp_Putchar( global, c );
  333. fpp_unget( global );
  334. fpp_Putchar( global, '\n' );
  335. break;
  336. }
  337. if( hash != L_include )
  338. {
  339. #if OLD_PREPROCESSOR
  340. /*
  341. * Ignore the rest of the #control line so you can write
  342. * #if foo
  343. * #endif foo
  344. */
  345. fpp_dump_line( global, counter ); /* Take common exit */
  346. return( FPP_OK );
  347. #else
  348. if( fpp_skipws( global ) != '\n' )
  349. {
  350. fpp_cwarn( global, WARN_UNEXPECTED_TEXT_IGNORED );
  351. fpp_skipnl( global );
  352. }
  353. #endif
  354. }
  355. (*counter)++;
  356. return( FPP_OK );
  357. }
  358. FILE_LOCAL
  359. void fpp_dump_line(struct Global *global, int *counter)
  360. {
  361. fpp_skipnl( global ); /* Ignore rest of line */
  362. (*counter)++;
  363. }
  364. FILE_LOCAL
  365. ReturnCode fpp_doif(struct Global *global, int hash)
  366. {
  367. /*
  368. * Process an #if, #ifdef, or #ifndef. The latter two are straightforward,
  369. * while #if needs a subroutine of its own to evaluate the expression.
  370. *
  371. * fpp_doif() is called only if compiling is FPP_TRUE. If false, compilation
  372. * is always supressed, so we don't need to evaluate anything. This
  373. * supresses unnecessary warnings.
  374. */
  375. int c;
  376. int found;
  377. ReturnCode ret;
  378. if( (c = fpp_skipws( global ) ) == '\n' || c == EOF_CHAR )
  379. {
  380. fpp_unget( global );
  381. fpp_cerror( global, ERROR_MISSING_ARGUMENT );
  382. #if !OLD_PREPROCESSOR
  383. fpp_skipnl( global ); /* Prevent an extra */
  384. fpp_unget( global ); /* Error message */
  385. #endif
  386. return(FPP_OK);
  387. }
  388. if( hash == L_if )
  389. {
  390. fpp_unget( global );
  391. ret = fpp_eval( global, &found );
  392. if( ret )
  393. return( ret );
  394. found = (found != 0); /* Evaluate expr, != 0 is FPP_TRUE */
  395. hash = L_ifdef; /* #if is now like #ifdef */
  396. }
  397. else
  398. {
  399. if( type[c] != LET )
  400. { /* Next non-blank isn't letter */
  401. /* ... is an error */
  402. fpp_cerror( global, ERROR_MISSING_ARGUMENT );
  403. #if !OLD_PREPROCESSOR
  404. fpp_skipnl( global ); /* Prevent an extra */
  405. fpp_unget( global ); /* Error message */
  406. #endif
  407. return(FPP_OK);
  408. }
  409. found = ( fpp_lookid( global, c ) != NULL ); /* Look for it in symbol table */
  410. }
  411. if( found == (hash == L_ifdef) )
  412. {
  413. compiling = FPP_TRUE;
  414. *global->ifptr |= FPP_TRUE_SEEN;
  415. }
  416. else
  417. compiling = FPP_FALSE;
  418. return(FPP_OK);
  419. }
  420. INLINE FILE_LOCAL
  421. ReturnCode fpp_doinclude( struct Global *global )
  422. {
  423. /*
  424. * Process the #include control line.
  425. * There are three variations:
  426. *
  427. * #include "file" search somewhere relative to the
  428. * current source file, if not found,
  429. * treat as #include <file>.
  430. *
  431. * #include <file> Search in an implementation-dependent
  432. * list of places.
  433. *
  434. * #include token Expand the token, it must be one of
  435. * "file" or <file>, process as such.
  436. *
  437. * Note: the November 12 draft forbids '>' in the #include <file> format.
  438. * This restriction is unnecessary and not implemented.
  439. */
  440. int c;
  441. int delim;
  442. ReturnCode ret;
  443. delim = fpp_skipws( global );
  444. if( (ret = fpp_macroid( global, &delim )) )
  445. return(ret);
  446. if( delim != '<' && delim != '"' )
  447. {
  448. fpp_cerror( global, ERROR_INCLUDE_SYNTAX );
  449. return( FPP_OK );
  450. }
  451. if( delim == '<' )
  452. delim = '>';
  453. global->workp = global->work;
  454. while( (c = fpp_get(global)) != '\n' && c != EOF_CHAR )
  455. if( (ret = fpp_save( global, c )) ) /* Put it away. */
  456. return( ret );
  457. fpp_unget( global ); /* Force nl after include */
  458. /*
  459. * The draft is unclear if the following should be done.
  460. */
  461. while( --global->workp >= global->work &&
  462. (*global->workp == ' ' || *global->workp == '\t') )
  463. ; /* Trim blanks from filename */
  464. if( *global->workp != delim )
  465. {
  466. fpp_cerror( global, ERROR_INCLUDE_SYNTAX );
  467. return(FPP_OK);
  468. }
  469. *global->workp = EOS; /* Terminate filename */
  470. ret = fpp_openinclude( global, global->work, (delim == '"') );
  471. if( ret && global->warnnoinclude )
  472. {
  473. /*
  474. * Warn if #include file isn't there.
  475. */
  476. fpp_cwarn( global, WARN_CANNOT_OPEN_INCLUDE, global->work );
  477. }
  478. return( FPP_OK );
  479. }
  480. #ifdef _AMIGA
  481. ReturnCode MultiAssignLoad( struct Global *global, char *incptr, char *filename, char *tmpname );
  482. #endif
  483. ReturnCode fpp_openinclude( struct Global *global,
  484. char *filename, /* Input file name */
  485. int searchlocal ) /* FPP_TRUE if #include "file" */
  486. {
  487. /*
  488. * Actually open an include file. This routine is only called from
  489. * fpp_doinclude() above, but was written as a separate subroutine for
  490. * programmer convenience. It searches the list of directories
  491. * and actually opens the file, linking it into the list of
  492. * active files. Returns ReturnCode. No error message is printed.
  493. */
  494. char **incptr;
  495. char tmpname[NWORK]; /* Filename work area */
  496. size_t len;
  497. if( filename[0] == '/' )
  498. {
  499. if( ! fpp_openfile( global, filename ) )
  500. return(FPP_OK);
  501. }
  502. if( searchlocal && global->allowincludelocal )
  503. {
  504. /*
  505. * Look in local directory first.
  506. * Try to open filename relative to the directory of the current
  507. * source file (as opposed to the current directory). (ARF, SCK).
  508. * Note that the fully qualified pathname is always built by
  509. * discarding the last pathname component of the source file
  510. * name then tacking on the #include argument.
  511. */
  512. if( fpp_hasdirectory( global->infile->filename, tmpname ) )
  513. strcat( tmpname, filename );
  514. else
  515. strcpy( tmpname, filename );
  516. if( ! fpp_openfile( global, tmpname ) )
  517. return(FPP_OK);
  518. }
  519. /*
  520. * Look in any directories specified by -I command line
  521. * arguments, then in the builtin search list.
  522. */
  523. for( incptr = global->incdir; incptr < global->incend; incptr++ )
  524. {
  525. len = strlen(*incptr);
  526. if( len + strlen(filename) >= sizeof(tmpname) )
  527. {
  528. fpp_cfatal( global, FATAL_FILENAME_BUFFER_OVERFLOW );
  529. return( FPP_FILENAME_BUFFER_OVERFLOW );
  530. }
  531. else
  532. {
  533. if( (*incptr)[len-1] != '/' )
  534. sprintf( tmpname, "%s/%s", *incptr, filename );
  535. else
  536. sprintf( tmpname, "%s%s", *incptr, filename );
  537. if( !fpp_openfile( global, tmpname ) )
  538. return(FPP_OK);
  539. }
  540. }
  541. return( FPP_NO_INCLUDE );
  542. }
  543. INLINE FILE_LOCAL
  544. int fpp_hasdirectory( char *source, /* Directory to examine */
  545. char *result ) /* Put directory stuff here */
  546. {
  547. /*
  548. * If a device or directory is found in the source filename string, the
  549. * node/device/directory part of the string is copied to result and
  550. * fpp_hasdirectory returns FPP_TRUE. Else, nothing is copied and it returns FPP_FALSE.
  551. */
  552. char *tp2;
  553. if( (tp2 = strrchr( source, '/' ) ) == NULL )
  554. return(FPP_FALSE);
  555. strncpy( result, source, tp2 - source + 1 );
  556. result[tp2 - source + 1] = EOS;
  557. return( FPP_TRUE );
  558. }
  559. #ifdef _AMIGA
  560. //
  561. // amp July 9, 1997
  562. //
  563. // Use the OS Luke...
  564. //
  565. // We do the sneaky version and let the OS do all
  566. // the hard work so we don't have to mess around
  567. // a lot ;)
  568. //
  569. ReturnCode MultiAssignLoad( struct Global *global, char *incptr, char *filename, char *tmpname )
  570. { /* MultiAssignLoad */
  571. struct MsgPort *FSTask;
  572. struct DevProc *DevProc = NULL;
  573. LONG RtnCode = FPP_NO_INCLUDE;
  574. FSTask = GetFileSysTask();
  575. do
  576. {
  577. //
  578. // This should not bring up a requester.
  579. // check to see if cpp does in fact tweek
  580. // the process WindowPtr.
  581. //
  582. DevProc = GetDeviceProc( incptr, DevProc );
  583. if( DevProc )
  584. {
  585. SetFileSysTask( DevProc->dvp_Port );
  586. //
  587. // Normally we would pass the lock and filename
  588. // to the Load() routine, which would CD to the
  589. // directory and Open(filename), but in order to
  590. // satisfy the exisiting fpp_openfile() function, we
  591. // bite the bullet and build the complete pathspec
  592. // rather than add the standard Load() routine.
  593. //
  594. if( NameFromLock( DevProc->dvp_Lock, tmpname, NWORK ) )
  595. {
  596. AddPart( tmpname, filename, NWORK );
  597. RtnCode = fpp_openfile( global, tmpname );
  598. if( ! RtnCode )
  599. break;
  600. }
  601. }
  602. } while ( RtnCode &&
  603. DevProc &&
  604. (DevProc->dvp_Flags & DVPF_ASSIGN) &&
  605. IoErr() == ERROR_OBJECT_NOT_FOUND); /* repeat if multi-assign */
  606. SetFileSysTask( FSTask );
  607. if( DevProc )
  608. FreeDeviceProc( DevProc );
  609. return RtnCode;
  610. } /* MultiAssignLoad */
  611. #endif //_AMIGA