• Home
  • Raw
  • Download

Lines Matching +full:write +full:- +full:output

1 #!/usr/bin/python -u
4 # the character-validation range routines, and updated to the
16 webpage = "http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html"
17 sources = "Blocks-4.0.1.txt UnicodeData-4.0.1.txt"
20 # blockAliases is a small hack - it is used for mapping block names which
26 blockAliases.append("PrivateUse:PrivateUseArea,SupplementaryPrivateUseArea-A," +
27 "SupplementaryPrivateUseArea-B")
89 # a dictionary with index category-name, with each entry containing
91 # names comprise two parts - the general category, and the "subclass"
93 # the first character of the 2-character category-name) and the full
94 # (2-character) name are entered into this dictionary.
117 value = value + ord(point[0]) - ord('0')
119 value = value + 10 + ord(point[0]) - ord('A')
121 value = value + 10 + ord(point[0]) - ord('a')
155 start = -1
156 prev = -1
157 end = -1
160 if start == -1:
203 output = open("xmlunicode.c", "w") variable
210 header.write(
238 output.write(
282 name = string.replace(block, '-', '')
284 output.write(',\n')
287 output.write(' {"%s", xmlUCSIs%s}' % (block, name))
288 output.write('};\n\n')
290 output.write('static xmlUnicodeRange xmlUnicodeCats[] = {\n')
294 output.write(',\n')
297 output.write(' {"%s", xmlUCSIsCat%s}' % (name, name))
298 output.write('};\n\n')
323 output.write(pline + " };\n")
330 output.write(pline + "\n")
333 output.write(pline + " };\nstatic xmlChRangeGroup xml%sG = {%s,%s,%s,%s};\n\n"
337 output.write(
346 * binary table lookup for user-supplied name
358 high = tptr->numentries - 1;
359 sptr = tptr->table;
365 high = mid - 1;
375 name = string.replace(block, '-', '')
376 header.write("XMLPUBFUN int XMLCALL xmlUCSIs%s\t(int code);\n" % name)
377 output.write("/**\n * xmlUCSIs%s:\n * @code: UCS code point\n" % (name))
378 output.write(" *\n * Check whether the character is part of %s UCS Block\n"%
380 output.write(" *\n * Returns 1 if true 0 otherwise\n */\n");
381 output.write("int\nxmlUCSIs%s(int code) {\n return(" % name)
385 output.write(" ||\n ")
388 output.write("((code >= %s) && (code <= %s))" % (start, end))
389 output.write(");\n}\n\n")
391 header.write("\nXMLPUBFUN int XMLCALL xmlUCSIsBlock\t(int code, const char *block);\n\n")
392 output.write(
400 * Returns 1 if true, 0 if false and -1 on unknown block
408 return (-1);
416 header.write("XMLPUBFUN int XMLCALL xmlUCSIsCat%s\t(int code);\n" % name)
417 output.write("/**\n * xmlUCSIsCat%s:\n * @code: UCS code point\n" % (name))
418 output.write(" *\n * Check whether the character is part of %s UCS Category\n"%
420 output.write(" *\n * Returns 1 if true 0 otherwise\n */\n");
421 output.write("int\nxmlUCSIsCat%s(int code) {\n" % name)
423 output.write(" return(xmlCharInRange((unsigned int)code, &xml%sG)"
430 output.write(" return(");
433 output.write(" ||\n ");
435 output.write("(code == %s)" % (hex(begin)))
437 output.write("((code >= %s) && (code <= %s))" % (
439 output.write(");\n}\n\n")
441 header.write("\nXMLPUBFUN int XMLCALL xmlUCSIsCat\t(int code, const char *cat);\n")
442 output.write(
450 * Returns 1 if true, 0 if false and -1 on unknown category
458 return (-1);
467 header.write("""
478 output.close()