Unit Instance
Units API.
See the Weblate's Web API documentation for detailed description of the API.
GET /api/units/92241/?format=api
https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api", "source": [ ";;;;;;; Fast Text-to-Unix Conversion (ftuc.asm) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;\n;; Started:\t21-Dec-2000\n;; Updated:\t22-Dec-2000\n;;\n;; Copyright 2000 G. Adam Stanislav.\n;; All rights reserved.\n;;\n;;;;;;; v.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n%include\t'system.inc'\n\nsection\t.data\n\tdb\t'Copyright 2000 G. Adam Stanislav.', 0Ah\n\tdb\t'All rights reserved.', 0Ah\nusg\tdb\t'Usage: ftuc filename', 0Ah\nusglen\tequ\t$-usg\nco\tdb\t\"ftuc: Can't open file.\", 0Ah\ncolen\tequ\t$-co\nfae\tdb\t'ftuc: File access error.', 0Ah\nfaelen\tequ\t$-fae\nftl\tdb\t'ftuc: File too long, use regular tuc instead.', 0Ah\nftllen\tequ\t$-ftl\nmae\tdb\t'ftuc: Memory allocation error.', 0Ah\nmaelen\tequ\t$-mae\n\nsection\t.text\n\nalign 4\nmemerr:\n\tpush\tdword maelen\n\tpush\tdword mae\n\tjmp\tshort error\n\nalign 4\ntoolong:\n\tpush\tdword ftllen\n\tpush\tdword ftl\n\tjmp\tshort error\n\nalign 4\nfacerr:\n\tpush\tdword faelen\n\tpush\tdword fae\n\tjmp\tshort error\n\nalign 4\ncantopen:\n\tpush\tdword colen\n\tpush\tdword co\n\tjmp\tshort error\n\nalign 4\nusage:\n\tpush\tdword usglen\n\tpush\tdword usg\n\nerror:\n\tpush\tdword stderr\n\tsys.write\n\n\tpush\tdword 1\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tpop\teax\t\t; argc\n\tpop\teax\t\t; program name\n\tpop\tecx\t\t; file to convert\n\tjecxz\tusage\n\n\tpop\teax\n\tor\teax, eax\t; Too many arguments?\n\tjne\tusage\n\n\t; Open the file\n\tpush\tdword O_RDWR\n\tpush\tecx\n\tsys.open\n\tjc\tcantopen\n\n\tmov\tebp, eax\t; Save fd\n\n\tsub\tesp, byte stat_size\n\tmov\tebx, esp\n\n\t; Find file size\n\tpush\tebx\n\tpush\tebp\t\t; fd\n\tsys.fstat\n\tjc\tfacerr\n\n\tmov\tedx, [ebx + st_size + 4]\n\n\t; File is too long if EDX != 0 ...\n\tor\tedx, edx\n\tjne\tnear toolong\n\tmov\tecx, [ebx + st_size]\n\t; ... or if it is above 2 GB\n\tor\tecx, ecx\n\tjs\tnear toolong\n\n\t; Do nothing if the file is 0 bytes in size\n\tjecxz\t.quit\n\n\t; Map the entire file in memory\n\tpush\tedx\n\tpush\tedx\t\t; starting at offset 0\n\tpush\tedx\t\t; pad\n\tpush\tebp\t\t; fd\n\tpush\tdword MAP_SHARED\n\tpush\tdword PROT_READ | PROT_WRITE\n\tpush\tecx\t\t; entire file size\n\tpush\tedx\t\t; let system decide on the address\n\tsys.mmap\n\tjc\tnear memerr\n\n\tmov\tedi, eax\n\tmov\tesi, eax\n\tpush\tecx\t\t; for SYS_munmap\n\tpush\tedi\n\n\t; Use EBX for state machine\n\tmov\tebx, ordinary\n\tmov\tah, 0Ah\n\tcld\n\n.loop:\n\tlodsb\n\tcall\tebx\n\tloop\t.loop\n\n\tcmp\tebx, ordinary\n\tje\t.filesize\n\n\t; Output final lf\n\tmov\tal, ah\n\tstosb\n\tinc\tedx\n\n.filesize:\n\t; truncate file to new size\n\tpush\tdword 0\t\t; high dword\n\tpush\tedx\t\t; low dword\n\tpush\teax\t\t; pad\n\tpush\tebp\n\tsys.ftruncate\n\n\t; close it (ebp still pushed)\n\tsys.close\n\n\tadd\tesp, byte 16\n\tsys.munmap\n\n.quit:\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nordinary:\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\tcmp\tal, ah\n\tje\t.lf\n\n\tstosb\n\tinc\tedx\n\tret\n\nalign 4\n.cr:\n\tmov\tebx, cr\n\tret\n\nalign 4\n.lf:\n\tmov\tebx, lf\n\tret\n\nalign 4\ncr:\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\tcmp\tal, ah\n\tje\t.lf\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\n\txchg\tal, ah\n\t; fall through\n\n.lf:\n\tstosb\n\tinc\tedx\n\tmov\tebx, ordinary\n\tret\n\nalign 4\n.cr:\n\tmov\tal, ah\n\tstosb\n\tinc\tedx\n\tret\n\nalign 4\nlf:\n\tcmp\tal, ah\n\tje\t.lf\n\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\tmov\tebx, ordinary\n\tret\n\nalign 4\n.cr:\n\tmov\tebx, ordinary\n\tmov\tal, ah\n\t; fall through\n\n.lf:\n\tstosb\n\tinc\tedx\n\tret" ], "previous_source": "", "target": [ ";;;;;;; Fast Text-to-Unix Conversion (ftuc.asm) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;\n;; Started:\t21-Dec-2000\n;; Updated:\t22-Dec-2000\n;;\n;; Copyright 2000 G. Adam Stanislav.\n;; All rights reserved.\n;;\n;;;;;;; v.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n%include\t'system.inc'\n\nsection\t.data\n\tdb\t'Copyright 2000 G. Adam Stanislav.', 0Ah\n\tdb\t'All rights reserved.', 0Ah\nusg\tdb\t'Usage: ftuc filename', 0Ah\nusglen\tequ\t$-usg\nco\tdb\t\"ftuc: Can't open file.\", 0Ah\ncolen\tequ\t$-co\nfae\tdb\t'ftuc: File access error.', 0Ah\nfaelen\tequ\t$-fae\nftl\tdb\t'ftuc: File too long, use regular tuc instead.', 0Ah\nftllen\tequ\t$-ftl\nmae\tdb\t'ftuc: Memory allocation error.', 0Ah\nmaelen\tequ\t$-mae\n\nsection\t.text\n\nalign 4\nmemerr:\n\tpush\tdword maelen\n\tpush\tdword mae\n\tjmp\tshort error\n\nalign 4\ntoolong:\n\tpush\tdword ftllen\n\tpush\tdword ftl\n\tjmp\tshort error\n\nalign 4\nfacerr:\n\tpush\tdword faelen\n\tpush\tdword fae\n\tjmp\tshort error\n\nalign 4\ncantopen:\n\tpush\tdword colen\n\tpush\tdword co\n\tjmp\tshort error\n\nalign 4\nusage:\n\tpush\tdword usglen\n\tpush\tdword usg\n\nerror:\n\tpush\tdword stderr\n\tsys.write\n\n\tpush\tdword 1\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tpop\teax\t\t; argc\n\tpop\teax\t\t; program name\n\tpop\tecx\t\t; file to convert\n\tjecxz\tusage\n\n\tpop\teax\n\tor\teax, eax\t; Too many arguments?\n\tjne\tusage\n\n\t; Open the file\n\tpush\tdword O_RDWR\n\tpush\tecx\n\tsys.open\n\tjc\tcantopen\n\n\tmov\tebp, eax\t; Save fd\n\n\tsub\tesp, byte stat_size\n\tmov\tebx, esp\n\n\t; Find file size\n\tpush\tebx\n\tpush\tebp\t\t; fd\n\tsys.fstat\n\tjc\tfacerr\n\n\tmov\tedx, [ebx + st_size + 4]\n\n\t; File is too long if EDX != 0 ...\n\tor\tedx, edx\n\tjne\tnear toolong\n\tmov\tecx, [ebx + st_size]\n\t; ... or if it is above 2 GB\n\tor\tecx, ecx\n\tjs\tnear toolong\n\n\t; Do nothing if the file is 0 bytes in size\n\tjecxz\t.quit\n\n\t; Map the entire file in memory\n\tpush\tedx\n\tpush\tedx\t\t; starting at offset 0\n\tpush\tedx\t\t; pad\n\tpush\tebp\t\t; fd\n\tpush\tdword MAP_SHARED\n\tpush\tdword PROT_READ | PROT_WRITE\n\tpush\tecx\t\t; entire file size\n\tpush\tedx\t\t; let system decide on the address\n\tsys.mmap\n\tjc\tnear memerr\n\n\tmov\tedi, eax\n\tmov\tesi, eax\n\tpush\tecx\t\t; for SYS_munmap\n\tpush\tedi\n\n\t; Use EBX for state machine\n\tmov\tebx, ordinary\n\tmov\tah, 0Ah\n\tcld\n\n.loop:\n\tlodsb\n\tcall\tebx\n\tloop\t.loop\n\n\tcmp\tebx, ordinary\n\tje\t.filesize\n\n\t; Output final lf\n\tmov\tal, ah\n\tstosb\n\tinc\tedx\n\n.filesize:\n\t; truncate file to new size\n\tpush\tdword 0\t\t; high dword\n\tpush\tedx\t\t; low dword\n\tpush\teax\t\t; pad\n\tpush\tebp\n\tsys.ftruncate\n\n\t; close it (ebp still pushed)\n\tsys.close\n\n\tadd\tesp, byte 16\n\tsys.munmap\n\n.quit:\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nordinary:\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\tcmp\tal, ah\n\tje\t.lf\n\n\tstosb\n\tinc\tedx\n\tret\n\nalign 4\n.cr:\n\tmov\tebx, cr\n\tret\n\nalign 4\n.lf:\n\tmov\tebx, lf\n\tret\n\nalign 4\ncr:\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\tcmp\tal, ah\n\tje\t.lf\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\n\txchg\tal, ah\n\t; fall through\n\n.lf:\n\tstosb\n\tinc\tedx\n\tmov\tebx, ordinary\n\tret\n\nalign 4\n.cr:\n\tmov\tal, ah\n\tstosb\n\tinc\tedx\n\tret\n\nalign 4\nlf:\n\tcmp\tal, ah\n\tje\t.lf\n\n\tcmp\tal, 0Dh\n\tje\t.cr\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\n\txchg\tal, ah\n\tstosb\n\tinc\tedx\n\tmov\tebx, ordinary\n\tret\n\nalign 4\n.cr:\n\tmov\tebx, ordinary\n\tmov\tal, ah\n\t; fall through\n\n.lf:\n\tstosb\n\tinc\tedx\n\tret" ], "id_hash": 5754640110954855985, "content_hash": 5754640110954855985, "location": "book.translate.xml:11843", "context": "", "note": "(itstool) path: sect2/programlisting", "flags": "no-wrap", "labels": [], "state": 100, "fuzzy": false, "translated": true, "approved": false, "position": 1900, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 552, "source_unit": "https://translate-dev.freebsd.org/api/units/92241/?format=api", "priority": 100, "id": 92241, "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=cfdc96b107adbe31", "url": "https://translate-dev.freebsd.org/api/units/92241/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2019-11-02T20:37:24.639799Z" }{ "translation": "