I've prepared NMU mhc 0.25.1+20050120-2.1 to fix this RC bug, see below.

If the maintainer don't make an objection to it, I'll do NMU soon.

----
diff -urN mhc-0.25.1+20050120-2/debian/changelog 
mhc-0.25.1+20050120/debian/changelog
--- mhc-0.25.1+20050120-2/debian/changelog      2006-07-09 13:55:58.000000000 
+0900
+++ mhc-0.25.1+20050120/debian/changelog        2006-11-19 23:02:01.000000000 
+0900
@@ -1,3 +1,11 @@
+mhc (0.25.1+20050120-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS, patch from [mhc:02219], thanks to KOIE Hidetaka.
+    closes: Bug#386196
+
+ -- Tatsuya Kinoshita <[EMAIL PROTECTED]>  Sun, 19 Nov 2006 23:01:31 +0900
+
 mhc (0.25.1+20050120-2) unstable; urgency=low
 
   * use ${misc:Depends} in debian/control for debconf
diff -urN mhc-0.25.1+20050120-2/ruby-ext/mhc_pilib.c 
mhc-0.25.1+20050120/ruby-ext/mhc_pilib.c
--- mhc-0.25.1+20050120-2/ruby-ext/mhc_pilib.c  2004-11-15 09:40:01.000000000 
+0900
+++ mhc-0.25.1+20050120/ruby-ext/mhc_pilib.c    2006-11-19 23:01:13.000000000 
+0900
@@ -121,6 +121,9 @@
       }
    }
 
