Advertisement
Guest User

anthony gorecki anthony@anthonygorecki.ca

a guest
Nov 22nd, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.16 KB | None | 0 0
  1. Sun Nov 22 04:57:05 EST 2015
  2. ./dev/gc-base-lib/proj-make.txt
  3. //==============================================================================
  4. // This file is part of Gc-Base-Lib.
  5. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  6. //
  7. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  8. // the terms of the GNU General Public License as published by the Free Software
  9. // Foundation, either version 3 of the License, or (at your option) any later
  10. // version.
  11. //
  12. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  13. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  14. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  15. // details.
  16. //
  17. // You should have received a copy of the GNU General Public License along with
  18. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  19. //==============================================================================
  20. # gc-proj-conf (tracks config; can reconfigure)
  21. # gc-proj-make (will rebuild changed files; will rebuild only necessary after conf change)
  22. # gc-proj-inst (installs all built targets)
  23.  
  24. DTGT gc-proj
  25.  
  26. TGEN dev
  27. MAKE
  28. EXEC lib/pkgconfig/make.sh $PREF
  29. INST
  30. COPY include/gc $PREF/include
  31. MOVE lib/pkgconfig/gc-proj.pc.tmp $PREF/lib/pkgconfig/gc-proj.pc
  32.  
  33. TLIB gc-proj
  34. ./dev/gc-base-lib/src/ct/u8_bcss.c
  35. //==============================================================================
  36. // This file is part of Gc-Base-Lib.
  37. // Lockless circular buffer, supporting a single producer and single consumer.
  38. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  39. //
  40. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  41. // the terms of the GNU General Public License as published by the Free Software
  42. // Foundation, either version 3 of the License, or (at your option) any later
  43. // version.
  44. //
  45. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  46. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  47. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  48. // details.
  49. //
  50. // You should have received a copy of the GNU General Public License along with
  51. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  52. //==============================================================================
  53. #include <gc/mem.h>
  54.  
  55. #include <gc/u8_bcss.h>
  56.  
  57. // Two variable "u8_a" type, member 1 is "dbeg", member 2 is "cbeg".
  58. //
  59. // Minimum size for this buffer implementation is two bytes. Check for this in
  60. // conf validation.
  61. //
  62. // Implementation should work out figures using the nonatomic 'scout' member.
  63. // Contig is inteded for buffer output, where parsers might need a certain
  64. // number of contiguous bytes to function properly. Support is also provided for
  65. // contiguous bytes for buffer input, should it be useful. These numbers are
  66. // designed to represent the /minimum/ that the application can handle.
  67. //
  68. // This buffer is not designed to handle circumstances in which the read or
  69. // write address needs to be aligned to some specific value, or when the reads
  70. // and writes need to be of a particular size. In other words, it is not
  71. // designed for linux kernel aio or any other kind of disk aio.
  72. //
  73. // This buffer is a candidate for sync and async network io, and sync disk io,
  74. // as well as unix pipes.
  75. //
  76. // Buffer conversion will be available: u8_bcss -> u8_b for pars_ -> publish
  77. // changes back to original u8_bcss once finished. This will work for more
  78. // advanced to less advanced buffers, and the other way around. Will have a
  79. // similar style to the (file) input and output functions at the end of this
  80. // file. This might only be for contiguous io segments. The buffer conversion
  81. // function is not responsible for doing any initialization or deinitialization
  82. // of the target buffer.
  83.  
  84.  
  85.  
  86. //==============================================================================
  87. // Initialization
  88. //==============================================================================
  89. u8 u8_bcss_init(struct u8_bcss_i *buf, struct u8_bcss_c *conf)
  90. {
  91. // Atomic members need to be initialized before being used. Do that here.
  92.  
  93. buf->scin = conf->scin; // U16
  94. buf->scout = conf->scout;
  95. buf->cin = buf->cbeg - conf->scntg;
  96. buf->cout = 0;
  97. buf->din = buf->dbeg + conf->scntg;
  98. buf->dout = buf->dbeg + conf->scntg;
  99. return 0;
  100. }
  101.  
  102.  
  103.  
  104. //==============================================================================
  105. // Advance
  106. //==============================================================================
  107. void u8_bcss_ia(struct u8_bcss_i *buf, u32 size)
  108. {
  109. u32 off = buf->din - buf->dbeg + size;
  110.  
  111. if (off < buf->cbeg - 1)
  112. buf->din += size;
  113.  
  114. else // Wrap around.
  115. buf->din = buf->dbeg + off - buf->cbeg;
  116.  
  117. atmc_fsub(&buf->cin, size);
  118. atmc_fadd(&buf->cout, size);
  119. }
  120.  
  121.  
  122. void u8_bcss_oa(struct u8_bcss_i *buf, u32 size)
  123. {
  124. u32 off = buf->dout - buf->dbeg + size;
  125.  
  126. if (off < buf->cbeg - 1)
  127. buf->dout += size;
  128.  
  129. else // Wrap around.
  130. buf->dout = buf->dbeg + off - buf->cbeg;
  131.  
  132. atmc_fsub(&buf->cout, size);
  133. atmc_fadd(&buf->cin, size);
  134. }
  135.  
  136.  
  137.  
  138. //==============================================================================
  139. // Count
  140. //==============================================================================
  141. u32 u8_bcss_igc(struct u8_bcss_i *buf)
  142. {
  143. return atmc_load(&buf->cin);
  144. }
  145.  
  146.  
  147. u32 u8_bcss_ogc(struct u8_bcss_i *buf)
  148. {
  149. return atmc_load(&buf->cout);
  150. }
  151.  
  152.  
  153.  
  154. //==============================================================================
  155. // Contiguous count and pointer
  156. //==============================================================================
  157. u32 u8_bcss_igcc(struct u8_bcss_i *buf)
  158. {
  159. u32 off_in = buf->din - buf->dbeg;
  160. u32 orig_cin = atmc_load(&buf->cin);
  161.  
  162. if (off_in + orig_cin < buf->cbeg - 1)
  163. return orig_cout;
  164.  
  165. return buf->cbeg - off_in;
  166. }
  167.  
  168.  
  169. u8 *u8_bcss_igcp(struct u8_bcss_i *buf)
  170. {
  171. return buf->din;
  172. }
  173.  
  174.  
  175. u32 u8_bcss_ogcc(struct u8_bcss_i *buf)
  176. {
  177. u32 off_out = buf->dout - buf->dbeg;
  178. u32 orig_cout = atmc_load(&buf->cout);
  179.  
  180. if (off_out + orig_cout < buf->cbeg - 1)
  181. return orig_cout;
  182.  
  183. return buf->cbeg - off_out;
  184. }
  185.  
  186.  
  187. u8 *u8_bcss_ogcp(struct u8_bcss_i *buf)
  188. {
  189. return buf->dout;
  190. }
  191.  
  192.  
  193.  
  194. //==============================================================================
  195. // Peeking
  196. //==============================================================================
  197. u8 u8_bcss_op1(struct u8_bcss_i *buf)
  198. {
  199. return buf->dout[0];
  200. }
  201.  
  202.  
  203. u16 u8_bcss_op2(struct u8_bcss_i *buf)
  204. {
  205. u8 data[2];
  206.  
  207. data[0] = buf->dout[0];
  208.  
  209. if (buf->dout <= buf->dbeg + buf->cbeg - 2)
  210. data[1] = buf->dout[1];
  211.  
  212. else
  213. data[1] = buf->dbeg[0];
  214.  
  215. return (u16)data;
  216. }
  217.  
  218.  
  219.  
  220. //==============================================================================
  221. // Input and output
  222. //==============================================================================
  223. u8 u8_bcss_if(struct u8_bcss_i *buf, u8 (*fin)(void*, u8*, u32, u32*),
  224. void *arg)
  225. {
  226. u32 ret;
  227.  
  228. if (unlikely(fin(arg, buf->din, u8_bcss_igcc(buf), &ret)))
  229. return 1;
  230.  
  231. u8_bcss_ia(buf, ret);
  232. return 0;
  233. }
  234.  
  235.  
  236. u8 u8_bcss_of(struct u8_bcss_i *buf, u8 (*fout)(void*, u8*, u32, u32*),
  237. void *arg)
  238. {
  239. u32 ret;
  240.  
  241. if (unlikely(fout(arg, buf->dout, u8_bcss_ogcc(buf), &ret)))
  242. return 1;
  243.  
  244. u8_bcss_oa(buf, ret);
  245. return 0;
  246. }
  247. ./dev/gc-base-lib/src/ct/u8_a.c
  248. //==============================================================================
  249. // This file is part of Gc-Base-Lib.
  250. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  251. //
  252. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  253. // the terms of the GNU General Public License as published by the Free Software
  254. // Foundation, either version 3 of the License, or (at your option) any later
  255. // version.
  256. //
  257. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  258. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  259. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  260. // details.
  261. //
  262. // You should have received a copy of the GNU General Public License along with
  263. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  264. //==============================================================================
  265. #include <gc/mem.h>
  266.  
  267. #include <gc/u8_a.h>
  268.  
  269. // Configuration for composite type "u8_a": CT_M1V
  270.  
  271.  
  272.  
  273. //==============================================================================
  274. // Initialization and deinitialization
  275. //==============================================================================
  276. u8 u8_a_init(u8 *data, u32 *size, struct u8_a_c *conf)
  277. {
  278. *data = mem_alloc(conf->size);
  279.  
  280. if (unlikely(*data == NULL && conf->size))
  281. return 1;
  282.  
  283. *size = conf->size;
  284. return 0;
  285. }
  286.  
  287.  
  288. void u8_a_deinit(u8 *data)
  289. {
  290. mem_dealloc(*data);
  291. }
  292. ./dev/gc-base-lib/src/ct/u8_ib.c
  293. //==============================================================================
  294. // This file is part of Gc-Base-Lib.
  295. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  296. //
  297. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  298. // the terms of the GNU General Public License as published by the Free Software
  299. // Foundation, either version 3 of the License, or (at your option) any later
  300. // version.
  301. //
  302. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  303. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  304. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  305. // details.
  306. //
  307. // You should have received a copy of the GNU General Public License along with
  308. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  309. //==============================================================================
  310. #include <gc/mem.h>
  311.  
  312. #include <gc/u8_ib.h>
  313.  
  314.  
  315.  
  316. //==============================================================================
  317. // Initialization and deinitialization
  318. //==============================================================================
  319. CT_WRAP_MSI2D1(u8_ib);
  320.  
  321.  
  322. u8 u8_ib_init_ms(struct u8_ib_i *ibuf, struct u8_ib_c *conf)
  323. {
  324. MS_BEG(0);
  325.  
  326. MS_SP {
  327. ibuf->buf = mem_alloc(conf->sbuf);
  328. MS_EV(ibuf->buf != NULL || !conf->sbuf);
  329. }
  330.  
  331. MS_SP { MS_EV(!conf->f->init(ibuf->buf, conf->buf)); }
  332. MS_SP { ibuf->f = conf->f; }
  333. return 0;
  334. }
  335.  
  336.  
  337. void u8_ib_deinit_ms(struct u8_ib_i *ibuf, u8 step)
  338. {
  339. MS_BEG(step);
  340. MS_EM;
  341. MS_SP { ibuf->f->deinit(ibuf->buf); }
  342. MS_SP { mem_dealloc(ibuf->buf); }
  343. }
  344.  
  345.  
  346.  
  347. //==============================================================================
  348. // Advance
  349. //==============================================================================
  350. void u8_ib_ia(struct u8_ib_i *ibuf, u32 size)
  351. {
  352. ibuf->f->ia(ibuf->buf, size);
  353. }
  354.  
  355.  
  356. void u8_ib_oa(struct u8_ib_i *ibuf, u32 size)
  357. {
  358. ibuf->f->oa(ibuf->buf, size);
  359. }
  360.  
  361.  
  362.  
  363. //==============================================================================
  364. // Count
  365. //==============================================================================
  366. u32 u8_ib_igc(struct u8_ib_i *ibuf)
  367. {
  368. return ibuf->f->igc(ibuf->buf);
  369. }
  370.  
  371.  
  372. u32 u8_ib_ogc(struct u8_ib_i *ibuf)
  373. {
  374. return ibuf->f->ogc(ibuf->buf);
  375. }
  376.  
  377.  
  378.  
  379. //==============================================================================
  380. // Contiguous count and pointer
  381. //==============================================================================
  382. u32 u8_ib_igcc(struct u8_ib_i *ibuf)
  383. {
  384. return ibuf->f->igcc(ibuf->buf);
  385. }
  386.  
  387.  
  388. u8 *u8_ib_igcp(struct u8_ib_i *ibuf)
  389. {
  390. return ibuf->f->igcp(ibuf->buf);
  391. }
  392.  
  393.  
  394. u32 u8_ib_ogcc(struct u8_ib_i *ibuf)
  395. {
  396. return ibuf->f->ogcc(ibuf->buf);
  397. }
  398.  
  399.  
  400. u8 *u8_ib_ogcp(struct u8_ib_i *ibuf)
  401. {
  402. return ibuf->f->ogcp(ibuf->buf);
  403. }
  404.  
  405.  
  406.  
  407. //==============================================================================
  408. // Peeking
  409. //==============================================================================
  410. u8 u8_ib_op1(struct u8_ib_i *ibuf)
  411. {
  412. return ibuf->f->op1(ibuf->buf);
  413. }
  414.  
  415.  
  416. u16 u8_ib_op2(struct u8_ib_i *ibuf)
  417. {
  418. return ibuf->f->op2(ibuf->buf);
  419. }
  420.  
  421.  
  422.  
  423. //==============================================================================
  424. // Input and output
  425. //==============================================================================
  426. u8 u8_ib_if(struct u8_ib_i *ibuf, u8 (*fin)(void*, u8*, u32, u32*), void *arg)
  427. {
  428. return ibuf->if(ibuf->buf, fin, arg);
  429. }
  430.  
  431.  
  432. u8 u8_ib_of(struct u8_ib_i *ibuf, u8 (*fout)(void*, u8*, u32, u32*), void *arg)
  433. {
  434. return ibuf->of(ibuf->buf, fout, arg);
  435. }
  436. ./dev/gc-base-lib/src/ct/u8_b.c
  437. ./dev/gc-base-lib/src/ct/u8_bc.c
  438. //==============================================================================
  439. // This file is part of Gc-Base-Lib.
  440. // Simple circular buffer, supporting nonsimultaneous input and output.
  441. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  442. //
  443. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  444. // the terms of the GNU General Public License as published by the Free Software
  445. // Foundation, either version 3 of the License, or (at your option) any later
  446. // version.
  447. //
  448. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  449. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  450. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  451. // details.
  452. //
  453. // You should have received a copy of the GNU General Public License along with
  454. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  455. //==============================================================================
  456. #include <gc/mem.h>
  457.  
  458. #include <gc/u8_bc.h>
  459.  
  460.  
  461.  
  462. //==============================================================================
  463. // Initialization and deinitialization
  464. //==============================================================================
  465. u8 u8_bc_init(struct u8_bc_i *buf, struct u8_bc_c *conf)
  466. {
  467. // Minimum size for this buffer implementation is two bytes. Check for this
  468. // in conf validation.
  469.  
  470. buf->dbeg = mem_alloc(conf->size);
  471.  
  472. if (unlikely(buf->dbeg == NULL))
  473. return 1;
  474.  
  475. buf->cbeg = size;
  476. return 0;
  477. }
  478.  
  479.  
  480. void u8_bc_deinit(struct u8_bc_i *buf)
  481. {
  482. mem_dealloc(buf->dbeg);
  483. }
  484.  
  485.  
  486.  
  487. //==============================================================================
  488. // Advance
  489. //==============================================================================
  490. void u8_bc_ia(struct u8_bc_i *buf, u32 size)
  491. {
  492. u32 off = buf->din - buf->dbeg + size;
  493.  
  494. if (off < buf->cbeg - 1)
  495. buf->din += size;
  496.  
  497. else // Wrap around.
  498. buf->din = buf->dbeg + off - buf->cbeg;
  499.  
  500. atmc_fsub(&buf->cin, size);
  501. atmc_fadd(&buf->cout, size);
  502. }
  503.  
  504.  
  505. void u8_bc_oa(struct u8_bc_i *buf, u32 size)
  506. {
  507. u32 off = buf->dout - buf->dbeg + size;
  508.  
  509. if (off < buf->cbeg - 1)
  510. buf->dout += size;
  511.  
  512. else // Wrap around.
  513. buf->dout = buf->dbeg + off - buf->cbeg;
  514.  
  515. atmc_fsub(&buf->cout, size);
  516. atmc_fadd(&buf->cin, size);
  517. }
  518.  
  519.  
  520.  
  521. //==============================================================================
  522. // Count
  523. //==============================================================================
  524. u32 u8_bc_igc(struct u8_bc_i *buf)
  525. {
  526. return atmc_load(&buf->cin);
  527. }
  528.  
  529.  
  530. u32 u8_bc_ogc(struct u8_bc_i *buf)
  531. {
  532. return atmc_load(&buf->cout);
  533. }
  534.  
  535.  
  536.  
  537. //==============================================================================
  538. // Contiguous count and pointer
  539. //==============================================================================
  540. u32 u8_bc_igcc(struct u8_bc_i *buf)
  541. {
  542. u32 off_in = buf->din - buf->dbeg;
  543. u32 orig_cin = atmc_load(&buf->cin);
  544.  
  545. if (off_in + orig_cin < buf->cbeg - 1)
  546. return orig_cout;
  547.  
  548. return buf->cbeg - off_in;
  549. }
  550.  
  551.  
  552. u8 *u8_bc_igcp(struct u8_bc_i *buf)
  553. {
  554. return buf->din;
  555. }
  556.  
  557.  
  558. u32 u8_bc_ogcc(struct u8_bc_i *buf)
  559. {
  560. u32 off_out = buf->dout - buf->dbeg;
  561. u32 orig_cout = atmc_load(&buf->cout);
  562.  
  563. if (off_out + orig_cout < buf->cbeg - 1)
  564. return orig_cout;
  565.  
  566. return buf->cbeg - off_out;
  567. }
  568.  
  569.  
  570. u8 *u8_bc_ogcp(struct u8_bc_i *buf)
  571. {
  572. return buf->dout;
  573. }
  574.  
  575.  
  576.  
  577. //==============================================================================
  578. // Peeking
  579. //==============================================================================
  580. u8 u8_bc_op1(struct u8_bc_i *buf)
  581. {
  582. return buf->dout[0];
  583. }
  584.  
  585.  
  586. u16 u8_bc_op2(struct u8_bc_i *buf)
  587. {
  588. u8 data[2];
  589.  
  590. data[0] = buf->dout[0];
  591.  
  592. if (buf->dout <= buf->dbeg + buf->cbeg - 2)
  593. data[1] = buf->dout[1];
  594.  
  595. else
  596. data[1] = buf->dbeg[0];
  597.  
  598. return (u16)data;
  599. }
  600.  
  601.  
  602.  
  603. //==============================================================================
  604. // Input and output
  605. //==============================================================================
  606. u8 u8_bc_if(struct u8_bc_i *buf, u8 (*fin)(void*, u8*, u32, u32*),
  607. void *arg)
  608. {
  609. u32 ret;
  610.  
  611. if (unlikely(fin(arg, buf->din, u8_bc_igcc(buf), &ret)))
  612. return 1;
  613.  
  614. u8_bc_ia(buf, ret);
  615. return 0;
  616. }
  617.  
  618.  
  619. u8 u8_bc_of(struct u8_bc_i *buf, u8 (*fout)(void*, u8*, u32, u32*),
  620. void *arg)
  621. {
  622. u32 ret;
  623.  
  624. if (unlikely(fout(arg, buf->dout, u8_bc_ogcc(buf), &ret)))
  625. return 1;
  626.  
  627. u8_bc_oa(buf, ret);
  628. return 0;
  629. }
  630. ./dev/gc-base-lib/src/util/pars.c
  631. //==============================================================================
  632. // This file is part of Gc-Base-Lib.
  633. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  634. //
  635. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  636. // the terms of the GNU General Public License as published by the Free Software
  637. // Foundation, either version 3 of the License, or (at your option) any later
  638. // version.
  639. //
  640. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  641. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  642. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  643. // details.
  644. //
  645. // You should have received a copy of the GNU General Public License along with
  646. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  647. //==============================================================================
  648. #include <gc/pars.h>
  649.  
  650. // u8_ib for this file?
  651.  
  652.  
  653. //==============================================================================
  654. // "u8's"
  655. //==============================================================================
  656. u8 pars_u8c(struct pars_i *pars, u8 data)
  657. {
  658. u32 orig_cnt = u8b_cnt(&pars->buf);
  659.  
  660. while (u8b_cnt(&pars->buf)) {
  661. if (u8b_peek1(&pars->buf) != data)
  662. break;
  663.  
  664. u8b_adv(&pars->buf, 1);
  665. }
  666.  
  667. return !(u8b_cnt(&pars->buf) < orig_cnt);
  668. }
  669.  
  670.  
  671. u8 pars_u8c2(struct pars_i *pars, u8 data1, u8 data2)
  672. {
  673. u8 cdata[] = {data1, data2};
  674. u32 orig_cnt = u8b_cnt(&pars->buf);
  675.  
  676. while (u8b_cnt(&pars->buf) >= 2) {
  677. if (u8b_peek2(&pars->buf) != (u16)cdata)
  678. break;
  679.  
  680. u8b_adv(&pars->buf, 2);
  681. }
  682.  
  683. return !(u8b_cnt(&pars->buf) < orig_cnt);
  684. }
  685.  
  686.  
  687.  
  688. //==============================================================================
  689. // New line characters
  690. //==============================================================================
  691. u8 pars_nld(struct pars_i *pars, u8 types)
  692. {
  693. assert((types & NL_RN) || (types & NL_N) || (types & NL_R));
  694.  
  695. u8 rn[] = {'\r', '\n'};
  696.  
  697. if (u8b_cnt(&pars->buf) >= 2 && (types & NL_RN)
  698. && u8b_peek2(&pars->buf) == (u16)rn)
  699. return NL_RN;
  700.  
  701. if (u8b_cnt(&pars->buf)) {
  702. if ((types & NL_N) && u8b_peek(&pars->buf) == '\n')
  703. return NL_N;
  704.  
  705. if ((types & NL_R) && u8b_peek(&pars->buf) == '\r')
  706. return NL_R;
  707. }
  708.  
  709. return 0;
  710. }
  711.  
  712.  
  713. u8 pars_nlcs(struct pars_i *pars, u8 types)
  714. {
  715. u8 dtype = pars_nld(pars, types);
  716.  
  717. if (unlikely(!dtype))
  718. return 1;
  719.  
  720. if ((dtype & NL_RN)) {
  721. u8b_adv(&pars->buf, 2);
  722. pars_u8c2(pars, '\r', '\n');
  723. }
  724.  
  725. else {
  726. u8b_adv(&pars->buf, 1);
  727.  
  728. if ((dtype & NL_N))
  729. pars_u8c(pars, '\n');
  730.  
  731. if ((dtype & NL_R))
  732. pars_u8c(pars, '\r');
  733. }
  734.  
  735. return 0;
  736. }
  737.  
  738.  
  739. u8 pars_nlcm(struct pars_i *pars, u8 types)
  740. {
  741. u8 ret = 1;
  742.  
  743. for (;;) {
  744. if (pars_nlcs(pars, types))
  745. break;
  746.  
  747. ret = 0;
  748. }
  749.  
  750. return ret;
  751. }
  752.  
  753. ./dev/gc-base-lib/src/os/linux/aio.txt
  754. kernel aio linux 512, 2048 or other sector size, as determined by the underlying
  755. block device. can get this value via ioctl.
  756.  
  757. also can do simple kernel aio implementation better than libaio. use this instead.
  758. see firefox bookmark "own aio impl" x2
  759.  
  760. aio works for block size increments. reads / writes other than that size to the
  761. beginning or end of the file will be blocking. see firefox bookmark "blocking aio".
  762. this has not been verified.
  763. ./dev/gc-base-lib/src/os/unix/proc.c
  764. //==============================================================================
  765. // This file is part of Gc-Base-Lib.
  766. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  767. //
  768. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  769. // the terms of the GNU General Public License as published by the Free Software
  770. // Foundation, either version 3 of the License, or (at your option) any later
  771. // version.
  772. //
  773. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  774. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  775. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  776. // details.
  777. //
  778. // You should have received a copy of the GNU General Public License along with
  779. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  780. //==============================================================================
  781. // proc_st_init, proc_st_next, ...
  782. #include <gc/proc.h>
  783.  
  784.  
  785.  
  786. //==============================================================================
  787. // Execution
  788. //==============================================================================
  789. u8 proc_exec(void)
  790. {
  791. }
  792. ./dev/gc-base-lib/src/os/unix/mem.c
  793. //==============================================================================
  794. // This file is part of Gc-Base-Lib.
  795. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  796. //
  797. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  798. // the terms of the GNU General Public License as published by the Free Software
  799. // Foundation, either version 3 of the License, or (at your option) any later
  800. // version.
  801. //
  802. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  803. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  804. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  805. // details.
  806. //
  807. // You should have received a copy of the GNU General Public License along with
  808. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  809. //==============================================================================
  810. #include <gc/mem.h>
  811.  
  812. #include <stdlib.h>
  813. #include <string.h>
  814.  
  815.  
  816.  
  817. //==============================================================================
  818. // Allocation, reallocation and deallocation
  819. //==============================================================================
  820. void *mem_alloc(size_t size)
  821. {
  822. return malloc(size);
  823. }
  824.  
  825.  
  826. void *mem_realloc(void *ptr, size_t size)
  827. {
  828. return realloc(ptr, size);
  829. }
  830.  
  831.  
  832. void mem_dealloc(void *ptr)
  833. {
  834. free(ptr);
  835. }
  836.  
  837.  
  838.  
  839. //==============================================================================
  840. // Utility
  841. //==============================================================================
  842. s8 mem_comp(void *data1, void *data2, size_t size)
  843. {
  844. return memcmp(data1, data2, size);
  845. }
  846.  
  847.  
  848. void mem_copy(void *dest, void *src, size_t size)
  849. {
  850. memcpy(dest, src, size);
  851. }
  852.  
  853.  
  854. void mem_move(void *dest, void *src, size_t size)
  855. {
  856. memmove(dest, src, size);
  857. }
  858.  
  859.  
  860. void mem_set(void *ptr, u8 data, size_t size)
  861. {
  862. memset(ptr, data, size);
  863. }
  864. ./dev/gc-base-lib/src/os/unix/file.c
  865. //==============================================================================
  866. // This file is part of Gc-Base-Lib.
  867. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  868. //
  869. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  870. // the terms of the GNU General Public License as published by the Free Software
  871. // Foundation, either version 3 of the License, or (at your option) any later
  872. // version.
  873. //
  874. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  875. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  876. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  877. // details.
  878. //
  879. // You should have received a copy of the GNU General Public License along with
  880. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  881. //==============================================================================
  882. #include <gc/file.h>
  883.  
  884. #include <unistd.h>
  885.  
  886.  
  887.  
  888. //==============================================================================
  889. // Initialization and deinitialization
  890. //==============================================================================
  891. u8 file_init(struct file_i *file, struct file_c *conf)
  892. {
  893. if (!(conf->flags & FILE_CREAT))
  894. file->fd = open(conf->path, conf->flags);
  895.  
  896. else
  897. file->fd = open(conf->path, conf->flags, conf->mode);
  898.  
  899. if (unlikely(file->fd == -1))
  900. return 1;
  901.  
  902. return 0;
  903. }
  904.  
  905.  
  906. void file_deinit(struct file_i *file)
  907. {
  908. close(file->fd);
  909. }
  910.  
  911.  
  912.  
  913. //==============================================================================
  914. // Read and write
  915. //==============================================================================
  916. u8 file_read(struct file_i *file, u8 *buf, u32 size, u32 *ret)
  917. {
  918. ssize_t bytes = read(file->fd, buf, size);
  919.  
  920. if (unlikely(bytes == -1))
  921. return 1;
  922.  
  923. *ret = bytes;
  924. return 0;
  925. }
  926.  
  927.  
  928. u8 file_write(struct file_i *file, u8 *buf, u32 size, u32 *ret)
  929. {
  930. ssize_t bytes = write(file->fd, buf, size);
  931.  
  932. if (unlikely(bytes == -1))
  933. return 1;
  934.  
  935. *ret = bytes;
  936. return 0;
  937. }
  938.  
  939.  
  940.  
  941. //==============================================================================
  942. // Utility
  943. //==============================================================================
  944. u8 file_gstats(struct file_i *file, struct file_stats *stats)
  945. {
  946. if (unlikely(fstat(file->fd, &stats->data)))
  947. return 1;
  948.  
  949. return 0;
  950. }
  951. ./dev/gc-base-lib/make.sh
  952. gcc -o libgc-base -shared -I include -std=c11 -Wall -Wextra -Wpedantic -Werror `find src -type f -name '*.c'`
  953. ./dev/gc-base-lib/inc/gc/macro/ms.h
  954. //==============================================================================
  955. // This file is part of Gc-Base-Lib.
  956. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  957. //
  958. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  959. // the terms of the GNU General Public License as published by the Free Software
  960. // Foundation, either version 3 of the License, or (at your option) any later
  961. // version.
  962. //
  963. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  964. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  965. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  966. // details.
  967. //
  968. // You should have received a copy of the GNU General Public License along with
  969. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  970. //==============================================================================
  971. #pragma once
  972.  
  973. #define MS_BEG(STEP)
  974. #define MS_EM
  975. #define MS_SP
  976. #define MS_EV
  977. ./dev/gc-base-lib/inc/gc/proc.h
  978. //==============================================================================
  979. // This file is part of Gc-Base-Lib.
  980. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  981. //
  982. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  983. // the terms of the GNU General Public License as published by the Free Software
  984. // Foundation, either version 3 of the License, or (at your option) any later
  985. // version.
  986. //
  987. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  988. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  989. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  990. // details.
  991. //
  992. // You should have received a copy of the GNU General Public License along with
  993. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  994. //==============================================================================
  995. #pragma once
  996.  
  997. #include <gc/common.h>
  998.  
  999. #if defined(__use_gnu_bktrc)
  1000. #include <gc/proc-gnu-bktrc.h>
  1001. #endif
  1002.  
  1003. #if defined(__use_lunwind)
  1004. #include <gc/proc-lunwind.h>
  1005. #endif
  1006.  
  1007. // Null function pointers for systems where back traces are not supported.
  1008. ./dev/gc-base-lib/inc/gc/common.h
  1009. //==============================================================================
  1010. // This file is part of Gc-Base-Lib.
  1011. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  1012. //
  1013. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  1014. // the terms of the GNU General Public License as published by the Free Software
  1015. // Foundation, either version 3 of the License, or (at your option) any later
  1016. // version.
  1017. //
  1018. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  1019. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1020. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1021. // details.
  1022. //
  1023. // You should have received a copy of the GNU General Public License along with
  1024. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  1025. //==============================================================================
  1026. #pragma once
  1027.  
  1028. #include <stddef.h>
  1029. #include <stdint.h>
  1030.  
  1031. // "__unused" is expected to be provided by a system library. Define it in this
  1032. // file only if it is missing on the host system.
  1033.  
  1034. #define likely(EXPR) __builtin_expect(EXPR, 1)
  1035. #define unlikely(EXPR) __builtin_expect(EXPR, 0)
  1036.  
  1037. typedef int8_t s8;
  1038. typedef int16_t s16;
  1039. typedef int32_t s32;
  1040. typedef int64_t s64;
  1041.  
  1042. typedef uint8_t u8;
  1043. typedef uint16_t u16;
  1044. typedef uint32_t u32;
  1045. typedef uint64_t u64;
  1046. ./dev/gc-base-lib/inc/gc/u8_ib.h
  1047. //==============================================================================
  1048. // This file is part of Gc-Base-Lib.
  1049. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  1050. //
  1051. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  1052. // the terms of the GNU General Public License as published by the Free Software
  1053. // Foundation, either version 3 of the License, or (at your option) any later
  1054. // version.
  1055. //
  1056. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  1057. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1058. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1059. // details.
  1060. //
  1061. // You should have received a copy of the GNU General Public License along with
  1062. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  1063. //==============================================================================
  1064. #pragma once
  1065.  
  1066. #include <gc/ct.h>
  1067.  
  1068. struct u8_ib_i {
  1069. };
  1070.  
  1071. struct u8_ib_c {
  1072. };
  1073. ./dev/gc-base-lib/inc/gc/atmc.h
  1074. //==============================================================================
  1075. // This file is part of Gc-Base-Lib.
  1076. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  1077. //
  1078. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  1079. // the terms of the GNU General Public License as published by the Free Software
  1080. // Foundation, either version 3 of the License, or (at your option) any later
  1081. // version.
  1082. //
  1083. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  1084. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1085. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1086. // details.
  1087. //
  1088. // You should have received a copy of the GNU General Public License along with
  1089. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  1090. //==============================================================================
  1091. #pragma once
  1092.  
  1093. #include <gc/common.h>
  1094.  
  1095. typedef _Atomic s8 as8;
  1096. typedef _Atomic s16 as16;
  1097. typedef _Atomic s32 as32;
  1098. typedef _Atomic s64 as64;
  1099.  
  1100. typedef _Atomic u8 au8;
  1101. typedef _Atomic u16 au16;
  1102. typedef _Atomic u32 au32;
  1103. typedef _Atomic u64 au64;
  1104.  
  1105. #define atmc_fadd atomic_fetch_add
  1106. #define atmc_fsub atomic_fetch_sub
  1107. #define atmc_load atomic_load
  1108. ./dev/gc-base-lib/inc/gc/ct.h
  1109. //==============================================================================
  1110. // This file is part of Gc-Base-Lib.
  1111. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  1112. //
  1113. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  1114. // the terms of the GNU General Public License as published by the Free Software
  1115. // Foundation, either version 3 of the License, or (at your option) any later
  1116. // version.
  1117. //
  1118. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  1119. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1120. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1121. // details.
  1122. //
  1123. // You should have received a copy of the GNU General Public License along with
  1124. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  1125. //==============================================================================
  1126. #pragma once
  1127.  
  1128. #include <gc/macro/ms.h>
  1129.  
  1130. // Configuration for composite types needs space for two offsets (u16's), to
  1131. // allow for two variable types (such as "u8_a").
  1132.  
  1133. #define CT_M1V 1 // Member 1 pass by value.
  1134. #define CT_M2V 2 // Member 2 pass by value.
  1135. #define CT_M2D 4 // Member 2 pass to deinit.
  1136.  
  1137. #define CT_WRAP_MSI2D1(PREF) \
  1138. u8 PREF##_init_ms(struct PREF##_i*, struct PREF##_c*); \
  1139. void PREF##_deinit_ms(struct PREF##_i*); \
  1140. u8 PREF##_init(struct PREF##_i *info, struct PREF##_c *conf) \
  1141. { \
  1142. u8 step = PREF##_init_ms(info, conf); \
  1143. if (!step) \
  1144. return 0; \
  1145. PREF##_deinit_ms(info, step); \
  1146. return 1; \
  1147. } \
  1148. void PREF##_deinit(struct PREF##_i *info) \
  1149. { \
  1150. PREF##_deinit_ms(info, 0); \
  1151. }
  1152. ./dev/gc-base-lib/inc/gc/u8b.h
  1153. //==============================================================================
  1154. // This file is part of Gc-Base-Lib.
  1155. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  1156. //
  1157. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  1158. // the terms of the GNU General Public License as published by the Free Software
  1159. // Foundation, either version 3 of the License, or (at your option) any later
  1160. // version.
  1161. //
  1162. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  1163. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1164. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1165. // details.
  1166. //
  1167. // You should have received a copy of the GNU General Public License along with
  1168. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  1169. //==============================================================================
  1170. #pragma once
  1171.  
  1172. #include <gc/atmc.h>
  1173.  
  1174. struct u8b_i {
  1175. u32 cbeg;
  1176. au32 cin;
  1177. au32 cout;
  1178. u8 *dbeg;
  1179. u8 *din;
  1180. u8 *dout;
  1181. };
  1182. ./dev/gc-base-lib/inc/gc/pars.h
  1183. //==============================================================================
  1184. // This file is part of Gc-Base-Lib.
  1185. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  1186. //
  1187. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  1188. // the terms of the GNU General Public License as published by the Free Software
  1189. // Foundation, either version 3 of the License, or (at your option) any later
  1190. // version.
  1191. //
  1192. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  1193. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1194. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1195. // details.
  1196. //
  1197. // You should have received a copy of the GNU General Public License along with
  1198. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  1199. //==============================================================================
  1200. #pragma once
  1201.  
  1202. #include <gc/u8b.h>
  1203.  
  1204. struct pars_i {
  1205. struct u8b_i buf;
  1206. };
  1207. ./dev/gc-base-lib/inc/gc/file.h
  1208. //==============================================================================
  1209. // This file is part of Gc-Base-Lib.
  1210. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  1211. //
  1212. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  1213. // the terms of the GNU General Public License as published by the Free Software
  1214. // Foundation, either version 3 of the License, or (at your option) any later
  1215. // version.
  1216. //
  1217. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  1218. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1219. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1220. // details.
  1221. //
  1222. // You should have received a copy of the GNU General Public License along with
  1223. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  1224. //==============================================================================
  1225. #pragma once
  1226.  
  1227. #include <gc/u8b.h>
  1228.  
  1229. #include <sys/stat.h>
  1230. #include <fcntl.h>
  1231.  
  1232. struct file_i {
  1233. int fd;
  1234. };
  1235.  
  1236. struct file_c {
  1237. const char *path;
  1238. int flags;
  1239. mode_t mode;
  1240. };
  1241.  
  1242. struct file_stats {
  1243. struct stat data;
  1244. };
  1245. ./dev/gc-base-lib/inc/gc/mem.h
  1246. //==============================================================================
  1247. // This file is part of Gc-Base-Lib.
  1248. // Copyright (C) 2015 Anthony Gorecki <agorecki@gcproj.org>
  1249. //
  1250. // Gc-Base-Lib is free software: you can redistribute it and/or modify it under
  1251. // the terms of the GNU General Public License as published by the Free Software
  1252. // Foundation, either version 3 of the License, or (at your option) any later
  1253. // version.
  1254. //
  1255. // Gc-Base-Lib is distributed in the hope that it will be useful, but WITHOUT
  1256. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1257. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1258. // details.
  1259. //
  1260. // You should have received a copy of the GNU General Public License along with
  1261. // Gc-Base-Lib. If not, see <http://www.gnu.org/licenses/>.
  1262. //==============================================================================
  1263. #pragma once
  1264.  
  1265. #include <gc/common.h>
  1266.  
  1267. void* mem_alloc(size_t);
  1268. void* mem_realloc(void*, size_t);
  1269. void mem_dealloc(void*);
  1270.  
  1271. u8 mem_comp(void*, void*, size_t);
  1272. void mem_copy(void*, void*, size_t);
  1273. void mem_move(void*, void*, size_t);
  1274. void mem_set(void*, u8, size_t);
  1275. ./dev/doc/includes.txt
  1276. External Gc headers, Gc header for local file, all other headers; groups
  1277. separated by a single new line.
  1278. ./dev/doc/func-args.txt
  1279. Structs are always used for info and conf varaibles so their contents /
  1280. implementation can easily be changed later and without modifying the code of
  1281. software using the libraries.
  1282. ./dev/doc/code-style.txt
  1283. Soft limit for line length is 80 characters, hard limit is 100 characters.
  1284.  
  1285. Conditional statements requiring multiple lines should indent the subsequent
  1286. lines with two tabs (one additional tab, relative the the code following the
  1287. conditional statement).
  1288. ./dev/doc/func-naming.txt
  1289. Hard limit for function name first part is five characters. Soft limit is
  1290. four characters.
  1291.  
  1292. Function name hard limit for second part is five characters (initialization /
  1293. activation). Does not apply to names that have been shortened to individual
  1294. characters per word.
  1295.  
  1296. Struct member name soft limit is four characters.
  1297. ./script/upload-pastebin.sh
  1298. cd /root
  1299.  
  1300. echo 'Files:'
  1301.  
  1302. files=$(find -name '*.c' -o -name '*.h' -o -name '*.py' -o -name '*.sh' -o -name '*.txt' -o -name '.vimrc')
  1303.  
  1304. date > upload-data.txt
  1305.  
  1306. for file in $files; do
  1307. echo " $file"
  1308. echo $file >> upload-data.txt
  1309. cat $file >> upload-data.txt
  1310. done
  1311.  
  1312. echo
  1313. echo -n 'URL: '
  1314. python ./script/intrn/upload-pastebin.py `cat script/intrn/dev-key`
  1315. rm upload-data.txt
  1316. ./script/intrn/upload-pastebin.py
  1317. import pastebin_python
  1318. import sys
  1319.  
  1320. pb = pastebin_python.pastebin.PastebinPython(api_dev_key=sys.argv[1])
  1321. print pb.createPasteFromFile('upload-data.txt', 'anthony gorecki anthony@anthonygorecki.ca', '', '0', 'N')
  1322. ./.vimrc
  1323. set ts=4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement