3cd9cb8661
platforms in order for dlsym() to work, hence plugins can be loaded. o Build Expense plugin. o Build synctime plugin. o Put in libtool patches.
97 lines
3.2 KiB
Plaintext
97 lines
3.2 KiB
Plaintext
$OpenBSD: patch-address_c,v 1.1.1.1 2001/05/29 00:54:43 pvalchev Exp $
|
|
--- address.c.orig Mon Feb 5 14:30:18 2001
|
|
+++ address.c Sun May 27 17:12:01 2001
|
|
@@ -30,10 +30,6 @@
|
|
#include "libplugin.h"
|
|
#include "password.h"
|
|
|
|
-#include "japanese.h"
|
|
-#include "cp1250.h"
|
|
-#include "russian.h"
|
|
-
|
|
#define ADDRESS_EOF 7
|
|
|
|
static int glob_sort_by_company;
|
|
@@ -223,8 +219,16 @@ int pc_address_write(struct Address *a,
|
|
unsigned int *unique_id)
|
|
{
|
|
char record[65536];
|
|
- int rec_len;
|
|
+ int rec_len,i;
|
|
buf_rec br;
|
|
+ long char_set;
|
|
+
|
|
+ get_pref(PREF_CHAR_SET, &char_set, NULL);
|
|
+ if (char_set != CHAR_SET_ENGLISH) {
|
|
+ for (i = 0; i < 19; i++) {
|
|
+ if (a->entry[i]) charset_j2p(a->entry[i], strlen(a->entry[i])+1, char_set);
|
|
+ }
|
|
+ }
|
|
|
|
rec_len = pack_Address(a, record, 65535);
|
|
if (!rec_len) {
|
|
@@ -274,36 +278,22 @@ int get_address_app_info(struct AddressA
|
|
return -1;
|
|
}
|
|
|
|
- get_pref(PREF_CHAR_SET, &char_set, NULL);
|
|
- if (char_set==CHAR_SET_JAPANESE ||
|
|
- char_set==CHAR_SET_1250 ||
|
|
- char_set==CHAR_SET_1251 ||
|
|
- char_set==CHAR_SET_1251_B
|
|
- ) {
|
|
+ get_pref(PREF_CHAR_SET, &char_set, NULL);
|
|
+ if (char_set != CHAR_SET_ENGLISH) {
|
|
/* Convert to character set */
|
|
- {
|
|
int i;
|
|
for (i = 0; i < 16; i++)
|
|
if (ai->category.name[i][0] != '\0') {
|
|
- if (char_set==CHAR_SET_JAPANESE) Sjis2Euc(ai->category.name[i], 16);
|
|
- if (char_set==CHAR_SET_1250) Win2Lat(ai->category.name[i], 16);
|
|
- if (char_set==CHAR_SET_1251) win1251_to_koi8(ai->category.name[i], 16);
|
|
+ charset_p2j(ai->category.name[i], 16, char_set);
|
|
}
|
|
for (i = 0; i < 19 + 3; i++)
|
|
if (ai->labels[i][0] != '\0') {
|
|
- if (char_set==CHAR_SET_JAPANESE) Sjis2Euc(ai->labels[i], 16);
|
|
- if (char_set==CHAR_SET_1250) Win2Lat(ai->labels[i], 16);
|
|
- if (char_set==CHAR_SET_1251) win1251_to_koi8(ai->labels[i], 16);
|
|
- if (char_set==CHAR_SET_1251_B) koi8_to_win1251(ai->labels[i], 16);
|
|
+ charset_p2j(ai->labels[i],16, char_set);
|
|
}
|
|
for (i = 0; i < 8; i++)
|
|
if (ai->phoneLabels[i][0] != '\0') {
|
|
- if (char_set==CHAR_SET_JAPANESE) Sjis2Euc(ai->phoneLabels[i], 16);
|
|
- if (char_set==CHAR_SET_1250) Win2Lat(ai->phoneLabels[i], 16);
|
|
- if (char_set==CHAR_SET_1251) win1251_to_koi8(ai->phoneLabels[i], 16);
|
|
- if (char_set==CHAR_SET_1251_B) koi8_to_win1251(ai->phoneLabels[i], 16);
|
|
+ charset_p2j(ai->phoneLabels[i],16, char_set);
|
|
}
|
|
- }
|
|
}
|
|
|
|
return 0;
|
|
@@ -385,17 +375,11 @@ int get_addresses2(AddressList **address
|
|
}
|
|
|
|
get_pref(PREF_CHAR_SET, &char_set, NULL);
|
|
- if (char_set==CHAR_SET_JAPANESE ||
|
|
- char_set==CHAR_SET_1250 ||
|
|
- char_set==CHAR_SET_1251 ||
|
|
- char_set==CHAR_SET_1251_B
|
|
- ) {
|
|
- int i;
|
|
+ if (char_set != CHAR_SET_ENGLISH) {
|
|
for (i = 0; i < 19; i++) {
|
|
- if (char_set==CHAR_SET_JAPANESE) Sjis2Euc(a.entry[i], 65536);
|
|
- if (char_set==CHAR_SET_1250) Win2Lat(a.entry[i], 65536);
|
|
- if (char_set==CHAR_SET_1251) win1251_to_koi8(a.entry[i], 65536);
|
|
- if (char_set==CHAR_SET_1251_B) koi8_to_win1251(a.entry[i], 65536);
|
|
+ if ((a.entry[i] != NULL) && (a.entry[i][0] != '\0')) {
|
|
+ charset_p2j(a.entry[i], strlen(a.entry[i])+1, char_set);
|
|
+ }
|
|
}
|
|
}
|
|
|