flipper_format.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. /**
  2. * @file flipper_format.h
  3. * Flipper File Format helper library.
  4. *
  5. * Flipper File Format is a fairly simple format for storing data in a file.
  6. *
  7. * Flipper file structure:
  8. *
  9. * ~~~~~~~~~~~~~~~~~~~~~
  10. * # Commentary
  11. * Field name: field value
  12. * ~~~~~~~~~~~~~~~~~~~~~
  13. *
  14. * Lines starting with the # character are ignored (considered as comments). The separator between the name of the value and the value itself is the string ": ".
  15. *
  16. * Currently supported types:
  17. *
  18. * ~~~~~~~~~~~~~~~~~~~~~
  19. * String: text
  20. * Int32: 1 2 -3 4
  21. * Uint32: 1 2 3 4
  22. * Float: 1.0 1234.654
  23. * Hex: A4 B3 C2 D1 12 FF
  24. * ~~~~~~~~~~~~~~~~~~~~~
  25. *
  26. * End of line is LF when writing, but CR is supported when reading.
  27. *
  28. * The library is designed in such a way that comments and field values are completely ignored when searching for keys, that is, they do not consume memory.
  29. *
  30. * File example:
  31. *
  32. * ~~~~~~~~~~~~~~~~~~~~~
  33. * Filetype: Flipper Test File
  34. * Version: 1
  35. * # Just test file
  36. * String: String value
  37. * UINT: 1234
  38. * Hex: 00 01 FF A3
  39. * ~~~~~~~~~~~~~~~~~~~~~
  40. *
  41. * Writing:
  42. *
  43. * ~~~~~~~~~~~~~~~~~~~~~
  44. * FlipperFormat* format = flipper_format_file_alloc(storage);
  45. *
  46. * do {
  47. * const uint32_t version = 1;
  48. * const char* string_value = "String value";
  49. * const uint32_t uint32_value = 1234;
  50. * const uint16_t array_size = 4;
  51. * const uint8_t* array[array_size] = {0x00, 0x01, 0xFF, 0xA3};
  52. *
  53. * if(!flipper_format_file_open_new(format, EXT_PATH("flipper_format_test"))) break;
  54. * if(!flipper_format_write_header_cstr(format, "Flipper Test File", version)) break;
  55. * if(!flipper_format_write_comment_cstr(format, "Just test file")) break;
  56. * if(!flipper_format_write_string_cstr(format, "String", string_value)) break;
  57. * if(!flipper_format_write_uint32(format, "UINT", &uint32_value, 1)) break;
  58. * if(!flipper_format_write_hex(format, "Hex Array", array, array_size)) break;
  59. *
  60. * // signal that the file was written successfully
  61. * } while(0);
  62. *
  63. * flipper_format_free(file);
  64. * ~~~~~~~~~~~~~~~~~~~~~
  65. *
  66. * Reading:
  67. *
  68. * ~~~~~~~~~~~~~~~~~~~~~
  69. * FlipperFormat* file = flipper_format_file_alloc(storage);
  70. *
  71. * do {
  72. * uint32_t version = 1;
  73. * FuriString* file_type;
  74. * FuriString* string_value;
  75. * uint32_t uint32_value = 1;
  76. * uint16_t array_size = 4;
  77. * uint8_t* array[array_size] = {0};
  78. * file_type = furi_string_alloc();
  79. * string_value = furi_string_alloc();
  80. *
  81. * if(!flipper_format_file_open_existing(file, EXT_PATH("flipper_format_test"))) break;
  82. * if(!flipper_format_read_header(file, file_type, &version)) break;
  83. * if(!flipper_format_read_string(file, "String", string_value)) break;
  84. * if(!flipper_format_read_uint32(file, "UINT", &uint32_value, 1)) break;
  85. * if(!flipper_format_read_hex(file, "Hex Array", array, array_size)) break;
  86. *
  87. * // signal that the file was read successfully
  88. * } while(0);
  89. *
  90. * flipper_format_free(file);
  91. * ~~~~~~~~~~~~~~~~~~~~~
  92. *
  93. */
  94. #pragma once
  95. #include <stdint.h>
  96. #include <storage/storage.h>
  97. #ifdef __cplusplus
  98. extern "C" {
  99. #endif
  100. typedef struct FlipperFormat FlipperFormat;
  101. /**
  102. * Allocate FlipperFormat as string.
  103. * @return FlipperFormat* pointer to a FlipperFormat instance
  104. */
  105. FlipperFormat* flipper_format_string_alloc();
  106. /**
  107. * Allocate FlipperFormat as file.
  108. * @return FlipperFormat* pointer to a FlipperFormat instance
  109. */
  110. FlipperFormat* flipper_format_file_alloc(Storage* storage);
  111. /**
  112. * Allocate FlipperFormat as file, buffered mode.
  113. * @return FlipperFormat* pointer to a FlipperFormat instance
  114. */
  115. FlipperFormat* flipper_format_buffered_file_alloc(Storage* storage);
  116. /**
  117. * Open existing file.
  118. * Use only if FlipperFormat allocated as a file.
  119. * @param flipper_format Pointer to a FlipperFormat instance
  120. * @param path File path
  121. * @return True on success
  122. */
  123. bool flipper_format_file_open_existing(FlipperFormat* flipper_format, const char* path);
  124. /**
  125. * Open existing file, buffered mode.
  126. * Use only if FlipperFormat allocated as a buffered file.
  127. * @param flipper_format Pointer to a FlipperFormat instance
  128. * @param path File path
  129. * @return True on success
  130. */
  131. bool flipper_format_buffered_file_open_existing(FlipperFormat* flipper_format, const char* path);
  132. /**
  133. * Open existing file for writing and add values to the end of file.
  134. * Use only if FlipperFormat allocated as a file.
  135. * @param flipper_format Pointer to a FlipperFormat instance
  136. * @param path File path
  137. * @return True on success
  138. */
  139. bool flipper_format_file_open_append(FlipperFormat* flipper_format, const char* path);
  140. /**
  141. * Open file. Creates a new file, or deletes the contents of the file if it already exists.
  142. * Use only if FlipperFormat allocated as a file.
  143. * @param flipper_format Pointer to a FlipperFormat instance
  144. * @param path File path
  145. * @return True on success
  146. */
  147. bool flipper_format_file_open_always(FlipperFormat* flipper_format, const char* path);
  148. /**
  149. * Open file. Creates a new file, or deletes the contents of the file if it already exists, buffered mode.
  150. * Use only if FlipperFormat allocated as a buffered file.
  151. * @param flipper_format Pointer to a FlipperFormat instance
  152. * @param path File path
  153. * @return True on success
  154. */
  155. bool flipper_format_buffered_file_open_always(FlipperFormat* flipper_format, const char* path);
  156. /**
  157. * Open file. Creates a new file, fails if file already exists.
  158. * Use only if FlipperFormat allocated as a file.
  159. * @param flipper_format Pointer to a FlipperFormat instance
  160. * @param path File path
  161. * @return True on success
  162. */
  163. bool flipper_format_file_open_new(FlipperFormat* flipper_format, const char* path);
  164. /**
  165. * Closes the file, use only if FlipperFormat allocated as a file.
  166. * @param flipper_format
  167. * @return true
  168. * @return false
  169. */
  170. bool flipper_format_file_close(FlipperFormat* flipper_format);
  171. /**
  172. * Closes the file, use only if FlipperFormat allocated as a buffered file.
  173. * @param flipper_format
  174. * @return true
  175. * @return false
  176. */
  177. bool flipper_format_buffered_file_close(FlipperFormat* flipper_format);
  178. /**
  179. * Free FlipperFormat.
  180. * @param flipper_format Pointer to a FlipperFormat instance
  181. */
  182. void flipper_format_free(FlipperFormat* flipper_format);
  183. /**
  184. * Set FlipperFormat mode.
  185. * @param flipper_format Pointer to a FlipperFormat instance
  186. * @param strict_mode True obligates not to skip valid fields. False by default.
  187. */
  188. void flipper_format_set_strict_mode(FlipperFormat* flipper_format, bool strict_mode);
  189. /**
  190. * Rewind the RW pointer.
  191. * @param flipper_format Pointer to a FlipperFormat instance
  192. * @return True on success
  193. */
  194. bool flipper_format_rewind(FlipperFormat* flipper_format);
  195. /**
  196. * Move the RW pointer at the end. Can be useful if you want to add some data after reading.
  197. * @param flipper_format Pointer to a FlipperFormat instance
  198. * @return True on success
  199. */
  200. bool flipper_format_seek_to_end(FlipperFormat* flipper_format);
  201. /**
  202. * Check if the key exists.
  203. * @param flipper_format Pointer to a FlipperFormat instance
  204. * @param key Key
  205. * @return true key exists
  206. * @return false key is not exists
  207. */
  208. bool flipper_format_key_exist(FlipperFormat* flipper_format, const char* key);
  209. /**
  210. * Read the header (file type and version).
  211. * @param flipper_format Pointer to a FlipperFormat instance
  212. * @param filetype File type string
  213. * @param version Version Value
  214. * @return True on success
  215. */
  216. bool flipper_format_read_header(
  217. FlipperFormat* flipper_format,
  218. FuriString* filetype,
  219. uint32_t* version);
  220. /**
  221. * Write the header (file type and version).
  222. * @param flipper_format Pointer to a FlipperFormat instance
  223. * @param filetype File type string
  224. * @param version Version Value
  225. * @return True on success
  226. */
  227. bool flipper_format_write_header(
  228. FlipperFormat* flipper_format,
  229. FuriString* filetype,
  230. const uint32_t version);
  231. /**
  232. * Write the header (file type and version). Plain C string version.
  233. * @param flipper_format Pointer to a FlipperFormat instance
  234. * @param filetype File type string
  235. * @param version Version Value
  236. * @return True on success
  237. */
  238. bool flipper_format_write_header_cstr(
  239. FlipperFormat* flipper_format,
  240. const char* filetype,
  241. const uint32_t version);
  242. /**
  243. * Get the count of values by key
  244. * @param flipper_format Pointer to a FlipperFormat instance
  245. * @param key
  246. * @param count
  247. * @return bool
  248. */
  249. bool flipper_format_get_value_count(
  250. FlipperFormat* flipper_format,
  251. const char* key,
  252. uint32_t* count);
  253. /**
  254. * Read a string by key
  255. * @param flipper_format Pointer to a FlipperFormat instance
  256. * @param key Key
  257. * @param data Value
  258. * @return True on success
  259. */
  260. bool flipper_format_read_string(FlipperFormat* flipper_format, const char* key, FuriString* data);
  261. /**
  262. * Write key and string
  263. * @param flipper_format Pointer to a FlipperFormat instance
  264. * @param key Key
  265. * @param data Value
  266. * @return True on success
  267. */
  268. bool flipper_format_write_string(FlipperFormat* flipper_format, const char* key, FuriString* data);
  269. /**
  270. * Write key and string. Plain C string version.
  271. * @param flipper_format Pointer to a FlipperFormat instance
  272. * @param key Key
  273. * @param data Value
  274. * @return True on success
  275. */
  276. bool flipper_format_write_string_cstr(
  277. FlipperFormat* flipper_format,
  278. const char* key,
  279. const char* data);
  280. /**
  281. * Read array of uint64 in hex format by key
  282. * @param flipper_format Pointer to a FlipperFormat instance
  283. * @param key Key
  284. * @param data Value
  285. * @param data_size Values count
  286. * @return True on success
  287. */
  288. bool flipper_format_read_hex_uint64(
  289. FlipperFormat* flipper_format,
  290. const char* key,
  291. uint64_t* data,
  292. const uint16_t data_size);
  293. /**
  294. * Write key and array of uint64 in hex format
  295. * @param flipper_format Pointer to a FlipperFormat instance
  296. * @param key Key
  297. * @param data Value
  298. * @param data_size Values count
  299. * @return True on success
  300. */
  301. bool flipper_format_write_hex_uint64(
  302. FlipperFormat* flipper_format,
  303. const char* key,
  304. const uint64_t* data,
  305. const uint16_t data_size);
  306. /**
  307. * Read array of uint32 by key
  308. * @param flipper_format Pointer to a FlipperFormat instance
  309. * @param key Key
  310. * @param data Value
  311. * @param data_size Values count
  312. * @return True on success
  313. */
  314. bool flipper_format_read_uint32(
  315. FlipperFormat* flipper_format,
  316. const char* key,
  317. uint32_t* data,
  318. const uint16_t data_size);
  319. /**
  320. * Write key and array of uint32
  321. * @param flipper_format Pointer to a FlipperFormat instance
  322. * @param key Key
  323. * @param data Value
  324. * @param data_size Values count
  325. * @return True on success
  326. */
  327. bool flipper_format_write_uint32(
  328. FlipperFormat* flipper_format,
  329. const char* key,
  330. const uint32_t* data,
  331. const uint16_t data_size);
  332. /**
  333. * Read array of int32 by key
  334. * @param flipper_format Pointer to a FlipperFormat instance
  335. * @param key Key
  336. * @param data Value
  337. * @param data_size Values count
  338. * @return True on success
  339. */
  340. bool flipper_format_read_int32(
  341. FlipperFormat* flipper_format,
  342. const char* key,
  343. int32_t* data,
  344. const uint16_t data_size);
  345. /**
  346. * Write key and array of int32
  347. * @param flipper_format Pointer to a FlipperFormat instance
  348. * @param key Key
  349. * @param data Value
  350. * @param data_size Values count
  351. * @return True on success
  352. */
  353. bool flipper_format_write_int32(
  354. FlipperFormat* flipper_format,
  355. const char* key,
  356. const int32_t* data,
  357. const uint16_t data_size);
  358. /**
  359. * Read array of bool by key
  360. * @param flipper_format Pointer to a FlipperFormat instance
  361. * @param key Key
  362. * @param data Value
  363. * @param data_size Values count
  364. * @return True on success
  365. */
  366. bool flipper_format_read_bool(
  367. FlipperFormat* flipper_format,
  368. const char* key,
  369. bool* data,
  370. const uint16_t data_size);
  371. /**
  372. * Write key and array of bool
  373. * @param flipper_format Pointer to a FlipperFormat instance
  374. * @param key Key
  375. * @param data Value
  376. * @param data_size Values count
  377. * @return True on success
  378. */
  379. bool flipper_format_write_bool(
  380. FlipperFormat* flipper_format,
  381. const char* key,
  382. const bool* data,
  383. const uint16_t data_size);
  384. /**
  385. * Read array of float by key
  386. * @param flipper_format Pointer to a FlipperFormat instance
  387. * @param key Key
  388. * @param data Value
  389. * @param data_size Values count
  390. * @return True on success
  391. */
  392. bool flipper_format_read_float(
  393. FlipperFormat* flipper_format,
  394. const char* key,
  395. float* data,
  396. const uint16_t data_size);
  397. /**
  398. * Write key and array of float
  399. * @param flipper_format Pointer to a FlipperFormat instance
  400. * @param key Key
  401. * @param data Value
  402. * @param data_size Values count
  403. * @return True on success
  404. */
  405. bool flipper_format_write_float(
  406. FlipperFormat* flipper_format,
  407. const char* key,
  408. const float* data,
  409. const uint16_t data_size);
  410. /**
  411. * Read array of hex-formatted bytes by key
  412. * @param flipper_format Pointer to a FlipperFormat instance
  413. * @param key Key
  414. * @param data Value
  415. * @param data_size Values count
  416. * @return True on success
  417. */
  418. bool flipper_format_read_hex(
  419. FlipperFormat* flipper_format,
  420. const char* key,
  421. uint8_t* data,
  422. const uint16_t data_size);
  423. /**
  424. * Write key and array of hex-formatted bytes
  425. * @param flipper_format Pointer to a FlipperFormat instance
  426. * @param key Key
  427. * @param data Value
  428. * @param data_size Values count
  429. * @return True on success
  430. */
  431. bool flipper_format_write_hex(
  432. FlipperFormat* flipper_format,
  433. const char* key,
  434. const uint8_t* data,
  435. const uint16_t data_size);
  436. /**
  437. * Write comment
  438. * @param flipper_format Pointer to a FlipperFormat instance
  439. * @param data Comment text
  440. * @return True on success
  441. */
  442. bool flipper_format_write_comment(FlipperFormat* flipper_format, FuriString* data);
  443. /**
  444. * Write comment. Plain C string version.
  445. * @param flipper_format Pointer to a FlipperFormat instance
  446. * @param data Comment text
  447. * @return True on success
  448. */
  449. bool flipper_format_write_comment_cstr(FlipperFormat* flipper_format, const char* data);
  450. /**
  451. * Removes the first matching key and its value. Sets the RW pointer to a position of deleted data.
  452. * @param flipper_format Pointer to a FlipperFormat instance
  453. * @param key Key
  454. * @return True on success
  455. */
  456. bool flipper_format_delete_key(FlipperFormat* flipper_format, const char* key);
  457. /**
  458. * Updates the value of the first matching key to a string value. Sets the RW pointer to a position at the end of inserted data.
  459. * @param flipper_format Pointer to a FlipperFormat instance
  460. * @param key Key
  461. * @param data Value
  462. * @return True on success
  463. */
  464. bool flipper_format_update_string(FlipperFormat* flipper_format, const char* key, FuriString* data);
  465. /**
  466. * Updates the value of the first matching key to a string value. Plain C version. Sets the RW pointer to a position at the end of inserted data.
  467. * @param flipper_format Pointer to a FlipperFormat instance
  468. * @param key Key
  469. * @param data Value
  470. * @return True on success
  471. */
  472. bool flipper_format_update_string_cstr(
  473. FlipperFormat* flipper_format,
  474. const char* key,
  475. const char* data);
  476. /**
  477. * Updates the value of the first matching key to a uint32 array value. Sets the RW pointer to a position at the end of inserted data.
  478. * @param flipper_format Pointer to a FlipperFormat instance
  479. * @param key Key
  480. * @param data Value
  481. * @return True on success
  482. */
  483. bool flipper_format_update_uint32(
  484. FlipperFormat* flipper_format,
  485. const char* key,
  486. const uint32_t* data,
  487. const uint16_t data_size);
  488. /**
  489. * Updates the value of the first matching key to a int32 array value. Sets the RW pointer to a position at the end of inserted data.
  490. * @param flipper_format Pointer to a FlipperFormat instance
  491. * @param key Key
  492. * @param data Value
  493. * @return True on success
  494. */
  495. bool flipper_format_update_int32(
  496. FlipperFormat* flipper_format,
  497. const char* key,
  498. const int32_t* data,
  499. const uint16_t data_size);
  500. /**
  501. * Updates the value of the first matching key to a bool array value. Sets the RW pointer to a position at the end of inserted data.
  502. * @param flipper_format Pointer to a FlipperFormat instance
  503. * @param key Key
  504. * @param data Value
  505. * @return True on success
  506. */
  507. bool flipper_format_update_bool(
  508. FlipperFormat* flipper_format,
  509. const char* key,
  510. const bool* data,
  511. const uint16_t data_size);
  512. /**
  513. * Updates the value of the first matching key to a float array value. Sets the RW pointer to a position at the end of inserted data.
  514. * @param flipper_format Pointer to a FlipperFormat instance
  515. * @param key Key
  516. * @param data Value
  517. * @return True on success
  518. */
  519. bool flipper_format_update_float(
  520. FlipperFormat* flipper_format,
  521. const char* key,
  522. const float* data,
  523. const uint16_t data_size);
  524. /**
  525. * Updates the value of the first matching key to an array of hex-formatted bytes. Sets the RW pointer to a position at the end of inserted data.
  526. * @param flipper_format Pointer to a FlipperFormat instance
  527. * @param key Key
  528. * @param data Value
  529. * @return True on success
  530. */
  531. bool flipper_format_update_hex(
  532. FlipperFormat* flipper_format,
  533. const char* key,
  534. const uint8_t* data,
  535. const uint16_t data_size);
  536. /**
  537. * Updates the value of the first matching key to a string value, or adds the key and value if the key did not exist.
  538. * Sets the RW pointer to a position at the end of inserted data.
  539. * @param flipper_format Pointer to a FlipperFormat instance
  540. * @param key Key
  541. * @param data Value
  542. * @return True on success
  543. */
  544. bool flipper_format_insert_or_update_string(
  545. FlipperFormat* flipper_format,
  546. const char* key,
  547. FuriString* data);
  548. /**
  549. * Updates the value of the first matching key to a string value, or adds the key and value if the key did not exist.
  550. * Plain C version.
  551. * Sets the RW pointer to a position at the end of inserted data.
  552. * @param flipper_format Pointer to a FlipperFormat instance
  553. * @param key Key
  554. * @param data Value
  555. * @return True on success
  556. */
  557. bool flipper_format_insert_or_update_string_cstr(
  558. FlipperFormat* flipper_format,
  559. const char* key,
  560. const char* data);
  561. /**
  562. * Updates the value of the first matching key to a uint32 array value, or adds the key and value if the key did not exist.
  563. * Sets the RW pointer to a position at the end of inserted data.
  564. * @param flipper_format Pointer to a FlipperFormat instance
  565. * @param key Key
  566. * @param data Value
  567. * @return True on success
  568. */
  569. bool flipper_format_insert_or_update_uint32(
  570. FlipperFormat* flipper_format,
  571. const char* key,
  572. const uint32_t* data,
  573. const uint16_t data_size);
  574. /**
  575. * Updates the value of the first matching key to a int32 array value, or adds the key and value if the key did not exist.
  576. * Sets the RW pointer to a position at the end of inserted data.
  577. * @param flipper_format Pointer to a FlipperFormat instance
  578. * @param key Key
  579. * @param data Value
  580. * @return True on success
  581. */
  582. bool flipper_format_insert_or_update_int32(
  583. FlipperFormat* flipper_format,
  584. const char* key,
  585. const int32_t* data,
  586. const uint16_t data_size);
  587. /**
  588. * Updates the value of the first matching key to a bool array value, or adds the key and value if the key did not exist.
  589. * Sets the RW pointer to a position at the end of inserted data.
  590. * @param flipper_format Pointer to a FlipperFormat instance
  591. * @param key Key
  592. * @param data Value
  593. * @return True on success
  594. */
  595. bool flipper_format_insert_or_update_bool(
  596. FlipperFormat* flipper_format,
  597. const char* key,
  598. const bool* data,
  599. const uint16_t data_size);
  600. /**
  601. * Updates the value of the first matching key to a float array value, or adds the key and value if the key did not exist.
  602. * Sets the RW pointer to a position at the end of inserted data.
  603. * @param flipper_format Pointer to a FlipperFormat instance
  604. * @param key Key
  605. * @param data Value
  606. * @return True on success
  607. */
  608. bool flipper_format_insert_or_update_float(
  609. FlipperFormat* flipper_format,
  610. const char* key,
  611. const float* data,
  612. const uint16_t data_size);
  613. /**
  614. * Updates the value of the first matching key to an array of hex-formatted bytes, or adds the key and value if the key did not exist.
  615. *Sets the RW pointer to a position at the end of inserted data.
  616. * @param flipper_format Pointer to a FlipperFormat instance
  617. * @param key Key
  618. * @param data Value
  619. * @return True on success
  620. */
  621. bool flipper_format_insert_or_update_hex(
  622. FlipperFormat* flipper_format,
  623. const char* key,
  624. const uint8_t* data,
  625. const uint16_t data_size);
  626. #ifdef __cplusplus
  627. }
  628. #endif