MCPcopy Create free account
hub / github.com/F-Stack/f-stack / main

Function main

tools/libxo/tests/core/test_05.c:34–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32int info_count = (sizeof(info) / sizeof(info[0]));
33
34int
35main (int argc, char **argv)
36{
37 struct employee {
38 const char *e_first;
39 const char *e_nic;
40 const char *e_last;
41 unsigned e_dept;
42 unsigned e_percent;
43 } employees[] = {
44 { "Jim", "რეგტ", "გთხოვთ ახ", 431, 90 },
45 { "Terry", "<one", "Οὐχὶ ταὐτὰ παρίσταταί μοι Jones", 660, 90 },
46 { "Leslie", "Les", "Patterson", 341,60 },
47 { "Ashley", "Ash", "Meter & Smith", 1440, 40 },
48 { "0123456789", "0123456789", "012345678901234567890", 1440, 40 },
49 { "ახლა", "გაიარო", "საერთაშორისო", 123, 90 },
50 { "෴ණ්ණ෴෴ණ්ණ෴", "Mick",
51 "෴ණ්ණ෴෴ණ්ණ෴෴ණ්ණ෴෴෴", 110, 20 },
52 { NULL, NULL }
53 }, *ep = employees;
54 int rc, i;
55
56 argc = xo_parse_args(argc, argv);
57 if (argc < 0)
58 return 1;
59
60 xo_set_info(NULL, info, info_count);
61 xo_set_flags(NULL, XOF_COLUMNS);
62
63 xo_open_container("indian-languages");
64
65 xo_emit("{T:Sample text}\n");
66 xo_emit("This sample text was taken from the Punjabi Wikipedia "
67 "article on Lahore and transliterated into the Latin script.\n");
68
69 xo_emit("{T:Gurmukhi:}\n");
70 xo_emit("{:gurmukhi}\n",
71 "ਲਹੌਰ ਪਾਕਿਸਤਾਨੀ ਪੰਜਾਬ ਦੀ ਰਾਜਧਾਨੀ ਹੈ । ਲੋਕ ਗਿਣਤੀ ਦੇ ਨਾਲ ਕਰਾਚੀ ਤੋਂ ਬਾਅਦ ਲਹੌਰ ਦੂਜਾ ਸਭ ਤੋਂ ਵੱਡਾ ਸ਼ਹਿਰ ਹੈ । ਲਹੌਰ ਪਾਕਿਸਤਾਨ ਦਾ ਸਿਆਸੀ, ਰਹਤਲੀ ਤੇ ਪੜ੍ਹਾਈ ਦਾ ਗੜ੍ਹ ਹੈ ਅਤੇ ਇਸ ਲਈ ਇਹਨੂੰ ਪਾਕਿਸਤਾਨ ਦਾ ਦਿਲ ਵੀ ਕਿਹਾ ਜਾਂਦਾ ਹੈ । ਲਹੌਰ ਦਰਿਆ-ਏ-ਰਾਵੀ ਦੇ ਕੰਢੇ ਤੇ ਵਸਦਾ ਹੈ ਤੇ ਇਸਦੀ ਲੋਕ ਗਿਣਤੀ ਇੱਕ ਕਰੋੜ ਦੇ ਨੇੜੇ ਹੈ ।");
72
73
74 xo_emit("{T:Shahmukhi:}\n");
75 xo_emit("{:shahmukhi}\n",
76 "لہور پاکستانی پنجاب دا دارالحکومت اے۔ لوک گنتی دے نال کراچی توں بعد لہور دوجا سبھ توں وڈا شہر اے۔ لہور پاکستان دا سیاسی، رہتلی تے پڑھائی دا گڑھ اے تے اس لئی ایھنوں پاکستان دا دل وی کیھا جاندا اے۔ لہور دریاۓ راوی دے کنڈھے تے وسدا اے اسدی لوک گنتی اک کروڑ دے نیڑے اے ۔");
77
78 xo_emit("{T:Transliteration}:\n");
79 xo_emit("{:tranliteration}\n",
80 "lahor pākistān panjāb dā dārul hakūmat ē. lōk giṇtī dē nāḷ karācī tō᷈ bāad lahor dūjā sab tō᷈ vaḍḍā shahr ē. lahor pākistān dā siāsī, rahtalī tē paṛā̀ī dā gā́ṛ ē tē is laī ihnū᷈ pākistān dā dil vī kehā jāndā ē. lahor dariāē rāvī dē kanḍē tē vasdā ē. isdī lōk giṇtī ikk karōṛ dē nēṛē ē.");
81
82 xo_close_container("indian-languages");
83
84 xo_open_container("employees");
85
86 wchar_t wc[] = { L'෴', L'ණ', L'්', L'ණ', 0x17D2, L'෴', 0 };
87 for (i = 0; wc[i]; i++)
88 xo_emit("Wide char: {lq:wc/%lc - %#lx - %d}\n",
89 wc[i], (unsigned long) wc[i], xo_wcwidth(wc[i]));
90
91 wchar_t msg[] = { L'1', 0x034f, L'2', 0x20dd, 0 };

Callers

nothing calls this directly

Calls 13

xo_parse_argsFunction · 0.85
xo_set_infoFunction · 0.85
xo_set_flagsFunction · 0.85
xo_open_containerFunction · 0.85
xo_emitFunction · 0.85
xo_close_containerFunction · 0.85
xo_wcwidthFunction · 0.85
xo_open_listFunction · 0.85
xo_open_instanceFunction · 0.85
xo_attrFunction · 0.85
xo_close_instanceFunction · 0.85
xo_close_listFunction · 0.85

Tested by

no test coverage detected