Репозитории ALT
S: | 0.0.4-alt3.qa1 |
5.1: | 0.0.4-alt2 |
4.1: | 0.0.4-alt2 |
4.0: | 0.0.4-alt2 |
3.0: | 0.0.4-alt1 |
Группа :: Работа с текстами
Пакет: o3read
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: o3read-0.0.4-alt-natspec.patch
Скачать
Скачать
diff -urN o3read-0.0.4.old/o3read.c o3read-0.0.4/o3read.c
--- o3read-0.0.4.old/o3read.c 2005-01-07 11:28:47 +0300
+++ o3read-0.0.4/o3read.c 2005-08-29 17:35:55 +0400
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <natspec.h>
#include "o3read.h"
@@ -91,6 +92,13 @@
return h;
}
+void putstring(const char *str)
+{
+ char *newstr = natspec_convert_with_translit(str, NULL, "UTF-8");
+ printf(newstr);
+ free(newstr);
+}
+
static void indent(int i)
{
int j;
diff -urN o3read-0.0.4.old/o3read.h o3read-0.0.4/o3read.h
--- o3read-0.0.4.old/o3read.h 2005-01-07 11:28:47 +0300
+++ o3read-0.0.4/o3read.h 2005-08-29 17:35:02 +0400
@@ -34,3 +34,4 @@
extern void *cmalloc(size_t);
extern char *cstrdup(const char *);
extern int cstrncasecmp(const char *, const char *, size_t);
+extern void putstring(const char *str);
diff -urN o3read-0.0.4.old/o3tohtml.c o3read-0.0.4/o3tohtml.c
--- o3read-0.0.4.old/o3tohtml.c 2005-01-07 11:28:47 +0300
+++ o3read-0.0.4/o3tohtml.c 2005-08-29 17:37:33 +0400
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <locale.h>
#include "o3read.h"
@@ -302,6 +303,8 @@
*/
static void text(hnode *h, hstate *s)
{
+ putstring(h->text);
+ /* TODO: Lav: fix later
int i;
for (i = 0; h->text[i]; i++) {
switch (h->text[i]) {
@@ -312,9 +315,10 @@
printf(">");
break;
default:
- putchar(h->text[i]);
+ putchar_locale(h->text[i]);
}
}
+ */
/* can't have children */
tree(h->next, s);
}
@@ -340,7 +344,7 @@
href = 0;
hrefs = NULL;
-
+ setlocale(LC_ALL, "");
h = parse_html(nextc, stdin);
if (h == NULL) usage();
diff -urN o3read-0.0.4.old/o3totxt.c o3read-0.0.4/o3totxt.c
--- o3read-0.0.4.old/o3totxt.c 2005-01-07 11:28:47 +0300
+++ o3read-0.0.4/o3totxt.c 2005-08-29 17:37:30 +0400
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <locale.h>
#include "o3read.h"
@@ -113,9 +114,12 @@
static void text(hnode *h, hstate *s)
{
int i;
+ putstring(h->text);
+ /*
for (i = 0; h->text[i]; i++) {
- putchar(h->text[i]);
+ putchar_locale(h->text[i]);
}
+ */
/* can't have children */
tree(h->next, s);
}
@@ -141,7 +145,7 @@
href = 0;
hrefs = NULL;
-
+ setlocale(LC_ALL, "");
h = parse_html(nextc, stdin);
if (h == NULL) usage();