+#if PILOT_LINK_MAJOR >= 12
+  ret = pi_bind(sd, dev_str);
+#else
   if (dev_usb) {
          for (i=7; i>0; i--) {
                  ret = pi_bind(sd, (struct sockaddr*)&addr, sizeof(addr));
@@ -130,6 +133,7 @@
   } else {
          ret = pi_bind(sd, (struct sockaddr*)&addr, sizeof(addr));
   }
+#endif
   if (ret == -1) return Qnil;
 
   return INT2FIX(sd);
@@ -260,6 +264,20 @@
 
 static VALUE rdlp_ReadAppBlock(VALUE obj, VALUE sd, VALUE db)
 {
+#if PILOT_LINK_MAJOR >= 12
+  int len;
+  VALUE ret = Qnil;
+  pi_buffer_t *buffer = pi_buffer_new(DLP_BUF_SIZE); /* xxx need check */
+
+  len = dlp_ReadAppBlock(FIX2INT(sd), FIX2INT(db), 0, DLP_BUF_SIZE, buffer);
+
+  if (len > 0)
+      ret = str_new(buffer->data, len);
+
+  pi_buffer_free(buffer);
+
+  return ret;
+#else
   int len;
   unsigned char buffer[0xffff];
 
@@ -269,6 +287,7 @@
     return Qnil;
   else
     return str_new(buffer, len);
+#endif
 }
 
 /****************************************************************/
@@ -284,18 +303,32 @@
 
 static VALUE rdlp_ReadRecordByIndex(VALUE obj, VALUE sd, VALUE db, VALUE i)
 {
-  VALUE ary;
+  VALUE ary = Qnil;
   int attr, category, len;
   recordid_t id;
+#if PILOT_LINK_MAJOR >= 12
+  pi_buffer_t *buffer = pi_buffer_new(DLP_BUF_SIZE); /* xxx needed check */
+#else
   unsigned char buffer[0xffff];
+#endif
 
-  ary = ary_new();
+#if PILOT_LINK_MAJOR >= 12
+  len = dlp_ReadRecordByIndex(FIX2INT(sd), FIX2INT(db), FIX2INT(i), 
+                             buffer, &id, &attr, &category);
+#else
   len = dlp_ReadRecordByIndex(FIX2INT(sd), FIX2INT(db), FIX2INT(i), 
                              buffer, &id, 0, &attr, &category);
+#endif
+
+  if (len <= 0) goto out;
 
-  if (len <= 0) return Qnil;
+  ary = ary_new();
 
+#if PILOT_LINK_MAJOR >= 12
+  dprintf(("id:%d atr:%d cat:%d bp:%d 
len:%d\n",id,attr,category,buffer->data,len));
+#else
   dprintf(("id:%d atr:%d cat:%d bp:%d len:%d\n",id,attr,category,buffer,len));
+#endif
   dprintf(("readrecordbyindex 0\n"));
   ar_set1(ary, "i", id);
   dprintf(("readrecordbyindex 1\n"));
@@ -303,32 +336,62 @@
   dprintf(("readrecordbyindex 2\n"));
   ar_set1(ary, "i", category);
   dprintf(("readrecordbyindex 3\n"));
+#if PILOT_LINK_MAJOR >= 12
+  ary_push(ary, str_new(buffer->data, len));
+#else
   ary_push(ary, str_new(buffer, len));
+#endif
   dprintf(("readrecordbyindex 4\n"));
 
+ out:
+#if PILOT_LINK_MAJOR >= 12
+  pi_buffer_free(buffer);
+#endif
   return ary;
 }
 
 static VALUE rdlp_ReadRecordById(VALUE obj, VALUE sd, VALUE db, VALUE vid)
 {
-  VALUE ary;
+  VALUE ary = Qnil;
   int attr, category, len;
   int index;
+#if PILOT_LINK_MAJOR >= 12
+  pi_buffer_t *buffer = pi_buffer_new(DLP_BUF_SIZE);
+#else
   unsigned char buffer[0xffff];
+#endif
   recordid_t id = FIX2INT(vid);
 
-  ary = ary_new();
+#if PILOT_LINK_MAJOR >= 12
+  len = dlp_ReadRecordById(FIX2INT(sd), FIX2INT(db), id, 
+                          buffer, &index, &attr, &category);
+#else
   len = dlp_ReadRecordById(FIX2INT(sd), FIX2INT(db), id, 
                           buffer, &index, 0, &attr, &category);
+#endif
 
-  if (len <= 0) return Qnil;
+  if (len <= 0) goto out;
 
+  ary = ary_new();
+
+#if PILOT_LINK_MAJOR >= 12
+  dprintf(("id:%d atr:%d cat:%d bp:%d 
len:%d\n",id,attr,category,buffer->data,len));
+#else
   dprintf(("id:%d atr:%d cat:%d bp:%d len:%d\n",id,attr,category,buffer,len));
+#endif
   ar_set1(ary, "i", id);
   ar_set1(ary, "i", attr);
   ar_set1(ary, "i", category);
+#if PILOT_LINK_MAJOR >= 12
+  ary_push(ary, str_new(buffer->data, len));
+#else
   ary_push(ary, str_new(buffer, len));
+#endif
 
+ out:
+#if PILOT_LINK_MAJOR >= 12
+  pi_buffer_free(buffer);
+#endif
   return ary;
 }
 
@@ -340,14 +403,22 @@
 {
   recordid_t id, new_id;
   int        attr, category, ret, len;
+#if PILOT_LINK_MAJOR >= 12
+  pi_buffer_t *buf = pi_buffer_new(DLP_BUF_SIZE); /* xxx need check */
+#else
   char       buf[0xffff];
+#endif
   char       *ptr;
   struct Appointment app;
   int i;
   VALUE      a = ary_new();
 
+#if PILOT_LINK_MAJOR >= 12
+  memset(buf->data, 0, buf->allocated);
+#else
   for (i = 0; i < 0xffff; i++)
     buf[i] = '\0';
+#endif
      
   ary_copy(a, ary);
   ar_get1(a, "i", id);
@@ -359,15 +430,26 @@
 
   dprintf(("buf: %s\n", buf));
 
+#if PILOT_LINK_MAJOR >= 12
+  unpack_Appointment(&app, buf, datebook_v1);
+#else
   unpack_Appointment(&app, buf, len);
+#endif
   dprintf(("event: %d\n", app.event));
   dprintf(("beg_year %d\n", app.begin.tm_year));
   dprintf(("Subject: %s\n", app.description));
   dprintf(("id: %d  attr: %d  cat: %d  buf_len: %d\n",
           id, attr, category, len));
 
+#if PILOT_LINK_MAJOR >= 12
+  ret = dlp_WriteRecord(FIX2INT(sd), FIX2INT(db), attr,
+                       id, category, buf->data, len, &new_id);
+
+  pi_buffer_free(buf);
+#else
   ret = dlp_WriteRecord(FIX2INT(sd), FIX2INT(db), attr,
                        id, category, buf, len, &new_id);
+#endif
 
   if (ret < 0){
     dprintf(("%s\n", dlp_strerror(ret)));
@@ -425,7 +507,12 @@
 static VALUE rpack_Appointment(VALUE x, VALUE ary1)
 {
   struct Appointment app;
+#if PILOT_LINK_MAJOR >= 12
+  pi_buffer_t *buf = pi_buffer_new(DLP_BUF_SIZE); /* xxx need check */
+  VALUE ret;
+#else
   char buf[0xffff];
+#endif
   int len, i = 0;
   VALUE ary = ary_new();
   ary_copy(ary, ary1);
@@ -449,10 +536,20 @@
   ar_get1(ary, "s", app.description);
   ar_get1(ary, "s", app.note);
 
+#if PILOT_LINK_MAJOR >= 12
+  len = pack_Appointment(&app, buf, datebook_v1);
+#else
   len = pack_Appointment(&app, buf, sizeof(buf));
+#endif
   dprintf(("pack_Appointment: length: %d\n", len));
   free(app.exception);
+#if PILOT_LINK_MAJOR >= 12
+  ret = str_new(buf->data, len);
+  pi_buffer_free(buf);
+  return ret;
+#else
   return str_new(buf, len);
+#endif
 }
 
 static VALUE runpack_Appointment(VALUE x, VALUE raw_str)
@@ -461,7 +558,15 @@
   VALUE ary = ary_new();
 
   Check_Type(raw_str, T_STRING);
+#if PILOT_LINK_MAJOR >= 12
+  pi_buffer_t *buf = pi_buffer_new(DLP_BUF_SIZE); /* xxx need check */
+  unpack_Appointment(&app, buf, datebook_v1);
+  memcpy(RSTRING(raw_str)->ptr, buf->data, buf->used);
+  RSTRING(raw_str)->len = buf->used;
+  pi_buffer_free(buf);
+#else
   unpack_Appointment(&app, RSTRING(raw_str)->ptr, RSTRING(raw_str)->len);
+#endif
 
   ar_set1(ary, "b", app.event);
   dprintf(("runpack_Appointment: 0\n"));
@@ -491,6 +596,46 @@
   return ary;
 }
 
+/* XXX koie */
+static VALUE rpack_AppointmentAppInfo(VALUE o, VALUE ary1)
+{
+  struct AppointmentAppInfo ai;
+  unsigned char buf[0xffff];
+  int len;
+  VALUE ary = ary_new();
+  ary_copy(ary, ary1);
+
+  ar_get2(ary, "b", ai.category.renamed, 16);
+  ar_get2(ary, "c", ai.category.ID, 16);
+  ar_get1(ary, "c", ai.category.lastUniqueID);
+
+  ar_get1(ary, "i", ai.startOfWeek);
+
+  len = pack_AppointmentAppInfo(&ai, buf, sizeof(buf));
+  dprintf(("pack_AppointmentAppInfo: length: %d\n", len));
+  return str_new(buf, len);
+}
+
+
+/* XXX koie */
+static VALUE runpack_AppointmentAppInfo(VALUE o, VALUE raw_str)
+{
+  struct AppointmentAppInfo ai;
+  VALUE ary = ary_new();
+
+  Check_Type(raw_str, T_STRING);
+  unpack_AppointmentAppInfo(&ai, RSTRING(raw_str)->ptr, RSTRING(raw_str)->len);
+
+  ar_set2(ary, "b", ai.category.renamed, 16);
+  ar_set2(ary, "s16", ai.category.name, 16);
+  ar_set2(ary, "c", ai.category.ID, 16);
+  ar_set1(ary, "c", ai.category.lastUniqueID);
+
+  ar_set1(ary, "i", ai.startOfWeek);
+
+  return ary;
+}  
+
 /****************************************************************/
 /********* For Address Records **********************************/
 /****************************************************************/
@@ -498,7 +643,12 @@
 static VALUE rpack_Address(VALUE x, VALUE ary1)
 {
   struct Address add;
+#if PILOT_LINK_MAJOR >= 12
+  pi_buffer_t *buf = pi_buffer_new(DLP_BUF_SIZE); /* xxx need check */
+  VALUE ret;
+#else
   unsigned char buf[0xffff];
+#endif
   int len;
 
   VALUE ary = ary_new();
@@ -508,8 +658,15 @@
   ar_get1(ary, "i", add.showPhone);
   ar_get2(ary, "s", add.entry, 19);
 
+#if PILOT_LINK_MAJOR >= 12
+  len = pack_Address(&add, buf, address_v1);
+  ret = str_new(buf->data, len);
+  pi_buffer_free(buf);
+  return ret;
+#else
   len = pack_Address(&add, buf, sizeof(buf));
   return str_new(buf, len);
+#endif
 }
 
 static VALUE runpack_Address(VALUE x, VALUE raw_str)
@@ -518,7 +675,15 @@
   VALUE ary = ary_new();
 
   Check_Type(raw_str, T_STRING);
+#if PILOT_LINK_MAJOR >= 12
+  pi_buffer_t *buf = pi_buffer_new(DLP_BUF_SIZE); /* xxx need check */
+  unpack_Address(&add, buf, address_v1);
+  memcpy(RSTRING(raw_str)->ptr, buf->data, buf->used);
+  RSTRING(raw_str)->len = buf->used;
+  pi_buffer_free(buf);
+#else
   unpack_Address(&add, RSTRING(raw_str)->ptr, RSTRING(raw_str)->len);
+#endif
 
   ar_set2(ary, "i", add.phoneLabel, 5);
   ar_set1(ary, "i", add.showPhone);
@@ -541,6 +706,7 @@
   ar_get1(ary, "c", ai.category.lastUniqueID);
 
   ar_get2(ary, "s16", ai.labels, 22);
+  /* XXX koie ar_get2(ary, "b",   ai.labelRenamed, 22) */
   ar_get2(ary, "s16", ai.phoneLabels, 8);
   ar_get1(ary, "i", ai.country);
   ar_get1(ary, "b", ai.sortByCompany);
@@ -599,14 +765,18 @@
 static VALUE rpi_file_get_app_info(VALUE obj)
 {
   struct pi_file *pf;
-  int len;
+  size_t len;
   char *ptr;
 
   Data_Get_Struct(obj, struct pi_file, pf);
 
+#if PILOT_LINK_MAJOR >= 12
+  pi_file_get_app_info(pf, (void*)&ptr, &len);
+#else
   if (pi_file_get_app_info(pf, (void*)&ptr, &len) < 0){
     Fail("pi_file_get_app_info");
   }
+#endif
   return str_new(ptr, len);
 }
 
@@ -614,7 +784,11 @@
 {
   struct pi_file *pf;
   int len, attr, category;
+#if PILOT_LINK_MAJOR >= 12
+  recordid_t id;
+#else
   pi_uid_t id;
+#endif
   void *ptr;
   VALUE ary = ary_new();
 
@@ -684,6 +858,9 @@
   /* for datebook */
   mfunc(mPiLib, "pack_Appointment",      rpack_Appointment,      1);
   mfunc(mPiLib, "unpack_Appointment",    runpack_Appointment,    1);
+  /* XXX koie */
+  mfunc(mPiLib, "pack_AppointmentAppInfo",   rpack_AppointmentAppInfo,   1);
+  mfunc(mPiLib, "unpack_AppointmentAppInfo", runpack_AppointmentAppInfo, 1);
 
   /* for address */
   mfunc(mPiLib, "pack_Address",          rpack_Address,          1);
----

--
Tatsuya Kinoshita

Attachment: pgpeqFHyw37vh.pgp
Description: PGP signature

Reply via email to