Units API.

See the Weblate's Web API documentation for detailed description of the API.

GET /api/units/92242/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "translation": "https://translate-dev.freebsd.org/api/translations/freebsd-doc/boooks_developers-handbook/en/?format=api",
    "source": [
        ";;;;;;; csv.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Convert a comma-separated file to a something-else separated file.\n;\n; Started:\t31-May-2001\n; Updated:\t 1-Jun-2001\n;\n; Copyright (c) 2001 G. Adam Stanislav\n; All rights reserved.\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nfd.in\tdd\tstdin\nfd.out\tdd\tstdout\nusg\tdb\t'Usage: csv [-t<delim>] [-c<comma>] [-p] [-o <outfile>] [-i <infile>]', 0Ah\nusglen\tequ\t$-usg\niemsg\tdb\t\"csv: Can't open input file\", 0Ah\niemlen\tequ\t$-iemsg\noemsg\tdb\t\"csv: Can't create output file\", 0Ah\noemlen\tequ\t$-oemsg\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\n\nsection\t.text\nalign 4\nierr:\n\tpush\tdword iemlen\n\tpush\tdword iemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 1\t\t; return failure\n\tsys.exit\n\nalign 4\noerr:\n\tpush\tdword oemlen\n\tpush\tdword oemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 2\n\tsys.exit\n\nalign 4\nusage:\n\tpush\tdword usglen\n\tpush\tdword usg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 3\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tadd\tesp, byte 8\t; discard argc and argv[0]\n\tmov\tedx, (',' << 8) | 9\n\n.arg:\n\tpop\tecx\n\tor\tecx, ecx\n\tje\tnear .init\t\t; no more arguments\n\n\t; ECX contains the pointer to an argument\n\tcmp\tbyte [ecx], '-'\n\tjne\tusage\n\n\tinc\tecx\n\tmov\tax, [ecx]\n\n.o:\n\tcmp\tal, 'o'\n\tjne\t.i\n\n\t; Make sure we are not asked for the output file twice\n\tcmp\tdword [fd.out], stdout\n\tjne\tusage\n\n\t; Find the path to output file - it is either at [ECX+1],\n\t; i.e., -ofile --\n\t; or in the next argument,\n\t; i.e., -o file\n\n\tinc\tecx\n\tor\tah, ah\n\tjne\t.openoutput\n\tpop\tecx\n\tjecxz\tusage\n\n.openoutput:\n\tpush\tdword 420\t; file mode (644 octal)\n\tpush\tdword 0200h | 0400h | 01h\n\t; O_CREAT | O_TRUNC | O_WRONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear oerr\n\n\tadd\tesp, byte 12\n\tmov\t[fd.out], eax\n\tjmp\tshort .arg\n\n.i:\n\tcmp\tal, 'i'\n\tjne\t.p\n\n\t; Make sure we are not asked twice\n\tcmp\tdword [fd.in], stdin\n\tjne\tnear usage\n\n\t; Find the path to the input file\n\tinc\tecx\n\tor\tah, ah\n\tjne\t.openinput\n\tpop\tecx\n\tor\tecx, ecx\n\tje near usage\n\n.openinput:\n\tpush\tdword 0\t\t; O_RDONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear ierr\t\t; open failed\n\n\tadd\tesp, byte 8\n\tmov\t[fd.in], eax\n\tjmp\t.arg\n\n.p:\n\tcmp\tal, 'p'\n\tjne\t.t\n\tor\tah, ah\n\tjne\tnear usage\n\tor\tedx, 1 << 31\n\tjmp\t.arg\n\n.t:\n\tcmp\tal, 't'\t\t; redefine output delimiter\n\tjne\t.c\n\tor\tah, ah\n\tje\tnear usage\n\tmov\tdl, ah\n\tjmp\t.arg\n\n.c:\n\tcmp\tal, 'c'\n\tjne\tnear usage\n\tor\tah, ah\n\tje\tnear usage\n\tmov\tdh, ah\n\tjmp\t.arg\n\nalign 4\n.init:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tmov\tedi, obuffer\n\n\t; See if we are to preserve the first line\n\tor\tedx, edx\n\tjs\t.loop\n\n.firstline:\n\t; get rid of the first line\n\tcall\tgetchar\n\tcmp\tal, 0Ah\n\tjne\t.firstline\n\n.loop:\n\t; read a byte from stdin\n\tcall\tgetchar\n\n\t; is it a comma (or whatever the user asked for)?\n\tcmp\tal, dh\n\tjne\t.quote\n\n\t; Replace the comma with a tab (or whatever the user wants)\n\tmov\tal, dl\n\n.put:\n\tcall\tputchar\n\tjmp\tshort .loop\n\n.quote:\n\tcmp\tal, '\"'\n\tjne\t.put\n\n\t; Print everything until you get another quote or EOL. If it\n\t; is a quote, skip it. If it is EOL, print it.\n.qloop:\n\tcall\tgetchar\n\tcmp\tal, '\"'\n\tje\t.loop\n\n\tcmp\tal, 0Ah\n\tje\t.put\n\n\tcall\tputchar\n\tjmp\tshort .qloop\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tret\n\nread:\n\tjecxz\t.read\n\tcall\twrite\n\n.read:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword [fd.in]\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.done\n\tsub\teax, eax\n\tret\n\nalign 4\n.done:\n\tcall\twrite\t\t; flush output buffer\n\n\t; close files\n\tpush\tdword [fd.in]\n\tsys.close\n\n\tpush\tdword [fd.out]\n\tsys.close\n\n\t; return success\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tjecxz\t.ret\t; nothing to write\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword [fd.out]\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n.ret:\n\tret"
    ],
    "previous_source": "",
    "target": [
        ";;;;;;; csv.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Convert a comma-separated file to a something-else separated file.\n;\n; Started:\t31-May-2001\n; Updated:\t 1-Jun-2001\n;\n; Copyright (c) 2001 G. Adam Stanislav\n; All rights reserved.\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n%include\t'system.inc'\n\n%define\tBUFSIZE\t2048\n\nsection\t.data\nfd.in\tdd\tstdin\nfd.out\tdd\tstdout\nusg\tdb\t'Usage: csv [-t<delim>] [-c<comma>] [-p] [-o <outfile>] [-i <infile>]', 0Ah\nusglen\tequ\t$-usg\niemsg\tdb\t\"csv: Can't open input file\", 0Ah\niemlen\tequ\t$-iemsg\noemsg\tdb\t\"csv: Can't create output file\", 0Ah\noemlen\tequ\t$-oemsg\n\nsection .bss\nibuffer\tresb\tBUFSIZE\nobuffer\tresb\tBUFSIZE\n\nsection\t.text\nalign 4\nierr:\n\tpush\tdword iemlen\n\tpush\tdword iemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 1\t\t; return failure\n\tsys.exit\n\nalign 4\noerr:\n\tpush\tdword oemlen\n\tpush\tdword oemsg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 2\n\tsys.exit\n\nalign 4\nusage:\n\tpush\tdword usglen\n\tpush\tdword usg\n\tpush\tdword stderr\n\tsys.write\n\tpush\tdword 3\n\tsys.exit\n\nalign 4\nglobal\t_start\n_start:\n\tadd\tesp, byte 8\t; discard argc and argv[0]\n\tmov\tedx, (',' << 8) | 9\n\n.arg:\n\tpop\tecx\n\tor\tecx, ecx\n\tje\tnear .init\t\t; no more arguments\n\n\t; ECX contains the pointer to an argument\n\tcmp\tbyte [ecx], '-'\n\tjne\tusage\n\n\tinc\tecx\n\tmov\tax, [ecx]\n\n.o:\n\tcmp\tal, 'o'\n\tjne\t.i\n\n\t; Make sure we are not asked for the output file twice\n\tcmp\tdword [fd.out], stdout\n\tjne\tusage\n\n\t; Find the path to output file - it is either at [ECX+1],\n\t; i.e., -ofile --\n\t; or in the next argument,\n\t; i.e., -o file\n\n\tinc\tecx\n\tor\tah, ah\n\tjne\t.openoutput\n\tpop\tecx\n\tjecxz\tusage\n\n.openoutput:\n\tpush\tdword 420\t; file mode (644 octal)\n\tpush\tdword 0200h | 0400h | 01h\n\t; O_CREAT | O_TRUNC | O_WRONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear oerr\n\n\tadd\tesp, byte 12\n\tmov\t[fd.out], eax\n\tjmp\tshort .arg\n\n.i:\n\tcmp\tal, 'i'\n\tjne\t.p\n\n\t; Make sure we are not asked twice\n\tcmp\tdword [fd.in], stdin\n\tjne\tnear usage\n\n\t; Find the path to the input file\n\tinc\tecx\n\tor\tah, ah\n\tjne\t.openinput\n\tpop\tecx\n\tor\tecx, ecx\n\tje near usage\n\n.openinput:\n\tpush\tdword 0\t\t; O_RDONLY\n\tpush\tecx\n\tsys.open\n\tjc\tnear ierr\t\t; open failed\n\n\tadd\tesp, byte 8\n\tmov\t[fd.in], eax\n\tjmp\t.arg\n\n.p:\n\tcmp\tal, 'p'\n\tjne\t.t\n\tor\tah, ah\n\tjne\tnear usage\n\tor\tedx, 1 << 31\n\tjmp\t.arg\n\n.t:\n\tcmp\tal, 't'\t\t; redefine output delimiter\n\tjne\t.c\n\tor\tah, ah\n\tje\tnear usage\n\tmov\tdl, ah\n\tjmp\t.arg\n\n.c:\n\tcmp\tal, 'c'\n\tjne\tnear usage\n\tor\tah, ah\n\tje\tnear usage\n\tmov\tdh, ah\n\tjmp\t.arg\n\nalign 4\n.init:\n\tsub\teax, eax\n\tsub\tebx, ebx\n\tsub\tecx, ecx\n\tmov\tedi, obuffer\n\n\t; See if we are to preserve the first line\n\tor\tedx, edx\n\tjs\t.loop\n\n.firstline:\n\t; get rid of the first line\n\tcall\tgetchar\n\tcmp\tal, 0Ah\n\tjne\t.firstline\n\n.loop:\n\t; read a byte from stdin\n\tcall\tgetchar\n\n\t; is it a comma (or whatever the user asked for)?\n\tcmp\tal, dh\n\tjne\t.quote\n\n\t; Replace the comma with a tab (or whatever the user wants)\n\tmov\tal, dl\n\n.put:\n\tcall\tputchar\n\tjmp\tshort .loop\n\n.quote:\n\tcmp\tal, '\"'\n\tjne\t.put\n\n\t; Print everything until you get another quote or EOL. If it\n\t; is a quote, skip it. If it is EOL, print it.\n.qloop:\n\tcall\tgetchar\n\tcmp\tal, '\"'\n\tje\t.loop\n\n\tcmp\tal, 0Ah\n\tje\t.put\n\n\tcall\tputchar\n\tjmp\tshort .qloop\n\nalign 4\ngetchar:\n\tor\tebx, ebx\n\tjne\t.fetch\n\n\tcall\tread\n\n.fetch:\n\tlodsb\n\tdec\tebx\n\tret\n\nread:\n\tjecxz\t.read\n\tcall\twrite\n\n.read:\n\tpush\tdword BUFSIZE\n\tmov\tesi, ibuffer\n\tpush\tesi\n\tpush\tdword [fd.in]\n\tsys.read\n\tadd\tesp, byte 12\n\tmov\tebx, eax\n\tor\teax, eax\n\tje\t.done\n\tsub\teax, eax\n\tret\n\nalign 4\n.done:\n\tcall\twrite\t\t; flush output buffer\n\n\t; close files\n\tpush\tdword [fd.in]\n\tsys.close\n\n\tpush\tdword [fd.out]\n\tsys.close\n\n\t; return success\n\tpush\tdword 0\n\tsys.exit\n\nalign 4\nputchar:\n\tstosb\n\tinc\tecx\n\tcmp\tecx, BUFSIZE\n\tje\twrite\n\tret\n\nalign 4\nwrite:\n\tjecxz\t.ret\t; nothing to write\n\tsub\tedi, ecx\t; start of buffer\n\tpush\tecx\n\tpush\tedi\n\tpush\tdword [fd.out]\n\tsys.write\n\tadd\tesp, byte 12\n\tsub\teax, eax\n\tsub\tecx, ecx\t; buffer is empty now\n.ret:\n\tret"
    ],
    "id_hash": -8182750035476127133,
    "content_hash": -8182750035476127133,
    "location": "book.translate.xml:12236",
    "context": "",
    "note": "(itstool) path: sect2/programlisting",
    "flags": "no-wrap",
    "labels": [],
    "state": 100,
    "fuzzy": false,
    "translated": true,
    "approved": false,
    "position": 1934,
    "has_suggestion": false,
    "has_comment": false,
    "has_failing_check": true,
    "num_words": 696,
    "source_unit": "https://translate-dev.freebsd.org/api/units/92242/?format=api",
    "priority": 100,
    "id": 92242,
    "web_url": "https://translate-dev.freebsd.org/translate/freebsd-doc/boooks_developers-handbook/en/?checksum=0e71083261a16263",
    "url": "https://translate-dev.freebsd.org/api/units/92242/?format=api",
    "explanation": "",
    "extra_flags": "",
    "pending": false,
    "timestamp": "2019-11-02T20:37:24.722327Z"
}