nested.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. /*
  2. * $Id: nested.c,v 4.4 2006/03/25 19:24:56 bkorb Exp $
  3. * Time-stamp: "2005-07-27 10:10:28 bkorb"
  4. *
  5. * Automated Options Nested Values module.
  6. */
  7. /*
  8. * Automated Options copyright 1992-2006 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. * 51 Franklin Street, Fifth Floor,
  24. * Boston, MA 02110-1301, 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. addStringValue( &(pRes->v.nestVal), pzName, nameLen, NULL, 0 );
  286. break;
  287. case '"':
  288. case '\'':
  289. quote_char:
  290. pzVal = pzScan;
  291. pzScan = scanQuotedString( pzScan );
  292. dataLen = pzScan - pzVal;
  293. pNV = addStringValue( &(pRes->v.nestVal), pzName, nameLen,
  294. pzVal, dataLen );
  295. if ((pNV != NULL) && (mode == OPTION_LOAD_COOKED))
  296. ao_string_cook( pNV->v.strVal, NULL );
  297. break;
  298. default:
  299. default_char:
  300. /*
  301. * We have found some strange text value. It ends with a newline
  302. * or a comma.
  303. */
  304. pzVal = pzScan;
  305. for (;;) {
  306. char ch = *(pzScan++);
  307. switch (ch) {
  308. case '\n':
  309. if ((pzScan > pzVal + 2) && (pzScan[-2] == '\\'))
  310. continue;
  311. /* FALLTHROUGH */
  312. case ',':
  313. dataLen = (pzScan - pzVal) - 1;
  314. pNV = addStringValue( &(pRes->v.nestVal), pzName, nameLen,
  315. pzVal, dataLen );
  316. if (pNV != NULL)
  317. removeBackslashes( pNV->v.strVal );
  318. goto leave_scan_name;
  319. }
  320. }
  321. break;
  322. } leave_scan_name:;
  323. return pzScan;
  324. }
  325. /* scanXmlEntry
  326. *
  327. * We've found a '<' character. We ignore this if it is a comment or a
  328. * directive. If it is something else, then whatever it is we are looking
  329. * at is bogus. Returning NULL stops processing.
  330. */
  331. static const char*
  332. scanXmlEntry( const char* pzName, tOptionValue* pRes, tOptionLoadMode mode )
  333. {
  334. size_t nameLen = 1, valLen = 0;
  335. const char* pzScan = ++pzName;
  336. const char* pzVal;
  337. tOptionValue valu;
  338. tOptionValue* pNewVal;
  339. if (! isalpha(*pzName)) {
  340. switch (*pzName) {
  341. default:
  342. pzName = NULL;
  343. break;
  344. case '!':
  345. pzName = strstr( pzName, "-->" );
  346. if (pzName != NULL)
  347. pzName += 3;
  348. break;
  349. case '?':
  350. pzName = strchr( pzName, '>' );
  351. if (pzName != NULL)
  352. pzName++;
  353. break;
  354. }
  355. return pzName;
  356. }
  357. while (isalpha( *++pzScan )) nameLen++;
  358. if (nameLen > 64)
  359. return NULL;
  360. valu.valType = OPARG_TYPE_STRING;
  361. switch (*pzScan) {
  362. case ' ':
  363. case '\t':
  364. pzScan = parseAttributes( NULL, (char*)pzScan, &mode, &valu );
  365. if (*pzScan == '>') {
  366. pzScan++;
  367. break;
  368. }
  369. if (*pzScan != '/')
  370. return NULL;
  371. /* FALLTHROUGH */
  372. case '/':
  373. if (*++pzScan != '>')
  374. return NULL;
  375. addStringValue( &(pRes->v.nestVal), pzName, nameLen, NULL, 0 );
  376. return pzScan+2;
  377. default: return NULL;
  378. case '>': break;
  379. }
  380. pzVal = pzScan;
  381. {
  382. char z[68];
  383. char* pzD = z;
  384. int ct = nameLen;
  385. const char* pzS = pzName;
  386. *(pzD++) = '<';
  387. *(pzD++) = '/';
  388. do {
  389. *(pzD++) = *(pzS++);
  390. } while (--ct > 0);
  391. *(pzD++) = '>';
  392. *pzD = NUL;
  393. pzScan = strstr( pzScan, z );
  394. if (pzScan == NULL)
  395. return NULL;
  396. valLen = (pzScan - pzVal);
  397. pzScan += nameLen + 3;
  398. while (isspace( *pzScan )) pzScan++;
  399. }
  400. switch (valu.valType) {
  401. case OPARG_TYPE_NONE:
  402. addStringValue( &(pRes->v.nestVal), pzName, nameLen, NULL, 0 );
  403. break;
  404. case OPARG_TYPE_STRING:
  405. pNewVal =
  406. addStringValue( &(pRes->v.nestVal), pzName, nameLen, pzVal, valLen );
  407. if (mode == OPTION_LOAD_KEEP)
  408. break;
  409. mungeString( pNewVal->v.strVal, mode );
  410. break;
  411. case OPARG_TYPE_BOOLEAN:
  412. addBoolValue( &(pRes->v.nestVal), pzName, nameLen, pzVal, valLen );
  413. break;
  414. case OPARG_TYPE_NUMERIC:
  415. addNumberValue( &(pRes->v.nestVal), pzName, nameLen, pzVal, valLen );
  416. break;
  417. case OPARG_TYPE_HIERARCHY:
  418. {
  419. char* pz = AGALOC( valLen+1, "hierarchical scan" );
  420. if (pz == NULL)
  421. break;
  422. memcpy( pz, pzVal, valLen );
  423. pz[valLen] = NUL;
  424. addNestedValue( &(pRes->v.nestVal), pzName, nameLen, pz, valLen, mode );
  425. free(pz);
  426. break;
  427. }
  428. case OPARG_TYPE_ENUMERATION:
  429. case OPARG_TYPE_MEMBERSHIP:
  430. default:
  431. break;
  432. }
  433. return pzScan;
  434. }
  435. static void
  436. unloadNestedArglist( tArgList* pAL )
  437. {
  438. int ct = pAL->useCt;
  439. tOptionValue** ppNV = (tOptionValue**)(pAL->apzArgs);
  440. while (ct-- > 0) {
  441. tOptionValue* pNV = *(ppNV++);
  442. if (pNV->valType == OPARG_TYPE_HIERARCHY)
  443. unloadNestedArglist( pNV->v.nestVal );
  444. free( pNV );
  445. }
  446. free( (void*)pAL );
  447. }
  448. /*=export_func optionUnloadNested
  449. *
  450. * what: Deallocate the memory for a nested value
  451. * arg: + const tOptionValue* + pOptVal + the hierarchical value +
  452. *
  453. * doc:
  454. * A nested value needs to be deallocated. The pointer passed in should
  455. * have been gotten from a call to @code{configFileLoad()} (See
  456. * @pxref{libopts-configFileLoad}).
  457. =*/
  458. void
  459. optionUnloadNested( const tOptionValue* pOV )
  460. {
  461. if (pOV == NULL) return;
  462. if (pOV->valType != OPARG_TYPE_HIERARCHY) {
  463. errno = EINVAL;
  464. return;
  465. }
  466. unloadNestedArglist( pOV->v.nestVal );
  467. free( (void*)pOV );
  468. }
  469. /* sortNestedList
  470. *
  471. * This is a _stable_ sort. The entries are sorted alphabetically,
  472. * but within entries of the same name the ordering is unchanged.
  473. * Typically, we also hope the input is sorted.
  474. */
  475. static void
  476. sortNestedList( tArgList* pAL )
  477. {
  478. int ix;
  479. int lm = pAL->useCt;
  480. /*
  481. * This loop iterates "useCt" - 1 times.
  482. */
  483. for (ix = 0; ++ix < lm;) {
  484. int iy = ix-1;
  485. tOptionValue* pNewNV = (tOptionValue*)pAL->apzArgs[ix];
  486. tOptionValue* pOldNV = (tOptionValue*)pAL->apzArgs[iy];
  487. /*
  488. * For as long as the new entry precedes the "old" entry,
  489. * move the old pointer. Stop before trying to extract the
  490. * "-1" entry.
  491. */
  492. while (strcmp( pOldNV->pzName, pNewNV->pzName ) > 0) {
  493. pAL->apzArgs[iy+1] = (void*)pOldNV;
  494. pOldNV = (tOptionValue*)pAL->apzArgs[--iy];
  495. if (iy < 0)
  496. break;
  497. }
  498. /*
  499. * Always store the pointer. Sometimes it is redundant,
  500. * but the redundancy is cheaper than a test and branch sequence.
  501. */
  502. pAL->apzArgs[iy+1] = (void*)pNewNV;
  503. }
  504. }
  505. /*=export_func optionLoadNested
  506. * private:
  507. *
  508. * what: parse a hierarchical option argument
  509. * arg: + const char* + pzTxt + the text to scan +
  510. * arg: + const char* + pzName + the name for the text +
  511. * arg: + size_t + nameLen + the length of "name" +
  512. * arg: + tOptionLoadMode + mode + the value formation mode +
  513. *
  514. * ret_type: tOptionValue*
  515. * ret_desc: An allocated, compound value structure
  516. *
  517. * doc:
  518. * A block of text represents a series of values. It may be an
  519. * entire configuration file, or it may be an argument to an
  520. * option that takes a hierarchical value.
  521. =*/
  522. tOptionValue*
  523. optionLoadNested( const char* pzTxt, const char* pzName, size_t nameLen,
  524. tOptionLoadMode mode )
  525. {
  526. tOptionValue* pRes;
  527. tArgList* pAL;
  528. /*
  529. * Make sure we have some data and we have space to put what we find.
  530. */
  531. if (pzTxt == NULL) {
  532. errno = EINVAL;
  533. return NULL;
  534. }
  535. while (isspace( *pzTxt )) pzTxt++;
  536. if (*pzTxt == NUL) {
  537. errno = ENOENT;
  538. return NULL;
  539. }
  540. pRes = AGALOC( sizeof(*pRes) + nameLen + 1, "nested args" );
  541. if (pRes == NULL) {
  542. errno = ENOMEM;
  543. return NULL;
  544. }
  545. pRes->valType = OPARG_TYPE_HIERARCHY;
  546. pRes->pzName = (char*)(pRes + 1);
  547. memcpy( pRes->pzName, pzName, nameLen );
  548. pRes->pzName[ nameLen ] = NUL;
  549. pAL = AGALOC( sizeof(*pAL), "nested arg list" );
  550. if (pAL == NULL) {
  551. free( pRes );
  552. return NULL;
  553. }
  554. pRes->v.nestVal = pAL;
  555. pAL->useCt = 0;
  556. pAL->allocCt = MIN_ARG_ALLOC_CT;
  557. /*
  558. * Scan until we hit a NUL.
  559. */
  560. do {
  561. while (isspace( *pzTxt )) pzTxt++;
  562. if (isalpha( *pzTxt )) {
  563. pzTxt = scanNameEntry( pzTxt, pRes, mode );
  564. }
  565. else switch (*pzTxt) {
  566. case NUL: goto scan_done;
  567. case '<': pzTxt = scanXmlEntry( pzTxt, pRes, mode );
  568. if (*pzTxt == ',') pzTxt++; break;
  569. case '#': pzTxt = strchr( pzTxt, '\n' ); break;
  570. default: goto woops;
  571. }
  572. } while (pzTxt != NULL); scan_done:;
  573. pAL = pRes->v.nestVal;
  574. if (pAL->useCt != 0) {
  575. sortNestedList( pAL );
  576. return pRes;
  577. }
  578. woops:
  579. free( pRes->v.nestVal );
  580. free( pRes );
  581. return NULL;
  582. }
  583. /*=export_func optionNestedVal
  584. * private:
  585. *
  586. * what: parse a hierarchical option argument
  587. * arg: + tOptions* + pOpts + program options descriptor +
  588. * arg: + tOptDesc* + pOptDesc + the descriptor for this arg +
  589. *
  590. * doc:
  591. * Nested value was found on the command line
  592. =*/
  593. void
  594. optionNestedVal( tOptions* pOpts, tOptDesc* pOD )
  595. {
  596. tOptionValue* pOV =
  597. optionLoadNested(pOD->pzLastArg, pOD->pz_Name, strlen( pOD->pz_Name ),
  598. OPTION_LOAD_UNCOOKED);
  599. if (pOV != NULL)
  600. addArgListEntry( &(pOD->optCookie), (void*)pOV );
  601. }
  602. /*
  603. * Local Variables:
  604. * mode: C
  605. * c-file-style: "stroustrup"
  606. * tab-width: 4
  607. * indent-tabs-mode: nil
  608. * End:
  609. * end of autoopts/nested.c */