/[d-i]/trunk/packages/partman/partman/stralign.c
ViewVC logotype

Contents of /trunk/packages/partman/partman/stralign.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11699 - (hide annotations) (download)
Mon Mar 22 09:35:42 2004 UTC (9 years, 2 months ago) by waldi
File MIME type: text/plain
File size: 986 byte(s)
* trunk/packages/anna: Move from trunk/anna.
* trunk/packages/kernel: Move from trunk/kernel.
* trunk/packages/libdebian-installer: Move from trunk/libdebian-installer.
* trunk/packages/main-menu: Move from trunk/main-menu.
* trunk/packages/packages-build: Move from trunk/packages-build.
* trunk/packages/partman: Move from trunk/partman.
* trunk/packages/retriever: Move from trunk/retriever.
* trunk/packages/rootskel: Move from trunk/rootskel.
* trunk/packages/debian-installer-utils: Move from trunk/utils.
1 zinoviev 10390 #include <stdio.h>
2     #include <locale.h>
3     #include <stdlib.h>
4     #include <string.h>
5     #include <wchar.h>
6    
7     int
8     main(int argc, char **argv)
9     {
10     int space;
11     int length;
12     int width;
13     wchar_t *string;
14     setlocale(LC_ALL, "");
15     sscanf(argv[1], "%i", &space);
16     length = strlen(argv[2]);
17     string = (wchar_t *) malloc(sizeof(wchar_t[length]));
18     mbstowcs(string, argv[2], length + 2);
19     width = wcswidth(string, length + 2);
20     if (space > 0 && space > width) {
21     int i;
22     for (i = width; i < space; i++)
23     putchar(' ');
24     }
25     printf("%s", argv[2]);
26     if (space < 0 && -space > width) {
27     int i;
28     for (i = width; i < -space; i++)
29     putchar(' ');
30     }
31     return 0;
32     }
33    
34    
35     /*
36     Local variables:
37     indent-tabs-mode: nil
38     c-file-style: "linux"
39     c-font-lock-extra-types: ("FILE" "\\sw+_t" "bool" "Ped\\sw+")
40     End:
41     */

  ViewVC Help
Powered by ViewVC 1.1.5