patch-bindings_Perl_Pilot_xs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. $OpenBSD: patch-bindings_Perl_Pilot_xs,v 1.3 2015/09/21 08:46:50 ajacoutot Exp $
  2. Allow pilot-link's perl bindings to build with newer Perl.
  3. From Debian ticket 628510
  4. --- bindings/Perl/Pilot.xs.orig Mon Nov 12 17:49:54 2007
  5. +++ bindings/Perl/Pilot.xs Mon Mar 18 22:07:45 2013
  6. @@ -160,7 +160,7 @@ SvChar4(arg)
  7. #define pack_dbinfo(arg, var, failure) { \
  8. if (failure < 0) { \
  9. - arg = &sv_undef; \
  10. + arg = &PL_sv_undef; \
  11. self->errnop = failure; \
  12. } else { \
  13. HV * i = newHV(); \
  14. @@ -214,15 +214,15 @@ SvChar4(arg)
  15. var.createDate = (s = hv_fetch(i, "createDate", 10, 0)) ? SvIV(*s) : 0;\
  16. var.modifyDate = (s = hv_fetch(i, "modifyDate", 10, 0)) ? SvIV(*s) : 0;\
  17. var.backupDate = (s = hv_fetch(i, "backupDate", 10, 0)) ? SvIV(*s) : 0;\
  18. - if ((s = hv_fetch(i, "name", 4, 0)) ? SvPV(*s,na) : 0) \
  19. - strncpy(var.name, SvPV(*s, na), sizeof(var.name)); \
  20. + if ((s = hv_fetch(i, "name", 4, 0)) ? SvPV(*s,PL_na) : 0) \
  21. + strncpy(var.name, SvPV(*s, PL_na), sizeof(var.name)); \
  22. } else {\
  23. croak("argument is not a hash reference"); \
  24. }
  25. #define pack_userinfo(arg, var, failure) { \
  26. if (failure < 0) { \
  27. - arg = &sv_undef; \
  28. + arg = &PL_sv_undef; \
  29. self->errnop = failure; \
  30. } else { \
  31. HV * i = newHV(); \
  32. @@ -246,8 +246,8 @@ SvChar4(arg)
  33. var.lastSyncPC = (s = hv_fetch(i, "lastSyncPC", 10, 0)) ? SvIV(*s) : 0;\
  34. var.lastSyncDate = (s = hv_fetch(i, "lastSyncDate", 12, 0)) ? SvIV(*s) : 0;\
  35. var.successfulSyncDate = (s = hv_fetch(i, "successfulSyncDate", 18, 0)) ? SvIV(*s) : 0;\
  36. - if ((s = hv_fetch(i, "name", 4, 0)) ? SvPV(*s,na) : 0)\
  37. - strncpy(var.username, SvPV(*s, na), sizeof(var.username));\
  38. + if ((s = hv_fetch(i, "name", 4, 0)) ? SvPV(*s,PL_na) : 0)\
  39. + strncpy(var.username, SvPV(*s, PL_na), sizeof(var.username));\
  40. } else {\
  41. croak("argument is not a hash reference");\
  42. }
  43. @@ -287,7 +287,7 @@ SvChar4(arg)
  44. }\
  45. } else {\
  46. self->errnop = result;\
  47. - PUSHs(&sv_undef);\
  48. + PUSHs(&PL_sv_undef);\
  49. }
  50. #define PackSI\
  51. @@ -329,7 +329,7 @@ SvChar4(arg)
  52. }\
  53. } else {\
  54. self->errnop = result;\
  55. - PUSHs(&sv_undef);\
  56. + PUSHs(&PL_sv_undef);\
  57. }
  58. #define PackRecord {\
  59. @@ -421,7 +421,7 @@ SvChar4(arg)
  60. }\
  61. } else {\
  62. self->errnop = result;\
  63. - PUSHs(&sv_undef);\
  64. + PUSHs(&PL_sv_undef);\
  65. }
  66. #define PackResource\
  67. @@ -473,7 +473,7 @@ SvChar4(arg)
  68. }\
  69. } else {\
  70. self->errnop = result;\
  71. - PUSHs(&sv_undef);\
  72. + PUSHs(&PL_sv_undef);\
  73. }
  74. #define PackPref\
  75. @@ -536,7 +536,7 @@ SvChar4(arg)
  76. croak("Unable to create resource");\
  77. } else {\
  78. self->errnop = result;\
  79. - PUSHs(&sv_undef);\
  80. + PUSHs(&PL_sv_undef);\
  81. }
  82. void doUnpackCategory(HV * self, struct CategoryAppInfo * c)
  83. @@ -576,7 +576,7 @@ void doPackCategory(HV * self, struct CategoryAppInfo
  84. if ((s = hv_fetch(self, "categoryName", 12, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV))
  85. for (i=0;i<16;i++)
  86. - strncpy(c->name[i], (s=av_fetch(av, i, 0)) ? SvPV(*s,na) : "", 16);
  87. + strncpy(c->name[i], (s=av_fetch(av, i, 0)) ? SvPV(*s,PL_na) : "", 16);
  88. else
  89. for (i=0;i<16;i++)
  90. strcpy(c->name[i], "");
  91. @@ -602,7 +602,7 @@ void doPackCategory(HV * self, struct CategoryAppInfo
  92. int SvList(SV * arg, char **list)
  93. {
  94. int i;
  95. - char * str = SvPV(arg, na);
  96. + char * str = SvPV(arg, PL_na);
  97. for (i=0;list[i];i++)
  98. if (strcasecmp(list[i], str)==0)
  99. return i;
  100. @@ -781,11 +781,11 @@ Pack(record)
  101. croak("Invalid advance unit %d encountered", u);
  102. }
  103. } else {
  104. - if (strEQ(SvPV(*s, na), "minutes"))
  105. + if (strEQ(SvPV(*s, PL_na), "minutes"))
  106. u = 0;
  107. - else if (strEQ(SvPV(*s, na), "hours"))
  108. + else if (strEQ(SvPV(*s, PL_na), "hours"))
  109. u = 1;
  110. - else if (strEQ(SvPV(*s, na), "days"))
  111. + else if (strEQ(SvPV(*s, PL_na), "days"))
  112. u = 2;
  113. else
  114. croak("Invalid advance unit %d encountered", u);
  115. @@ -850,10 +850,10 @@ Pack(record)
  116. }
  117. }
  118. - a.description = (s = hv_fetch(h, "description", 11, 0)) ? SvPV(*s,na) : 0;
  119. + a.description = (s = hv_fetch(h, "description", 11, 0)) ? SvPV(*s,PL_na) : 0;
  120. if (!a.description)
  121. croak("appointments must contain a description");
  122. - a.note = (s = hv_fetch(h, "note", 4, 0)) ? SvPV(*s,na) : 0;
  123. + a.note = (s = hv_fetch(h, "note", 4, 0)) ? SvPV(*s,PL_na) : 0;
  124. if (pack_Appointment(&a, &pibuf, datebook_v1) < 0) {
  125. croak("pack_Appointment failed");
  126. @@ -897,7 +897,7 @@ UnpackAppBlock(record)
  127. }
  128. SvPV(record,len);
  129. - if (unpack_AppointmentAppInfo(&a, (CPTR)SvPV(record, na), len)>0) {
  130. + if (unpack_AppointmentAppInfo(&a, (CPTR)SvPV(record, PL_na), len)>0) {
  131. doUnpackCategory(ret, &a.category);
  132. @@ -1023,8 +1023,8 @@ Pack(record)
  133. a.indefinite = 1;
  134. }
  135. - a.description = (s = hv_fetch(h, "description", 11, 0)) ? SvPV(*s,na) : 0;
  136. - a.note = (s = hv_fetch(h, "note", 4, 0)) ? SvPV(*s,na) : 0;
  137. + a.description = (s = hv_fetch(h, "description", 11, 0)) ? SvPV(*s,PL_na) : 0;
  138. + a.note = (s = hv_fetch(h, "note", 4, 0)) ? SvPV(*s,PL_na) : 0;
  139. if (pack_ToDo(&a, &pibuf, todo_v1) < 0) {
  140. croak("pack_ToDo failed");
  141. @@ -1065,7 +1065,7 @@ UnpackAppBlock(record)
  142. }
  143. SvPV(record,len);
  144. - if (unpack_ToDoAppInfo(&a, (CPTR)SvPV(record, na), len)>0) {
  145. + if (unpack_ToDoAppInfo(&a, (CPTR)SvPV(record, PL_na), len)>0) {
  146. doUnpackCategory(ret, &a.category);
  147. @@ -1160,7 +1160,7 @@ Unpack(record)
  148. hv_store(ret, "entry", 5, newRV_noinc((SV*)e), 0);
  149. for (i=0;i<19;i++) {
  150. - av_push(e, a.entry[i] ? newSVpv(a.entry[i],0) : &sv_undef);
  151. + av_push(e, a.entry[i] ? newSVpv(a.entry[i],0) : &PL_sv_undef);
  152. }
  153. hv_store(ret, "showPhone", 9, newSViv(a.showPhone), 0);
  154. @@ -1200,7 +1200,7 @@ Pack(record)
  155. if ((s = hv_fetch(h, "entry", 5, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV))
  156. for (i=0;i<19;i++)
  157. - a.entry[i] = ((s=av_fetch(av, i, 0)) && SvOK(*s)) ? SvPV(*s,na) : 0;
  158. + a.entry[i] = ((s=av_fetch(av, i, 0)) && SvOK(*s)) ? SvPV(*s,PL_na) : 0;
  159. else
  160. for (i=0;i<19;i++)
  161. a.entry[i] = 0;
  162. @@ -1249,7 +1249,7 @@ UnpackAppBlock(record)
  163. }
  164. SvPV(record,len);
  165. - if (unpack_AddressAppInfo(&a, (CPTR)SvPV(record, na), len)>0) {
  166. + if (unpack_AddressAppInfo(&a, (CPTR)SvPV(record, PL_na), len)>0) {
  167. doUnpackCategory(ret, &a.category);
  168. @@ -1309,13 +1309,13 @@ PackAppBlock(record)
  169. a.sortByCompany = (s = hv_fetch(h, "sortByCompany", 13, 0)) ? SvIV(*s) : 0;
  170. if ((s = hv_fetch(h, "label", 5, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV))
  171. - for (i=0;i<22;i++) strncpy(a.labels[i], (s=av_fetch(av, i, 0)) ? SvPV(*s,na) : "", 16);
  172. + for (i=0;i<22;i++) strncpy(a.labels[i], (s=av_fetch(av, i, 0)) ? SvPV(*s,PL_na) : "", 16);
  173. else
  174. for (i=0;i<22;i++) a.labels[i][0] = 0;
  175. for (i=0;i<22;i++) a.labels[i][15] = 0;
  176. if ((s = hv_fetch(h, "phoneLabel", 10, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(av=(AV*)SvRV(*s))==SVt_PVAV))
  177. - for (i=0;i<8;i++) strncpy(a.phoneLabels[i], (s=av_fetch(av, i, 0)) ? SvPV(*s,na) : "", 16);
  178. + for (i=0;i<8;i++) strncpy(a.phoneLabels[i], (s=av_fetch(av, i, 0)) ? SvPV(*s,PL_na) : "", 16);
  179. else
  180. for (i=0;i<8;i++) a.phoneLabels[i][0] = 0;
  181. for (i=0;i<8;i++) a.phoneLabels[i][15] = 0;
  182. @@ -1396,7 +1396,7 @@ Pack(record)
  183. else {
  184. if ((s = hv_fetch(h, "text", 4, 0)))
  185. - a.text = SvPV(*s,na);
  186. + a.text = SvPV(*s,PL_na);
  187. else
  188. a.text = 0;
  189. @@ -1438,7 +1438,7 @@ UnpackAppBlock(record)
  190. }
  191. SvPV(record,len);
  192. - if (unpack_MemoAppInfo(&a, (CPTR)SvPV(record, na), len)>0) {
  193. + if (unpack_MemoAppInfo(&a, (CPTR)SvPV(record, PL_na), len)>0) {
  194. doUnpackCategory(ret, &a.category);
  195. @@ -1510,7 +1510,7 @@ Unpack(record)
  196. SvPV(record,len);
  197. if (len > 0) { /* len == 0 if deleted flag is set */
  198. - if (unpack_Expense(&e, (CPTR)SvPV(record, na), len)>0) {
  199. + if (unpack_Expense(&e, (CPTR)SvPV(record, PL_na), len)>0) {
  200. hv_store(ret, "date", 4, newRV_noinc((SV*)tmtoav(&e.date)), 0);
  201. hv_store(ret, "type", 4, newSVlist(e.type,ExpenseTypeNames),0);
  202. @@ -1570,15 +1570,15 @@ Pack(record)
  203. avtotm((AV*)SvRV(*s), &e.date);
  204. else
  205. croak("expense record must contain date");
  206. - if ((s = hv_fetch(h, "amount", 6, 0))) e.amount = SvPV(*s,na);
  207. + if ((s = hv_fetch(h, "amount", 6, 0))) e.amount = SvPV(*s,PL_na);
  208. else e.amount = 0;
  209. - if ((s = hv_fetch(h, "vendor", 6, 0))) e.vendor = SvPV(*s,na);
  210. + if ((s = hv_fetch(h, "vendor", 6, 0))) e.vendor = SvPV(*s,PL_na);
  211. else e.vendor = 0;
  212. - if ((s = hv_fetch(h, "city", 4, 0))) e.city = SvPV(*s,na);
  213. + if ((s = hv_fetch(h, "city", 4, 0))) e.city = SvPV(*s,PL_na);
  214. else e.city = 0;
  215. - if ((s = hv_fetch(h, "attendess", 9, 0))) e.attendees = SvPV(*s,na);
  216. + if ((s = hv_fetch(h, "attendess", 9, 0))) e.attendees = SvPV(*s,PL_na);
  217. else e.attendees = 0;
  218. - if ((s = hv_fetch(h, "note", 4, 0))) e.note = SvPV(*s,na);
  219. + if ((s = hv_fetch(h, "note", 4, 0))) e.note = SvPV(*s,PL_na);
  220. else e.note = 0;
  221. len = pack_Expense(&e, mybuf, 0xffff);
  222. @@ -1619,7 +1619,7 @@ UnpackAppBlock(record)
  223. }
  224. SvPV(record,len);
  225. - if (unpack_ExpenseAppInfo(&e, (CPTR)SvPV(record, na), len)>0) {
  226. + if (unpack_ExpenseAppInfo(&e, (CPTR)SvPV(record, PL_na), len)>0) {
  227. hv_store(ret, "sortOrder", 9, newSVlist(e.sortOrder,ExpenseSortNames),0);
  228. a = newAV();
  229. @@ -1662,15 +1662,15 @@ PackAppBlock(record)
  230. HV * hv;
  231. if ((s=av_fetch(av, i, 0)) && SvOK(*s) && SvRV(*s) && (SvTYPE(hv=(HV*)SvRV(*s))==SVt_PVHV)) {
  232. if (s = hv_fetch(hv, "name", 4, 0)) {
  233. - strncpy(e.currencies[i].name, SvPV(*s, na), 16);
  234. + strncpy(e.currencies[i].name, SvPV(*s, PL_na), 16);
  235. e.currencies[i].name[15] = 0;
  236. }
  237. if (s = hv_fetch(hv, "symbol", 6, 0)) {
  238. - strncpy(e.currencies[i].symbol, SvPV(*s, na), 4);
  239. + strncpy(e.currencies[i].symbol, SvPV(*s, PL_na), 4);
  240. e.currencies[i].symbol[3] = 0;
  241. }
  242. if (s = hv_fetch(hv, "rate", 4, 0)) {
  243. - strncpy(e.currencies[i].rate, SvPV(*s, na), 8);
  244. + strncpy(e.currencies[i].rate, SvPV(*s, PL_na), 8);
  245. e.currencies[i].rate[7] = 0;
  246. }
  247. }
  248. @@ -1718,7 +1718,7 @@ UnpackPref(record)
  249. }
  250. SvPV(record,len);
  251. - if (unpack_ExpensePref(&a, (CPTR)SvPV(record, na), len)>0) {
  252. + if (unpack_ExpensePref(&a, (CPTR)SvPV(record, PL_na), len)>0) {
  253. hv_store(ret, "unitOfDistance", 14, newSVlist(a.unitOfDistance, ExpenseDistanceNames), 0);
  254. hv_store(ret, "currentCategory", 15, newSViv(a.currentCategory), 0);
  255. @@ -1811,7 +1811,7 @@ Unpack(record)
  256. SvPV(record,len);
  257. if (len > 0) { /* len == 0 if deleted flag is set */
  258. - if (unpack_Mail(&a, (CPTR)SvPV(record, na), len)>0) {
  259. + if (unpack_Mail(&a, (CPTR)SvPV(record, PL_na), len)>0) {
  260. if (a.subject) hv_store(ret, "subject", 7, newSVpv(a.subject,0), 0);
  261. if (a.from) hv_store(ret, "from", 4, newSVpv(a.from,0), 0);
  262. @@ -1858,14 +1858,14 @@ Pack(record)
  263. }
  264. else {
  265. - a.subject = (s = hv_fetch(h, "subject", 7, 0)) ? SvPV(*s,na) : 0;
  266. - a.from = (s = hv_fetch(h, "from", 4, 0)) ? SvPV(*s,na) : 0;
  267. - a.to = (s = hv_fetch(h, "to", 2, 0)) ? SvPV(*s,na) : 0;
  268. - a.cc = (s = hv_fetch(h, "cc", 2, 0)) ? SvPV(*s,na) : 0;
  269. - a.bcc = (s = hv_fetch(h, "bcc", 3, 0)) ? SvPV(*s,na) : 0;
  270. - a.replyTo = (s = hv_fetch(h, "replyTo", 7, 0)) ? SvPV(*s,na) : 0;
  271. - a.sentTo = (s = hv_fetch(h, "sentTo", 6, 0)) ? SvPV(*s,na) : 0;
  272. - a.body = (s = hv_fetch(h, "body", 4, 0)) ? SvPV(*s,na) : 0;
  273. + a.subject = (s = hv_fetch(h, "subject", 7, 0)) ? SvPV(*s,PL_na) : 0;
  274. + a.from = (s = hv_fetch(h, "from", 4, 0)) ? SvPV(*s,PL_na) : 0;
  275. + a.to = (s = hv_fetch(h, "to", 2, 0)) ? SvPV(*s,PL_na) : 0;
  276. + a.cc = (s = hv_fetch(h, "cc", 2, 0)) ? SvPV(*s,PL_na) : 0;
  277. + a.bcc = (s = hv_fetch(h, "bcc", 3, 0)) ? SvPV(*s,PL_na) : 0;
  278. + a.replyTo = (s = hv_fetch(h, "replyTo", 7, 0)) ? SvPV(*s,PL_na) : 0;
  279. + a.sentTo = (s = hv_fetch(h, "sentTo", 6, 0)) ? SvPV(*s,PL_na) : 0;
  280. + a.body = (s = hv_fetch(h, "body", 4, 0)) ? SvPV(*s,PL_na) : 0;
  281. a.read = (s = hv_fetch(h, "read", 4, 0)) ? SvIV(*s) : 0;
  282. a.signature = (s = hv_fetch(h, "signature", 9, 0)) ? SvIV(*s) : 0;
  283. @@ -1913,7 +1913,7 @@ UnpackAppBlock(record)
  284. }
  285. SvPV(record,len);
  286. - if (unpack_MailAppInfo(&a, (CPTR)SvPV(record, na), len)>0) {
  287. + if (unpack_MailAppInfo(&a, (CPTR)SvPV(record, PL_na), len)>0) {
  288. doUnpackCategory(ret, &a.category);
  289. @@ -1989,7 +1989,7 @@ UnpackSyncPref(record)
  290. }
  291. SvPV(record,len);
  292. - if (unpack_MailSyncPref(&a, (CPTR)SvPV(record, na), len)>0) {
  293. + if (unpack_MailSyncPref(&a, (CPTR)SvPV(record, PL_na), len)>0) {
  294. hv_store(ret, "syncType", 8, newSVlist(a.syncType, MailSyncTypeNames), 0);
  295. hv_store(ret, "getHigh", 7, newSViv(a.getHigh), 0);
  296. @@ -2033,9 +2033,9 @@ PackSyncPref(record, id)
  297. a.getContaining = (s=hv_fetch(h,"getContaining",13,0)) ? SvIV(*s) : 0;
  298. a.truncate = (s=hv_fetch(h,"truncate",8,0)) ? SvIV(*s) : 0;
  299. - a.filterTo = (s=hv_fetch(h,"filterTo",8,0)) ? SvPV(*s,na) : 0;
  300. - a.filterFrom = (s=hv_fetch(h,"filterFrom",10,0)) ? SvPV(*s,na) : 0;
  301. - a.filterSubject = (s=hv_fetch(h,"filterSubject",13,0)) ? SvPV(*s,na) : 0;
  302. + a.filterTo = (s=hv_fetch(h,"filterTo",8,0)) ? SvPV(*s,PL_na) : 0;
  303. + a.filterFrom = (s=hv_fetch(h,"filterFrom",10,0)) ? SvPV(*s,PL_na) : 0;
  304. + a.filterSubject = (s=hv_fetch(h,"filterSubject",13,0)) ? SvPV(*s,PL_na) : 0;
  305. len = pack_MailSyncPref(&a, mybuf, 0xffff);
  306. @@ -2073,7 +2073,7 @@ UnpackSignaturePref(record)
  307. }
  308. SvPV(record,len);
  309. - if (unpack_MailSignaturePref(&a, (CPTR)SvPV(record, na), len)>0) {
  310. + if (unpack_MailSignaturePref(&a, (CPTR)SvPV(record, PL_na), len)>0) {
  311. if (a.signature)
  312. hv_store(ret, "signature", 9, newSVpv(a.signature, 0), 0);
  313. @@ -2099,7 +2099,7 @@ PackSignaturePref(record, id)
  314. RETVAL = record;
  315. else {
  316. - a.signature = (s=hv_fetch(h,"signature",9,0)) ? SvPV(*s,na) : 0;
  317. + a.signature = (s=hv_fetch(h,"signature",9,0)) ? SvPV(*s,PL_na) : 0;
  318. len = pack_MailSignaturePref(&a, mybuf, 0xffff);
  319. @@ -2129,7 +2129,7 @@ write(socket, msg)
  320. {
  321. STRLEN len;
  322. SvPV(msg, len);
  323. - RETVAL = pi_write(socket,SvPV(msg,na),len);
  324. + RETVAL = pi_write(socket,SvPV(msg,PL_na),len);
  325. }
  326. SV *
  327. @@ -2146,7 +2146,7 @@ read(socket, len)
  328. if (result >=0)
  329. RETVAL = newSVpvn((char *) pibuf.data, result);
  330. else
  331. - RETVAL = &sv_undef;
  332. + RETVAL = &PL_sv_undef;
  333. }
  334. OUTPUT:
  335. RETVAL
  336. @@ -2282,7 +2282,7 @@ class(self, name=0)
  337. croak("DBClasses doesn't exist");
  338. if (SvOK(name)) {
  339. (void)SvPV(name,len);
  340. - s = hv_fetch(h, SvPV(name,na), len, 0);
  341. + s = hv_fetch(h, SvPV(name,PL_na), len, 0);
  342. }
  343. if (!s)
  344. s = hv_fetch(h, "", 0, 0);
  345. @@ -2577,7 +2577,7 @@ getRecords(self)
  346. {
  347. int result = dlp_ReadOpenDBInfo(self->socket, self->handle, &RETVAL);
  348. if (result < 0) {
  349. - RETVAL = newSVsv(&sv_undef);
  350. + RETVAL = newSVsv(&PL_sv_undef);
  351. self->errnop = result;
  352. }
  353. }
  354. @@ -2745,7 +2745,7 @@ setResource(self, data)
  355. result = dlp_WriteResource(self->socket, self->handle, type, id, c, len);
  356. if (result < 0) {
  357. self->errnop = result;
  358. - RETVAL = newSVsv(&sv_undef);
  359. + RETVAL = newSVsv(&PL_sv_undef);
  360. } else
  361. RETVAL = newSViv(result);
  362. }
  363. @@ -2798,7 +2798,7 @@ getPref(self, id=0, backup=1)
  364. r = dlp_CloseDB(self->socket, self->handle);
  365. result = dlp_ReadAppPreference(self->socket, creator, id, backup, 0xFFFF, mybuf, &len, &version);
  366. if (pi_version(self->socket)< 0x101)
  367. - r = dlp_OpenDB(self->socket, self->dbcard, self->dbmode, SvPV(self->dbname,na), &self->handle);
  368. + r = dlp_OpenDB(self->socket, self->dbcard, self->dbmode, SvPV(self->dbname,PL_na), &self->handle);
  369. ReturnReadPref(mybuf, len);
  370. }
  371. @@ -2822,10 +2822,10 @@ setPref(self, data)
  372. r = dlp_CloseDB(self->socket, self->handle);
  373. result = dlp_WriteAppPreference(self->socket, creator, id, backup, version, buf, len);
  374. if (pi_version(self->socket)< 0x101)
  375. - r = dlp_OpenDB(self->socket, self->dbcard, self->dbmode, SvPV(self->dbname,na), &self->handle);
  376. + r = dlp_OpenDB(self->socket, self->dbcard, self->dbmode, SvPV(self->dbname,PL_na), &self->handle);
  377. if (result < 0) {
  378. self->errnop = result;
  379. - RETVAL = newSVsv(&sv_undef);
  380. + RETVAL = newSVsv(&PL_sv_undef);
  381. } else {
  382. RETVAL = newSViv(result);
  383. }
  384. @@ -2861,7 +2861,7 @@ setPrefRaw(self, data, number, version, backup=1)
  385. result = dlp_WriteAppPreference(self->socket, creator, number, backup, version, buf, len);
  386. if (result < 0) {
  387. self->errnop = result;
  388. - RETVAL = newSVsv(&sv_undef);
  389. + RETVAL = newSVsv(&PL_sv_undef);
  390. } else {
  391. RETVAL = newSViv(result);
  392. }
  393. @@ -2904,7 +2904,7 @@ getTime(self)
  394. int result = dlp_GetSysDateTime(self->socket, &t);
  395. if (result < 0) {
  396. self->errnop = result;
  397. - RETVAL = newSVsv(&sv_undef);
  398. + RETVAL = newSVsv(&PL_sv_undef);
  399. } else
  400. RETVAL = newSViv(t);
  401. }
  402. @@ -2929,7 +2929,7 @@ getSysInfo(self)
  403. int result = dlp_ReadSysInfo(self->socket, &si);
  404. if (result < 0) {
  405. self->errnop = result;
  406. - RETVAL = newSVsv(&sv_undef);
  407. + RETVAL = newSVsv(&PL_sv_undef);
  408. } else {
  409. HV * i = newHV();
  410. hv_store(i, "romVersion", 10, newSViv(si.romVersion), 0);\
  411. @@ -2951,7 +2951,7 @@ getCardInfo(self, cardno=0)
  412. int result = dlp_ReadStorageInfo(self->socket, cardno, &c);
  413. if (result < 0) {
  414. self->errnop = result;
  415. - RETVAL = newSVsv(&sv_undef);
  416. + RETVAL = newSVsv(&PL_sv_undef);
  417. } else {
  418. HV * i = newHV();
  419. hv_store(i, "card", 6, newSViv(c.card), 0);\
  420. @@ -3037,7 +3037,7 @@ newPref(self, creator, id=0, version=0, backup=0)
  421. croak("Default PrefClass not defined");
  422. PUSHMARK(sp);
  423. XPUSHs(newSVsv(*s));
  424. - XPUSHs(&sv_undef);
  425. + XPUSHs(&PL_sv_undef);
  426. XPUSHs(sv_2mortal(newSVChar4(creator)));
  427. if (id)
  428. XPUSHs(id);
  429. @@ -3107,7 +3107,7 @@ open(self, name, mode=0, cardno=0)
  430. result = dlp_OpenDB(self->socket, cardno, nummode, name, &handle);
  431. if (result<0) {
  432. self->errnop = result;
  433. - RETVAL = &sv_undef;
  434. + RETVAL = &PL_sv_undef;
  435. } else {
  436. int type;
  437. PDA__Pilot__DLP__DB * x = malloc(sizeof(PDA__Pilot__DLP__DB));
  438. @@ -3156,7 +3156,7 @@ create(self, name, creator, type, flags, version, card
  439. int result = dlp_CreateDB(self->socket, creator, type, cardno, flags, version, name, &handle);
  440. if (result<0) {
  441. self->errnop = result;
  442. - RETVAL = &sv_undef;
  443. + RETVAL = &PL_sv_undef;
  444. } else {
  445. PDA__Pilot__DLP__DB * x = malloc(sizeof(PDA__Pilot__DLP__DB));
  446. SV * sv = newSViv((IV)(void*)x);
  447. @@ -3224,7 +3224,7 @@ setPref(self, data)
  448. result = dlp_WriteAppPreference(self->socket, creator, id, backup, version, buf, len);
  449. if (result < 0) {
  450. self->errnop = result;
  451. - RETVAL = newSVsv(&sv_undef);
  452. + RETVAL = newSVsv(&PL_sv_undef);
  453. } else {
  454. RETVAL = newSViv(result);
  455. }
  456. @@ -3248,7 +3248,7 @@ setPrefRaw(self, data, creator, number, version, backu
  457. result = dlp_WriteAppPreference(self->socket, creator, number, backup, version, buf, len);
  458. if (result < 0) {
  459. self->errnop = result;
  460. - RETVAL = newSVsv(&sv_undef);
  461. + RETVAL = newSVsv(&PL_sv_undef);
  462. } else {
  463. RETVAL = newSViv(result);
  464. }
  465. @@ -3350,7 +3350,7 @@ findDBInfo(self, start, name, creator, type, cardno=0)
  466. else
  467. t = 0;
  468. result = dlp_FindDBInfo(self->socket, cardno, start,
  469. - SvOK(name) ? SvPV(name,na) : 0,
  470. + SvOK(name) ? SvPV(name,PL_na) : 0,
  471. t, c, &info);
  472. pack_dbinfo(RETVAL, info, result);
  473. }
  474. @@ -3367,7 +3367,7 @@ getFeature(self, creator, number)
  475. unsigned long f;
  476. int result;
  477. if ((result = dlp_ReadFeature(self->socket, creator, number, &f))<0) {
  478. - RETVAL = newSVsv(&sv_undef);
  479. + RETVAL = newSVsv(&PL_sv_undef);
  480. self->errnop = result;
  481. } else {
  482. RETVAL = newSViv(f);
  483. @@ -3397,7 +3397,7 @@ getROMToken(self,token)
  484. }
  485. void
  486. -callApplication(self, creator, type, action, data=&sv_undef)
  487. +callApplication(self, creator, type, action, data=&PL_sv_undef)
  488. PDA::Pilot::DLP *self
  489. Char4 creator
  490. Char4 type
  491. @@ -3410,7 +3410,7 @@ callApplication(self, creator, type, action, data=&sv_
  492. int result;
  493. (void)SvPV(data,len);
  494. result = dlp_CallApplication(self->socket, creator,
  495. - type, action, len, SvPV(data,na),
  496. + type, action, len, SvPV(data,PL_na),
  497. &retcode, &pibuf);
  498. EXTEND(sp, 2);
  499. if (result >= 0) {
  500. @@ -3419,7 +3419,7 @@ callApplication(self, creator, type, action, data=&sv_
  501. PUSHs(sv_2mortal(newSViv(retcode)));
  502. }
  503. } else
  504. - PUSHs(&sv_undef);
  505. + PUSHs(&PL_sv_undef);
  506. }
  507. int
  508. @@ -3530,7 +3530,7 @@ class(self, name=0)
  509. croak("DBClasses doesn't exist");
  510. if (SvOK(name)) {
  511. (void)SvPV(name, len);
  512. - s = hv_fetch(h, SvPV(name, na), len, 0);
  513. + s = hv_fetch(h, SvPV(name, PL_na), len, 0);
  514. }
  515. if (!s)
  516. s = hv_fetch(h, "", 0, 0);