1
0

nested.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. /*
  2. * $Id: nested.c,v 4.1 2005/03/13 19:54:57 bkorb Exp $
  3. * Time-stamp: "2005-03-06 12:11:57 bkorb"
  4. *
  5. * Automated Options Nested Values module.
  6. */
  7. /*
  8. * Automated Options copyright 1992-2005 Bruce Korb
  9. *
  10. * Automated Options is free software.
  11. * You may redistribute it and/or modify it under the terms of the
  12. * GNU General Public License, as published by the Free Software
  13. * Foundation; either version 2, or (at your option) any later version.
  14. *
  15. * Automated Options is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with Automated Options. See the file "COPYING". If not,
  22. * write to: The Free Software Foundation, Inc.,
  23. * 59 Temple Place - Suite 330,
  24. * Boston, MA 02111-1307, USA.
  25. *
  26. * As a special exception, Bruce Korb gives permission for additional
  27. * uses of the text contained in his release of AutoOpts.
  28. *
  29. * The exception is that, if you link the AutoOpts library with other
  30. * files to produce an executable, this does not by itself cause the
  31. * resulting executable to be covered by the GNU General Public License.
  32. * Your use of that executable is in no way restricted on account of
  33. * linking the AutoOpts library code into it.
  34. *
  35. * This exception does not however invalidate any other reasons why
  36. * the executable file might be covered by the GNU General Public License.
  37. *
  38. * This exception applies only to the code released by Bruce Korb under
  39. * the name AutoOpts. If you copy code from other sources under the
  40. * General Public License into a copy of AutoOpts, as the General Public
  41. * License permits, the exception does not apply to the code that you add
  42. * in this way. To avoid misleading anyone as to the status of such
  43. * modified files, you must delete this exception notice from them.
  44. *
  45. * If you write modifications of your own for AutoOpts, it is your choice
  46. * whether to permit this exception to apply to your modifications.
  47. * If you do not wish that, delete this exception notice.
  48. */
  49. /* = = = START-STATIC-FORWARD = = = */
  50. /* static forward declarations maintained by :mkfwd */
  51. static void
  52. removeBackslashes( char* pzSrc );
  53. static const char*
  54. scanQuotedString( const char* pzTxt );
  55. static tOptionValue*
  56. addStringValue( void** pp, const char* pzName, size_t nameLen,
  57. const char* pzValue, size_t dataLen );
  58. static tOptionValue*
  59. addBoolValue( void** pp, const char* pzName, size_t nameLen,
  60. const char* pzValue, size_t dataLen );
  61. static tOptionValue*
  62. addNumberValue( void** pp, const char* pzName, size_t nameLen,
  63. const char* pzValue, size_t dataLen );
  64. static tOptionValue*
  65. addNestedValue( void** pp, const char* pzName, size_t nameLen,
  66. char* pzValue, size_t dataLen, tOptionLoadMode mode );
  67. static const char*
  68. scanNameEntry( const char* pzName, tOptionValue* pRes, tOptionLoadMode mode );
  69. static const char*
  70. scanXmlEntry( const char* pzName, tOptionValue* pRes, tOptionLoadMode mode );
  71. static void
  72. unloadNestedArglist( tArgList* pAL );
  73. static void
  74. sortNestedList( tArgList* pAL );
  75. /* = = = END-STATIC-FORWARD = = = */
  76. /* removeBackslashes
  77. *
  78. * This function assumes that all newline characters were preceeded by
  79. * backslashes that need removal.
  80. */
  81. static void
  82. removeBackslashes( char* pzSrc )
  83. {
  84. char* pzD = strchr(pzSrc, '\n');
  85. if (pzD == NULL)
  86. return;
  87. *--pzD = '\n';
  88. for (;;) {
  89. char ch = ((*pzD++) = *(pzSrc++));
  90. switch (ch) {
  91. case '\n': *--pzD = ch; break;
  92. case NUL: return;
  93. default:
  94. ;
  95. }
  96. }
  97. }
  98. /* scanQuotedString
  99. *
  100. * Find the end of a quoted string, skipping escaped quote characters.
  101. */
  102. static const char*
  103. scanQuotedString( const char* pzTxt )
  104. {
  105. char q = *(pzTxt++); /* remember the type of quote */
  106. for (;;) {
  107. char ch = *(pzTxt++);
  108. if (ch == NUL)
  109. return pzTxt-1;
  110. if (ch == q)
  111. return pzTxt;
  112. if (ch == '\\') {
  113. ch = *(pzTxt++);
  114. /*
  115. * IF the next character is NUL, drop the backslash, too.
  116. */
  117. if (ch == NUL)
  118. return pzTxt - 2;
  119. /*
  120. * IF the quote character or the escape character were escaped,
  121. * then skip both, as long as the string does not end.
  122. */
  123. if ((ch == q) || (ch == '\\')) {
  124. if (*(pzTxt++) == NUL)
  125. return pzTxt-1;
  126. }
  127. }
  128. }
  129. }
  130. /* addStringValue
  131. *
  132. * Associate a name with either a string or no value.
  133. */
  134. static tOptionValue*
  135. addStringValue( void** pp, const char* pzName, size_t nameLen,
  136. const char* pzValue, size_t dataLen )
  137. {
  138. tOptionValue* pNV;
  139. size_t sz = nameLen + dataLen + sizeof(*pNV);
  140. pNV = AGALOC( sz, "option name/str value pair" );
  141. if (pNV == NULL)
  142. return NULL;
  143. if (pzValue == NULL) {
  144. pNV->valType = OPARG_TYPE_NONE;
  145. pNV->pzName = pNV->v.strVal;
  146. } else {
  147. pNV->valType = OPARG_TYPE_STRING;
  148. if (dataLen > 0)
  149. memcpy( pNV->v.strVal, pzValue, dataLen );
  150. pNV->v.strVal[dataLen] = NUL;
  151. pNV->pzName = pNV->v.strVal + dataLen + 1;
  152. }
  153. memcpy( pNV->pzName, pzName, nameLen );
  154. pNV->pzName[ nameLen ] = NUL;
  155. addArgListEntry( pp, pNV );
  156. return pNV;
  157. }
  158. /* addBoolValue
  159. *
  160. * Associate a name with either a string or no value.
  161. */
  162. static tOptionValue*
  163. addBoolValue( void** pp, const char* pzName, size_t nameLen,
  164. const char* pzValue, size_t dataLen )
  165. {
  166. tOptionValue* pNV;
  167. size_t sz = nameLen + sizeof(*pNV) + 1;
  168. pNV = AGALOC( sz, "option name/bool value pair" );
  169. if (pNV == NULL)
  170. return NULL;
  171. while (isspace( *pzValue ) && (dataLen > 0)) {
  172. dataLen--; pzValue++;
  173. }
  174. if (dataLen == 0)
  175. pNV->v.boolVal = 0;
  176. else if (isdigit( *pzValue ))
  177. pNV->v.boolVal = atoi( pzValue );
  178. else switch (*pzValue) {
  179. case 'f':
  180. case 'F':
  181. case 'n':
  182. case 'N':
  183. pNV->v.boolVal = 0; break;
  184. default:
  185. pNV->v.boolVal = 1;
  186. }
  187. pNV->valType = OPARG_TYPE_BOOLEAN;
  188. pNV->pzName = (char*)(pNV + 1);
  189. memcpy( pNV->pzName, pzName, nameLen );
  190. pNV->pzName[ nameLen ] = NUL;
  191. addArgListEntry( pp, pNV );
  192. return pNV;
  193. }
  194. /* addNumberValue
  195. *
  196. * Associate a name with either a string or no value.
  197. */
  198. static tOptionValue*
  199. addNumberValue( void** pp, const char* pzName, size_t nameLen,
  200. const char* pzValue, size_t dataLen )
  201. {
  202. tOptionValue* pNV;
  203. size_t sz = nameLen + sizeof(*pNV) + 1;
  204. pNV = AGALOC( sz, "option name/bool value pair" );
  205. if (pNV == NULL)
  206. return NULL;
  207. while (isspace( *pzValue ) && (dataLen > 0)) {
  208. dataLen--; pzValue++;
  209. }
  210. if (dataLen == 0)
  211. pNV->v.boolVal = 0;
  212. else
  213. pNV->v.boolVal = atoi( pzValue );
  214. pNV->valType = OPARG_TYPE_NUMERIC;
  215. pNV->pzName = (char*)(pNV + 1);
  216. memcpy( pNV->pzName, pzName, nameLen );
  217. pNV->pzName[ nameLen ] = NUL;
  218. addArgListEntry( pp, pNV );
  219. return pNV;
  220. }
  221. /* addNestedValue
  222. *
  223. * Associate a name with either a string or no value.
  224. */
  225. static tOptionValue*
  226. addNestedValue( void** pp, const char* pzName, size_t nameLen,
  227. char* pzValue, size_t dataLen, tOptionLoadMode mode )
  228. {
  229. tOptionValue* pNV;
  230. if (dataLen == 0) {
  231. size_t sz = nameLen + sizeof(*pNV) + 1;
  232. pNV = AGALOC( sz, "empty nested value pair" );
  233. if (pNV == NULL)
  234. return NULL;
  235. pNV->v.nestVal = NULL;
  236. pNV->valType = OPARG_TYPE_HIERARCHY;
  237. pNV->pzName = (char*)(pNV + 1);
  238. memcpy( pNV->pzName, pzName, nameLen );
  239. pNV->pzName[ nameLen ] = NUL;
  240. } else {
  241. pNV = optionLoadNested( pzValue, pzName, nameLen, mode );
  242. }
  243. if (pNV != NULL)
  244. addArgListEntry( pp, pNV );
  245. return pNV;
  246. }
  247. /* scanNameEntry
  248. *
  249. * We have an entry that starts with a name. Find the end of it, cook it
  250. * (if called for) and create the name/value association.
  251. */
  252. static const char*
  253. scanNameEntry( const char* pzName, tOptionValue* pRes, tOptionLoadMode mode )
  254. {
  255. tOptionValue* pNV;
  256. const char* pzScan = pzName+1;
  257. const char* pzVal;
  258. size_t nameLen = 1;
  259. size_t dataLen = 0;
  260. while (ISNAMECHAR( *pzScan )) { pzScan++; nameLen++; }
  261. while (isspace( *pzScan )) {
  262. char ch = *(pzScan++);
  263. if ((ch == '\n') || (ch == ',')) {
  264. addStringValue( &(pRes->v.nestVal), pzName, nameLen, NULL, 0 );
  265. return pzScan - 1;
  266. }
  267. }
  268. switch (*pzScan) {
  269. case '=':
  270. case ':':
  271. while (isspace( *++pzScan )) ;
  272. switch (*pzScan) {
  273. case ',': goto comma_char;
  274. case '"':
  275. case '\'': goto quote_char;
  276. case NUL: addStringValue( &(pRes->v.nestVal), pzName, nameLen, NULL, 0);
  277. goto leave_scan_name;
  278. default: goto default_char;
  279. }
  280. case ',':
  281. comma_char:
  282. pzScan++;
  283. /* FALLTHROUGH */
  284. case NUL:
  285. no_value:
  286. addStringValue( &(pRes->v.nestVal), pzName, nameLen, NULL, 0 );
  287. break;
  288. case '"':
  289. case '\'':
  290. quote_char:
  291. pzVal = pzScan;
  292. pzScan = scanQuotedString( pzScan );
  293. dataLen = pzScan - pzVal;
  294. pNV = addStringValue( &(pRes->v.nestVal), pzName, nameLen,
  295. pzVal, dataLen );
  296. if ((pNV != NULL) && (mode == OPTION_LOAD_COOKED))
  297. ao_string_cook( pNV->v.strVal, NULL );
  298. break;
  299. default:
  300. default_char:
  301. /*
  302. * We have found some strange text value. It ends with a newline
  303. * or a comma.
  304. */
  305. pzVal = pzScan;
  306. for (;;) {
  307. char ch = *(pzScan++);
  308. switch (ch) {
  309. case '\n':
  310. if ((pzScan > pzVal + 2) && (pzScan[-2] == '\\'))
  311. continue;
  312. /* FALLTHROUGH */
  313. case ',':
  314. dataLen = (pzScan - pzVal) - 1;
  315. pNV = addStringValue( &(pRes->v.nestVal), pzName, nameLen,
  316. pzVal, dataLen );
  317. if (pNV != NULL)
  318. removeBackslashes( pNV->v.strVal );
  319. goto leave_scan_name;
  320. }
  321. }
  322. break;
  323. } leave_scan_name:;
  324. return pzScan;
  325. }
  326. /* scanXmlEntry
  327. *
  328. * We've found a '<' character. We ignore this if it is a comment or a
  329. * directive. If it is something else, then whatever it is we are looking
  330. * at is bogus. Returning NULL stops processing.
  331. */
  332. static const char*
  333. scanXmlEntry( const char* pzName, tOptionValue* pRes, tOptionLoadMode mode )
  334. {
  335. size_t nameLen = 1, valLen = 0;
  336. const char* pzScan = ++pzName;
  337. const char* pzVal;
  338. tOptionValue valu;
  339. tOptionValue* pNewVal;
  340. if (! isalpha(*pzName)) {
  341. switch (*pzName) {
  342. default:
  343. pzName = NULL;
  344. break;
  345. case '!':
  346. pzName = strstr( pzName, "-->" );
  347. if (pzName != NULL)
  348. pzName += 3;
  349. break;
  350. case '?':
  351. pzName = strchr( pzName, '>' );
  352. if (pzName != NULL)
  353. pzName++;
  354. break;
  355. }
  356. return pzName;
  357. }
  358. while (isalpha( *++pzScan )) nameLen++;
  359. if (nameLen > 64)
  360. return NULL;
  361. valu.valType = OPARG_TYPE_STRING;
  362. switch (*pzScan) {
  363. case ' ':
  364. case '\t':
  365. pzScan = parseAttributes( NULL, (char*)pzScan, &mode, &valu );
  366. if (*pzScan == '>') {
  367. pzScan++;
  368. break;
  369. }
  370. if (*pzScan != '/')
  371. return NULL;
  372. /* FALLTHROUGH */
  373. case '/':
  374. if (*++pzScan != '>')
  375. return NULL;
  376. addStringValue( &(pRes->v.nestVal), pzName, nameLen, NULL, 0 );
  377. return pzScan+2;
  378. default: return NULL;
  379. case '>': break;
  380. }
  381. pzVal = pzScan;
  382. {
  383. char z[68];
  384. char* pzD = z;
  385. int ct = nameLen;
  386. const char* pzS = pzName;
  387. *(pzD++) = '<';
  388. *(pzD++) = '/';
  389. do {
  390. *(pzD++) = *(pzS++);
  391. } while (--ct > 0);
  392. *(pzD++) = '>';
  393. *pzD = NUL;
  394. pzScan = strstr( pzScan, z );
  395. if (pzScan == NULL)
  396. return NULL;
  397. valLen = (pzScan - pzVal);
  398. pzScan += nameLen + 3;
  399. while (isspace( *pzScan )) pzScan++;
  400. }
  401. switch (valu.valType) {
  402. case OPARG_TYPE_NONE:
  403. addStringValue( &(pRes->v.nestVal), pzName, nameLen, NULL, 0 );
  404. break;
  405. case OPARG_TYPE_STRING:
  406. pNewVal =
  407. addStringValue( &(pRes->v.nestVal), pzName, nameLen, pzVal, valLen );
  408. if (mode == OPTION_LOAD_KEEP)
  409. break;
  410. mungeString( pNewVal->v.strVal, mode );
  411. break;
  412. case OPARG_TYPE_BOOLEAN:
  413. addBoolValue( &(pRes->v.nestVal), pzName, nameLen, pzVal, valLen );
  414. break;
  415. case OPARG_TYPE_NUMERIC:
  416. addNumberValue( &(pRes->v.nestVal), pzName, nameLen, pzVal, valLen );
  417. break;
  418. case OPARG_TYPE_HIERARCHY:
  419. {
  420. char* pz = AGALOC( valLen+1, "hierarchical scan" );
  421. if (pz == NULL)
  422. break;
  423. memcpy( pz, pzVal, valLen );
  424. pz[valLen] = NUL;
  425. addNestedValue( &(pRes->v.nestVal), pzName, nameLen, pz, valLen, mode );
  426. free(pz);
  427. break;
  428. }
  429. case OPARG_TYPE_ENUMERATION:
  430. case OPARG_TYPE_MEMBERSHIP:
  431. default:
  432. break;
  433. }
  434. return pzScan;
  435. }
  436. static void
  437. unloadNestedArglist( tArgList* pAL )
  438. {
  439. int ct = pAL->useCt;
  440. tOptionValue** ppNV = (tOptionValue**)(pAL->apzArgs);
  441. while (ct-- > 0) {
  442. tOptionValue* pNV = *(ppNV++);
  443. if (pNV->valType == OPARG_TYPE_HIERARCHY)
  444. unloadNestedArglist( pNV->v.nestVal );
  445. free( pNV );
  446. }
  447. free( (void*)pAL );
  448. }
  449. /*=export_func optionUnloadNested
  450. *
  451. * what: Deallocate the memory for a nested value
  452. * arg: + const tOptionValue* + pOptVal + the hierarchical value +
  453. *
  454. * doc:
  455. * A nested value needs to be deallocated. The pointer passed in should
  456. * have been gotten from a call to @code{configFileLoad()} (See
  457. * @pxref{libopts-configFileLoad}).
  458. =*/
  459. void
  460. optionUnloadNested( const tOptionValue* pOV )
  461. {
  462. if (pOV == NULL) return;
  463. if (pOV->valType != OPARG_TYPE_HIERARCHY) {
  464. errno = EINVAL;
  465. return;
  466. }
  467. unloadNestedArglist( pOV->v.nestVal );
  468. free( (void*)pOV );
  469. }
  470. /* sortNestedList
  471. *
  472. * This is a _stable_ sort. The entries are sorted alphabetically,
  473. * but within entries of the same name the ordering is unchanged.
  474. * Typically, we also hope the input is sorted.
  475. */
  476. static void
  477. sortNestedList( tArgList* pAL )
  478. {
  479. int ix;
  480. int lm = pAL->useCt;
  481. void* ptr;
  482. /*
  483. * This loop iterates "useCt" - 1 times.
  484. */
  485. for (ix = 0; ++ix < lm;) {
  486. int iy = ix-1;
  487. tOptionValue* pNewNV = (tOptionValue*)pAL->apzArgs[ix];
  488. tOptionValue* pOldNV = (tOptionValue*)pAL->apzArgs[iy];
  489. /*
  490. * For as long as the new entry precedes the "old" entry,
  491. * move the old pointer. Stop before trying to extract the
  492. * "-1" entry.
  493. */
  494. while (strcmp( pOldNV->pzName, pNewNV->pzName ) > 0) {
  495. pAL->apzArgs[iy+1] = (void*)pOldNV;
  496. pOldNV = (tOptionValue*)pAL->apzArgs[--iy];
  497. if (iy < 0)
  498. break;
  499. }
  500. /*
  501. * Always store the pointer. Sometimes it is redundant,
  502. * but the redundancy is cheaper than a test and branch sequence.
  503. */
  504. pAL->apzArgs[iy+1] = (void*)pNewNV;
  505. }
  506. }
  507. /*=export_func optionLoadNested
  508. * private:
  509. *
  510. * what: parse a hierarchical option argument
  511. * arg: + const char* + pzTxt + the text to scan +
  512. * arg: + const char* + pzName + the name for the text +
  513. * arg: + size_t + nameLen + the length of "name" +
  514. * arg: + tOptionLoadMode + mode + the value formation mode +
  515. *
  516. * ret_type: tOptionValue*
  517. * ret_desc: An allocated, compound value structure
  518. *
  519. * doc:
  520. * A block of text represents a series of values. It may be an
  521. * entire configuration file, or it may be an argument to an
  522. * option that takes a hierarchical value.
  523. =*/
  524. tOptionValue*
  525. optionLoadNested( const char* pzTxt, const char* pzName, size_t nameLen,
  526. tOptionLoadMode mode )
  527. {
  528. tOptionValue* pRes;
  529. tArgList* pAL;
  530. /*
  531. * Make sure we have some data and we have space to put what we find.
  532. */
  533. if (pzTxt == NULL) {
  534. errno = EINVAL;
  535. return NULL;
  536. }
  537. while (isspace( *pzTxt )) pzTxt++;
  538. if (*pzTxt == NUL) {
  539. errno = ENOENT;
  540. return NULL;
  541. }
  542. pRes = AGALOC( sizeof(*pRes) + nameLen + 1, "nested args" );
  543. if (pRes == NULL) {
  544. errno = ENOMEM;
  545. return NULL;
  546. }
  547. pRes->valType = OPARG_TYPE_HIERARCHY;
  548. pRes->pzName = (char*)(pRes + 1);
  549. memcpy( pRes->pzName, pzName, nameLen );
  550. pRes->pzName[ nameLen ] = NUL;
  551. pAL = AGALOC( sizeof(*pAL), "nested arg list" );
  552. if (pAL == NULL) {
  553. free( pRes );
  554. return NULL;
  555. }
  556. pRes->v.nestVal = pAL;
  557. pAL->useCt = 0;
  558. pAL->allocCt = MIN_ARG_ALLOC_CT;
  559. /*
  560. * Scan until we hit a NUL.
  561. */
  562. do {
  563. while (isspace( *pzTxt )) pzTxt++;
  564. if (isalpha( *pzTxt )) {
  565. pzTxt = scanNameEntry( pzTxt, pRes, mode );
  566. }
  567. else switch (*pzTxt) {
  568. case NUL: goto scan_done;
  569. case '<': pzTxt = scanXmlEntry( pzTxt, pRes, mode );
  570. if (*pzTxt == ',') pzTxt++; break;
  571. case '#': pzTxt = strchr( pzTxt, '\n' ); break;
  572. default: goto woops;
  573. }
  574. } while (pzTxt != NULL); scan_done:;
  575. pAL = pRes->v.nestVal;
  576. if (pAL->useCt != 0) {
  577. sortNestedList( pAL );
  578. return pRes;
  579. }
  580. woops:
  581. free( pRes->v.nestVal );
  582. free( pRes );
  583. return NULL;
  584. }
  585. /*=export_func optionNestedVal
  586. * private:
  587. *
  588. * what: parse a hierarchical option argument
  589. * arg: + tOptions* + pOpts + program options descriptor +
  590. * arg: + tOptDesc* + pOptDesc + the descriptor for this arg +
  591. *
  592. * doc:
  593. * Nested value was found on the command line
  594. =*/
  595. void
  596. optionNestedVal( tOptions* pOpts, tOptDesc* pOD )
  597. {
  598. tOptionValue* pOV =
  599. optionLoadNested(pOD->pzLastArg, pOD->pz_Name, strlen( pOD->pz_Name ),
  600. OPTION_LOAD_UNCOOKED);
  601. if (pOV != NULL)
  602. addArgListEntry( &(pOD->optCookie), (void*)pOV );
  603. }
  604. /*
  605. * Local Variables:
  606. * mode: C
  607. * c-file-style: "stroustrup"
  608. * tab-width: 4
  609. * indent-tabs-mode: nil
  610. * End:
  611. * end of autoopts/nested.c */