From a4a07a5e1e4d8fbbcd4433b25047370ed6df85ed Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 8 Apr 2022 17:27:30 +0300 Subject: [PATCH 01/50] Update shuffle packets and keys --- src/map/packets_shuffle_main.h | 10 ++++++++-- src/map/packets_shuffle_zero.h | 7 +++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/map/packets_shuffle_main.h b/src/map/packets_shuffle_main.h index 6d4ebdcd202..f768bd790d8 100644 --- a/src/map/packets_shuffle_main.h +++ b/src/map/packets_shuffle_main.h @@ -9824,7 +9824,7 @@ packet(0x0967,clif->pSolveCharName,2); #endif -// 2021-06-30_Ragexe_1624007702, 2021-06-30_Ragexe_1625124654, 2021-06-30_Ragexe_1625564223, 2021-07-21_Ragexe_1626409768, 2021-08-04_Ragexe_1627620157, 2021-08-18_Ragexe_1628745477, 2021-09-01_Ragexe_1630029097, 2021-09-01_Ragexe_1630309867, 2021-09-15_Ragexe_1631495724, 2021-09-15_Ragexe_1631603235, 2021-09-29_Ragexe_1632459236, 2021-10-20_Ragexe_1634267486, 2021-10-20_Ragexe_1634520921, 2021-10-20_Ragexe_1634626294, 2021-11-03_Ragexe_1635824489, 2021-11-03_Ragexe_1635841038, 2021-11-03_Ragexe_1635926200, 2021-11-05_Ragexe_1636078531, 2021-11-05_Ragexe_1636095152, 2021-11-10_Ragexe_1636525031, 2021-11-17_Ragexe_1636621550, 2021-11-17_Ragexe_1637039759, 2021-11-17_Ragexe_1637052357, 2021-11-18_Ragexe_1637202460, 2021-12-01_Ragexe_1638153575, 2021-12-01_Ragexe_1638170199, 2021-12-01_Ragexe_1638249576, 2021-12-15_Ragexe_1639122152, 2021-12-17_Ragexe_1639706300, 2021-12-29_Ragexe_1640247184, 2022-01-05_Ragexe_1641372373, 2022-01-10_Ragexe_1641789537, 2022-01-19_Ragexe_1642137645, 2022-02-16_Ragexe_1644545820, 2022-02-16_Ragexe_1644896396, 2022-03-02_Ragexe_1645764335, 2022-03-16_Ragexe_1646970034, 2022-03-16_Ragexe_1647229890 +// 2021-06-30_Ragexe_1624007702, 2021-06-30_Ragexe_1625124654, 2021-06-30_Ragexe_1625564223, 2021-07-21_Ragexe_1626409768, 2021-08-04_Ragexe_1627620157, 2021-08-18_Ragexe_1628745477, 2021-09-01_Ragexe_1630029097, 2021-09-01_Ragexe_1630309867, 2021-09-15_Ragexe_1631495724, 2021-09-15_Ragexe_1631603235, 2021-09-29_Ragexe_1632459236, 2021-10-20_Ragexe_1634267486, 2021-10-20_Ragexe_1634520921, 2021-10-20_Ragexe_1634626294, 2021-11-03_Ragexe_1635824489, 2021-11-03_Ragexe_1635841038, 2021-11-03_Ragexe_1635926200, 2021-11-05_Ragexe_1636078531, 2021-11-05_Ragexe_1636095152, 2021-11-10_Ragexe_1636525031, 2021-11-17_Ragexe_1636621550, 2021-11-17_Ragexe_1637039759, 2021-11-17_Ragexe_1637052357, 2021-11-18_Ragexe_1637202460, 2021-12-01_Ragexe_1638153575, 2021-12-01_Ragexe_1638170199, 2021-12-01_Ragexe_1638249576, 2021-12-15_Ragexe_1639122152, 2021-12-17_Ragexe_1639706300, 2021-12-29_Ragexe_1640247184, 2022-01-05_Ragexe_1641372373, 2022-01-10_Ragexe_1641789537, 2022-01-19_Ragexe_1642137645, 2022-02-16_Ragexe_1644545820, 2022-02-16_Ragexe_1644896396, 2022-03-02_Ragexe_1645764335, 2022-03-16_Ragexe_1646970034, 2022-03-16_Ragexe_1647229890, 2022-03-30_Ragexe_1648110506, 2022-03-30_Ragexe_1648440293, 2022-04-01aRagexe, 2022-04-06_Ragexe_1648707856, 2022-04-06_Ragexe_1648716950, 2022-04-20_Ragexe_1649984205, 2022-04-20_Ragexe_1650331864, 2022-05-04_Ragexe_1651138297, 2022-05-04_Ragexe_1651471440, 2022-05-04_Ragexe_1651551928, 2022-05-04_Ragexe_1651630914, 2022-05-18_Ragexe_1652663707, 2022-05-18_Ragexe_1652861729 #if PACKETVER == 20210630 || \ PACKETVER == 20210721 || \ PACKETVER == 20210804 || \ @@ -9847,7 +9847,13 @@ PACKETVER == 20220119 || \ PACKETVER == 20220216 || \ PACKETVER == 20220302 || \ - PACKETVER >= 20220316 + PACKETVER == 20220316 || \ + PACKETVER == 20220330 || \ + PACKETVER == 20220401 || \ + PACKETVER == 20220406 || \ + PACKETVER == 20220420 || \ + PACKETVER == 20220504 || \ + PACKETVER >= 20220518 packet(0x0202,clif->pFriendsListAdd,2); packet(0x022d,clif->pHomMenu,2,4); packet(0x023b,clif->pStoragePassword,0); diff --git a/src/map/packets_shuffle_zero.h b/src/map/packets_shuffle_zero.h index 4153ab1219c..fac3c27eb5f 100644 --- a/src/map/packets_shuffle_zero.h +++ b/src/map/packets_shuffle_zero.h @@ -815,7 +815,7 @@ packet(0x0968,clif->pStoragePassword,0); #endif -// 2021-06-30_Ragexe_1624599911_zero, 2021-06-30_Ragexe_1624607404_zero, 2021-06-30_Ragexe_1624854348_zero, 2021-07-21_Ragexe_1625719811_zero, 2021-08-04_Ragexe_1627876396_zero, 2021-08-18_Ragexe_1628740146_zero, 2021-09-29_Ragexe_1632464403_zero, 2021-09-29_Ragexe_1632814839_zero, 2021-09-29_Ragexe_1632894566_zero, 2021-10-06_Ragexe_1633056582_zero, 2021-10-20_Ragexe_1634624271_zero, 2021-11-03_Ragexe_1635730894_zero, 2021-11-03_Ragexe_1635842843_zero, 2021-11-17_Ragexe_1636622068_zero, 2021-12-01_Ragexe_1637907717_zero, 2021-12-01_Ragexe_1637915599_zero, 2021-12-01_Ragexe_1638171799_zero, 2021-12-01_Ragexe_1638253451_zero, 2021-12-15_Ragexe_1639118645_zero, 2021-12-29_Ragexe_1640246076_zero, 2022-01-19_Ragexe_1642129078_zero, 2022-02-03_Ragexe_1643105250_zero, 2022-03-16_Ragexe_1646956311_zero +// 2021-06-30_Ragexe_1624599911_zero, 2021-06-30_Ragexe_1624607404_zero, 2021-06-30_Ragexe_1624854348_zero, 2021-07-21_Ragexe_1625719811_zero, 2021-08-04_Ragexe_1627876396_zero, 2021-08-18_Ragexe_1628740146_zero, 2021-09-29_Ragexe_1632464403_zero, 2021-09-29_Ragexe_1632814839_zero, 2021-09-29_Ragexe_1632894566_zero, 2021-10-06_Ragexe_1633056582_zero, 2021-10-20_Ragexe_1634624271_zero, 2021-11-03_Ragexe_1635730894_zero, 2021-11-03_Ragexe_1635842843_zero, 2021-11-17_Ragexe_1636622068_zero, 2021-12-01_Ragexe_1637907717_zero, 2021-12-01_Ragexe_1637915599_zero, 2021-12-01_Ragexe_1638171799_zero, 2021-12-01_Ragexe_1638253451_zero, 2021-12-15_Ragexe_1639118645_zero, 2021-12-29_Ragexe_1640246076_zero, 2022-01-19_Ragexe_1642129078_zero, 2022-02-03_Ragexe_1643105250_zero, 2022-03-16_Ragexe_1646956311_zero, 2022-04-20_Ragexe_1649992489_zero, 2022-05-04_Ragexe_1651557764_zero, 2022-05-04_Ragexe_1651567771_zero, 2022-05-18_Ragexe_1652667686_zero, 2022-05-18_Ragexe_1652861966_zero #if PACKETVER == 20210630 || \ PACKETVER == 20210721 || \ PACKETVER == 20210804 || \ @@ -830,7 +830,10 @@ PACKETVER == 20211229 || \ PACKETVER == 20220119 || \ PACKETVER == 20220203 || \ - PACKETVER >= 20220316 + PACKETVER == 20220316 || \ + PACKETVER == 20220420 || \ + PACKETVER == 20220504 || \ + PACKETVER >= 20220518 packet(0x0202,clif->pFriendsListAdd,2); packet(0x022d,clif->pHomMenu,2,4); packet(0x023b,clif->pStoragePassword,0); From c6803e997036f2e02c5ba572210e3cbeb784141c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 8 Apr 2022 17:27:30 +0300 Subject: [PATCH 02/50] Update messages --- src/map/messages_main.h | 27 +++++++++++++++++++++++++-- src/map/messages_zero.h | 27 +++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/src/map/messages_main.h b/src/map/messages_main.h index b64b067a99d..05d763d0f98 100644 --- a/src/map/messages_main.h +++ b/src/map/messages_main.h @@ -24,7 +24,7 @@ /* This file is autogenerated, please do not commit manual changes -Latest version: 20220316 +Latest version: 20220518 */ enum clif_messages { @@ -23410,8 +23410,10 @@ Burrow 상태에서는 아이템을 사용 할 수 없습니다. ^ff0000 %d일 %d시간 동안 사용 가능 ^000000 */ MSG_ID_F86 = 0xf86, -/*20220216 to latest +/*20220216 to 20220420 %s 를 선택 하셨습니다. 선택한 내용이 맞습니까? +20220504 to latest +%s(을)를 선택하셨습니다. 선택한 내용이 맞습니까? */ MSG_ID_F87 = 0xf87, #endif @@ -23445,6 +23447,27 @@ Windhawk */ MSG_ID_F8E = 0xf8e, #endif +#if PACKETVER >= 20220330 +/*20220330 to latest +미니파티창 정렬 +*/ + MSG_ID_F8F = 0xf8f, +/*20220330 to latest +균등분배 상태입니다. +파티원의 무게 또는 종류가 초과하여 아이템을 획득할 수 없습니다. +*/ + MSG_ID_F90 = 0xf90, +#endif +#if PACKETVER >= 20220518 +/*20220518 to latest +[%s]님이 [%s](으)로부터 '+%d %s' 를 획득 했습니다. +*/ + MSG_ID_F91 = 0xf91, +/*20220518 to latest +우편함을 다시 열어주세요. +*/ + MSG_ID_F92 = 0xf92, +#endif }; #endif /* MAP_MESSAGES_MAIN_H */ diff --git a/src/map/messages_zero.h b/src/map/messages_zero.h index 73e71df8eca..cebfcb086ef 100644 --- a/src/map/messages_zero.h +++ b/src/map/messages_zero.h @@ -24,7 +24,7 @@ /* This file is autogenerated, please do not commit manual changes -Latest version: 20220316 +Latest version: 20220518 */ enum clif_messages { @@ -19468,8 +19468,10 @@ Burrow 상태에서는 아이템을 사용 할 수 없습니다. ^ff0000 %d일 %d시간 동안 사용 가능 ^000000 */ MSG_ID_F86 = 0xf86, -/*20220316 to latest +/*20220316 to 20220504 %s 를 선택 하셨습니다. 선택한 내용이 맞습니까? +20220504 to latest +%s(을)를 선택하셨습니다. 선택한 내용이 맞습니까? */ MSG_ID_F87 = 0xf87, /*20220316 to latest @@ -19501,6 +19503,27 @@ Windhawk */ MSG_ID_F8E = 0xf8e, #endif +#if PACKETVER >= 20220420 +/*20220420 to latest +미니파티창 정렬 +*/ + MSG_ID_F8F = 0xf8f, +/*20220420 to latest +균등분배 상태입니다. +파티원의 무게 또는 종류가 초과하여 아이템을 획득할 수 없습니다. +*/ + MSG_ID_F90 = 0xf90, +#endif +#if PACKETVER >= 20220518 +/*20220518 to latest +[%s]님이 [%s](으)로부터 '+%d %s' 를 획득 했습니다. +*/ + MSG_ID_F91 = 0xf91, +/*20220518 to latest +우편함을 다시 열어주세요. +*/ + MSG_ID_F92 = 0xf92, +#endif }; #endif /* MAP_MESSAGES_ZERO_H */ From 20d5710815bb4fe797e9647fdab5c25f300ab016 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 8 Apr 2022 17:27:30 +0300 Subject: [PATCH 03/50] Update packets table --- src/common/packets/packets2022_len_main.h | 30 +++++++++++++++++++++++ src/common/packets/packets2022_len_zero.h | 30 +++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/src/common/packets/packets2022_len_main.h b/src/common/packets/packets2022_len_main.h index 0c3e83f82f1..1b51c9f698c 100644 --- a/src/common/packets/packets2022_len_main.h +++ b/src/common/packets/packets2022_len_main.h @@ -4808,5 +4808,35 @@ packetLen(0x0bb3, -1) packetLen(0x0bb4, 31) #endif +// Packet: 0x0bb5 +#if PACKETVER >= 20220330 +packetLen(0x0bb5, 10) +#endif + +// Packet: 0x0bb6 +#if PACKETVER >= 20220406 +packetLen(0x0bb6, 18) +#endif + +// Packet: 0x0bb7 +#if PACKETVER >= 20220406 +packetLen(0x0bb7, -1) +#endif + +// Packet: 0x0bb8 +#if PACKETVER >= 20220406 +packetLen(0x0bb8, 16) +#endif + +// Packet: 0x0bb9 +#if PACKETVER >= 20220406 +packetLen(0x0bb9, 27) +#endif + +// Packet: 0x0bba +#if PACKETVER >= 20220518 +packetLen(0x0bba, -1) +#endif + #endif /* COMMON_PACKETS2022_LEN_MAIN_H */ diff --git a/src/common/packets/packets2022_len_zero.h b/src/common/packets/packets2022_len_zero.h index 5b0f5b02ee9..efa4297ce4e 100644 --- a/src/common/packets/packets2022_len_zero.h +++ b/src/common/packets/packets2022_len_zero.h @@ -4810,5 +4810,35 @@ packetLen(0x0bb3, -1) packetLen(0x0bb4, 31) #endif +// Packet: 0x0bb5 +#if PACKETVER >= 20220420 +packetLen(0x0bb5, 10) +#endif + +// Packet: 0x0bb6 +#if PACKETVER >= 20220420 +packetLen(0x0bb6, 18) +#endif + +// Packet: 0x0bb7 +#if PACKETVER >= 20220420 +packetLen(0x0bb7, -1) +#endif + +// Packet: 0x0bb8 +#if PACKETVER >= 20220420 +packetLen(0x0bb8, 16) +#endif + +// Packet: 0x0bb9 +#if PACKETVER >= 20220420 +packetLen(0x0bb9, 27) +#endif + +// Packet: 0x0bba +#if PACKETVER >= 20220518 +packetLen(0x0bba, -1) +#endif + #endif /* COMMON_PACKETS2022_LEN_ZERO_H */ From 45ad99980b72a233c73972fb4b364aaf37bfe997 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 5 May 2022 23:09:58 +0300 Subject: [PATCH 04/50] Convert packet ZC_SAY_DIALOG into struct --- src/map/clif.c | 32 ++++++++++++++------------------ src/map/packets_struct.h | 8 ++++++++ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index adcf1f0b4c7..94162f1f507 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2279,39 +2279,35 @@ static void clif_selllist(struct map_session_data *sd) /// - append this text static void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes) { - int fd, slen; -#ifdef SCRIPT_MES_STRIP_LINEBREAK - char *stripmes = NULL; - int i; -#endif - nullpo_retv(sd); nullpo_retv(mes); - fd = sd->fd; - slen = (int)strlen(mes) + 9; + const int fd = sd->fd; + const size_t slen = strlen(mes) + 1; + const size_t len = sizeof(struct PACKET_ZC_SAY_DIALOG) + slen; Assert_retv(slen <= INT16_MAX); pc->update_idle_time(sd, BCIDLE_SCRIPT); - sd->state.dialog = 1; - WFIFOHEAD(fd, slen); - WFIFOW(fd,0) = 0xb4; - WFIFOW(fd,2) = slen; - WFIFOL(fd,4) = npcid; + WFIFOHEAD(fd, len); + struct PACKET_ZC_SAY_DIALOG *p = WFIFOP(fd, 0); + + p->PacketType = HEADER_ZC_SAY_DIALOG; + p->PacketLength = len; + p->NpcID = npcid; #ifdef SCRIPT_MES_STRIP_LINEBREAK - stripmes = aStrdup(mes); - for (i = 0; stripmes[i] != '\0'; ++i) { + char *stripmes = aStrdup(mes); + for (int i = 0; stripmes[i] != '\0'; ++i) { if (stripmes[i] == '\r') stripmes[i] = ' '; } - memcpy(WFIFOP(fd,8), stripmes, slen-8); + memcpy(p->message, stripmes, slen); aFree(stripmes); #else // ! SCRIPT_MES_STRIP_LINEBREAK - memcpy(WFIFOP(fd,8), mes, slen-8); + memcpy(p->message, mes, slen); #endif // SCRIPT_MES_STRIP_LINEBREAK - WFIFOSET(fd,WFIFOW(fd,2)); + WFIFOSET(fd, len); } static void clif_zc_quest_dialog(struct map_session_data *sd, int npcid, const char *mes) diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 5fdb3038bfb..ad65a14a3a0 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5528,6 +5528,14 @@ struct PACKET_ZC_SPIRITS { } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_SPIRITS, 0x01d0) +struct PACKET_ZC_SAY_DIALOG { + int16 PacketType; + int16 PacketLength; + uint32 NpcID; + char message[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SAY_DIALOG, 0x00b4) + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris From 9418481fc05f4805cf63628770f84641b267d49a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 00:48:22 +0300 Subject: [PATCH 05/50] Add packet ZC_SAY_DIALOG2 --- src/map/clif.c | 44 ++++++++++++++++++++++++++++++++++++++++ src/map/clif.h | 1 + src/map/packets_struct.h | 19 +++++++++++++++++ 3 files changed, 64 insertions(+) diff --git a/src/map/clif.c b/src/map/clif.c index 94162f1f507..8fc1d0b7a4a 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2310,6 +2310,49 @@ static void clif_scriptmes(struct map_session_data *sd, int npcid, const char *m WFIFOSET(fd, len); } +/// Displays an NPC dialog message (ZC_SAY_DIALOG2). +/// Client behavior (dialog window): +/// - disable mouse targeting +/// - open the dialog window +/// - set npcid of dialog window (0 by default) +/// - if set to clear on next mes, clear contents +/// - append this text +static void clif_scriptmes2(struct map_session_data *sd, int npcid, const char *mes, int type) +{ + nullpo_retv(sd); + nullpo_retv(mes); + + const int fd = sd->fd; + const size_t slen = strlen(mes) + 1; + const size_t len = sizeof(struct PACKET_ZC_SAY_DIALOG2) + slen; + Assert_retv(slen <= INT16_MAX); + + pc->update_idle_time(sd, BCIDLE_SCRIPT); + sd->state.dialog = 1; + + WFIFOHEAD(fd, len); + struct PACKET_ZC_SAY_DIALOG2 *p = WFIFOP(fd, 0); + + p->PacketType = HEADER_ZC_SAY_DIALOG2; + p->PacketLength = len; + p->NpcID = npcid; +#if PACKETVER_MAIN_NUM >= 20220504 + p->type = type; +#endif // PACKETVER_MAIN_NUM >= 20220504 +#ifdef SCRIPT_MES_STRIP_LINEBREAK + char *stripmes = aStrdup(mes); + for (int i = 0; stripmes[i] != '\0'; ++i) { + if (stripmes[i] == '\r') + stripmes[i] = ' '; + } + memcpy(p->message, stripmes, slen); + aFree(stripmes); +#else // ! SCRIPT_MES_STRIP_LINEBREAK + memcpy(p->message, mes, slen); +#endif // SCRIPT_MES_STRIP_LINEBREAK + WFIFOSET(fd, len); +} + static void clif_zc_quest_dialog(struct map_session_data *sd, int npcid, const char *mes) { #if PACKETVER_ZERO_NUM >= 20210721 @@ -25739,6 +25782,7 @@ void clif_defaults(void) clif->cashshop_ack = clif_cashshop_ack; /* npc-script-related */ clif->scriptmes = clif_scriptmes; + clif->scriptmes2 = clif_scriptmes2; clif->zc_quest_dialog = clif_zc_quest_dialog; clif->zc_monolog_dialog = clif_zc_monolog_dialog; clif->scriptnext = clif_scriptnext; diff --git a/src/map/clif.h b/src/map/clif.h index b82b8bb32b3..5215c1e29a1 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -990,6 +990,7 @@ struct clif_interface { void (*cashshop_ack) (struct map_session_data* sd, int error); /* npc-script-related */ void (*scriptmes) (struct map_session_data *sd, int npcid, const char *mes); + void (*scriptmes2) (struct map_session_data *sd, int npcid, const char *mes, int type); void (*zc_quest_dialog) (struct map_session_data *sd, int npcid, const char *mes); void (*zc_monolog_dialog) (struct map_session_data *sd, int npcid, const char *mes); void (*scriptnext) (struct map_session_data *sd,int npcid); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index ad65a14a3a0..57181cef1c1 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5536,6 +5536,25 @@ struct PACKET_ZC_SAY_DIALOG { } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_SAY_DIALOG, 0x00b4) +#if PACKETVER_MAIN_NUM >= 20220504 +struct PACKET_ZC_SAY_DIALOG2 { + int16 PacketType; + int16 PacketLength; + uint32 NpcID; + uint8 type; + char message[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SAY_DIALOG2, 0x0972) +#else // PACKETVER_MAIN_NUM >= 20220504 +struct PACKET_ZC_SAY_DIALOG2 { + int16 PacketType; + int16 PacketLength; + uint32 NpcID; + char message[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SAY_DIALOG2, 0x00b4) +#endif // PACKETVER_MAIN_NUM >= 20220504 + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris From 451dc492ce000501672a108d292eb4bb7944870d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 01:25:44 +0300 Subject: [PATCH 06/50] Add script command mes2 --- doc/script_commands.txt | 9 +++++++++ src/map/script.c | 31 +++++++++++++++++++++++++++++ src/map/script.h | 1 + src/plugins/generate-translations.c | 1 + 4 files changed, 42 insertions(+) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 21e6b53aed5..adb242b5869 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -1411,6 +1411,15 @@ Works only in zero clients starting from 20210721. --------------------------------------- +*mes2(""{, type}) + +This command will displays a box on the screen for the invoking character. +Work same as *mes* except positionting window with text at bottom. + +Works only on main client starting from 20220504. + +--------------------------------------- + *next() This command will display a 'next' button in the message window for the diff --git a/src/map/script.c b/src/map/script.c index 33c0adf0c53..6fe1a24ce26 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6443,6 +6443,35 @@ static BUILDIN(mes) return true; } +///////////////////////////////////////////////////////////////////// +// NPC interaction +// + +/// Appends a message to the npc dialog in format 2. +/// If a dialog doesn't exist yet, one is created. +/// +/// mes2 "", type; +/// mes2 ""; +static BUILDIN(mes2) +{ + struct map_session_data *sd = script->rid2sd(st); + + if (sd == NULL) + return true; + + if (script_hasdata(st, 2)) { + if (script_hasdata(st, 3)) { + clif->scriptmes2(sd, st->oid, script_getstr(st, 2), script_getnum(st, 3)); + } else { + clif->scriptmes2(sd, st->oid, script_getstr(st, 2), 0); + } + } else { + clif->scriptmes2(sd, st->oid, "", 0); + } + + return true; +} + /** * Appends a message to the npc dialog, applying format string conversions (see * sprintf). @@ -27725,6 +27754,7 @@ static bool script_add_builtin(const struct script_function *buildin, bool overr else if( strcmp(buildin->name, "callfunc") == 0 ) script->buildin_callfunc_ref = n; else if( strcmp(buildin->name, "getelementofarray") == 0 ) script->buildin_getelementofarray_ref = n; else if( strcmp(buildin->name, "mes") == 0 ) script->buildin_mes_offset = script->buildin_count; + else if( strcmp(buildin->name, "mes2") == 0 ) script->buildin_mes2_offset = script->buildin_count; else if( strcmp(buildin->name, "zmes1") == 0 ) script->buildin_zmes1_offset = script->buildin_count; else if( strcmp(buildin->name, "zmes2") == 0 ) script->buildin_zmes2_offset = script->buildin_count; else if( strcmp(buildin->name, "mesf") == 0 ) script->buildin_mesf_offset = script->buildin_count; @@ -27892,6 +27922,7 @@ static void script_parse_builtin(void) // NPC interaction BUILDIN_DEF(mes, "?"), + BUILDIN_DEF(mes2, "*"), BUILDIN_DEF(zmes1, "?"), BUILDIN_DEF(zmes2, "?"), BUILDIN_DEF(mesf, "s*"), diff --git a/src/map/script.h b/src/map/script.h index 03fdc2a1232..70cafa40155 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -879,6 +879,7 @@ struct script_interface { const char *parser_current_npc_name; /* */ int buildin_mes_offset; + int buildin_mes2_offset; int buildin_zmes1_offset; int buildin_zmes2_offset; int buildin_mesf_offset; diff --git a/src/plugins/generate-translations.c b/src/plugins/generate-translations.c index f0135862936..7f71a1e85ce 100644 --- a/src/plugins/generate-translations.c +++ b/src/plugins/generate-translations.c @@ -116,6 +116,7 @@ void script_add_translatable_string_posthook(const struct script_string_buf *str if (!duplicate) { if (script->syntax.last_func == script->buildin_mes_offset + || script->syntax.last_func == script->buildin_mes2_offset || script->syntax.last_func == script->buildin_zmes1_offset || script->syntax.last_func == script->buildin_zmes2_offset || script->syntax.last_func == script->buildin_select_offset From 86daf55b20b4393ad289e397acd360e5707df224 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 01:47:58 +0300 Subject: [PATCH 07/50] Add script function mes2f --- doc/script_commands.txt | 9 ++++++++ src/map/script.c | 34 +++++++++++++++++++++++++++++ src/map/script.h | 1 + src/plugins/generate-translations.c | 1 + 4 files changed, 45 insertions(+) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index adb242b5869..275807f0a88 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -1420,6 +1420,15 @@ Works only on main client starting from 20220504. --------------------------------------- +*mes2f(""{, {, {, ...{, type}}}}) + +This command will displays a box on the screen for the invoking character. +Works same as *mesf* except positionting window with text at bottom. + +Works only on main client starting from 20220504. + +--------------------------------------- + *next() This command will display a 'next' button in the message window for the diff --git a/src/map/script.c b/src/map/script.c index 6fe1a24ce26..f01d5242140 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6503,6 +6503,38 @@ static BUILDIN(mesf) return true; } +/** + * Appends a message to the npc dialog, applying format string conversions (see + * sprintf). + * + * If a dialog doesn't exist yet, one is created. + * + * @code + * mes2f ""; + * mes2f "", type; + * @endcode + */ +static BUILDIN(mes2f) +{ + struct map_session_data *sd = script->rid2sd(st); + struct StringBuf buf; + + if (sd == NULL) + return true; + + StrBuf->Init(&buf); + + if (!script->sprintf_helper(st, 2, &buf)) { + StrBuf->Destroy(&buf); + return false; + } + + clif->scriptmes2(sd, st->oid, StrBuf->Value(&buf), script_lastdata(st)); + StrBuf->Destroy(&buf); + + return true; +} + /// Appends a message to the npc dialog. /// If a dialog doesn't exist yet, one is created. /// @@ -27758,6 +27790,7 @@ static bool script_add_builtin(const struct script_function *buildin, bool overr else if( strcmp(buildin->name, "zmes1") == 0 ) script->buildin_zmes1_offset = script->buildin_count; else if( strcmp(buildin->name, "zmes2") == 0 ) script->buildin_zmes2_offset = script->buildin_count; else if( strcmp(buildin->name, "mesf") == 0 ) script->buildin_mesf_offset = script->buildin_count; + else if( strcmp(buildin->name, "mes2f") == 0 ) script->buildin_mes2f_offset = script->buildin_count; else if( strcmp(buildin->name, "zmes1f") == 0 ) script->buildin_zmes1f_offset = script->buildin_count; else if( strcmp(buildin->name, "zmes2f") == 0 ) script->buildin_zmes2f_offset = script->buildin_count; else if( strcmp(buildin->name, "select") == 0 ) script->buildin_select_offset = script->buildin_count; @@ -27926,6 +27959,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(zmes1, "?"), BUILDIN_DEF(zmes2, "?"), BUILDIN_DEF(mesf, "s*"), + BUILDIN_DEF(mes2f, "s*"), BUILDIN_DEF(zmes1f, "s*"), BUILDIN_DEF(zmes2f, "s*"), BUILDIN_DEF(next,""), diff --git a/src/map/script.h b/src/map/script.h index 70cafa40155..f960c0d7f79 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -883,6 +883,7 @@ struct script_interface { int buildin_zmes1_offset; int buildin_zmes2_offset; int buildin_mesf_offset; + int buildin_mes2f_offset; int buildin_zmes1f_offset; int buildin_zmes2f_offset; int buildin_select_offset; diff --git a/src/plugins/generate-translations.c b/src/plugins/generate-translations.c index 7f71a1e85ce..71ba371c2f2 100644 --- a/src/plugins/generate-translations.c +++ b/src/plugins/generate-translations.c @@ -124,6 +124,7 @@ void script_add_translatable_string_posthook(const struct script_string_buf *str ) { is_translatable_string = true; } else if (script->syntax.last_func == script->buildin_mesf_offset + || script->syntax.last_func == script->buildin_mes2f_offset || script->syntax.last_func == script->buildin_zmes1f_offset || script->syntax.last_func == script->buildin_zmes2f_offset || script->syntax.lang_macro_fmtstring_active From e82f480259f0f6c72bbac7a6030d0b5ad29f0e47 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 02:24:41 +0300 Subject: [PATCH 08/50] Convert packet ZC_WAIT_DIALOG into struct --- src/map/clif.c | 13 ++++++------- src/map/packets_struct.h | 6 ++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 8fc1d0b7a4a..2eec2b74e1f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2435,17 +2435,16 @@ static void clif_zc_monolog_dialog(struct map_session_data *sd, int npcid, const /// - remove 'next' button static void clif_scriptnext(struct map_session_data *sd, int npcid) { - int fd; - nullpo_retv(sd); pc->update_idle_time(sd, BCIDLE_SCRIPT); - fd=sd->fd; - WFIFOHEAD(fd, packet_len(0xb5)); - WFIFOW(fd,0)=0xb5; - WFIFOL(fd,2)=npcid; - WFIFOSET(fd,packet_len(0xb5)); + int fd = sd->fd; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_WAIT_DIALOG)); + struct PACKET_ZC_WAIT_DIALOG *p = WFIFOP(fd, 0); + p->PacketType = HEADER_ZC_WAIT_DIALOG; + p->NpcID = npcid; + WFIFOSET(fd, sizeof(struct PACKET_ZC_WAIT_DIALOG)); } /// Adds a 'close' button to an NPC dialog (ZC_CLOSE_DIALOG). diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 57181cef1c1..e12f7f6ea75 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5555,6 +5555,12 @@ struct PACKET_ZC_SAY_DIALOG2 { DEFINE_PACKET_HEADER(ZC_SAY_DIALOG2, 0x00b4) #endif // PACKETVER_MAIN_NUM >= 20220504 +struct PACKET_ZC_WAIT_DIALOG { + int16 PacketType; + uint32 NpcID; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_WAIT_DIALOG, 0x00b5) + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris From c9e1850de1a1a2f0c5bcfc2761d14a53eb689bd1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 02:43:59 +0300 Subject: [PATCH 09/50] Add packet ZC_WAIT_DIALOG2 --- src/map/clif.c | 27 +++++++++++++++++++++++++++ src/map/clif.h | 1 + src/map/packets_struct.h | 15 +++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/src/map/clif.c b/src/map/clif.c index 2eec2b74e1f..cda4058725a 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2447,6 +2447,32 @@ static void clif_scriptnext(struct map_session_data *sd, int npcid) WFIFOSET(fd, sizeof(struct PACKET_ZC_WAIT_DIALOG)); } +/// Adds a 'next' button to an NPC dialog (ZC_WAIT_DIALOG). +/// Client behavior (dialog window): +/// - disable mouse targeting +/// - open the dialog window +/// - add 'next' button +/// When 'next' is pressed: +/// - 00B9 .L +/// - set to clear on next mes +/// - remove 'next' button +static void clif_scriptnext2(struct map_session_data *sd, int npcid, int type) +{ + nullpo_retv(sd); + + pc->update_idle_time(sd, BCIDLE_SCRIPT); + + int fd = sd->fd; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_WAIT_DIALOG2)); + struct PACKET_ZC_WAIT_DIALOG2 *p = WFIFOP(fd, 0); + p->PacketType = HEADER_ZC_WAIT_DIALOG2; + p->NpcID = npcid; +#if PACKETVER_MAIN_NUM >= 20220504 + p->type = type; +#endif // PACKETVER_MAIN_NUM >= 20220504 + WFIFOSET(fd, sizeof(struct PACKET_ZC_WAIT_DIALOG2)); +} + /// Adds a 'close' button to an NPC dialog (ZC_CLOSE_DIALOG). /// 00b6 .L /// Client behavior: @@ -25785,6 +25811,7 @@ void clif_defaults(void) clif->zc_quest_dialog = clif_zc_quest_dialog; clif->zc_monolog_dialog = clif_zc_monolog_dialog; clif->scriptnext = clif_scriptnext; + clif->scriptnext2 = clif_scriptnext2; clif->scriptclose = clif_scriptclose; clif->scriptmenu = clif_scriptmenu; clif->zc_quest_dialog_menu_list = clif_zc_quest_dialog_menu_list; diff --git a/src/map/clif.h b/src/map/clif.h index 5215c1e29a1..c6eb3a76336 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -994,6 +994,7 @@ struct clif_interface { void (*zc_quest_dialog) (struct map_session_data *sd, int npcid, const char *mes); void (*zc_monolog_dialog) (struct map_session_data *sd, int npcid, const char *mes); void (*scriptnext) (struct map_session_data *sd,int npcid); + void (*scriptnext2) (struct map_session_data *sd, int npcid, int type); void (*scriptclose) (struct map_session_data *sd, int npcid); void (*scriptmenu) (struct map_session_data* sd, int npcid, const char* mes); void (*zc_quest_dialog_menu_list) (struct map_session_data* sd, int npcid, const char* mes); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index e12f7f6ea75..4496dd9874e 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5561,6 +5561,21 @@ struct PACKET_ZC_WAIT_DIALOG { } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_WAIT_DIALOG, 0x00b5) +#if PACKETVER_MAIN_NUM >= 20220504 +struct PACKET_ZC_WAIT_DIALOG2 { + int16 PacketType; + uint32 NpcID; + uint8 type; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_WAIT_DIALOG2, 0x0973) +#else // PACKETVER_MAIN_NUM >= 20220504 +struct PACKET_ZC_WAIT_DIALOG2 { + int16 PacketType; + uint32 NpcID; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_WAIT_DIALOG2, 0x00b5) +#endif // PACKETVER_MAIN_NUM >= 20220504 + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris From 86df5460ab83044ccc82230cedc66f4dca2d1be0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 16:53:23 +0300 Subject: [PATCH 10/50] Add script command next2 --- doc/script_commands.txt | 11 +++++++++++ src/map/script.c | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 275807f0a88..b51823a57cd 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -1448,6 +1448,17 @@ and the script will terminate. --------------------------------------- +*next2() +*next2(type) + +This command will display a 'next' button in the message window for the +invoking character. +Work same as *next* but should be used with *mes2*. + +Works only on main client starting from 20220504. + +--------------------------------------- + *mesclear(); This command will clear the dialog text and continue the script without player interaction. diff --git a/src/map/script.c b/src/map/script.c index f01d5242140..c5cf1ee3b37 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6632,6 +6632,26 @@ static BUILDIN(next) return true; } +/// Displays the button 'next' in the npc dialog. +/// The dialog text is cleared and the script continues when the button is pressed. +/// +/// next; +static BUILDIN(next2) +{ + struct map_session_data *sd = script->rid2sd(st); + if (sd == NULL) + return true; +#ifdef SECURE_NPCTIMEOUT + sd->npc_idle_type = NPCT_WAIT; +#endif + st->state = STOP; + if (script_hasdata(st, 2)) + clif->scriptnext2(sd, st->oid, script_getnum(st, 2)); + else + clif->scriptnext2(sd, st->oid, 0); + return true; +} + /// Clears the NPC dialog and continues the script without press next button. /// /// mesclear(); @@ -27963,6 +27983,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(zmes1f, "s*"), BUILDIN_DEF(zmes2f, "s*"), BUILDIN_DEF(next,""), + BUILDIN_DEF(next2,"?"), BUILDIN_DEF(mesclear,""), BUILDIN_DEF(close,""), BUILDIN_DEF(close2,""), From d7fb73ed8d4e6be01b83cf281e5694a85ecb29fe Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 18:08:26 +0300 Subject: [PATCH 11/50] Add packet ZC_DIALOG_WINDOW_SIZE --- src/map/clif.c | 17 +++++++++++++++++ src/map/clif.h | 1 + src/map/packets_struct.h | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/map/clif.c b/src/map/clif.c index cda4058725a..951952a114f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -25382,6 +25382,21 @@ static void clif_announce_grade_status(struct map_session_data *sd, int item_id, #endif } +static void clif_set_npc_window_size(struct map_session_data *sd, int width, int height) +{ +#if PACKETVER_MAIN_NUM >= 20220504 + nullpo_retv(sd); + + const int fd = sd->fd; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_DIALOG_WINDOW_SIZE)); + struct PACKET_ZC_DIALOG_WINDOW_SIZE *p = WFIFOP(fd, 0); + p->PacketType = HEADER_ZC_DIALOG_WINDOW_SIZE; + p->width = width; + p->height = height; + WFIFOSET(fd, sizeof(struct PACKET_ZC_DIALOG_WINDOW_SIZE)); +#endif // PACKETVER_MAIN_NUM >= 20220504 +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -26689,6 +26704,8 @@ void clif_defaults(void) clif->setlevel_sub = clif_setlevel_sub; clif->load_end_ack_sub_messages = clif_load_end_ack_sub_messages; clif->sub_guild_invite = clif_sub_guild_invite; + clif->set_npc_window_size = clif_set_npc_window_size; + clif->parse_cmd_normal = clif_parse_cmd_normal; clif->parse_cmd_decrypt = clif_parse_cmd_decrypt; clif->parse_cmd_optional = clif_parse_cmd_optional; diff --git a/src/map/clif.h b/src/map/clif.h index c6eb3a76336..785f005456c 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1868,6 +1868,7 @@ struct clif_interface { int (*setlevel_sub) (int lv); void (*load_end_ack_sub_messages) (struct map_session_data *sd, bool connect_new, bool change_map); bool (*sub_guild_invite) (int fd, struct map_session_data *sd, struct map_session_data *t_sd); + void (*set_npc_window_size) (struct map_session_data *sd, int width, int height); unsigned short (*parse_cmd_normal) (int fd, struct map_session_data *sd); unsigned short (*parse_cmd_decrypt) (int fd, struct map_session_data *sd); unsigned short (*parse_cmd_optional) (int fd, struct map_session_data *sd); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 4496dd9874e..0fc734eb8e8 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5576,6 +5576,15 @@ struct PACKET_ZC_WAIT_DIALOG2 { DEFINE_PACKET_HEADER(ZC_WAIT_DIALOG2, 0x00b5) #endif // PACKETVER_MAIN_NUM >= 20220504 +#if PACKETVER_MAIN_NUM >= 20220504 +struct PACKET_ZC_DIALOG_WINDOW_SIZE { + int16 PacketType; + int height; + int width; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_DIALOG_WINDOW_SIZE, 0x0ba2) +#endif // PACKETVER_MAIN_NUM >= 20220504 + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris From 03374de7e381fedac01db962c28c368adc509196 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 18:57:50 +0300 Subject: [PATCH 12/50] Add script command for set npc window dialog size New script command: setdialogsize --- doc/script_commands.txt | 9 +++++++++ npc/custom/dialogpossize.txt | 25 +++++++++++++++++++++++++ npc/scripts_custom.conf | 1 + src/map/script.c | 16 ++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 npc/custom/dialogpossize.txt diff --git a/doc/script_commands.txt b/doc/script_commands.txt index b51823a57cd..b92df73870c 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -10949,6 +10949,15 @@ vertical align: Works from clients: main 20210203, re 20211103 --------------------------------------- + +*setdialogsize(, ) + +Set size for npc dialog. + +Works from clients: main 20220504. + +--------------------------------------- + *opengradeui() Opens Grade Enchant user interface for the player diff --git a/npc/custom/dialogpossize.txt b/npc/custom/dialogpossize.txt new file mode 100644 index 00000000000..3ee4e85a889 --- /dev/null +++ b/npc/custom/dialogpossize.txt @@ -0,0 +1,25 @@ +//===== Hercules Script ====================================== +//= Dialog text pos/size demo +//===== By: ================================================== +//= 4144 +//===== Current Version: ===================================== +//= 1.0 +//===== Description: ========================================= +//= Dialog pos and size demo in prontera. +//============================================================ + +prontera,162,286,4 script Pos / Size demo#prt 4_M_KID1,{ + mes("setdialogsize(400, 100)"); + mes("select next ..."); + next; + setdialogsize(400, 100); + next; + + mes("setdialogsize(700, 500)"); + mes("select next ..."); + next; + setdialogsize(700, 500); + next; + + close; +} diff --git a/npc/scripts_custom.conf b/npc/scripts_custom.conf index 4b879e62c5f..5412b1499d8 100644 --- a/npc/scripts_custom.conf +++ b/npc/scripts_custom.conf @@ -54,6 +54,7 @@ //"npc/custom/expandedbartershop.txt", //"npc/custom/zeroui.txt", //"npc/custom/dialogalign.txt", +//"npc/custom/dialogpossize.txt", //================= Other Scripts ========================================= // -- MVP Arena diff --git a/src/map/script.c b/src/map/script.c index c5cf1ee3b37..bac90cb6a39 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -27745,6 +27745,21 @@ static BUILDIN(opengradeui) #endif } +static BUILDIN(setdialogsize) +{ +#if PACKETVER_MAIN_NUM >= 20220504 + struct map_session_data *sd = script_rid2sd(st); + + if (sd == NULL) { + script_pushint(st, 0); + return false; + } + + clif->set_npc_window_size(sd, script_getnum(st, 2), script_getnum(st, 3)); + return true; +#endif +} + /** * Adds a built-in script function. * @@ -28045,6 +28060,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(setparam,"ii?"), BUILDIN_DEF(getcharid,"i?"), BUILDIN_DEF(getnpcid, "?"), + BUILDIN_DEF(setdialogsize, "ii"), BUILDIN_DEF(getpartyname,"i"), BUILDIN_DEF(getpartymember,"i?"), BUILDIN_DEF(getpartyleader,"i?"), From ac3797f343f09ae494c45dcf3455be6c81d5445e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 19:07:43 +0300 Subject: [PATCH 13/50] Add packet ZC_DIALOG_WINDOW_POS --- src/map/clif.c | 16 ++++++++++++++++ src/map/clif.h | 1 + src/map/packets_struct.h | 9 +++++++++ 3 files changed, 26 insertions(+) diff --git a/src/map/clif.c b/src/map/clif.c index 951952a114f..f5744b1feda 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -25397,6 +25397,21 @@ static void clif_set_npc_window_size(struct map_session_data *sd, int width, int #endif // PACKETVER_MAIN_NUM >= 20220504 } +static void clif_set_npc_window_pos(struct map_session_data *sd, int x, int y) +{ +#if PACKETVER_MAIN_NUM >= 20220504 + nullpo_retv(sd); + + const int fd = sd->fd; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_DIALOG_WINDOW_POS)); + struct PACKET_ZC_DIALOG_WINDOW_POS *p = WFIFOP(fd, 0); + p->PacketType = HEADER_ZC_DIALOG_WINDOW_POS; + p->x = x; + p->y = y; + WFIFOSET(fd, sizeof(struct PACKET_ZC_DIALOG_WINDOW_POS)); +#endif // PACKETVER_MAIN_NUM >= 20220504 +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -26705,6 +26720,7 @@ void clif_defaults(void) clif->load_end_ack_sub_messages = clif_load_end_ack_sub_messages; clif->sub_guild_invite = clif_sub_guild_invite; clif->set_npc_window_size = clif_set_npc_window_size; + clif->set_npc_window_pos = clif_set_npc_window_pos; clif->parse_cmd_normal = clif_parse_cmd_normal; clif->parse_cmd_decrypt = clif_parse_cmd_decrypt; diff --git a/src/map/clif.h b/src/map/clif.h index 785f005456c..3a62ff5e993 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1869,6 +1869,7 @@ struct clif_interface { void (*load_end_ack_sub_messages) (struct map_session_data *sd, bool connect_new, bool change_map); bool (*sub_guild_invite) (int fd, struct map_session_data *sd, struct map_session_data *t_sd); void (*set_npc_window_size) (struct map_session_data *sd, int width, int height); + void (*set_npc_window_pos) (struct map_session_data *sd, int x, int y); unsigned short (*parse_cmd_normal) (int fd, struct map_session_data *sd); unsigned short (*parse_cmd_decrypt) (int fd, struct map_session_data *sd); unsigned short (*parse_cmd_optional) (int fd, struct map_session_data *sd); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 0fc734eb8e8..7386f12f8d9 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5585,6 +5585,15 @@ struct PACKET_ZC_DIALOG_WINDOW_SIZE { DEFINE_PACKET_HEADER(ZC_DIALOG_WINDOW_SIZE, 0x0ba2) #endif // PACKETVER_MAIN_NUM >= 20220504 +#if PACKETVER_MAIN_NUM >= 20220504 +struct PACKET_ZC_DIALOG_WINDOW_POS { + int16 PacketType; + int x; + int y; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_DIALOG_WINDOW_POS, 0x0ba3) +#endif // PACKETVER_MAIN_NUM >= 20220504 + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris From f49304e2716fcc9a406f9c94fcb53fae349a1f34 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 19:19:05 +0300 Subject: [PATCH 14/50] Add script command for set npc dialog window position New script command: setdialogpos --- doc/script_commands.txt | 8 ++++++++ npc/custom/dialogpossize.txt | 4 ++++ src/map/script.c | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index b92df73870c..bcb5b25ecf9 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -10958,6 +10958,14 @@ Works from clients: main 20220504. --------------------------------------- +*setdialogpos(, ) + +Set position for npc dialog in pixels. + +Works from clients: main 20220504. + +--------------------------------------- + *opengradeui() Opens Grade Enchant user interface for the player diff --git a/npc/custom/dialogpossize.txt b/npc/custom/dialogpossize.txt index 3ee4e85a889..23144475021 100644 --- a/npc/custom/dialogpossize.txt +++ b/npc/custom/dialogpossize.txt @@ -9,15 +9,19 @@ //============================================================ prontera,162,286,4 script Pos / Size demo#prt 4_M_KID1,{ + mes("setdialogpos(100, 100)"); mes("setdialogsize(400, 100)"); mes("select next ..."); next; + setdialogpos(100, 100); setdialogsize(400, 100); next; + mes("setdialogpos(200, 150)"); mes("setdialogsize(700, 500)"); mes("select next ..."); next; + setdialogpos(200, 150); setdialogsize(700, 500); next; diff --git a/src/map/script.c b/src/map/script.c index bac90cb6a39..cfba9fc3826 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -27760,6 +27760,21 @@ static BUILDIN(setdialogsize) #endif } +static BUILDIN(setdialogpos) +{ +#if PACKETVER_MAIN_NUM >= 20220504 + struct map_session_data *sd = script_rid2sd(st); + + if (sd == NULL) { + script_pushint(st, 0); + return false; + } + + clif->set_npc_window_pos(sd, script_getnum(st, 2), script_getnum(st, 3)); + return true; +#endif +} + /** * Adds a built-in script function. * @@ -28061,6 +28076,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(getcharid,"i?"), BUILDIN_DEF(getnpcid, "?"), BUILDIN_DEF(setdialogsize, "ii"), + BUILDIN_DEF(setdialogpos, "ii"), BUILDIN_DEF(getpartyname,"i"), BUILDIN_DEF(getpartymember,"i?"), BUILDIN_DEF(getpartyleader,"i?"), From 3a9961ebdb49f3be01f1d9126779cbc3b15d73f2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 21:52:49 +0300 Subject: [PATCH 15/50] Add packet ZC_DIALOG_WINDOW_POS_PERCENT --- src/map/clif.c | 16 ++++++++++++++++ src/map/clif.h | 1 + src/map/packets_struct.h | 9 +++++++++ 3 files changed, 26 insertions(+) diff --git a/src/map/clif.c b/src/map/clif.c index f5744b1feda..2a97acc05ff 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -25412,6 +25412,21 @@ static void clif_set_npc_window_pos(struct map_session_data *sd, int x, int y) #endif // PACKETVER_MAIN_NUM >= 20220504 } +static void clif_set_npc_window_pos_percent(struct map_session_data *sd, int x, int y) +{ +#if PACKETVER_MAIN_NUM >= 20220504 + nullpo_retv(sd); + + const int fd = sd->fd; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_DIALOG_WINDOW_POS2)); + struct PACKET_ZC_DIALOG_WINDOW_POS *p = WFIFOP(fd, 0); + p->PacketType = HEADER_ZC_DIALOG_WINDOW_POS2; + p->x = x; + p->y = y; + WFIFOSET(fd, sizeof(struct PACKET_ZC_DIALOG_WINDOW_POS2)); +#endif // PACKETVER_MAIN_NUM >= 20220504 +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -26721,6 +26736,7 @@ void clif_defaults(void) clif->sub_guild_invite = clif_sub_guild_invite; clif->set_npc_window_size = clif_set_npc_window_size; clif->set_npc_window_pos = clif_set_npc_window_pos; + clif->set_npc_window_pos_percent = clif_set_npc_window_pos_percent; clif->parse_cmd_normal = clif_parse_cmd_normal; clif->parse_cmd_decrypt = clif_parse_cmd_decrypt; diff --git a/src/map/clif.h b/src/map/clif.h index 3a62ff5e993..13a4f1623c9 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1870,6 +1870,7 @@ struct clif_interface { bool (*sub_guild_invite) (int fd, struct map_session_data *sd, struct map_session_data *t_sd); void (*set_npc_window_size) (struct map_session_data *sd, int width, int height); void (*set_npc_window_pos) (struct map_session_data *sd, int x, int y); + void (*set_npc_window_pos_percent) (struct map_session_data *sd, int x, int y); unsigned short (*parse_cmd_normal) (int fd, struct map_session_data *sd); unsigned short (*parse_cmd_decrypt) (int fd, struct map_session_data *sd); unsigned short (*parse_cmd_optional) (int fd, struct map_session_data *sd); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 7386f12f8d9..6ceb04f9186 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5594,6 +5594,15 @@ struct PACKET_ZC_DIALOG_WINDOW_POS { DEFINE_PACKET_HEADER(ZC_DIALOG_WINDOW_POS, 0x0ba3) #endif // PACKETVER_MAIN_NUM >= 20220504 +#if PACKETVER_MAIN_NUM >= 20220504 +struct PACKET_ZC_DIALOG_WINDOW_POS2 { + int16 PacketType; + int x; + int y; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_DIALOG_WINDOW_POS2, 0x0bb5) +#endif // PACKETVER_MAIN_NUM >= 20220504 + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris From b95af40174ad4309d887bbb58babc471b6a78f62 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 May 2022 22:33:05 +0300 Subject: [PATCH 16/50] Add script function for move npc dialog window at given percent screen position New script function setdialogpospercent. --- doc/script_commands.txt | 8 ++++++++ npc/custom/dialogpossize.txt | 28 ++++++++++++++++++++++++---- src/map/script.c | 16 ++++++++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index bcb5b25ecf9..fb37473f4df 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -10966,6 +10966,14 @@ Works from clients: main 20220504. --------------------------------------- +*setdialogpospercent(, ) + +Set position for npc dialog in screen size percent. + +Works from clients: main 20220504. + +--------------------------------------- + *opengradeui() Opens Grade Enchant user interface for the player diff --git a/npc/custom/dialogpossize.txt b/npc/custom/dialogpossize.txt index 23144475021..eaaba5e9864 100644 --- a/npc/custom/dialogpossize.txt +++ b/npc/custom/dialogpossize.txt @@ -9,20 +9,40 @@ //============================================================ prontera,162,286,4 script Pos / Size demo#prt 4_M_KID1,{ - mes("setdialogpos(100, 100)"); mes("setdialogsize(400, 100)"); + mes("setdialogpos(100, 100)"); mes("select next ..."); next; - setdialogpos(100, 100); setdialogsize(400, 100); + setdialogpos(100, 100); next; - mes("setdialogpos(200, 150)"); mes("setdialogsize(700, 500)"); + mes("setdialogpos(200, 150)"); mes("select next ..."); next; - setdialogpos(200, 150); setdialogsize(700, 500); + setdialogpos(200, 150); + next; + + mes("setdialogsize(400, 100)"); + mes("setdialogpospercent(10, 50)"); + mes("select next ..."); + next; + setdialogsize(400, 100); + setdialogpospercent(10, 50); + next; + + mes("setdialogpospercent(20, 60)"); + mes("select next ..."); + next; + setdialogpospercent(20, 60); + next; + + mes("setdialogpospercent(30, 70)"); + mes("select next ..."); + next; + setdialogpospercent(30, 70); next; close; diff --git a/src/map/script.c b/src/map/script.c index cfba9fc3826..12f817ab6ca 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -27775,6 +27775,21 @@ static BUILDIN(setdialogpos) #endif } +static BUILDIN(setdialogpospercent) +{ +#if PACKETVER_MAIN_NUM >= 20220504 + struct map_session_data *sd = script_rid2sd(st); + + if (sd == NULL) { + script_pushint(st, 0); + return false; + } + + clif->set_npc_window_pos_percent(sd, script_getnum(st, 2), script_getnum(st, 3)); + return true; +#endif +} + /** * Adds a built-in script function. * @@ -28077,6 +28092,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(getnpcid, "?"), BUILDIN_DEF(setdialogsize, "ii"), BUILDIN_DEF(setdialogpos, "ii"), + BUILDIN_DEF(setdialogpospercent, "ii"), BUILDIN_DEF(getpartyname,"i"), BUILDIN_DEF(getpartymember,"i?"), BUILDIN_DEF(getpartyleader,"i?"), From 87c3cd74cf555a916631b4dc291a6a83128e4790 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 May 2022 20:02:53 +0300 Subject: [PATCH 17/50] Convert PACKET_ZC_PLAY_NPC_BGM into struct --- src/map/clif.c | 13 ++++++------- src/map/packets_struct.h | 8 ++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 2a97acc05ff..4c033e5e494 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9329,15 +9329,14 @@ static void clif_wisall(struct map_session_data *sd, int type, int flag) /// 07fe .24B static void clif_playBGM(struct map_session_data *sd, const char *name) { - int fd; - nullpo_retv(sd); - fd = sd->fd; - WFIFOHEAD(fd,packet_len(0x7fe)); - WFIFOW(fd,0) = 0x7fe; - safestrncpy(WFIFOP(fd,2), name, NAME_LENGTH); - WFIFOSET(fd,packet_len(0x7fe)); + const int fd = sd->fd; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_PLAY_NPC_BGM)); + struct PACKET_ZC_PLAY_NPC_BGM *p = WFIFOP(fd, 0); + p->PacketType = HEADER_ZC_PLAY_NPC_BGM; + safestrncpy(p->bgm, name, NAME_LENGTH); + WFIFOSET(fd, sizeof(struct PACKET_ZC_PLAY_NPC_BGM)); } /// Plays/stops a wave sound (ZC_SOUND). diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 6ceb04f9186..d36a01c402b 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5603,6 +5603,14 @@ struct PACKET_ZC_DIALOG_WINDOW_POS2 { DEFINE_PACKET_HEADER(ZC_DIALOG_WINDOW_POS2, 0x0bb5) #endif // PACKETVER_MAIN_NUM >= 20220504 +#if PACKETVER >= 20091201 +struct PACKET_ZC_PLAY_NPC_BGM { + int16 PacketType; + char bgm[NAME_LENGTH]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_PLAY_NPC_BGM, 0x07fe) +#endif // PACKETVER >= 20091201 + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris From f8a14e0c69c88f63e9b2fb4bcc57de8c93300023 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 May 2022 20:44:33 +0300 Subject: [PATCH 18/50] Update packet ZC_PLAY_NPC_BGM --- src/map/clif.c | 18 +++++++++++++++--- src/map/clif.h | 6 ++++++ src/map/packets_struct.h | 10 +++++++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 4c033e5e494..0d246a8f163 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9330,13 +9330,25 @@ static void clif_wisall(struct map_session_data *sd, int type, int flag) static void clif_playBGM(struct map_session_data *sd, const char *name) { nullpo_retv(sd); + nullpo_retv(name); const int fd = sd->fd; - WFIFOHEAD(fd, sizeof(struct PACKET_ZC_PLAY_NPC_BGM)); +#if PACKETVER_MAIN_NUM >= 20220504 + const int nameLen = (int)strlen(name) + 1; + const int sz = sizeof(struct PACKET_ZC_PLAY_NPC_BGM) + nameLen; +#else // PACKETVER_MAIN_NUM >= 20220504 + const int nameLen = NAME_LENGTH; + const int sz = sizeof(struct PACKET_ZC_PLAY_NPC_BGM); +#endif // PACKETVER_MAIN_NUM >= 20220504 + WFIFOHEAD(fd, sz); struct PACKET_ZC_PLAY_NPC_BGM *p = WFIFOP(fd, 0); p->PacketType = HEADER_ZC_PLAY_NPC_BGM; - safestrncpy(p->bgm, name, NAME_LENGTH); - WFIFOSET(fd, sizeof(struct PACKET_ZC_PLAY_NPC_BGM)); + safestrncpy(p->bgm, name, nameLen); +#if PACKETVER_MAIN_NUM >= 20220504 + p->PacketLength = sz; + p->playType = PLAY_BGM_LOOP; +#endif // PACKETVER_MAIN_NUM >= 20220504 + WFIFOSET(fd, sz); } /// Plays/stops a wave sound (ZC_SOUND). diff --git a/src/map/clif.h b/src/map/clif.h index 13a4f1623c9..68fe56b8948 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -856,6 +856,12 @@ enum bossmap_info_type { BOSS_INFO_DEAD, // Boss is dead }; +enum play_npc_bgm { + PLAY_BGM_LOOP = 0, + PLAY_BGM_OMCE = 1, + PLAY_BGM_STOP = 2, +}; + /** * Clif.c Interface **/ diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index d36a01c402b..08849607f79 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5603,7 +5603,15 @@ struct PACKET_ZC_DIALOG_WINDOW_POS2 { DEFINE_PACKET_HEADER(ZC_DIALOG_WINDOW_POS2, 0x0bb5) #endif // PACKETVER_MAIN_NUM >= 20220504 -#if PACKETVER >= 20091201 +#if PACKETVER_MAIN_NUM >= 20220504 +struct PACKET_ZC_PLAY_NPC_BGM { + int16 PacketType; + int16 PacketLength; + uint8 playType; + char bgm[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_PLAY_NPC_BGM, 0x0b8c) +#elif PACKETVER >= 20091201 struct PACKET_ZC_PLAY_NPC_BGM { int16 PacketType; char bgm[NAME_LENGTH]; From c9847e8594b1510c9ec8cd49cbd4b7f16795d52b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 May 2022 22:44:03 +0300 Subject: [PATCH 19/50] Update HPM --- src/common/HPMDataCheck.h | 4 + src/plugins/HPMHooking/HPMHooking.Defs.inc | 14 +- .../HPMHooking_map.HPMHooksCore.inc | 20 +++ .../HPMHooking_map.HookingPoints.inc | 5 + .../HPMHooking/HPMHooking_map.Hooks.inc | 142 +++++++++++++++++- 5 files changed, 177 insertions(+), 8 deletions(-) diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 3e1ef4d592e..125242beb80 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -785,6 +785,8 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_REPAIRITEMLIST", sizeof(struct PACKET_ZC_REPAIRITEMLIST), SERVER_TYPE_MAP }, { "PACKET_ZC_REQ_WEAR_EQUIP_ACK", sizeof(struct PACKET_ZC_REQ_WEAR_EQUIP_ACK), SERVER_TYPE_MAP }, { "PACKET_ZC_ROLE_CHANGE", sizeof(struct PACKET_ZC_ROLE_CHANGE), SERVER_TYPE_MAP }, + { "PACKET_ZC_SAY_DIALOG", sizeof(struct PACKET_ZC_SAY_DIALOG), SERVER_TYPE_MAP }, + { "PACKET_ZC_SAY_DIALOG2", sizeof(struct PACKET_ZC_SAY_DIALOG2), SERVER_TYPE_MAP }, { "PACKET_ZC_SHOW_IMAGE", sizeof(struct PACKET_ZC_SHOW_IMAGE), SERVER_TYPE_MAP }, { "PACKET_ZC_SKILL_SCALE", sizeof(struct PACKET_ZC_SKILL_SCALE), SERVER_TYPE_MAP }, { "PACKET_ZC_SKILLINFO_LIST", sizeof(struct PACKET_ZC_SKILLINFO_LIST), SERVER_TYPE_MAP }, @@ -803,6 +805,8 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_UPDATE_ITEM_FROM_BUYING_STORE", sizeof(struct PACKET_ZC_UPDATE_ITEM_FROM_BUYING_STORE), SERVER_TYPE_MAP }, { "PACKET_ZC_USE_ITEM_ACK", sizeof(struct PACKET_ZC_USE_ITEM_ACK), SERVER_TYPE_MAP }, { "PACKET_ZC_USE_SKILL", sizeof(struct PACKET_ZC_USE_SKILL), SERVER_TYPE_MAP }, + { "PACKET_ZC_WAIT_DIALOG", sizeof(struct PACKET_ZC_WAIT_DIALOG), SERVER_TYPE_MAP }, + { "PACKET_ZC_WAIT_DIALOG2", sizeof(struct PACKET_ZC_WAIT_DIALOG2), SERVER_TYPE_MAP }, { "PACKET_ZC_WARPLIST", sizeof(struct PACKET_ZC_WARPLIST), SERVER_TYPE_MAP }, { "PACKET_ZC_WARPLIST_sub", sizeof(struct PACKET_ZC_WARPLIST_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_WHISPER", sizeof(struct PACKET_ZC_WHISPER), SERVER_TYPE_MAP }, diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 1e0b6094a18..8ebb1b83eb5 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1264,12 +1264,16 @@ typedef void (*HPMHOOK_pre_clif_cashshop_ack) (struct map_session_data **sd, int typedef void (*HPMHOOK_post_clif_cashshop_ack) (struct map_session_data *sd, int error); typedef void (*HPMHOOK_pre_clif_scriptmes) (struct map_session_data **sd, int *npcid, const char **mes); typedef void (*HPMHOOK_post_clif_scriptmes) (struct map_session_data *sd, int npcid, const char *mes); +typedef void (*HPMHOOK_pre_clif_scriptmes2) (struct map_session_data **sd, int *npcid, const char **mes, int *type); +typedef void (*HPMHOOK_post_clif_scriptmes2) (struct map_session_data *sd, int npcid, const char *mes, int type); typedef void (*HPMHOOK_pre_clif_zc_quest_dialog) (struct map_session_data **sd, int *npcid, const char **mes); typedef void (*HPMHOOK_post_clif_zc_quest_dialog) (struct map_session_data *sd, int npcid, const char *mes); typedef void (*HPMHOOK_pre_clif_zc_monolog_dialog) (struct map_session_data **sd, int *npcid, const char **mes); typedef void (*HPMHOOK_post_clif_zc_monolog_dialog) (struct map_session_data *sd, int npcid, const char *mes); typedef void (*HPMHOOK_pre_clif_scriptnext) (struct map_session_data **sd, int *npcid); typedef void (*HPMHOOK_post_clif_scriptnext) (struct map_session_data *sd, int npcid); +typedef void (*HPMHOOK_pre_clif_scriptnext2) (struct map_session_data **sd, int *npcid, int *type); +typedef void (*HPMHOOK_post_clif_scriptnext2) (struct map_session_data *sd, int npcid, int type); typedef void (*HPMHOOK_pre_clif_scriptclose) (struct map_session_data **sd, int *npcid); typedef void (*HPMHOOK_post_clif_scriptclose) (struct map_session_data *sd, int npcid); typedef void (*HPMHOOK_pre_clif_scriptmenu) (struct map_session_data **sd, int *npcid, const char **mes); @@ -1602,8 +1606,8 @@ typedef void (*HPMHOOK_pre_clif_snap) (struct block_list **bl, short *x, short * typedef void (*HPMHOOK_post_clif_snap) (struct block_list *bl, short x, short y); typedef void (*HPMHOOK_pre_clif_weather_check) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_weather_check) (struct map_session_data *sd); -typedef void (*HPMHOOK_pre_clif_playBGM) (struct map_session_data **sd, const char **name); -typedef void (*HPMHOOK_post_clif_playBGM) (struct map_session_data *sd, const char *name); +typedef void (*HPMHOOK_pre_clif_playBGM) (struct map_session_data **sd, const char **name, enum play_npc_bgm *type); +typedef void (*HPMHOOK_post_clif_playBGM) (struct map_session_data *sd, const char *name, enum play_npc_bgm type); typedef void (*HPMHOOK_pre_clif_soundeffect) (struct map_session_data **sd, struct block_list **bl, const char **name, int *type); typedef void (*HPMHOOK_post_clif_soundeffect) (struct map_session_data *sd, struct block_list *bl, const char *name, int type); typedef void (*HPMHOOK_pre_clif_soundeffectall) (struct block_list **bl, const char **name, int *type, enum send_target *coverage); @@ -2866,6 +2870,12 @@ typedef void (*HPMHOOK_pre_clif_load_end_ack_sub_messages) (struct map_session_d typedef void (*HPMHOOK_post_clif_load_end_ack_sub_messages) (struct map_session_data *sd, bool connect_new, bool change_map); typedef bool (*HPMHOOK_pre_clif_sub_guild_invite) (int *fd, struct map_session_data **sd, struct map_session_data **t_sd); typedef bool (*HPMHOOK_post_clif_sub_guild_invite) (bool retVal___, int fd, struct map_session_data *sd, struct map_session_data *t_sd); +typedef void (*HPMHOOK_pre_clif_set_npc_window_size) (struct map_session_data **sd, int *width, int *height); +typedef void (*HPMHOOK_post_clif_set_npc_window_size) (struct map_session_data *sd, int width, int height); +typedef void (*HPMHOOK_pre_clif_set_npc_window_pos) (struct map_session_data **sd, int *x, int *y); +typedef void (*HPMHOOK_post_clif_set_npc_window_pos) (struct map_session_data *sd, int x, int y); +typedef void (*HPMHOOK_pre_clif_set_npc_window_pos_percent) (struct map_session_data **sd, int *x, int *y); +typedef void (*HPMHOOK_post_clif_set_npc_window_pos_percent) (struct map_session_data *sd, int x, int y); typedef unsigned short (*HPMHOOK_pre_clif_parse_cmd_normal) (int *fd, struct map_session_data **sd); typedef unsigned short (*HPMHOOK_post_clif_parse_cmd_normal) (unsigned short retVal___, int fd, struct map_session_data *sd); typedef unsigned short (*HPMHOOK_pre_clif_parse_cmd_decrypt) (int *fd, struct map_session_data **sd); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 2d3ee1b2ab3..6b4482421e3 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -852,12 +852,16 @@ struct { struct HPMHookPoint *HP_clif_cashshop_ack_post; struct HPMHookPoint *HP_clif_scriptmes_pre; struct HPMHookPoint *HP_clif_scriptmes_post; + struct HPMHookPoint *HP_clif_scriptmes2_pre; + struct HPMHookPoint *HP_clif_scriptmes2_post; struct HPMHookPoint *HP_clif_zc_quest_dialog_pre; struct HPMHookPoint *HP_clif_zc_quest_dialog_post; struct HPMHookPoint *HP_clif_zc_monolog_dialog_pre; struct HPMHookPoint *HP_clif_zc_monolog_dialog_post; struct HPMHookPoint *HP_clif_scriptnext_pre; struct HPMHookPoint *HP_clif_scriptnext_post; + struct HPMHookPoint *HP_clif_scriptnext2_pre; + struct HPMHookPoint *HP_clif_scriptnext2_post; struct HPMHookPoint *HP_clif_scriptclose_pre; struct HPMHookPoint *HP_clif_scriptclose_post; struct HPMHookPoint *HP_clif_scriptmenu_pre; @@ -2454,6 +2458,12 @@ struct { struct HPMHookPoint *HP_clif_load_end_ack_sub_messages_post; struct HPMHookPoint *HP_clif_sub_guild_invite_pre; struct HPMHookPoint *HP_clif_sub_guild_invite_post; + struct HPMHookPoint *HP_clif_set_npc_window_size_pre; + struct HPMHookPoint *HP_clif_set_npc_window_size_post; + struct HPMHookPoint *HP_clif_set_npc_window_pos_pre; + struct HPMHookPoint *HP_clif_set_npc_window_pos_post; + struct HPMHookPoint *HP_clif_set_npc_window_pos_percent_pre; + struct HPMHookPoint *HP_clif_set_npc_window_pos_percent_post; struct HPMHookPoint *HP_clif_parse_cmd_normal_pre; struct HPMHookPoint *HP_clif_parse_cmd_normal_post; struct HPMHookPoint *HP_clif_parse_cmd_decrypt_pre; @@ -8169,12 +8179,16 @@ struct { int HP_clif_cashshop_ack_post; int HP_clif_scriptmes_pre; int HP_clif_scriptmes_post; + int HP_clif_scriptmes2_pre; + int HP_clif_scriptmes2_post; int HP_clif_zc_quest_dialog_pre; int HP_clif_zc_quest_dialog_post; int HP_clif_zc_monolog_dialog_pre; int HP_clif_zc_monolog_dialog_post; int HP_clif_scriptnext_pre; int HP_clif_scriptnext_post; + int HP_clif_scriptnext2_pre; + int HP_clif_scriptnext2_post; int HP_clif_scriptclose_pre; int HP_clif_scriptclose_post; int HP_clif_scriptmenu_pre; @@ -9771,6 +9785,12 @@ struct { int HP_clif_load_end_ack_sub_messages_post; int HP_clif_sub_guild_invite_pre; int HP_clif_sub_guild_invite_post; + int HP_clif_set_npc_window_size_pre; + int HP_clif_set_npc_window_size_post; + int HP_clif_set_npc_window_pos_pre; + int HP_clif_set_npc_window_pos_post; + int HP_clif_set_npc_window_pos_percent_pre; + int HP_clif_set_npc_window_pos_percent_post; int HP_clif_parse_cmd_normal_pre; int HP_clif_parse_cmd_normal_post; int HP_clif_parse_cmd_decrypt_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 7eb10f1b823..cbb16765253 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -450,9 +450,11 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->npc_sell_result, HP_clif_npc_sell_result) }, { HP_POP(clif->cashshop_ack, HP_clif_cashshop_ack) }, { HP_POP(clif->scriptmes, HP_clif_scriptmes) }, + { HP_POP(clif->scriptmes2, HP_clif_scriptmes2) }, { HP_POP(clif->zc_quest_dialog, HP_clif_zc_quest_dialog) }, { HP_POP(clif->zc_monolog_dialog, HP_clif_zc_monolog_dialog) }, { HP_POP(clif->scriptnext, HP_clif_scriptnext) }, + { HP_POP(clif->scriptnext2, HP_clif_scriptnext2) }, { HP_POP(clif->scriptclose, HP_clif_scriptclose) }, { HP_POP(clif->scriptmenu, HP_clif_scriptmenu) }, { HP_POP(clif->zc_quest_dialog_menu_list, HP_clif_zc_quest_dialog_menu_list) }, @@ -1251,6 +1253,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->setlevel_sub, HP_clif_setlevel_sub) }, { HP_POP(clif->load_end_ack_sub_messages, HP_clif_load_end_ack_sub_messages) }, { HP_POP(clif->sub_guild_invite, HP_clif_sub_guild_invite) }, + { HP_POP(clif->set_npc_window_size, HP_clif_set_npc_window_size) }, + { HP_POP(clif->set_npc_window_pos, HP_clif_set_npc_window_pos) }, + { HP_POP(clif->set_npc_window_pos_percent, HP_clif_set_npc_window_pos_percent) }, { HP_POP(clif->parse_cmd_normal, HP_clif_parse_cmd_normal) }, { HP_POP(clif->parse_cmd_decrypt, HP_clif_parse_cmd_decrypt) }, { HP_POP(clif->parse_cmd_optional, HP_clif_parse_cmd_optional) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 3b6fec20124..d43bb89678e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -11096,6 +11096,32 @@ void HP_clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes) } return; } +void HP_clif_scriptmes2(struct map_session_data *sd, int npcid, const char *mes, int type) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_scriptmes2_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *npcid, const char **mes, int *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptmes2_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_scriptmes2_pre[hIndex].func; + preHookFunc(&sd, &npcid, &mes, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.scriptmes2(sd, npcid, mes, type); + } + if (HPMHooks.count.HP_clif_scriptmes2_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int npcid, const char *mes, int type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptmes2_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_scriptmes2_post[hIndex].func; + postHookFunc(sd, npcid, mes, type); + } + } + return; +} void HP_clif_zc_quest_dialog(struct map_session_data *sd, int npcid, const char *mes) { int hIndex = 0; if (HPMHooks.count.HP_clif_zc_quest_dialog_pre > 0) { @@ -11174,6 +11200,32 @@ void HP_clif_scriptnext(struct map_session_data *sd, int npcid) { } return; } +void HP_clif_scriptnext2(struct map_session_data *sd, int npcid, int type) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_scriptnext2_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *npcid, int *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptnext2_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_scriptnext2_pre[hIndex].func; + preHookFunc(&sd, &npcid, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.scriptnext2(sd, npcid, type); + } + if (HPMHooks.count.HP_clif_scriptnext2_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int npcid, int type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptnext2_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_scriptnext2_post[hIndex].func; + postHookFunc(sd, npcid, type); + } + } + return; +} void HP_clif_scriptclose(struct map_session_data *sd, int npcid) { int hIndex = 0; if (HPMHooks.count.HP_clif_scriptclose_pre > 0) { @@ -15523,14 +15575,14 @@ void HP_clif_weather_check(struct map_session_data *sd) { } return; } -void HP_clif_playBGM(struct map_session_data *sd, const char *name) { +void HP_clif_playBGM(struct map_session_data *sd, const char *name, enum play_npc_bgm type) { int hIndex = 0; if (HPMHooks.count.HP_clif_playBGM_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, const char **name); + void (*preHookFunc) (struct map_session_data **sd, const char **name, enum play_npc_bgm *type); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_playBGM_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_playBGM_pre[hIndex].func; - preHookFunc(&sd, &name); + preHookFunc(&sd, &name, &type); } if (*HPMforce_return) { *HPMforce_return = false; @@ -15538,13 +15590,13 @@ void HP_clif_playBGM(struct map_session_data *sd, const char *name) { } } { - HPMHooks.source.clif.playBGM(sd, name); + HPMHooks.source.clif.playBGM(sd, name, type); } if (HPMHooks.count.HP_clif_playBGM_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, const char *name); + void (*postHookFunc) (struct map_session_data *sd, const char *name, enum play_npc_bgm type); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_playBGM_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_playBGM_post[hIndex].func; - postHookFunc(sd, name); + postHookFunc(sd, name, type); } } return; @@ -31995,6 +32047,84 @@ bool HP_clif_sub_guild_invite(int fd, struct map_session_data *sd, struct map_se } return retVal___; } +void HP_clif_set_npc_window_size(struct map_session_data *sd, int width, int height) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_set_npc_window_size_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *width, int *height); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_npc_window_size_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_set_npc_window_size_pre[hIndex].func; + preHookFunc(&sd, &width, &height); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.set_npc_window_size(sd, width, height); + } + if (HPMHooks.count.HP_clif_set_npc_window_size_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int width, int height); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_npc_window_size_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_set_npc_window_size_post[hIndex].func; + postHookFunc(sd, width, height); + } + } + return; +} +void HP_clif_set_npc_window_pos(struct map_session_data *sd, int x, int y) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_set_npc_window_pos_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *x, int *y); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_npc_window_pos_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_set_npc_window_pos_pre[hIndex].func; + preHookFunc(&sd, &x, &y); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.set_npc_window_pos(sd, x, y); + } + if (HPMHooks.count.HP_clif_set_npc_window_pos_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int x, int y); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_npc_window_pos_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_set_npc_window_pos_post[hIndex].func; + postHookFunc(sd, x, y); + } + } + return; +} +void HP_clif_set_npc_window_pos_percent(struct map_session_data *sd, int x, int y) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_set_npc_window_pos_percent_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *x, int *y); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_npc_window_pos_percent_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_set_npc_window_pos_percent_pre[hIndex].func; + preHookFunc(&sd, &x, &y); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.set_npc_window_pos_percent(sd, x, y); + } + if (HPMHooks.count.HP_clif_set_npc_window_pos_percent_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int x, int y); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_npc_window_pos_percent_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_set_npc_window_pos_percent_post[hIndex].func; + postHookFunc(sd, x, y); + } + } + return; +} unsigned short HP_clif_parse_cmd_normal(int fd, struct map_session_data *sd) { int hIndex = 0; unsigned short retVal___ = 0; From 7806a2cd180f7e2f13e51e41a16c5ffd12175153 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 May 2022 22:42:08 +0300 Subject: [PATCH 20/50] Extend script command playbgm with type parameter Also add command playbgmall2 same as playbgmall but with type parameter. --- doc/script_commands.txt | 12 ++++++-- npc/custom/bgm.txt | 26 +++++++++++++++++ npc/scripts_custom.conf | 1 + src/map/clif.c | 4 +-- src/map/clif.h | 4 +-- src/map/script.c | 64 ++++++++++++++++++++++++++++++++++++----- 6 files changed, 98 insertions(+), 13 deletions(-) create mode 100644 npc/custom/bgm.txt diff --git a/doc/script_commands.txt b/doc/script_commands.txt index fb37473f4df..cf48af2dcae 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -8431,15 +8431,23 @@ You can add your own effects this way, naturally. --------------------------------------- -*playbgm("") +*playbgm(""{, }) *playbgmall(""{, ""{, , , , }}) +*playbgmall2(""{, {, ""{, , , , }}}) These two commands will play a Background Music to either the invoking -character only (playbgm()) or multiple characters (playbgmall()). +character only (playbgm()) or multiple characters (playbgmall(), playbgmall2()). BGM filename is the filename in /BGM/ folder. It has to be in .mp3 extension, but it's not required to specify the extension in the script. +type set play type and can be: + PLAY_BGM_LOOP - play music in loop + PLAY_BGM_OMCE - play music once + PLAY_BGM_STOP - stop music + +Parameter type make sense only for clients main 20220504 and newer. + If coordinates are omitted, BGM will be broadcasted on the entire map. If the map name is also omitted the BGM will be played for the entire server. diff --git a/npc/custom/bgm.txt b/npc/custom/bgm.txt new file mode 100644 index 00000000000..e11a2546f07 --- /dev/null +++ b/npc/custom/bgm.txt @@ -0,0 +1,26 @@ +//===== Hercules Script ====================================== +//= Bgm play demo +//===== By: ================================================== +//= 4144 +//===== Current Version: ===================================== +//= 1.0 +//===== Description: ========================================= +//= Bgm player demo in prontera. +//============================================================ + +prontera,162,286,4 script Bgm demo#prt 4_M_KID1,{ + mes("Play track 30.mp3 once and return to normal music"); + mes("playbgm \"30\", PLAY_BGM_ONCE"); + playbgm("30", PLAY_BGM_ONCE); + next(); + mes("Play track 100.mp3 in loop"); + mes("playbgm \"100\", PLAY_BGM_LOOP"); + playbgm("100", PLAY_BGM_LOOP); + next(); + mes("Stop custom tracks"); + mes("playbgm \"\", PLAY_BGM_STOP"); + playbgm("", PLAY_BGM_STOP); + next; + + close; +} diff --git a/npc/scripts_custom.conf b/npc/scripts_custom.conf index 5412b1499d8..cc140771917 100644 --- a/npc/scripts_custom.conf +++ b/npc/scripts_custom.conf @@ -55,6 +55,7 @@ //"npc/custom/zeroui.txt", //"npc/custom/dialogalign.txt", //"npc/custom/dialogpossize.txt", +//"npc/custom/bgm.txt", //================= Other Scripts ========================================= // -- MVP Arena diff --git a/src/map/clif.c b/src/map/clif.c index 0d246a8f163..ce150a2d761 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9327,7 +9327,7 @@ static void clif_wisall(struct map_session_data *sd, int type, int flag) /// Play a BGM! [Rikter/Yommy] (ZC_PLAY_NPC_BGM). /// 07fe .24B -static void clif_playBGM(struct map_session_data *sd, const char *name) +static void clif_playBGM(struct map_session_data *sd, const char *name, enum play_npc_bgm type) { nullpo_retv(sd); nullpo_retv(name); @@ -9346,7 +9346,7 @@ static void clif_playBGM(struct map_session_data *sd, const char *name) safestrncpy(p->bgm, name, nameLen); #if PACKETVER_MAIN_NUM >= 20220504 p->PacketLength = sz; - p->playType = PLAY_BGM_LOOP; + p->playType = type; #endif // PACKETVER_MAIN_NUM >= 20220504 WFIFOSET(fd, sz); } diff --git a/src/map/clif.h b/src/map/clif.h index 68fe56b8948..8f142acf9d0 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -858,7 +858,7 @@ enum bossmap_info_type { enum play_npc_bgm { PLAY_BGM_LOOP = 0, - PLAY_BGM_OMCE = 1, + PLAY_BGM_ONCE = 1, PLAY_BGM_STOP = 2, }; @@ -1174,7 +1174,7 @@ struct clif_interface { void (*snap) ( struct block_list *bl, short x, short y ); void (*weather_check) (struct map_session_data *sd); /* sound effects client-side */ - void (*playBGM) (struct map_session_data* sd, const char* name); + void (*playBGM) (struct map_session_data* sd, const char* name, enum play_npc_bgm type); void (*soundeffect) (struct map_session_data* sd, struct block_list* bl, const char* name, int type); void (*soundeffectall) (struct block_list* bl, const char* name, int type, enum send_target coverage); /* chat/message-related */ diff --git a/src/map/script.c b/src/map/script.c index 12f817ab6ca..cc7a91e4c20 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -16607,7 +16607,10 @@ static BUILDIN(playbgm) if (sd != NULL) { const char *name = script_getstr(st,2); - clif->playBGM(sd, name); + if (script_hasdata(st, 3)) + clif->playBGM(sd, name, script_getnum(st, 3)); + else + clif->playBGM(sd, name, PLAY_BGM_LOOP); } return true; @@ -16616,8 +16619,9 @@ static BUILDIN(playbgm) static int playbgm_sub(struct block_list *bl, va_list ap) { const char* name = va_arg(ap,const char*); + enum play_npc_bgm type = va_arg(ap, int); - clif->playBGM(BL_CAST(BL_PC, bl), name); + clif->playBGM(BL_CAST(BL_PC, bl), name, type); return 0; } @@ -16625,9 +16629,10 @@ static int playbgm_sub(struct block_list *bl, va_list ap) static int playbgm_foreachpc_sub(struct map_session_data *sd, va_list args) { const char* name = va_arg(args, const char*); + enum play_npc_bgm type = va_arg(args, int); nullpo_ret(name); - clif->playBGM(sd, name); + clif->playBGM(sd, name, type); return 0; } @@ -16654,7 +16659,7 @@ static BUILDIN(playbgmall) return true; } - map->foreachinarea(script->playbgm_sub, m, x0, y0, x1, y1, BL_PC, name); + map->foreachinarea(script->playbgm_sub, m, x0, y0, x1, y1, BL_PC, name, PLAY_BGM_LOOP); } else if( script_hasdata(st,3) ) { // entire map const char* mapname = script_getstr(st,3); @@ -16665,10 +16670,49 @@ static BUILDIN(playbgmall) return true; } - map->foreachinmap(script->playbgm_sub, m, BL_PC, name); + map->foreachinmap(script->playbgm_sub, m, BL_PC, name, PLAY_BGM_LOOP); + } else { + // entire server + map->foreachpc(script->playbgm_foreachpc_sub, name, PLAY_BGM_LOOP); + } + + return true; +} + +static BUILDIN(playbgmall2) +{ + const char *name = script_getstr(st, 2); + const int type = script_getnum(st, 3); + + if (script_hasdata(st, 8)) { + // specified part of map + const char *mapname = script_getstr(st, 4); + int x0 = script_getnum(st, 5); + int y0 = script_getnum(st, 6); + int x1 = script_getnum(st, 7); + int y1 = script_getnum(st, 8); + int m; + + if ((m = map->mapname2mapid(mapname)) == -1) { + ShowWarning("playbgmall: Attempted to play song '%s' on non-existent map '%s'\n", name, mapname); + return true; + } + + map->foreachinarea(script->playbgm_sub, m, x0, y0, x1, y1, BL_PC, name, type); + } else if (script_hasdata(st, 4)) { + // entire map + const char *mapname = script_getstr(st, 4); + int m; + + if ((m = map->mapname2mapid(mapname)) == -1) { + ShowWarning("playbgmall: Attempted to play song '%s' on non-existent map '%s'\n", name, mapname); + return true; + } + + map->foreachinmap(script->playbgm_sub, m, BL_PC, name, type); } else { // entire server - map->foreachpc(script->playbgm_foreachpc_sub, name); + map->foreachpc(script->playbgm_foreachpc_sub, name, type); } return true; @@ -28262,8 +28306,9 @@ static void script_parse_builtin(void) BUILDIN_DEF(getskilllist,""), BUILDIN_DEF(clearitem,""), BUILDIN_DEF(classchange,"ii?"), - BUILDIN_DEF(playbgm,"s"), + BUILDIN_DEF(playbgm,"s?"), BUILDIN_DEF(playbgmall,"s?????"), + BUILDIN_DEF(playbgmall2,"si?????"), BUILDIN_DEF(soundeffect,"si"), BUILDIN_DEF(soundeffectall,"si?????"), // SoundEffectAll [Codemaster] BUILDIN_DEF(strmobinfo,"ii"), // display mob data [Valaris] @@ -29555,6 +29600,11 @@ static void script_hardcoded_constants(void) script->set_constant("ITEM_GRADE_SS", ITEM_GRADE_SS, false, false); script->set_constant("ITEM_GRADE_MAX", ITEM_GRADE_MAX, false, false); + script->constdb_comment("BGM play type"); + script->set_constant("PLAY_BGM_LOOP", PLAY_BGM_LOOP, false, false); + script->set_constant("PLAY_BGM_ONCE", PLAY_BGM_ONCE, false, false); + script->set_constant("PLAY_BGM_STOP", PLAY_BGM_STOP, false, false); + script->constdb_comment("Renewal"); #ifdef RENEWAL script->set_constant("RENEWAL", 1, false, false); From ddbe5c6228c455829d320374586cafcca335ead7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 16:12:05 +0300 Subject: [PATCH 21/50] Update packet ZC_MOVE_ITEM_FAILED --- src/map/clif.c | 10 +++++----- src/map/packets_struct.h | 9 ++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index ce150a2d761..154432f7264 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2897,12 +2897,12 @@ static void clif_item_movefailed(struct map_session_data *sd, int n) { #if PACKETVER_MAIN_NUM >= 20161214 || PACKETVER_RE_NUM >= 20161130 || defined(PACKETVER_ZERO) int fd = sd->fd; - const int len = sizeof(struct PACKET_ZC_INVENTORY_MOVE_FAILED); + const int len = sizeof(struct PACKET_ZC_MOVE_ITEM_FAILED); WFIFOHEAD(fd, len); - struct PACKET_ZC_INVENTORY_MOVE_FAILED *p = WFIFOP(fd, 0); - p->packetType = 0xaa7; - p->index = n + 2; - p->unknown = 1; + struct PACKET_ZC_MOVE_ITEM_FAILED *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_MOVE_ITEM_FAILED; + p->itemIndex = n + 2; + p->itemCount = 1; WFIFOSET(fd, len); #else clif->dropitem(sd, n, 0); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 08849607f79..72c5b1b76a2 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3593,11 +3593,14 @@ struct PACKET_ZC_GUILD_POSITION { char position[]; } __attribute__((packed)); -struct PACKET_ZC_INVENTORY_MOVE_FAILED { +#if PACKETVER_MAIN_NUM >= 20161214 || PACKETVER_RE_NUM >= 20161130 || defined(PACKETVER_ZERO) +struct PACKET_ZC_MOVE_ITEM_FAILED { int16 packetType; - int16 index; - int16 unknown; + int16 itemIndex; + int16 itemCount; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_MOVE_ITEM_FAILED, 0x0aa7); +#endif // PACKETVER_MAIN_NUM >= 20161214 || PACKETVER_RE_NUM >= 20161130 || defined(PACKETVER_ZERO) #if PACKETVER_MAIN_NUM >= 20161019 || PACKETVER_RE_NUM >= 20160921 || defined(PACKETVER_ZERO) #define PACKET_ZC_ACK_BAN_GUILD PACKET_ZC_ACK_BAN_GUILD3 From 0a0122e14706e6c772da493e148e46305e770771 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 16:14:30 +0300 Subject: [PATCH 22/50] Update HPM --- src/common/HPMDataCheck.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 125242beb80..652bf59de9f 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -733,7 +733,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_GUILD_INFO", sizeof(struct PACKET_ZC_GUILD_INFO), SERVER_TYPE_MAP }, { "PACKET_ZC_GUILD_POSITION", sizeof(struct PACKET_ZC_GUILD_POSITION), SERVER_TYPE_MAP }, { "PACKET_ZC_GUILD_SKILLINFO", sizeof(struct PACKET_ZC_GUILD_SKILLINFO), SERVER_TYPE_MAP }, - { "PACKET_ZC_INVENTORY_MOVE_FAILED", sizeof(struct PACKET_ZC_INVENTORY_MOVE_FAILED), SERVER_TYPE_MAP }, { "PACKET_ZC_ITEM_ENTRY", sizeof(struct PACKET_ZC_ITEM_ENTRY), SERVER_TYPE_MAP }, { "PACKET_ZC_ITEM_PICKUP_ACK", sizeof(struct PACKET_ZC_ITEM_PICKUP_ACK), SERVER_TYPE_MAP }, { "PACKET_ZC_LONGPAR_CHANGE", sizeof(struct PACKET_ZC_LONGPAR_CHANGE), SERVER_TYPE_MAP }, From 7ac47588a075b52b379cc0fe317da56366a30ae5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 16:29:43 +0300 Subject: [PATCH 23/50] Convert packet CZ_MOVE_ITEM_FROM_BODY_TO_CART to struct --- src/map/clif.c | 13 ++++++++----- src/map/packets_struct.h | 7 +++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 154432f7264..3dfe72ae84f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -13074,16 +13074,19 @@ static void clif_parse_PutItemToCart(int fd, struct map_session_data *sd) __attr /// 0126 .W .L static void clif_parse_PutItemToCart(int fd, struct map_session_data *sd) { - int flag = 0; - if (pc_istrading_except_npc(sd) || (sd->npc_id != 0 && sd->state.using_megaphone == 0) || sd->state.prevend != 0) return; if (!pc_iscarton(sd)) return; - if ( (flag = pc->putitemtocart(sd,RFIFOW(fd,2)-2,RFIFOL(fd,4))) ) { - clif->item_movefailed(sd, RFIFOW(fd,2)-2); - clif->cart_additem_ack(sd,flag == 1?0x0:0x1); + + struct PACKET_CZ_MOVE_ITEM_FROM_BODY_TO_CART *p = RFIFOP(fd, 0); + const int index = p->index - 2; + const int flag = pc->putitemtocart(sd, index, p->count); + + if (flag) { + clif->item_movefailed(sd, index); + clif->cart_additem_ack(sd, flag == 1 ? 0x0 : 0x1); } } diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 72c5b1b76a2..0ebd581534f 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5622,6 +5622,13 @@ struct PACKET_ZC_PLAY_NPC_BGM { DEFINE_PACKET_HEADER(ZC_PLAY_NPC_BGM, 0x07fe) #endif // PACKETVER >= 20091201 +struct PACKET_CZ_MOVE_ITEM_FROM_BODY_TO_CART { + int16 PacketType; + int16 index; + int count; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_MOVE_ITEM_FROM_BODY_TO_CART, 0x0126) + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris From c1653cf47bf22ddff892317f28a6327a204e508d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 16:34:13 +0300 Subject: [PATCH 24/50] Use item amount in packet ZC_MOVE_ITEM_FAILED --- src/map/clif.c | 6 +++--- src/map/clif.h | 2 +- src/map/storage.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 3dfe72ae84f..f9196bb6a88 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2893,7 +2893,7 @@ static void clif_dropitem(struct map_session_data *sd, int n, int amount) WFIFOSET(fd,packet_len(0xaf)); } -static void clif_item_movefailed(struct map_session_data *sd, int n) +static void clif_item_movefailed(struct map_session_data *sd, int n, int amount) { #if PACKETVER_MAIN_NUM >= 20161214 || PACKETVER_RE_NUM >= 20161130 || defined(PACKETVER_ZERO) int fd = sd->fd; @@ -2902,7 +2902,7 @@ static void clif_item_movefailed(struct map_session_data *sd, int n) struct PACKET_ZC_MOVE_ITEM_FAILED *p = WFIFOP(fd, 0); p->packetType = HEADER_ZC_MOVE_ITEM_FAILED; p->itemIndex = n + 2; - p->itemCount = 1; + p->itemCount = amount; WFIFOSET(fd, len); #else clif->dropitem(sd, n, 0); @@ -13085,7 +13085,7 @@ static void clif_parse_PutItemToCart(int fd, struct map_session_data *sd) const int flag = pc->putitemtocart(sd, index, p->count); if (flag) { - clif->item_movefailed(sd, index); + clif->item_movefailed(sd, index, p->count); clif->cart_additem_ack(sd, flag == 1 ? 0x0 : 0x1); } } diff --git a/src/map/clif.h b/src/map/clif.h index 8f142acf9d0..2270fbbcd5e 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -921,7 +921,7 @@ struct clif_interface { void (*dropitem) (struct map_session_data *sd,int n,int amount); void (*delitem) (struct map_session_data *sd,int n,int amount, enum delitem_reason reason); void (*takeitem) (struct block_list* src, struct block_list* dst); - void (*item_movefailed) (struct map_session_data *sd, int n); + void (*item_movefailed) (struct map_session_data *sd, int n, int amount); void (*item_equip) (short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos); void (*item_normal) (short idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id); void (*arrowequip) (struct map_session_data *sd,int val); diff --git a/src/map/storage.c b/src/map/storage.c index 8333a66ad75..f9d3353b48c 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -297,7 +297,7 @@ static int storage_add_from_inventory(struct map_session_data *sd, int index, in if (storage->additem(sd, &sd->status.inventory[index], amount) == 0) pc->delitem(sd, index, amount, 0, DELITEM_TOSTORAGE, LOG_TYPE_STORAGE); else - clif->item_movefailed(sd, index); + clif->item_movefailed(sd, index, amount); return 1; } @@ -683,7 +683,7 @@ static int storage_guild_storageadd(struct map_session_data *sd, int index, int if (gstorage->additem(sd, stor, &sd->status.inventory[index], amount) == 0) pc->delitem(sd, index, amount, 0, DELITEM_TOSTORAGE, LOG_TYPE_GSTORAGE); else - clif->item_movefailed(sd, index); + clif->item_movefailed(sd, index, amount); return 1; } From dad6b68c72de03a7db2adc5cf2d65df48e88e864 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 16:35:39 +0300 Subject: [PATCH 25/50] Update HPM --- src/common/HPMDataCheck.h | 1 + src/plugins/HPMHooking/HPMHooking.Defs.inc | 4 ++-- src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 652bf59de9f..e96503f3ae5 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -651,6 +651,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_CZ_ADD_ITEM_TO_MAIL", sizeof(struct PACKET_CZ_ADD_ITEM_TO_MAIL), SERVER_TYPE_MAP }, { "PACKET_CZ_CONTACTNPC", sizeof(struct PACKET_CZ_CONTACTNPC), SERVER_TYPE_MAP }, { "PACKET_CZ_MEMORIALDUNGEON_COMMAND", sizeof(struct PACKET_CZ_MEMORIALDUNGEON_COMMAND), SERVER_TYPE_MAP }, + { "PACKET_CZ_MOVE_ITEM_FROM_BODY_TO_CART", sizeof(struct PACKET_CZ_MOVE_ITEM_FROM_BODY_TO_CART), SERVER_TYPE_MAP }, { "PACKET_CZ_OPEN_UI", sizeof(struct PACKET_CZ_OPEN_UI), SERVER_TYPE_MAP }, { "PACKET_CZ_PARTY_CONFIG", sizeof(struct PACKET_CZ_PARTY_CONFIG), SERVER_TYPE_MAP }, { "PACKET_CZ_PC_BUY_CASH_POINT_ITEM", sizeof(struct PACKET_CZ_PC_BUY_CASH_POINT_ITEM), SERVER_TYPE_MAP }, diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 8ebb1b83eb5..7c6a17efb64 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1126,8 +1126,8 @@ typedef void (*HPMHOOK_pre_clif_delitem) (struct map_session_data **sd, int *n, typedef void (*HPMHOOK_post_clif_delitem) (struct map_session_data *sd, int n, int amount, enum delitem_reason reason); typedef void (*HPMHOOK_pre_clif_takeitem) (struct block_list **src, struct block_list **dst); typedef void (*HPMHOOK_post_clif_takeitem) (struct block_list *src, struct block_list *dst); -typedef void (*HPMHOOK_pre_clif_item_movefailed) (struct map_session_data **sd, int *n); -typedef void (*HPMHOOK_post_clif_item_movefailed) (struct map_session_data *sd, int n); +typedef void (*HPMHOOK_pre_clif_item_movefailed) (struct map_session_data **sd, int *n, int *amount); +typedef void (*HPMHOOK_post_clif_item_movefailed) (struct map_session_data *sd, int n, int amount); typedef void (*HPMHOOK_pre_clif_item_equip) (short *idx, struct EQUIPITEM_INFO **p, struct item **i, struct item_data **id, int *eqp_pos); typedef void (*HPMHOOK_post_clif_item_equip) (short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos); typedef void (*HPMHOOK_pre_clif_item_normal) (short *idx, struct NORMALITEM_INFO **p, struct item **i, struct item_data **id); diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index d43bb89678e..fabdc1708a8 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -9292,14 +9292,14 @@ void HP_clif_takeitem(struct block_list *src, struct block_list *dst) { } return; } -void HP_clif_item_movefailed(struct map_session_data *sd, int n) { +void HP_clif_item_movefailed(struct map_session_data *sd, int n, int amount) { int hIndex = 0; if (HPMHooks.count.HP_clif_item_movefailed_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, int *n); + void (*preHookFunc) (struct map_session_data **sd, int *n, int *amount); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_movefailed_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_item_movefailed_pre[hIndex].func; - preHookFunc(&sd, &n); + preHookFunc(&sd, &n, &amount); } if (*HPMforce_return) { *HPMforce_return = false; @@ -9307,13 +9307,13 @@ void HP_clif_item_movefailed(struct map_session_data *sd, int n) { } } { - HPMHooks.source.clif.item_movefailed(sd, n); + HPMHooks.source.clif.item_movefailed(sd, n, amount); } if (HPMHooks.count.HP_clif_item_movefailed_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, int n); + void (*postHookFunc) (struct map_session_data *sd, int n, int amount); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_movefailed_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_item_movefailed_post[hIndex].func; - postHookFunc(sd, n); + postHookFunc(sd, n, amount); } } return; From c63b0ac5a32cbda02677181f4c873df1f71f953b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 17:13:59 +0300 Subject: [PATCH 26/50] Convert packet PACKET_ZC_SOUND into struct --- src/map/clif.c | 35 +++++++++++++++++------------------ src/map/packets_struct.h | 9 +++++++++ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index f9196bb6a88..6f22fd239fa 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9366,35 +9366,34 @@ static void clif_playBGM(struct map_session_data *sd, const char *name, enum pla /// relative position of the NPC to the player (3D sound). static void clif_soundeffect(struct map_session_data *sd, struct block_list *bl, const char *name, int type) { - int fd; - nullpo_retv(sd); nullpo_retv(bl); nullpo_retv(name); - fd = sd->fd; - WFIFOHEAD(fd,packet_len(0x1d3)); - WFIFOW(fd,0) = 0x1d3; - safestrncpy(WFIFOP(fd,2), name, NAME_LENGTH); - WFIFOB(fd,26) = type; - WFIFOL(fd,27) = 0; - WFIFOL(fd,31) = bl->id; - WFIFOSET(fd,packet_len(0x1d3)); + const int fd = sd->fd; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_SOUND)); + struct PACKET_ZC_SOUND *p = WFIFOP(fd, 0); + p->PacketType = HEADER_ZC_SOUND; + safestrncpy(p->name, name, NAME_LENGTH); + p->act = type; + p->term = 0; + p->AID = bl->id; + WFIFOSET(fd, sizeof(struct PACKET_ZC_SOUND)); } static void clif_soundeffectall(struct block_list *bl, const char *name, int type, enum send_target coverage) { - unsigned char buf[40]; - nullpo_retv(bl); nullpo_retv(name); - WBUFW(buf,0) = 0x1d3; - safestrncpy(WBUFP(buf,2), name, NAME_LENGTH); - WBUFB(buf,26) = type; - WBUFL(buf,27) = 0; - WBUFL(buf,31) = bl->id; - clif->send(buf, packet_len(0x1d3), bl, coverage); + struct PACKET_ZC_SOUND p = { 0 }; + + p.PacketType = HEADER_ZC_SOUND; + safestrncpy(p.name, name, NAME_LENGTH); + p.act = type; + p.term = 0; + p.AID = bl->id; + clif->send(&p, sizeof(struct PACKET_ZC_SOUND), bl, coverage); } /// Displays special effects (npcs, weather, etc) [Valaris] (ZC_NOTIFY_EFFECT2). diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 0ebd581534f..4c752a7b0c8 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5629,6 +5629,15 @@ struct PACKET_CZ_MOVE_ITEM_FROM_BODY_TO_CART { } __attribute__((packed)); DEFINE_PACKET_HEADER(CZ_MOVE_ITEM_FROM_BODY_TO_CART, 0x0126) +struct PACKET_ZC_SOUND { + int16 PacketType; + char name[NAME_LENGTH]; + uint8 act; + uint32 term; + uint32 AID; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SOUND, 0x01d3) + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris From 9e5e8f4102424293c7f4bdec34e4c9fb25c69036 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 17:56:05 +0300 Subject: [PATCH 27/50] Add term parameter into functions clif_soundeffect, clif_soundeffectall --- src/map/atcommand.c | 2 +- src/map/clif.c | 8 ++++---- src/map/clif.h | 10 ++++++++-- src/map/script.c | 19 ++++++++----------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 217840708f2..a292fd586b8 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6542,7 +6542,7 @@ ACMD(sound) if(strstr(sound_file, ".wav") == NULL) strcat(sound_file, ".wav"); - clif->soundeffectall(&sd->bl, sound_file, 0, AREA); + clif->soundeffectall(&sd->bl, sound_file, SOUND_TYPE_PLAY, 0, AREA); return true; } diff --git a/src/map/clif.c b/src/map/clif.c index 6f22fd239fa..e404277757f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9364,7 +9364,7 @@ static void clif_playBGM(struct map_session_data *sd, const char *name, enum pla /// npc id: /// The acoustic direction of the sound is determined by the /// relative position of the NPC to the player (3D sound). -static void clif_soundeffect(struct map_session_data *sd, struct block_list *bl, const char *name, int type) +static void clif_soundeffect(struct map_session_data *sd, struct block_list *bl, const char *name, enum play_sound_act type, int term) { nullpo_retv(sd); nullpo_retv(bl); @@ -9376,12 +9376,12 @@ static void clif_soundeffect(struct map_session_data *sd, struct block_list *bl, p->PacketType = HEADER_ZC_SOUND; safestrncpy(p->name, name, NAME_LENGTH); p->act = type; - p->term = 0; + p->term = term; p->AID = bl->id; WFIFOSET(fd, sizeof(struct PACKET_ZC_SOUND)); } -static void clif_soundeffectall(struct block_list *bl, const char *name, int type, enum send_target coverage) +static void clif_soundeffectall(struct block_list *bl, const char *name, enum play_sound_act type, int term, enum send_target coverage) { nullpo_retv(bl); nullpo_retv(name); @@ -9391,7 +9391,7 @@ static void clif_soundeffectall(struct block_list *bl, const char *name, int typ p.PacketType = HEADER_ZC_SOUND; safestrncpy(p.name, name, NAME_LENGTH); p.act = type; - p.term = 0; + p.term = term; p.AID = bl->id; clif->send(&p, sizeof(struct PACKET_ZC_SOUND), bl, coverage); } diff --git a/src/map/clif.h b/src/map/clif.h index 2270fbbcd5e..c41a0f2e1a5 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -862,6 +862,12 @@ enum play_npc_bgm { PLAY_BGM_STOP = 2, }; +enum play_sound_act { + SOUND_TYPE_PLAY = 0, + SOUND_TYPE_REPEAT = 1, + SOUND_TYPE_STOP = 2, +}; + /** * Clif.c Interface **/ @@ -1175,8 +1181,8 @@ struct clif_interface { void (*weather_check) (struct map_session_data *sd); /* sound effects client-side */ void (*playBGM) (struct map_session_data* sd, const char* name, enum play_npc_bgm type); - void (*soundeffect) (struct map_session_data* sd, struct block_list* bl, const char* name, int type); - void (*soundeffectall) (struct block_list* bl, const char* name, int type, enum send_target coverage); + void (*soundeffect) (struct map_session_data* sd, struct block_list* bl, const char* name, enum play_sound_act type, int term); + void (*soundeffectall) (struct block_list* bl, const char* name, enum play_sound_act type, int term, enum send_target coverage); /* chat/message-related */ void (*GlobalMessage) (struct block_list* bl, const char* message); void (*createchat) (struct map_session_data* sd, int flag); diff --git a/src/map/script.c b/src/map/script.c index cc7a91e4c20..6f3e7a36992 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -16725,10 +16725,10 @@ static BUILDIN(soundeffect) { struct map_session_data *sd = script->rid2sd(st); const char* name = script_getstr(st,2); - int type = script_getnum(st,3); + enum play_sound_act type = script_getnum(st,3); if (sd != NULL) { - clif->soundeffect(sd,&sd->bl,name,type); + clif->soundeffect(sd, &sd->bl, name, type, 0); } return true; } @@ -16743,7 +16743,7 @@ static int soundeffect_sub(struct block_list *bl, va_list ap) Assert_ret(bl->type == BL_PC); sd = BL_UCAST(BL_PC, bl); - clif->soundeffect(sd, bl, name, type); + clif->soundeffect(sd, bl, name, type, 0); return true; } @@ -16754,27 +16754,24 @@ static int soundeffect_sub(struct block_list *bl, va_list ap) *------------------------------------------*/ static BUILDIN(soundeffectall) { - const char* name; - int type; - struct block_list *bl = st->rid != 0 ? map->id2bl(st->rid) : map->id2bl(st->oid); if (bl == NULL) return true; - name = script_getstr(st,2); - type = script_getnum(st,3); + const char *name = script_getstr(st, 2); + enum play_sound_act type = script_getnum(st, 3); //FIXME: enumerating map squares (map->foreach) is slower than enumerating the list of online players (map->foreachpc?) [ultramage] if(!script_hasdata(st,4)) { // area around - clif->soundeffectall(bl, name, type, AREA); + clif->soundeffectall(bl, name, type, 0, AREA); } else { if(!script_hasdata(st,5)) { // entire map const char *mapname = script_getstr(st,4); int m; if ( ( m = map->mapname2mapid(mapname) ) == -1 ) { - ShowWarning("soundeffectall: Attempted to play song '%s' (type %d) on non-existent map '%s'\n",name,type, mapname); + ShowWarning("soundeffectall: Attempted to play song '%s' (type %d) on non-existent map '%s'\n", name, (int)type, mapname); return true; } @@ -16788,7 +16785,7 @@ static BUILDIN(soundeffectall) int m; if ( ( m = map->mapname2mapid(mapname) ) == -1 ) { - ShowWarning("soundeffectall: Attempted to play song '%s' (type %d) on non-existent map '%s'\n",name,type, mapname); + ShowWarning("soundeffectall: Attempted to play song '%s' (type %d) on non-existent map '%s'\n", name, (int)type, mapname); return true; } From cef7757ccf57634e4d678cdc18724368e855677b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 18:08:47 +0300 Subject: [PATCH 28/50] Update HPM --- src/common/HPMDataCheck.h | 1 + src/plugins/HPMHooking/HPMHooking.Defs.inc | 1024 ++++----- .../HPMHooking/HPMHooking_char.Hooks.inc | 488 ++--- .../HPMHooking/HPMHooking_login.Hooks.inc | 408 ++-- .../HPMHooking/HPMHooking_map.Hooks.inc | 1920 ++++++++--------- 5 files changed, 1921 insertions(+), 1920 deletions(-) diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index e96503f3ae5..cf6e71501df 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -791,6 +791,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_SKILL_SCALE", sizeof(struct PACKET_ZC_SKILL_SCALE), SERVER_TYPE_MAP }, { "PACKET_ZC_SKILLINFO_LIST", sizeof(struct PACKET_ZC_SKILLINFO_LIST), SERVER_TYPE_MAP }, { "PACKET_ZC_SKILLINFO_UPDATE2", sizeof(struct PACKET_ZC_SKILLINFO_UPDATE2), SERVER_TYPE_MAP }, + { "PACKET_ZC_SOUND", sizeof(struct PACKET_ZC_SOUND), SERVER_TYPE_MAP }, { "PACKET_ZC_SPIRITS", sizeof(struct PACKET_ZC_SPIRITS), SERVER_TYPE_MAP }, { "PACKET_ZC_SPRITE_CHANGE", sizeof(struct PACKET_ZC_SPRITE_CHANGE), SERVER_TYPE_MAP }, { "PACKET_ZC_START_CAPTURE", sizeof(struct PACKET_ZC_START_CAPTURE), SERVER_TYPE_MAP }, diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 7c6a17efb64..00732708e72 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -30,12 +30,12 @@ typedef void (*HPMHOOK_pre_HCache_init) (void); typedef void (*HPMHOOK_post_HCache_init) (void); typedef bool (*HPMHOOK_pre_HCache_check) (const char **file); typedef bool (*HPMHOOK_post_HCache_check) (bool retVal___, const char *file); -typedef FILE* (*HPMHOOK_pre_HCache_open) (const char **file, const char **opt); -typedef FILE* (*HPMHOOK_post_HCache_open) (FILE* retVal___, const char *file, const char *opt); +typedef FILE * (*HPMHOOK_pre_HCache_open) (const char **file, const char **opt); +typedef FILE * (*HPMHOOK_post_HCache_open) (FILE * retVal___, const char *file, const char *opt); #endif // COMMON_UTILS_H #ifdef LOGIN_ACCOUNT_H /* account */ -typedef struct Sql* (*HPMHOOK_pre_account_db_sql_up) (AccountDB **self); -typedef struct Sql* (*HPMHOOK_post_account_db_sql_up) (struct Sql* retVal___, AccountDB *self); +typedef struct Sql * (*HPMHOOK_pre_account_db_sql_up) (AccountDB **self); +typedef struct Sql * (*HPMHOOK_post_account_db_sql_up) (struct Sql * retVal___, AccountDB *self); typedef void (*HPMHOOK_pre_account_mmo_send_accreg2) (AccountDB **self, int *fd, int *account_id, int *char_id); typedef void (*HPMHOOK_post_account_mmo_send_accreg2) (AccountDB *self, int fd, int account_id, int char_id); typedef void (*HPMHOOK_pre_account_mmo_save_accreg2) (AccountDB **self, int *fd, int *account_id, int *char_id); @@ -44,8 +44,8 @@ typedef bool (*HPMHOOK_pre_account_mmo_auth_fromsql) (AccountDB_SQL **db, struct typedef bool (*HPMHOOK_post_account_mmo_auth_fromsql) (bool retVal___, AccountDB_SQL *db, struct mmo_account *acc, int account_id); typedef bool (*HPMHOOK_pre_account_mmo_auth_tosql) (AccountDB_SQL **db, const struct mmo_account **acc, bool *is_new); typedef bool (*HPMHOOK_post_account_mmo_auth_tosql) (bool retVal___, AccountDB_SQL *db, const struct mmo_account *acc, bool is_new); -typedef AccountDB* (*HPMHOOK_pre_account_db_sql) (void); -typedef AccountDB* (*HPMHOOK_post_account_db_sql) (AccountDB* retVal___); +typedef AccountDB * (*HPMHOOK_pre_account_db_sql) (void); +typedef AccountDB * (*HPMHOOK_post_account_db_sql) (AccountDB * retVal___); typedef bool (*HPMHOOK_pre_account_db_sql_init) (AccountDB **self); typedef bool (*HPMHOOK_post_account_db_sql_init) (bool retVal___, AccountDB *self); typedef void (*HPMHOOK_pre_account_db_sql_destroy) (AccountDB **self); @@ -64,8 +64,8 @@ typedef bool (*HPMHOOK_pre_account_db_sql_load_num) (AccountDB **self, struct mm typedef bool (*HPMHOOK_post_account_db_sql_load_num) (bool retVal___, AccountDB *self, struct mmo_account *acc, const int account_id); typedef bool (*HPMHOOK_pre_account_db_sql_load_str) (AccountDB **self, struct mmo_account **acc, const char **userid); typedef bool (*HPMHOOK_post_account_db_sql_load_str) (bool retVal___, AccountDB *self, struct mmo_account *acc, const char *userid); -typedef AccountDBIterator* (*HPMHOOK_pre_account_db_sql_iterator) (AccountDB **self); -typedef AccountDBIterator* (*HPMHOOK_post_account_db_sql_iterator) (AccountDBIterator* retVal___, AccountDB *self); +typedef AccountDBIterator * (*HPMHOOK_pre_account_db_sql_iterator) (AccountDB **self); +typedef AccountDBIterator * (*HPMHOOK_post_account_db_sql_iterator) (AccountDBIterator * retVal___, AccountDB *self); typedef void (*HPMHOOK_pre_account_db_sql_iter_destroy) (AccountDBIterator **self); typedef void (*HPMHOOK_post_account_db_sql_iter_destroy) (AccountDBIterator *self); typedef bool (*HPMHOOK_pre_account_db_sql_iter_next) (AccountDBIterator **self, struct mmo_account **acc); @@ -114,10 +114,10 @@ typedef void (*HPMHOOK_pre_achievement_readdb_additional_fields) (const struct c typedef void (*HPMHOOK_post_achievement_readdb_additional_fields) (const struct config_setting_t *conf, struct achievement_data *entry, const char *source); typedef void (*HPMHOOK_pre_achievement_readdb_ranks) (void); typedef void (*HPMHOOK_post_achievement_readdb_ranks) (void); -typedef const struct achievement_data* (*HPMHOOK_pre_achievement_get) (int *aid); -typedef const struct achievement_data* (*HPMHOOK_post_achievement_get) (const struct achievement_data* retVal___, int aid); -typedef struct achievement* (*HPMHOOK_pre_achievement_ensure) (struct map_session_data **sd, const struct achievement_data **ad); -typedef struct achievement* (*HPMHOOK_post_achievement_ensure) (struct achievement* retVal___, struct map_session_data *sd, const struct achievement_data *ad); +typedef const struct achievement_data * (*HPMHOOK_pre_achievement_get) (int *aid); +typedef const struct achievement_data * (*HPMHOOK_post_achievement_get) (const struct achievement_data * retVal___, int aid); +typedef struct achievement * (*HPMHOOK_pre_achievement_ensure) (struct map_session_data **sd, const struct achievement_data **ad); +typedef struct achievement * (*HPMHOOK_post_achievement_ensure) (struct achievement * retVal___, struct map_session_data *sd, const struct achievement_data *ad); typedef void (*HPMHOOK_pre_achievement_calculate_totals) (const struct map_session_data **sd, int **points, int **completed, int **rank, int **curr_rank_points); typedef void (*HPMHOOK_post_achievement_calculate_totals) (const struct map_session_data *sd, int *points, int *completed, int *rank, int *curr_rank_points); typedef bool (*HPMHOOK_pre_achievement_check_complete) (struct map_session_data **sd, const struct achievement_data **ad); @@ -198,18 +198,18 @@ typedef bool (*HPMHOOK_pre_atcommand_can_use2) (struct map_session_data **sd, co typedef bool (*HPMHOOK_post_atcommand_can_use2) (bool retVal___, struct map_session_data *sd, const char *command, AtCommandType type); typedef void (*HPMHOOK_pre_atcommand_load_groups) (GroupSettings ***groups, struct config_setting_t ***commands_, size_t *sz); typedef void (*HPMHOOK_post_atcommand_load_groups) (GroupSettings **groups, struct config_setting_t **commands_, size_t sz); -typedef AtCommandInfo* (*HPMHOOK_pre_atcommand_exists) (const char **name); -typedef AtCommandInfo* (*HPMHOOK_post_atcommand_exists) (AtCommandInfo* retVal___, const char *name); +typedef AtCommandInfo * (*HPMHOOK_pre_atcommand_exists) (const char **name); +typedef AtCommandInfo * (*HPMHOOK_post_atcommand_exists) (AtCommandInfo * retVal___, const char *name); typedef bool (*HPMHOOK_pre_atcommand_msg_read) (const char **cfg_name, bool *allow_override); typedef bool (*HPMHOOK_post_atcommand_msg_read) (bool retVal___, const char *cfg_name, bool allow_override); typedef void (*HPMHOOK_pre_atcommand_final_msg) (void); typedef void (*HPMHOOK_post_atcommand_final_msg) (void); -typedef struct atcmd_binding_data* (*HPMHOOK_pre_atcommand_get_bind_byname) (const char **name); -typedef struct atcmd_binding_data* (*HPMHOOK_post_atcommand_get_bind_byname) (struct atcmd_binding_data* retVal___, const char *name); -typedef AtCommandInfo* (*HPMHOOK_pre_atcommand_get_info_byname) (const char **name); -typedef AtCommandInfo* (*HPMHOOK_post_atcommand_get_info_byname) (AtCommandInfo* retVal___, const char *name); -typedef const char* (*HPMHOOK_pre_atcommand_check_alias) (const char **aliasname); -typedef const char* (*HPMHOOK_post_atcommand_check_alias) (const char* retVal___, const char *aliasname); +typedef struct atcmd_binding_data * (*HPMHOOK_pre_atcommand_get_bind_byname) (const char **name); +typedef struct atcmd_binding_data * (*HPMHOOK_post_atcommand_get_bind_byname) (struct atcmd_binding_data * retVal___, const char *name); +typedef AtCommandInfo * (*HPMHOOK_pre_atcommand_get_info_byname) (const char **name); +typedef AtCommandInfo * (*HPMHOOK_post_atcommand_get_info_byname) (AtCommandInfo * retVal___, const char *name); +typedef const char * (*HPMHOOK_pre_atcommand_check_alias) (const char **aliasname); +typedef const char * (*HPMHOOK_post_atcommand_check_alias) (const char * retVal___, const char *aliasname); typedef void (*HPMHOOK_pre_atcommand_get_suggestions) (struct map_session_data **sd, const char **name, bool *is_atcmd_cmd); typedef void (*HPMHOOK_post_atcommand_get_suggestions) (struct map_session_data *sd, const char *name, bool is_atcmd_cmd); typedef void (*HPMHOOK_pre_atcommand_config_read) (const char **config_filename); @@ -246,14 +246,14 @@ typedef void (*HPMHOOK_pre_atcommand_base_commands) (void); typedef void (*HPMHOOK_post_atcommand_base_commands) (void); typedef bool (*HPMHOOK_pre_atcommand_add) (char **name, AtCommandFunc *func, bool *replace); typedef bool (*HPMHOOK_post_atcommand_add) (bool retVal___, char *name, AtCommandFunc func, bool replace); -typedef const char* (*HPMHOOK_pre_atcommand_msg) (int *msg_number); -typedef const char* (*HPMHOOK_post_atcommand_msg) (const char* retVal___, int msg_number); +typedef const char * (*HPMHOOK_pre_atcommand_msg) (int *msg_number); +typedef const char * (*HPMHOOK_post_atcommand_msg) (const char * retVal___, int msg_number); typedef void (*HPMHOOK_pre_atcommand_expand_message_table) (void); typedef void (*HPMHOOK_post_atcommand_expand_message_table) (void); -typedef const char* (*HPMHOOK_pre_atcommand_msgfd) (int *fd, int *msg_number); -typedef const char* (*HPMHOOK_post_atcommand_msgfd) (const char* retVal___, int fd, int msg_number); -typedef const char* (*HPMHOOK_pre_atcommand_msgsd) (struct map_session_data **sd, int *msg_number); -typedef const char* (*HPMHOOK_post_atcommand_msgsd) (const char* retVal___, struct map_session_data *sd, int msg_number); +typedef const char * (*HPMHOOK_pre_atcommand_msgfd) (int *fd, int *msg_number); +typedef const char * (*HPMHOOK_post_atcommand_msgfd) (const char * retVal___, int fd, int msg_number); +typedef const char * (*HPMHOOK_pre_atcommand_msgsd) (struct map_session_data **sd, int *msg_number); +typedef const char * (*HPMHOOK_post_atcommand_msgsd) (const char * retVal___, struct map_session_data *sd, int msg_number); #endif // MAP_ATCOMMAND_H #ifdef MAP_BATTLE_H /* battle */ typedef void (*HPMHOOK_pre_battle_init) (bool *minimal); @@ -306,12 +306,12 @@ typedef int64 (*HPMHOOK_pre_battle_calc_weapon_damage) (struct block_list **src, typedef int64 (*HPMHOOK_post_battle_calc_weapon_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, struct weapon_atk *watk, int nk, bool n_ele, short s_ele, short s_ele_, int size, int type, int flag, int flag2); typedef int64 (*HPMHOOK_pre_battle_calc_defense) (int *attack_type, struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *flag, int *pdef); typedef int64 (*HPMHOOK_post_battle_calc_defense) (int64 retVal___, int attack_type, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int flag, int pdef); -typedef struct block_list* (*HPMHOOK_pre_battle_get_master) (struct block_list **src); -typedef struct block_list* (*HPMHOOK_post_battle_get_master) (struct block_list* retVal___, struct block_list *src); -typedef struct block_list* (*HPMHOOK_pre_battle_get_targeted) (struct block_list **target); -typedef struct block_list* (*HPMHOOK_post_battle_get_targeted) (struct block_list* retVal___, struct block_list *target); -typedef struct block_list* (*HPMHOOK_pre_battle_get_enemy) (struct block_list **target, int *type, int *range); -typedef struct block_list* (*HPMHOOK_post_battle_get_enemy) (struct block_list* retVal___, struct block_list *target, int type, int range); +typedef struct block_list * (*HPMHOOK_pre_battle_get_master) (struct block_list **src); +typedef struct block_list * (*HPMHOOK_post_battle_get_master) (struct block_list * retVal___, struct block_list *src); +typedef struct block_list * (*HPMHOOK_pre_battle_get_targeted) (struct block_list **target); +typedef struct block_list * (*HPMHOOK_post_battle_get_targeted) (struct block_list * retVal___, struct block_list *target); +typedef struct block_list * (*HPMHOOK_pre_battle_get_enemy) (struct block_list **target, int *type, int *range); +typedef struct block_list * (*HPMHOOK_post_battle_get_enemy) (struct block_list * retVal___, struct block_list *target, int type, int range); typedef int (*HPMHOOK_pre_battle_get_target) (struct block_list **bl); typedef int (*HPMHOOK_post_battle_get_target) (int retVal___, struct block_list *bl); typedef int (*HPMHOOK_pre_battle_get_current_skill) (struct block_list **bl); @@ -362,8 +362,8 @@ typedef bool (*HPMHOOK_pre_battle_config_get_value) (const char **w1, int **valu typedef bool (*HPMHOOK_post_battle_config_get_value) (bool retVal___, const char *w1, int *value); typedef void (*HPMHOOK_pre_battle_config_adjust) (void); typedef void (*HPMHOOK_post_battle_config_adjust) (void); -typedef struct block_list* (*HPMHOOK_pre_battle_get_enemy_area) (struct block_list **src, int *x, int *y, int *range, int *type, int *ignore_id); -typedef struct block_list* (*HPMHOOK_post_battle_get_enemy_area) (struct block_list* retVal___, struct block_list *src, int x, int y, int range, int type, int ignore_id); +typedef struct block_list * (*HPMHOOK_pre_battle_get_enemy_area) (struct block_list **src, int *x, int *y, int *range, int *type, int *ignore_id); +typedef struct block_list * (*HPMHOOK_post_battle_get_enemy_area) (struct block_list * retVal___, struct block_list *src, int x, int y, int range, int type, int ignore_id); typedef int (*HPMHOOK_pre_battle_damage_area) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_battle_damage_area) (int retVal___, struct block_list *bl, va_list ap); typedef void (*HPMHOOK_pre_battle_calc_masteryfix_unknown) (struct block_list **src, struct block_list **target, uint16 **skill_id, uint16 **skill_lv, int64 **damage, int **div, bool **left, bool **weapon); @@ -380,8 +380,8 @@ typedef void (*HPMHOOK_pre_bg_init) (bool *minimal); typedef void (*HPMHOOK_post_bg_init) (bool minimal); typedef void (*HPMHOOK_pre_bg_final) (void); typedef void (*HPMHOOK_post_bg_final) (void); -typedef struct bg_arena* (*HPMHOOK_pre_bg_name2arena) (const char **name); -typedef struct bg_arena* (*HPMHOOK_post_bg_name2arena) (struct bg_arena* retVal___, const char *name); +typedef struct bg_arena * (*HPMHOOK_pre_bg_name2arena) (const char **name); +typedef struct bg_arena * (*HPMHOOK_post_bg_name2arena) (struct bg_arena * retVal___, const char *name); typedef void (*HPMHOOK_pre_bg_queue_add) (struct map_session_data **sd, struct bg_arena **arena, enum bg_queue_types *type); typedef void (*HPMHOOK_post_bg_queue_add) (struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type); typedef enum BATTLEGROUNDS_QUEUE_ACK (*HPMHOOK_pre_bg_can_queue) (struct map_session_data **sd, struct bg_arena **arena, enum bg_queue_types *type); @@ -404,10 +404,10 @@ typedef void (*HPMHOOK_pre_bg_match_over) (struct bg_arena **arena, bool *cancel typedef void (*HPMHOOK_post_bg_match_over) (struct bg_arena *arena, bool canceled); typedef void (*HPMHOOK_pre_bg_queue_check) (struct bg_arena **arena); typedef void (*HPMHOOK_post_bg_queue_check) (struct bg_arena *arena); -typedef struct battleground_data* (*HPMHOOK_pre_bg_team_search) (int *bg_id); -typedef struct battleground_data* (*HPMHOOK_post_bg_team_search) (struct battleground_data* retVal___, int bg_id); -typedef struct map_session_data* (*HPMHOOK_pre_bg_getavailablesd) (struct battleground_data **bgd); -typedef struct map_session_data* (*HPMHOOK_post_bg_getavailablesd) (struct map_session_data* retVal___, struct battleground_data *bgd); +typedef struct battleground_data * (*HPMHOOK_pre_bg_team_search) (int *bg_id); +typedef struct battleground_data * (*HPMHOOK_post_bg_team_search) (struct battleground_data * retVal___, int bg_id); +typedef struct map_session_data * (*HPMHOOK_pre_bg_getavailablesd) (struct battleground_data **bgd); +typedef struct map_session_data * (*HPMHOOK_post_bg_getavailablesd) (struct map_session_data * retVal___, struct battleground_data *bgd); typedef bool (*HPMHOOK_pre_bg_team_delete) (int *bg_id); typedef bool (*HPMHOOK_post_bg_team_delete) (bool retVal___, int bg_id); typedef bool (*HPMHOOK_pre_bg_team_warp) (int *bg_id, unsigned short *map_index, short *x, short *y); @@ -462,10 +462,10 @@ typedef int (*HPMHOOK_pre_channel_init) (bool *minimal); typedef int (*HPMHOOK_post_channel_init) (int retVal___, bool minimal); typedef void (*HPMHOOK_pre_channel_final) (void); typedef void (*HPMHOOK_post_channel_final) (void); -typedef struct channel_data* (*HPMHOOK_pre_channel_search) (const char **name, struct map_session_data **sd); -typedef struct channel_data* (*HPMHOOK_post_channel_search) (struct channel_data* retVal___, const char *name, struct map_session_data *sd); -typedef struct channel_data* (*HPMHOOK_pre_channel_create) (enum channel_types *type, const char **name, unsigned char *color); -typedef struct channel_data* (*HPMHOOK_post_channel_create) (struct channel_data* retVal___, enum channel_types type, const char *name, unsigned char color); +typedef struct channel_data * (*HPMHOOK_pre_channel_search) (const char **name, struct map_session_data **sd); +typedef struct channel_data * (*HPMHOOK_post_channel_search) (struct channel_data * retVal___, const char *name, struct map_session_data *sd); +typedef struct channel_data * (*HPMHOOK_pre_channel_create) (enum channel_types *type, const char **name, unsigned char *color); +typedef struct channel_data * (*HPMHOOK_post_channel_create) (struct channel_data * retVal___, enum channel_types type, const char *name, unsigned char color); typedef void (*HPMHOOK_pre_channel_delete) (struct channel_data **chan); typedef void (*HPMHOOK_post_channel_delete) (struct channel_data *chan); typedef void (*HPMHOOK_pre_channel_set_password) (struct channel_data **chan, const char **password); @@ -878,8 +878,8 @@ typedef bool (*HPMHOOK_pre_chat_npc_kick_all) (struct chat_data **cd); typedef bool (*HPMHOOK_post_chat_npc_kick_all) (bool retVal___, struct chat_data *cd); typedef bool (*HPMHOOK_pre_chat_trigger_event) (struct chat_data **cd); typedef bool (*HPMHOOK_post_chat_trigger_event) (bool retVal___, struct chat_data *cd); -typedef struct chat_data* (*HPMHOOK_pre_chat_create) (struct block_list **bl, const char **title, const char **pass, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level); -typedef struct chat_data* (*HPMHOOK_post_chat_create) (struct chat_data* retVal___, struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level); +typedef struct chat_data * (*HPMHOOK_pre_chat_create) (struct block_list **bl, const char **title, const char **pass, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level); +typedef struct chat_data * (*HPMHOOK_post_chat_create) (struct chat_data * retVal___, struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level); #endif // MAP_CHAT_H #ifdef MAP_CHRIF_H /* chrif */ typedef void (*HPMHOOK_pre_chrif_init) (bool *minimal); @@ -900,10 +900,10 @@ typedef int (*HPMHOOK_pre_chrif_isconnected) (void); typedef int (*HPMHOOK_post_chrif_isconnected) (int retVal___); typedef void (*HPMHOOK_pre_chrif_check_shutdown) (void); typedef void (*HPMHOOK_post_chrif_check_shutdown) (void); -typedef struct auth_node* (*HPMHOOK_pre_chrif_search) (int *account_id); -typedef struct auth_node* (*HPMHOOK_post_chrif_search) (struct auth_node* retVal___, int account_id); -typedef struct auth_node* (*HPMHOOK_pre_chrif_auth_check) (int *account_id, int *char_id, enum sd_state *state); -typedef struct auth_node* (*HPMHOOK_post_chrif_auth_check) (struct auth_node* retVal___, int account_id, int char_id, enum sd_state state); +typedef struct auth_node * (*HPMHOOK_pre_chrif_search) (int *account_id); +typedef struct auth_node * (*HPMHOOK_post_chrif_search) (struct auth_node * retVal___, int account_id); +typedef struct auth_node * (*HPMHOOK_pre_chrif_auth_check) (int *account_id, int *char_id, enum sd_state *state); +typedef struct auth_node * (*HPMHOOK_post_chrif_auth_check) (struct auth_node * retVal___, int account_id, int char_id, enum sd_state state); typedef bool (*HPMHOOK_pre_chrif_auth_delete) (int *account_id, int *char_id, enum sd_state *state); typedef bool (*HPMHOOK_post_chrif_auth_delete) (bool retVal___, int account_id, int char_id, enum sd_state state); typedef bool (*HPMHOOK_pre_chrif_auth_finished) (struct map_session_data **sd); @@ -1038,12 +1038,12 @@ typedef void (*HPMHOOK_pre_clan_read_db_additional_fields) (struct clan **entry, typedef void (*HPMHOOK_post_clan_read_db_additional_fields) (struct clan *entry, struct config_setting_t *t, int n, const char *source); typedef void (*HPMHOOK_pre_clan_read_buffs) (struct clan **c, struct config_setting_t **buff, const char **source); typedef void (*HPMHOOK_post_clan_read_buffs) (struct clan *c, struct config_setting_t *buff, const char *source); -typedef struct clan* (*HPMHOOK_pre_clan_search) (int *clan_id); -typedef struct clan* (*HPMHOOK_post_clan_search) (struct clan* retVal___, int clan_id); -typedef struct clan* (*HPMHOOK_pre_clan_searchname) (const char **name); -typedef struct clan* (*HPMHOOK_post_clan_searchname) (struct clan* retVal___, const char *name); -typedef struct map_session_data* (*HPMHOOK_pre_clan_getonlinesd) (struct clan **c); -typedef struct map_session_data* (*HPMHOOK_post_clan_getonlinesd) (struct map_session_data* retVal___, struct clan *c); +typedef struct clan * (*HPMHOOK_pre_clan_search) (int *clan_id); +typedef struct clan * (*HPMHOOK_post_clan_search) (struct clan * retVal___, int clan_id); +typedef struct clan * (*HPMHOOK_pre_clan_searchname) (const char **name); +typedef struct clan * (*HPMHOOK_post_clan_searchname) (struct clan * retVal___, const char *name); +typedef struct map_session_data * (*HPMHOOK_pre_clan_getonlinesd) (struct clan **c); +typedef struct map_session_data * (*HPMHOOK_post_clan_getonlinesd) (struct map_session_data * retVal___, struct clan *c); typedef int (*HPMHOOK_pre_clan_getindex) (const struct clan **c, int *char_id); typedef int (*HPMHOOK_post_clan_getindex) (int retVal___, const struct clan *c, int char_id); typedef bool (*HPMHOOK_pre_clan_join) (struct map_session_data **sd, int *clan_id); @@ -1098,8 +1098,8 @@ typedef int (*HPMHOOK_pre_clif_send_actual) (int *fd, void **buf, int *len); typedef int (*HPMHOOK_post_clif_send_actual) (int retVal___, int fd, void *buf, int len); typedef int (*HPMHOOK_pre_clif_parse) (int *fd); typedef int (*HPMHOOK_post_clif_parse) (int retVal___, int fd); -typedef const struct s_packet_db* (*HPMHOOK_pre_clif_packet) (int *packet_id); -typedef const struct s_packet_db* (*HPMHOOK_post_clif_packet) (const struct s_packet_db* retVal___, int packet_id); +typedef const struct s_packet_db * (*HPMHOOK_pre_clif_packet) (int *packet_id); +typedef const struct s_packet_db * (*HPMHOOK_post_clif_packet) (const struct s_packet_db * retVal___, int packet_id); typedef unsigned short (*HPMHOOK_pre_clif_parse_cmd) (int *fd, struct map_session_data **sd); typedef unsigned short (*HPMHOOK_post_clif_parse_cmd) (unsigned short retVal___, int fd, struct map_session_data *sd); typedef unsigned short (*HPMHOOK_pre_clif_decrypt_cmd) (int *cmd, struct map_session_data **sd); @@ -1608,10 +1608,10 @@ typedef void (*HPMHOOK_pre_clif_weather_check) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_weather_check) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_playBGM) (struct map_session_data **sd, const char **name, enum play_npc_bgm *type); typedef void (*HPMHOOK_post_clif_playBGM) (struct map_session_data *sd, const char *name, enum play_npc_bgm type); -typedef void (*HPMHOOK_pre_clif_soundeffect) (struct map_session_data **sd, struct block_list **bl, const char **name, int *type); -typedef void (*HPMHOOK_post_clif_soundeffect) (struct map_session_data *sd, struct block_list *bl, const char *name, int type); -typedef void (*HPMHOOK_pre_clif_soundeffectall) (struct block_list **bl, const char **name, int *type, enum send_target *coverage); -typedef void (*HPMHOOK_post_clif_soundeffectall) (struct block_list *bl, const char *name, int type, enum send_target coverage); +typedef void (*HPMHOOK_pre_clif_soundeffect) (struct map_session_data **sd, struct block_list **bl, const char **name, enum play_sound_act *type, int *term); +typedef void (*HPMHOOK_post_clif_soundeffect) (struct map_session_data *sd, struct block_list *bl, const char *name, enum play_sound_act type, int term); +typedef void (*HPMHOOK_pre_clif_soundeffectall) (struct block_list **bl, const char **name, enum play_sound_act *type, int *term, enum send_target *coverage); +typedef void (*HPMHOOK_post_clif_soundeffectall) (struct block_list *bl, const char *name, enum play_sound_act type, int term, enum send_target coverage); typedef void (*HPMHOOK_pre_clif_GlobalMessage) (struct block_list **bl, const char **message); typedef void (*HPMHOOK_post_clif_GlobalMessage) (struct block_list *bl, const char *message); typedef void (*HPMHOOK_pre_clif_createchat) (struct map_session_data **sd, int *flag); @@ -1670,8 +1670,8 @@ typedef void (*HPMHOOK_pre_clif_message) (const int *fd, const char **mes); typedef void (*HPMHOOK_post_clif_message) (const int fd, const char *mes); typedef void (*HPMHOOK_pre_clif_messageln) (const int *fd, const char **mes); typedef void (*HPMHOOK_post_clif_messageln) (const int fd, const char *mes); -typedef const char* (*HPMHOOK_pre_clif_process_chat_message) (struct map_session_data **sd, const struct packet_chat_message **packet, char **out_buf, int *out_buflen); -typedef const char* (*HPMHOOK_post_clif_process_chat_message) (const char* retVal___, struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen); +typedef const char * (*HPMHOOK_pre_clif_process_chat_message) (struct map_session_data **sd, const struct packet_chat_message **packet, char **out_buf, int *out_buflen); +typedef const char * (*HPMHOOK_post_clif_process_chat_message) (const char * retVal___, struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen); typedef bool (*HPMHOOK_pre_clif_process_whisper_message) (struct map_session_data **sd, const struct packet_whisper_message **packet, char **out_name, char **out_message, int *out_messagelen); typedef bool (*HPMHOOK_post_clif_process_whisper_message) (bool retVal___, struct map_session_data *sd, const struct packet_whisper_message *packet, char *out_name, char *out_message, int out_messagelen); typedef void (*HPMHOOK_pre_clif_wisexin) (struct map_session_data **sd, int *type, int *flag); @@ -2616,8 +2616,8 @@ typedef void (*HPMHOOK_pre_clif_selectcart) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_selectcart) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pSelectCart) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pSelectCart) (int fd, struct map_session_data *sd); -typedef const char* (*HPMHOOK_pre_clif_get_bl_name) (const struct block_list **bl); -typedef const char* (*HPMHOOK_post_clif_get_bl_name) (const char* retVal___, const struct block_list *bl); +typedef const char * (*HPMHOOK_pre_clif_get_bl_name) (const struct block_list **bl); +typedef const char * (*HPMHOOK_post_clif_get_bl_name) (const char * retVal___, const struct block_list *bl); typedef void (*HPMHOOK_pre_clif_pRodexOpenWriteMail) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pRodexOpenWriteMail) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_rodex_open_write_mail) (int *fd, const char **receiver_name, int8 *result); @@ -2894,8 +2894,8 @@ typedef int (*HPMHOOK_pre_cmdline_exec) (int *argc, char ***argv, unsigned int * typedef int (*HPMHOOK_post_cmdline_exec) (int retVal___, int argc, char **argv, unsigned int options); typedef bool (*HPMHOOK_pre_cmdline_arg_next_value) (const char **name, int *current_arg, int *argc); typedef bool (*HPMHOOK_post_cmdline_arg_next_value) (bool retVal___, const char *name, int current_arg, int argc); -typedef const char* (*HPMHOOK_pre_cmdline_arg_source) (struct CmdlineArgData **arg); -typedef const char* (*HPMHOOK_post_cmdline_arg_source) (const char* retVal___, struct CmdlineArgData *arg); +typedef const char * (*HPMHOOK_pre_cmdline_arg_source) (struct CmdlineArgData **arg); +typedef const char * (*HPMHOOK_post_cmdline_arg_source) (const char * retVal___, struct CmdlineArgData *arg); #endif // COMMON_CORE_H #ifdef COMMON_CONSOLE_H /* console */ typedef void (*HPMHOOK_pre_console_init) (void); @@ -2922,8 +2922,8 @@ typedef DBReleaser (*HPMHOOK_pre_DB_default_release) (enum DBType *type, enum DB typedef DBReleaser (*HPMHOOK_post_DB_default_release) (DBReleaser retVal___, enum DBType type, enum DBOptions options); typedef DBReleaser (*HPMHOOK_pre_DB_custom_release) (enum DBReleaseOption *which); typedef DBReleaser (*HPMHOOK_post_DB_custom_release) (DBReleaser retVal___, enum DBReleaseOption which); -typedef struct DBMap* (*HPMHOOK_pre_DB_alloc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen); -typedef struct DBMap* (*HPMHOOK_post_DB_alloc) (struct DBMap* retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen); +typedef struct DBMap * (*HPMHOOK_pre_DB_alloc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen); +typedef struct DBMap * (*HPMHOOK_post_DB_alloc) (struct DBMap * retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen); typedef union DBKey (*HPMHOOK_pre_DB_i2key) (int *key); typedef union DBKey (*HPMHOOK_post_DB_i2key) (union DBKey retVal___, int key); typedef union DBKey (*HPMHOOK_pre_DB_ui2key) (unsigned int *key); @@ -2944,8 +2944,8 @@ typedef int (*HPMHOOK_pre_DB_data2i) (struct DBData **data); typedef int (*HPMHOOK_post_DB_data2i) (int retVal___, struct DBData *data); typedef unsigned int (*HPMHOOK_pre_DB_data2ui) (struct DBData **data); typedef unsigned int (*HPMHOOK_post_DB_data2ui) (unsigned int retVal___, struct DBData *data); -typedef void* (*HPMHOOK_pre_DB_data2ptr) (struct DBData **data); -typedef void* (*HPMHOOK_post_DB_data2ptr) (void* retVal___, struct DBData *data); +typedef void * (*HPMHOOK_pre_DB_data2ptr) (struct DBData **data); +typedef void * (*HPMHOOK_post_DB_data2ptr) (void * retVal___, struct DBData *data); typedef void (*HPMHOOK_pre_DB_init) (void); typedef void (*HPMHOOK_post_DB_init) (void); typedef void (*HPMHOOK_pre_DB_final) (void); @@ -2984,8 +2984,8 @@ typedef void (*HPMHOOK_pre_elemental_final) (void); typedef void (*HPMHOOK_post_elemental_final) (void); typedef bool (*HPMHOOK_pre_elemental_class) (int *class_); typedef bool (*HPMHOOK_post_elemental_class) (bool retVal___, int class_); -typedef struct view_data* (*HPMHOOK_pre_elemental_get_viewdata) (int *class_); -typedef struct view_data* (*HPMHOOK_post_elemental_get_viewdata) (struct view_data* retVal___, int class_); +typedef struct view_data * (*HPMHOOK_pre_elemental_get_viewdata) (int *class_); +typedef struct view_data * (*HPMHOOK_post_elemental_get_viewdata) (struct view_data * retVal___, int class_); typedef int (*HPMHOOK_pre_elemental_create) (struct map_session_data **sd, int *class_, unsigned int *lifetime); typedef int (*HPMHOOK_post_elemental_create) (int retVal___, struct map_session_data *sd, int class_, unsigned int lifetime); typedef int (*HPMHOOK_pre_elemental_data_received) (const struct s_elemental **ele, bool *flag); @@ -3044,8 +3044,8 @@ typedef int (*HPMHOOK_pre_elemental_read_db) (void); typedef int (*HPMHOOK_post_elemental_read_db) (int retVal___); #endif // MAP_ELEMENTAL_H #ifdef CHAR_GEOIP_H /* geoip */ -typedef const char* (*HPMHOOK_pre_geoip_getcountry) (uint32 *ipnum); -typedef const char* (*HPMHOOK_post_geoip_getcountry) (const char* retVal___, uint32 ipnum); +typedef const char * (*HPMHOOK_pre_geoip_getcountry) (uint32 *ipnum); +typedef const char * (*HPMHOOK_post_geoip_getcountry) (const char * retVal___, uint32 ipnum); typedef void (*HPMHOOK_pre_geoip_final) (bool *shutdown); typedef void (*HPMHOOK_post_geoip_final) (bool shutdown); typedef void (*HPMHOOK_pre_geoip_init) (void); @@ -3072,8 +3072,8 @@ typedef bool (*HPMHOOK_pre_grader_failure_behavior_string2enum) (const char **st typedef bool (*HPMHOOK_post_grader_failure_behavior_string2enum) (bool retVal___, const char *str, enum grade_ui_failure_behavior *result); typedef bool (*HPMHOOK_pre_grader_announce_behavior_string2enum) (const char **str, enum grade_announce_condition **result); typedef bool (*HPMHOOK_post_grader_announce_behavior_string2enum) (bool retVal___, const char *str, enum grade_announce_condition *result); -typedef const struct s_grade_info* (*HPMHOOK_pre_grader_get_grade_info) (int *grade); -typedef const struct s_grade_info* (*HPMHOOK_post_grader_get_grade_info) (const struct s_grade_info* retVal___, int grade); +typedef const struct s_grade_info * (*HPMHOOK_pre_grader_get_grade_info) (int *grade); +typedef const struct s_grade_info * (*HPMHOOK_post_grader_get_grade_info) (const struct s_grade_info * retVal___, int grade); typedef void (*HPMHOOK_pre_grader_enchant_add_item) (struct map_session_data **sd, int *idx); typedef void (*HPMHOOK_post_grader_enchant_add_item) (struct map_session_data *sd, int idx); typedef void (*HPMHOOK_pre_grader_enchant_start) (struct map_session_data **sd, int *idx, int *mat_idx, bool *use_blessing, int *blessing_amount); @@ -3084,10 +3084,10 @@ typedef void (*HPMHOOK_pre_grfio_init) (const char **fname); typedef void (*HPMHOOK_post_grfio_init) (const char *fname); typedef void (*HPMHOOK_pre_grfio_final) (void); typedef void (*HPMHOOK_post_grfio_final) (void); -typedef void* (*HPMHOOK_pre_grfio_reads) (const char **fname, int **size); -typedef void* (*HPMHOOK_post_grfio_reads) (void* retVal___, const char *fname, int *size); -typedef const char* (*HPMHOOK_pre_grfio_find_file) (const char **fname); -typedef const char* (*HPMHOOK_post_grfio_find_file) (const char* retVal___, const char *fname); +typedef void * (*HPMHOOK_pre_grfio_reads) (const char **fname, int **size); +typedef void * (*HPMHOOK_post_grfio_reads) (void * retVal___, const char *fname, int *size); +typedef const char * (*HPMHOOK_pre_grfio_find_file) (const char **fname); +typedef const char * (*HPMHOOK_post_grfio_find_file) (const char * retVal___, const char *fname); typedef unsigned long (*HPMHOOK_pre_grfio_crc32) (const unsigned char **buf, unsigned int *len); typedef unsigned long (*HPMHOOK_post_grfio_crc32) (unsigned long retVal___, const unsigned char *buf, unsigned int len); typedef int (*HPMHOOK_pre_grfio_decode_zip) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len); @@ -3096,8 +3096,8 @@ typedef int (*HPMHOOK_pre_grfio_encode_zip) (void **dest, unsigned long **dest_l typedef int (*HPMHOOK_post_grfio_encode_zip) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len); typedef void (*HPMHOOK_pre_grfio_report_error) (int *err); typedef void (*HPMHOOK_post_grfio_report_error) (int err); -typedef char* (*HPMHOOK_pre_grfio_decode_filename) (unsigned char **buf, int *len); -typedef char* (*HPMHOOK_post_grfio_decode_filename) (char* retVal___, unsigned char *buf, int len); +typedef char * (*HPMHOOK_pre_grfio_decode_filename) (unsigned char **buf, int *len); +typedef char * (*HPMHOOK_post_grfio_decode_filename) (char * retVal___, unsigned char *buf, int len); #endif // COMMON_GRFIO_H #ifdef MAP_GUILD_H /* guild */ typedef void (*HPMHOOK_pre_guild_init) (bool *minimal); @@ -3114,18 +3114,18 @@ typedef int (*HPMHOOK_pre_guild_checkcastles) (struct guild **g); typedef int (*HPMHOOK_post_guild_checkcastles) (int retVal___, struct guild *g); typedef bool (*HPMHOOK_pre_guild_isallied) (int *guild_id, int *guild_id2); typedef bool (*HPMHOOK_post_guild_isallied) (bool retVal___, int guild_id, int guild_id2); -typedef struct guild* (*HPMHOOK_pre_guild_search) (int *guild_id); -typedef struct guild* (*HPMHOOK_post_guild_search) (struct guild* retVal___, int guild_id); -typedef struct guild* (*HPMHOOK_pre_guild_searchname) (const char **str); -typedef struct guild* (*HPMHOOK_post_guild_searchname) (struct guild* retVal___, const char *str); -typedef struct guild_castle* (*HPMHOOK_pre_guild_castle_search) (int *gcid); -typedef struct guild_castle* (*HPMHOOK_post_guild_castle_search) (struct guild_castle* retVal___, int gcid); -typedef struct guild_castle* (*HPMHOOK_pre_guild_mapname2gc) (const char **mapname); -typedef struct guild_castle* (*HPMHOOK_post_guild_mapname2gc) (struct guild_castle* retVal___, const char *mapname); -typedef struct guild_castle* (*HPMHOOK_pre_guild_mapindex2gc) (short *map_index); -typedef struct guild_castle* (*HPMHOOK_post_guild_mapindex2gc) (struct guild_castle* retVal___, short map_index); -typedef struct map_session_data* (*HPMHOOK_pre_guild_getavailablesd) (struct guild **g); -typedef struct map_session_data* (*HPMHOOK_post_guild_getavailablesd) (struct map_session_data* retVal___, struct guild *g); +typedef struct guild * (*HPMHOOK_pre_guild_search) (int *guild_id); +typedef struct guild * (*HPMHOOK_post_guild_search) (struct guild * retVal___, int guild_id); +typedef struct guild * (*HPMHOOK_pre_guild_searchname) (const char **str); +typedef struct guild * (*HPMHOOK_post_guild_searchname) (struct guild * retVal___, const char *str); +typedef struct guild_castle * (*HPMHOOK_pre_guild_castle_search) (int *gcid); +typedef struct guild_castle * (*HPMHOOK_post_guild_castle_search) (struct guild_castle * retVal___, int gcid); +typedef struct guild_castle * (*HPMHOOK_pre_guild_mapname2gc) (const char **mapname); +typedef struct guild_castle * (*HPMHOOK_post_guild_mapname2gc) (struct guild_castle * retVal___, const char *mapname); +typedef struct guild_castle * (*HPMHOOK_pre_guild_mapindex2gc) (short *map_index); +typedef struct guild_castle * (*HPMHOOK_post_guild_mapindex2gc) (struct guild_castle * retVal___, short map_index); +typedef struct map_session_data * (*HPMHOOK_pre_guild_getavailablesd) (struct guild **g); +typedef struct map_session_data * (*HPMHOOK_post_guild_getavailablesd) (struct map_session_data * retVal___, struct guild *g); typedef int (*HPMHOOK_pre_guild_getindex) (const struct guild **g, int *account_id, int *char_id); typedef int (*HPMHOOK_post_guild_getindex) (int retVal___, const struct guild *g, int account_id, int char_id); typedef int (*HPMHOOK_pre_guild_getposition) (struct guild **g, struct map_session_data **sd); @@ -3238,8 +3238,8 @@ typedef void (*HPMHOOK_pre_guild_retrieveitembound) (int *char_id, int *aid, int typedef void (*HPMHOOK_post_guild_retrieveitembound) (int char_id, int aid, int guild_id); typedef int (*HPMHOOK_pre_guild_payexp_timer) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_guild_payexp_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); -typedef struct map_session_data* (*HPMHOOK_pre_guild_sd_check) (int *guild_id, int *account_id, int *char_id); -typedef struct map_session_data* (*HPMHOOK_post_guild_sd_check) (struct map_session_data* retVal___, int guild_id, int account_id, int char_id); +typedef struct map_session_data * (*HPMHOOK_pre_guild_sd_check) (int *guild_id, int *account_id, int *char_id); +typedef struct map_session_data * (*HPMHOOK_post_guild_sd_check) (struct map_session_data * retVal___, int guild_id, int account_id, int char_id); typedef bool (*HPMHOOK_pre_guild_read_guildskill_tree_db) (char **split[], int *columns, int *current); typedef bool (*HPMHOOK_post_guild_read_guildskill_tree_db) (bool retVal___, char *split[], int columns, int current); typedef bool (*HPMHOOK_pre_guild_read_castledb_libconfig) (void); @@ -3278,8 +3278,8 @@ typedef int (*HPMHOOK_pre_guild_castle_owner_change_foreach) (struct map_session typedef int (*HPMHOOK_post_guild_castle_owner_change_foreach) (int retVal___, struct map_session_data *sd, va_list ap); #endif // MAP_GUILD_H #ifdef MAP_STORAGE_H /* gstorage */ -typedef struct guild_storage* (*HPMHOOK_pre_gstorage_ensure) (int *guild_id); -typedef struct guild_storage* (*HPMHOOK_post_gstorage_ensure) (struct guild_storage* retVal___, int guild_id); +typedef struct guild_storage * (*HPMHOOK_pre_gstorage_ensure) (int *guild_id); +typedef struct guild_storage * (*HPMHOOK_post_gstorage_ensure) (struct guild_storage * retVal___, int guild_id); typedef void (*HPMHOOK_pre_gstorage_init) (bool *minimal); typedef void (*HPMHOOK_post_gstorage_init) (bool minimal); typedef void (*HPMHOOK_pre_gstorage_final) (void); @@ -3322,8 +3322,8 @@ typedef void (*HPMHOOK_pre_homun_reload) (void); typedef void (*HPMHOOK_post_homun_reload) (void); typedef void (*HPMHOOK_pre_homun_reload_skill) (void); typedef void (*HPMHOOK_post_homun_reload_skill) (void); -typedef struct view_data* (*HPMHOOK_pre_homun_get_viewdata) (int *class_); -typedef struct view_data* (*HPMHOOK_post_homun_get_viewdata) (struct view_data* retVal___, int class_); +typedef struct view_data * (*HPMHOOK_pre_homun_get_viewdata) (int *class_); +typedef struct view_data * (*HPMHOOK_post_homun_get_viewdata) (struct view_data * retVal___, int class_); typedef enum homun_type (*HPMHOOK_pre_homun_class2type) (enum homun_id *class_); typedef enum homun_type (*HPMHOOK_post_homun_class2type) (enum homun_type retVal___, enum homun_id class_); typedef void (*HPMHOOK_pre_homun_damaged) (struct homun_data **hd); @@ -3530,12 +3530,12 @@ typedef int (*HPMHOOK_pre_inter_guild_removemember_tosql) (int *account_id, int typedef int (*HPMHOOK_post_inter_guild_removemember_tosql) (int retVal___, int account_id, int char_id); typedef bool (*HPMHOOK_pre_inter_guild_tosql) (struct guild **g, int *flag); typedef bool (*HPMHOOK_post_inter_guild_tosql) (bool retVal___, struct guild *g, int flag); -typedef struct guild* (*HPMHOOK_pre_inter_guild_fromsql) (int *guild_id); -typedef struct guild* (*HPMHOOK_post_inter_guild_fromsql) (struct guild* retVal___, int guild_id); +typedef struct guild * (*HPMHOOK_pre_inter_guild_fromsql) (int *guild_id); +typedef struct guild * (*HPMHOOK_post_inter_guild_fromsql) (struct guild * retVal___, int guild_id); typedef int (*HPMHOOK_pre_inter_guild_castle_tosql) (struct guild_castle **gc); typedef int (*HPMHOOK_post_inter_guild_castle_tosql) (int retVal___, struct guild_castle *gc); -typedef struct guild_castle* (*HPMHOOK_pre_inter_guild_castle_fromsql) (int *castle_id); -typedef struct guild_castle* (*HPMHOOK_post_inter_guild_castle_fromsql) (struct guild_castle* retVal___, int castle_id); +typedef struct guild_castle * (*HPMHOOK_pre_inter_guild_castle_fromsql) (int *castle_id); +typedef struct guild_castle * (*HPMHOOK_post_inter_guild_castle_fromsql) (struct guild_castle * retVal___, int castle_id); typedef bool (*HPMHOOK_pre_inter_guild_exp_parse_row) (char **split[], int *column, int *current); typedef bool (*HPMHOOK_post_inter_guild_exp_parse_row) (bool retVal___, char *split[], int column, int current); typedef int (*HPMHOOK_pre_inter_guild_CharOnline) (int *char_id, int *guild_id); @@ -3566,8 +3566,8 @@ typedef int (*HPMHOOK_pre_inter_guild_parse_frommap) (int *fd); typedef int (*HPMHOOK_post_inter_guild_parse_frommap) (int retVal___, int fd); typedef int (*HPMHOOK_pre_inter_guild_broken) (int *guild_id); typedef int (*HPMHOOK_post_inter_guild_broken) (int retVal___, int guild_id); -typedef struct guild* (*HPMHOOK_pre_inter_guild_create) (const char **name, const struct guild_member **master); -typedef struct guild* (*HPMHOOK_post_inter_guild_create) (struct guild* retVal___, const char *name, const struct guild_member *master); +typedef struct guild * (*HPMHOOK_pre_inter_guild_create) (const char **name, const struct guild_member **master); +typedef struct guild * (*HPMHOOK_post_inter_guild_create) (struct guild * retVal___, const char *name, const struct guild_member *master); typedef bool (*HPMHOOK_pre_inter_guild_add_member) (int *guild_id, const struct guild_member **member, int *map_fd); typedef bool (*HPMHOOK_post_inter_guild_add_member) (bool retVal___, int guild_id, const struct guild_member *member, int map_fd); typedef bool (*HPMHOOK_pre_inter_guild_leave) (int *guild_id, int *account_id, int *char_id, int *flag, const char **mes, int *map_fd); @@ -3616,14 +3616,14 @@ typedef bool (*HPMHOOK_pre_inter_homunculus_rename) (const char **name); typedef bool (*HPMHOOK_post_inter_homunculus_rename) (bool retVal___, const char *name); #endif // CHAR_INT_HOMUN_H #ifdef CHAR_INTER_H /* inter */ -typedef const char* (*HPMHOOK_pre_inter_msg_txt) (int *msg_number); -typedef const char* (*HPMHOOK_post_inter_msg_txt) (const char* retVal___, int msg_number); +typedef const char * (*HPMHOOK_pre_inter_msg_txt) (int *msg_number); +typedef const char * (*HPMHOOK_post_inter_msg_txt) (const char * retVal___, int msg_number); typedef bool (*HPMHOOK_pre_inter_msg_config_read) (const char **cfg_name, bool *allow_override); typedef bool (*HPMHOOK_post_inter_msg_config_read) (bool retVal___, const char *cfg_name, bool allow_override); typedef void (*HPMHOOK_pre_inter_do_final_msg) (void); typedef void (*HPMHOOK_post_inter_do_final_msg) (void); -typedef const char* (*HPMHOOK_pre_inter_job_name) (int *class); -typedef const char* (*HPMHOOK_post_inter_job_name) (const char* retVal___, int class); +typedef const char * (*HPMHOOK_pre_inter_job_name) (int *class); +typedef const char * (*HPMHOOK_post_inter_job_name) (const char * retVal___, int class); typedef void (*HPMHOOK_pre_inter_vmsg_to_fd) (int *fd, int *u_fd, int *aid, char **msg, va_list ap); typedef void (*HPMHOOK_post_inter_vmsg_to_fd) (int fd, int u_fd, int aid, char *msg, va_list ap); typedef void (*HPMHOOK_pre_inter_savereg) (int *account_id, int *char_id, const char **key, unsigned int *index, intptr_t *val, bool *is_string); @@ -3714,14 +3714,14 @@ typedef int (*HPMHOOK_pre_inter_party_tosql) (struct party **p, int *flag, int * typedef int (*HPMHOOK_post_inter_party_tosql) (int retVal___, struct party *p, int flag, int index); typedef int (*HPMHOOK_pre_inter_party_del_nonexistent_party) (int *party_id); typedef int (*HPMHOOK_post_inter_party_del_nonexistent_party) (int retVal___, int party_id); -typedef struct party_data* (*HPMHOOK_pre_inter_party_fromsql) (int *party_id); -typedef struct party_data* (*HPMHOOK_post_inter_party_fromsql) (struct party_data* retVal___, int party_id); +typedef struct party_data * (*HPMHOOK_pre_inter_party_fromsql) (int *party_id); +typedef struct party_data * (*HPMHOOK_post_inter_party_fromsql) (struct party_data * retVal___, int party_id); typedef int (*HPMHOOK_pre_inter_party_sql_init) (void); typedef int (*HPMHOOK_post_inter_party_sql_init) (int retVal___); typedef void (*HPMHOOK_pre_inter_party_sql_final) (void); typedef void (*HPMHOOK_post_inter_party_sql_final) (void); -typedef struct party_data* (*HPMHOOK_pre_inter_party_search_partyname) (const char **str); -typedef struct party_data* (*HPMHOOK_post_inter_party_search_partyname) (struct party_data* retVal___, const char *str); +typedef struct party_data * (*HPMHOOK_pre_inter_party_search_partyname) (const char **str); +typedef struct party_data * (*HPMHOOK_post_inter_party_search_partyname) (struct party_data * retVal___, const char *str); typedef int (*HPMHOOK_pre_inter_party_check_exp_share) (struct party_data **p); typedef int (*HPMHOOK_post_inter_party_check_exp_share) (int retVal___, struct party_data *p); typedef int (*HPMHOOK_pre_inter_party_check_empty) (struct party_data **p); @@ -3734,8 +3734,8 @@ typedef int (*HPMHOOK_pre_inter_party_CharOnline) (int *char_id, int *party_id); typedef int (*HPMHOOK_post_inter_party_CharOnline) (int retVal___, int char_id, int party_id); typedef int (*HPMHOOK_pre_inter_party_CharOffline) (int *char_id, int *party_id); typedef int (*HPMHOOK_post_inter_party_CharOffline) (int retVal___, int char_id, int party_id); -typedef struct party_data* (*HPMHOOK_pre_inter_party_create) (const char **name, int *item, int *item2, const struct party_member **leader); -typedef struct party_data* (*HPMHOOK_post_inter_party_create) (struct party_data* retVal___, const char *name, int item, int item2, const struct party_member *leader); +typedef struct party_data * (*HPMHOOK_pre_inter_party_create) (const char **name, int *item, int *item2, const struct party_member **leader); +typedef struct party_data * (*HPMHOOK_post_inter_party_create) (struct party_data * retVal___, const char *name, int item, int item2, const struct party_member *leader); typedef bool (*HPMHOOK_pre_inter_party_add_member) (int *party_id, const struct party_member **member); typedef bool (*HPMHOOK_post_inter_party_add_member) (bool retVal___, int party_id, const struct party_member *member); typedef bool (*HPMHOOK_pre_inter_party_change_option) (int *party_id, int *account_id, int *exp, int *item, int *map_fd); @@ -3760,16 +3760,16 @@ typedef int (*HPMHOOK_pre_inter_pet_delete_) (int *pet_id); typedef int (*HPMHOOK_post_inter_pet_delete_) (int retVal___, int pet_id); typedef int (*HPMHOOK_pre_inter_pet_parse_frommap) (int *fd); typedef int (*HPMHOOK_post_inter_pet_parse_frommap) (int retVal___, int fd); -typedef struct s_pet* (*HPMHOOK_pre_inter_pet_create) (int *account_id, int *char_id, int *pet_class, int *pet_lv, int *pet_egg_id, int *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, const char **pet_name); -typedef struct s_pet* (*HPMHOOK_post_inter_pet_create) (struct s_pet* retVal___, int account_id, int char_id, int pet_class, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name); -typedef struct s_pet* (*HPMHOOK_pre_inter_pet_load) (int *account_id, int *char_id, int *pet_id); -typedef struct s_pet* (*HPMHOOK_post_inter_pet_load) (struct s_pet* retVal___, int account_id, int char_id, int pet_id); +typedef struct s_pet * (*HPMHOOK_pre_inter_pet_create) (int *account_id, int *char_id, int *pet_class, int *pet_lv, int *pet_egg_id, int *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, const char **pet_name); +typedef struct s_pet * (*HPMHOOK_post_inter_pet_create) (struct s_pet * retVal___, int account_id, int char_id, int pet_class, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name); +typedef struct s_pet * (*HPMHOOK_pre_inter_pet_load) (int *account_id, int *char_id, int *pet_id); +typedef struct s_pet * (*HPMHOOK_post_inter_pet_load) (struct s_pet * retVal___, int account_id, int char_id, int pet_id); #endif // CHAR_INT_PET_H #ifdef CHAR_INT_QUEST_H /* inter_quest */ typedef int (*HPMHOOK_pre_inter_quest_parse_frommap) (int *fd); typedef int (*HPMHOOK_post_inter_quest_parse_frommap) (int retVal___, int fd); -typedef struct quest* (*HPMHOOK_pre_inter_quest_fromsql) (int *char_id, int **count); -typedef struct quest* (*HPMHOOK_post_inter_quest_fromsql) (struct quest* retVal___, int char_id, int *count); +typedef struct quest * (*HPMHOOK_pre_inter_quest_fromsql) (int *char_id, int **count); +typedef struct quest * (*HPMHOOK_post_inter_quest_fromsql) (struct quest * retVal___, int char_id, int *count); typedef bool (*HPMHOOK_pre_inter_quest_delete) (int *char_id, int *quest_id); typedef bool (*HPMHOOK_post_inter_quest_delete) (bool retVal___, int char_id, int quest_id); typedef bool (*HPMHOOK_pre_inter_quest_add) (int *char_id, struct quest *qd); @@ -4134,8 +4134,8 @@ typedef void (*HPMHOOK_pre_ircbot_parse_sub) (int *fd, char **str); typedef void (*HPMHOOK_post_ircbot_parse_sub) (int fd, char *str); typedef void (*HPMHOOK_pre_ircbot_parse_source) (char **source, char **nick, char **ident, char **host); typedef void (*HPMHOOK_post_ircbot_parse_source) (char *source, char *nick, char *ident, char *host); -typedef struct irc_func* (*HPMHOOK_pre_ircbot_func_search) (char **function_name); -typedef struct irc_func* (*HPMHOOK_post_ircbot_func_search) (struct irc_func* retVal___, char *function_name); +typedef struct irc_func * (*HPMHOOK_pre_ircbot_func_search) (char **function_name); +typedef struct irc_func * (*HPMHOOK_post_ircbot_func_search) (struct irc_func * retVal___, char *function_name); typedef int (*HPMHOOK_pre_ircbot_connect_timer) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_ircbot_connect_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef int (*HPMHOOK_pre_ircbot_identify_timer) (int *tid, int64 *tick, int *id, intptr_t *data); @@ -4184,20 +4184,20 @@ typedef void (*HPMHOOK_pre_itemdb_write_cached_packages) (const char **config_fi typedef void (*HPMHOOK_post_itemdb_write_cached_packages) (const char *config_filename); typedef bool (*HPMHOOK_pre_itemdb_read_cached_packages) (const char **config_filename); typedef bool (*HPMHOOK_post_itemdb_read_cached_packages) (bool retVal___, const char *config_filename); -typedef struct item_data* (*HPMHOOK_pre_itemdb_name2id) (const char **str); -typedef struct item_data* (*HPMHOOK_post_itemdb_name2id) (struct item_data* retVal___, const char *str); -typedef struct item_data* (*HPMHOOK_pre_itemdb_search_name) (const char **name); -typedef struct item_data* (*HPMHOOK_post_itemdb_search_name) (struct item_data* retVal___, const char *name); +typedef struct item_data * (*HPMHOOK_pre_itemdb_name2id) (const char **str); +typedef struct item_data * (*HPMHOOK_post_itemdb_name2id) (struct item_data * retVal___, const char *str); +typedef struct item_data * (*HPMHOOK_pre_itemdb_search_name) (const char **name); +typedef struct item_data * (*HPMHOOK_post_itemdb_search_name) (struct item_data * retVal___, const char *name); typedef int (*HPMHOOK_pre_itemdb_search_name_array) (struct item_data ***data, const int *size, const char **str, enum item_name_search_flag *flag); typedef int (*HPMHOOK_post_itemdb_search_name_array) (int retVal___, struct item_data **data, const int size, const char *str, enum item_name_search_flag flag); -typedef struct item_data* (*HPMHOOK_pre_itemdb_load) (int *nameid); -typedef struct item_data* (*HPMHOOK_post_itemdb_load) (struct item_data* retVal___, int nameid); -typedef struct item_data* (*HPMHOOK_pre_itemdb_search) (int *nameid); -typedef struct item_data* (*HPMHOOK_post_itemdb_search) (struct item_data* retVal___, int nameid); -typedef struct item_data* (*HPMHOOK_pre_itemdb_exists) (int *nameid); -typedef struct item_data* (*HPMHOOK_post_itemdb_exists) (struct item_data* retVal___, int nameid); -typedef struct itemdb_option* (*HPMHOOK_pre_itemdb_option_exists) (int *idx); -typedef struct itemdb_option* (*HPMHOOK_post_itemdb_option_exists) (struct itemdb_option* retVal___, int idx); +typedef struct item_data * (*HPMHOOK_pre_itemdb_load) (int *nameid); +typedef struct item_data * (*HPMHOOK_post_itemdb_load) (struct item_data * retVal___, int nameid); +typedef struct item_data * (*HPMHOOK_pre_itemdb_search) (int *nameid); +typedef struct item_data * (*HPMHOOK_post_itemdb_search) (struct item_data * retVal___, int nameid); +typedef struct item_data * (*HPMHOOK_pre_itemdb_exists) (int *nameid); +typedef struct item_data * (*HPMHOOK_post_itemdb_exists) (struct item_data * retVal___, int nameid); +typedef struct itemdb_option * (*HPMHOOK_pre_itemdb_option_exists) (int *idx); +typedef struct itemdb_option * (*HPMHOOK_post_itemdb_option_exists) (struct itemdb_option * retVal___, int idx); typedef bool (*HPMHOOK_pre_itemdb_in_group) (struct item_group **group, int *nameid); typedef bool (*HPMHOOK_post_itemdb_in_group) (bool retVal___, struct item_group *group, int nameid); typedef int (*HPMHOOK_pre_itemdb_group_item) (struct item_group **group); @@ -4212,16 +4212,16 @@ typedef int (*HPMHOOK_pre_itemdb_searchname_array_sub) (union DBKey *key, struct typedef int (*HPMHOOK_post_itemdb_searchname_array_sub) (int retVal___, union DBKey key, struct DBData data, va_list ap); typedef int (*HPMHOOK_pre_itemdb_searchrandomid) (struct item_group **group); typedef int (*HPMHOOK_post_itemdb_searchrandomid) (int retVal___, struct item_group *group); -typedef const char* (*HPMHOOK_pre_itemdb_typename) (enum item_types *type); -typedef const char* (*HPMHOOK_post_itemdb_typename) (const char* retVal___, enum item_types type); +typedef const char * (*HPMHOOK_pre_itemdb_typename) (enum item_types *type); +typedef const char * (*HPMHOOK_post_itemdb_typename) (const char * retVal___, enum item_types type); typedef void (*HPMHOOK_pre_itemdb_jobmask2mapid) (uint64 **bclass, uint64 *jobmask); typedef void (*HPMHOOK_post_itemdb_jobmask2mapid) (uint64 *bclass, uint64 jobmask); typedef void (*HPMHOOK_pre_itemdb_jobid2mapid) (uint64 **bclass, int *job_class, bool *enable); typedef void (*HPMHOOK_post_itemdb_jobid2mapid) (uint64 *bclass, int job_class, bool enable); typedef void (*HPMHOOK_pre_itemdb_create_dummy_data) (void); typedef void (*HPMHOOK_post_itemdb_create_dummy_data) (void); -typedef struct item_data* (*HPMHOOK_pre_itemdb_create_item_data) (int *nameid); -typedef struct item_data* (*HPMHOOK_post_itemdb_create_item_data) (struct item_data* retVal___, int nameid); +typedef struct item_data * (*HPMHOOK_pre_itemdb_create_item_data) (int *nameid); +typedef struct item_data * (*HPMHOOK_post_itemdb_create_item_data) (struct item_data * retVal___, int nameid); typedef int (*HPMHOOK_pre_itemdb_isequip) (int *nameid); typedef int (*HPMHOOK_post_itemdb_isequip) (int retVal___, int nameid); typedef int (*HPMHOOK_pre_itemdb_isequip2) (struct item_data **data); @@ -4284,8 +4284,8 @@ typedef int (*HPMHOOK_pre_itemdb_options_final_sub) (union DBKey *key, struct DB typedef int (*HPMHOOK_post_itemdb_options_final_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap); typedef void (*HPMHOOK_pre_itemdb_clear) (bool *total); typedef void (*HPMHOOK_post_itemdb_clear) (bool total); -typedef struct item_combo* (*HPMHOOK_pre_itemdb_id2combo) (int *id); -typedef struct item_combo* (*HPMHOOK_post_itemdb_id2combo) (struct item_combo* retVal___, int id); +typedef struct item_combo * (*HPMHOOK_pre_itemdb_id2combo) (int *id); +typedef struct item_combo * (*HPMHOOK_post_itemdb_id2combo) (struct item_combo * retVal___, int id); typedef bool (*HPMHOOK_pre_itemdb_is_item_usable) (struct item_data **item); typedef bool (*HPMHOOK_post_itemdb_is_item_usable) (bool retVal___, struct item_data *item); typedef bool (*HPMHOOK_pre_itemdb_lookup_const) (const struct config_setting_t **it, const char **name, int **value); @@ -4332,8 +4332,8 @@ typedef void (*HPMHOOK_pre_lclif_login_error) (int *fd, uint8 *error); typedef void (*HPMHOOK_post_lclif_login_error) (int fd, uint8 error); typedef void (*HPMHOOK_pre_lclif_coding_key) (int *fd, struct login_session_data **sd); typedef void (*HPMHOOK_post_lclif_coding_key) (int fd, struct login_session_data *sd); -typedef const struct login_packet_db* (*HPMHOOK_pre_lclif_packet) (int16 *packet_id); -typedef const struct login_packet_db* (*HPMHOOK_post_lclif_packet) (const struct login_packet_db* retVal___, int16 packet_id); +typedef const struct login_packet_db * (*HPMHOOK_pre_lclif_packet) (int16 *packet_id); +typedef const struct login_packet_db * (*HPMHOOK_post_lclif_packet) (const struct login_packet_db * retVal___, int16 packet_id); typedef enum parsefunc_rcode (*HPMHOOK_pre_lclif_parse_packet) (const struct login_packet_db **lpd, int *fd, struct login_session_data **sd); typedef enum parsefunc_rcode (*HPMHOOK_post_lclif_parse_packet) (enum parsefunc_rcode retVal___, const struct login_packet_db *lpd, int fd, struct login_session_data *sd); typedef int (*HPMHOOK_pre_lclif_parse) (int *fd); @@ -4408,10 +4408,10 @@ typedef double (*HPMHOOK_pre_libconfig_setting_get_float) (const struct config_s typedef double (*HPMHOOK_post_libconfig_setting_get_float) (double retVal___, const struct config_setting_t *setting); typedef int (*HPMHOOK_pre_libconfig_setting_get_bool) (const struct config_setting_t **setting); typedef int (*HPMHOOK_post_libconfig_setting_get_bool) (int retVal___, const struct config_setting_t *setting); -typedef const char* (*HPMHOOK_pre_libconfig_setting_get_string) (const struct config_setting_t **setting); -typedef const char* (*HPMHOOK_post_libconfig_setting_get_string) (const char* retVal___, const struct config_setting_t *setting); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_lookup) (struct config_setting_t **setting, const char **name); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_lookup) (struct config_setting_t* retVal___, struct config_setting_t *setting, const char *name); +typedef const char * (*HPMHOOK_pre_libconfig_setting_get_string) (const struct config_setting_t **setting); +typedef const char * (*HPMHOOK_post_libconfig_setting_get_string) (const char * retVal___, const struct config_setting_t *setting); +typedef struct config_setting_t * (*HPMHOOK_pre_libconfig_setting_lookup) (struct config_setting_t **setting, const char **name); +typedef struct config_setting_t * (*HPMHOOK_post_libconfig_setting_lookup) (struct config_setting_t * retVal___, struct config_setting_t *setting, const char *name); typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int) (const struct config_setting_t **setting, const char **name, int **value); typedef int (*HPMHOOK_post_libconfig_setting_lookup_int) (int retVal___, const struct config_setting_t *setting, const char *name, int *value); typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int64) (const struct config_setting_t **setting, const char **name, int64 **value); @@ -4444,36 +4444,36 @@ typedef double (*HPMHOOK_pre_libconfig_setting_get_float_elem) (const struct con typedef double (*HPMHOOK_post_libconfig_setting_get_float_elem) (double retVal___, const struct config_setting_t *setting, int idx); typedef int (*HPMHOOK_pre_libconfig_setting_get_bool_elem) (const struct config_setting_t **setting, int *idx); typedef int (*HPMHOOK_post_libconfig_setting_get_bool_elem) (int retVal___, const struct config_setting_t *setting, int idx); -typedef const char* (*HPMHOOK_pre_libconfig_setting_get_string_elem) (const struct config_setting_t **setting, int *idx); -typedef const char* (*HPMHOOK_post_libconfig_setting_get_string_elem) (const char* retVal___, const struct config_setting_t *setting, int idx); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_int_elem) (struct config_setting_t **setting, int *idx, int *value); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_int_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_int64_elem) (struct config_setting_t **setting, int *idx, int64 *value); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_int64_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_float_elem) (struct config_setting_t **setting, int *idx, double *value); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_float_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, double value); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_bool_elem) (struct config_setting_t **setting, int *idx, int *value); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_bool_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_string_elem) (struct config_setting_t **setting, int *idx, const char **value); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_string_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, const char *value); +typedef const char * (*HPMHOOK_pre_libconfig_setting_get_string_elem) (const struct config_setting_t **setting, int *idx); +typedef const char * (*HPMHOOK_post_libconfig_setting_get_string_elem) (const char * retVal___, const struct config_setting_t *setting, int idx); +typedef struct config_setting_t * (*HPMHOOK_pre_libconfig_setting_set_int_elem) (struct config_setting_t **setting, int *idx, int *value); +typedef struct config_setting_t * (*HPMHOOK_post_libconfig_setting_set_int_elem) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int value); +typedef struct config_setting_t * (*HPMHOOK_pre_libconfig_setting_set_int64_elem) (struct config_setting_t **setting, int *idx, int64 *value); +typedef struct config_setting_t * (*HPMHOOK_post_libconfig_setting_set_int64_elem) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int64 value); +typedef struct config_setting_t * (*HPMHOOK_pre_libconfig_setting_set_float_elem) (struct config_setting_t **setting, int *idx, double *value); +typedef struct config_setting_t * (*HPMHOOK_post_libconfig_setting_set_float_elem) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, double value); +typedef struct config_setting_t * (*HPMHOOK_pre_libconfig_setting_set_bool_elem) (struct config_setting_t **setting, int *idx, int *value); +typedef struct config_setting_t * (*HPMHOOK_post_libconfig_setting_set_bool_elem) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int value); +typedef struct config_setting_t * (*HPMHOOK_pre_libconfig_setting_set_string_elem) (struct config_setting_t **setting, int *idx, const char **value); +typedef struct config_setting_t * (*HPMHOOK_post_libconfig_setting_set_string_elem) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, const char *value); typedef int (*HPMHOOK_pre_libconfig_setting_index) (const struct config_setting_t **setting); typedef int (*HPMHOOK_post_libconfig_setting_index) (int retVal___, const struct config_setting_t *setting); typedef int (*HPMHOOK_pre_libconfig_setting_length) (const struct config_setting_t **setting); typedef int (*HPMHOOK_post_libconfig_setting_length) (int retVal___, const struct config_setting_t *setting); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_get_elem) (const struct config_setting_t **setting, unsigned int *idx); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_get_elem) (struct config_setting_t* retVal___, const struct config_setting_t *setting, unsigned int idx); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_get_member) (const struct config_setting_t **setting, const char **name); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_get_member) (struct config_setting_t* retVal___, const struct config_setting_t *setting, const char *name); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_add) (struct config_setting_t **parent, const char **name, int *type); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_add) (struct config_setting_t* retVal___, struct config_setting_t *parent, const char *name, int type); +typedef struct config_setting_t * (*HPMHOOK_pre_libconfig_setting_get_elem) (const struct config_setting_t **setting, unsigned int *idx); +typedef struct config_setting_t * (*HPMHOOK_post_libconfig_setting_get_elem) (struct config_setting_t * retVal___, const struct config_setting_t *setting, unsigned int idx); +typedef struct config_setting_t * (*HPMHOOK_pre_libconfig_setting_get_member) (const struct config_setting_t **setting, const char **name); +typedef struct config_setting_t * (*HPMHOOK_post_libconfig_setting_get_member) (struct config_setting_t * retVal___, const struct config_setting_t *setting, const char *name); +typedef struct config_setting_t * (*HPMHOOK_pre_libconfig_setting_add) (struct config_setting_t **parent, const char **name, int *type); +typedef struct config_setting_t * (*HPMHOOK_post_libconfig_setting_add) (struct config_setting_t * retVal___, struct config_setting_t *parent, const char *name, int type); typedef int (*HPMHOOK_pre_libconfig_setting_remove) (struct config_setting_t **parent, const char **name); typedef int (*HPMHOOK_post_libconfig_setting_remove) (int retVal___, struct config_setting_t *parent, const char *name); typedef int (*HPMHOOK_pre_libconfig_setting_remove_elem) (struct config_setting_t **parent, unsigned int *idx); typedef int (*HPMHOOK_post_libconfig_setting_remove_elem) (int retVal___, struct config_setting_t *parent, unsigned int idx); typedef void (*HPMHOOK_pre_libconfig_setting_set_hook) (struct config_setting_t **setting, void **hook); typedef void (*HPMHOOK_post_libconfig_setting_set_hook) (struct config_setting_t *setting, void *hook); -typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_lookup) (const struct config_t **config, const char **filepath); -typedef struct config_setting_t* (*HPMHOOK_post_libconfig_lookup) (struct config_setting_t* retVal___, const struct config_t *config, const char *filepath); +typedef struct config_setting_t * (*HPMHOOK_pre_libconfig_lookup) (const struct config_t **config, const char **filepath); +typedef struct config_setting_t * (*HPMHOOK_post_libconfig_lookup) (struct config_setting_t * retVal___, const struct config_t *config, const char *filepath); typedef int (*HPMHOOK_pre_libconfig_lookup_int) (const struct config_t **config, const char **filepath, int **value); typedef int (*HPMHOOK_post_libconfig_lookup_int) (int retVal___, const struct config_t *config, const char *filepath, int *value); typedef int (*HPMHOOK_pre_libconfig_lookup_int64) (const struct config_t **config, const char **filepath, int64 **value); @@ -4570,8 +4570,8 @@ typedef int (*HPMHOOK_pre_login_waiting_disconnect_timer) (int *tid, int64 *tick typedef int (*HPMHOOK_post_login_waiting_disconnect_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef struct DBData (*HPMHOOK_pre_login_create_online_user) (union DBKey *key, va_list args); typedef struct DBData (*HPMHOOK_post_login_create_online_user) (struct DBData retVal___, union DBKey key, va_list args); -typedef struct online_login_data* (*HPMHOOK_pre_login_add_online_user) (int *char_server, int *account_id); -typedef struct online_login_data* (*HPMHOOK_post_login_add_online_user) (struct online_login_data* retVal___, int char_server, int account_id); +typedef struct online_login_data * (*HPMHOOK_pre_login_add_online_user) (int *char_server, int *account_id); +typedef struct online_login_data * (*HPMHOOK_post_login_add_online_user) (struct online_login_data * retVal___, int char_server, int account_id); typedef void (*HPMHOOK_pre_login_remove_online_user) (int *account_id); typedef void (*HPMHOOK_post_login_remove_online_user) (int account_id); typedef int (*HPMHOOK_pre_login_online_db_setoffline) (union DBKey *key, struct DBData **data, va_list ap); @@ -4830,8 +4830,8 @@ typedef int (*HPMHOOK_pre_map_moveblock) (struct block_list **bl, int *x1, int * typedef int (*HPMHOOK_post_map_moveblock) (int retVal___, struct block_list *bl, int x1, int y1, int64 tick); typedef int (*HPMHOOK_pre_map_count_oncell) (int16 *m, int16 *x, int16 *y, int *type, int *flag); typedef int (*HPMHOOK_post_map_count_oncell) (int retVal___, int16 m, int16 x, int16 y, int type, int flag); -typedef struct skill_unit* (*HPMHOOK_pre_map_find_skill_unit_oncell) (struct block_list **target, int16 *x, int16 *y, uint16 *skill_id, struct skill_unit **out_unit, int *flag); -typedef struct skill_unit* (*HPMHOOK_post_map_find_skill_unit_oncell) (struct skill_unit* retVal___, struct block_list *target, int16 x, int16 y, uint16 skill_id, struct skill_unit *out_unit, int flag); +typedef struct skill_unit * (*HPMHOOK_pre_map_find_skill_unit_oncell) (struct block_list **target, int16 *x, int16 *y, uint16 *skill_id, struct skill_unit **out_unit, int *flag); +typedef struct skill_unit * (*HPMHOOK_post_map_find_skill_unit_oncell) (struct skill_unit * retVal___, struct block_list *target, int16 x, int16 y, uint16 skill_id, struct skill_unit *out_unit, int flag); typedef int (*HPMHOOK_pre_map_get_new_object_id) (void); typedef int (*HPMHOOK_post_map_get_new_object_id) (int retVal___); typedef int (*HPMHOOK_pre_map_search_free_cell) (struct block_list **src, int16 *m, int16 **x, int16 **y, int16 *range_x, int16 *range_y, int *flag); @@ -4856,10 +4856,10 @@ typedef void (*HPMHOOK_pre_map_delnickdb) (int *charid, const char **nick); typedef void (*HPMHOOK_post_map_delnickdb) (int charid, const char *nick); typedef void (*HPMHOOK_pre_map_reqnickdb) (struct map_session_data **sd, int *charid); typedef void (*HPMHOOK_post_map_reqnickdb) (struct map_session_data *sd, int charid); -typedef const char* (*HPMHOOK_pre_map_charid2nick) (int *charid); -typedef const char* (*HPMHOOK_post_map_charid2nick) (const char* retVal___, int charid); -typedef struct map_session_data* (*HPMHOOK_pre_map_charid2sd) (int *charid); -typedef struct map_session_data* (*HPMHOOK_post_map_charid2sd) (struct map_session_data* retVal___, int charid); +typedef const char * (*HPMHOOK_pre_map_charid2nick) (int *charid); +typedef const char * (*HPMHOOK_post_map_charid2nick) (const char * retVal___, int charid); +typedef struct map_session_data * (*HPMHOOK_pre_map_charid2sd) (int *charid); +typedef struct map_session_data * (*HPMHOOK_post_map_charid2sd) (struct map_session_data * retVal___, int charid); typedef void (*HPMHOOK_pre_map_vforeachpc) (int ( **func ) (struct map_session_data *sd, va_list args), va_list args); typedef void (*HPMHOOK_post_map_vforeachpc) (int ( *func ) (struct map_session_data *sd, va_list args), va_list args); typedef void (*HPMHOOK_pre_map_vforeachmob) (int ( **func ) (struct mob_data *md, va_list args), va_list args); @@ -4890,28 +4890,28 @@ typedef int (*HPMHOOK_pre_map_vforeachinmap) (int ( **func ) (struct block_list typedef int (*HPMHOOK_post_map_vforeachinmap) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int type, va_list args); typedef int (*HPMHOOK_pre_map_vforeachininstance) (int ( **func ) (struct block_list *, va_list), int16 *instance_id, int *type, va_list ap); typedef int (*HPMHOOK_post_map_vforeachininstance) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 instance_id, int type, va_list ap); -typedef struct map_session_data* (*HPMHOOK_pre_map_id2sd) (int *id); -typedef struct map_session_data* (*HPMHOOK_post_map_id2sd) (struct map_session_data* retVal___, int id); -typedef struct npc_data* (*HPMHOOK_pre_map_id2nd) (int *id); -typedef struct npc_data* (*HPMHOOK_post_map_id2nd) (struct npc_data* retVal___, int id); -typedef struct mob_data* (*HPMHOOK_pre_map_id2md) (int *id); -typedef struct mob_data* (*HPMHOOK_post_map_id2md) (struct mob_data* retVal___, int id); -typedef struct flooritem_data* (*HPMHOOK_pre_map_id2fi) (int *id); -typedef struct flooritem_data* (*HPMHOOK_post_map_id2fi) (struct flooritem_data* retVal___, int id); -typedef struct chat_data* (*HPMHOOK_pre_map_id2cd) (int *id); -typedef struct chat_data* (*HPMHOOK_post_map_id2cd) (struct chat_data* retVal___, int id); -typedef struct skill_unit* (*HPMHOOK_pre_map_id2su) (int *id); -typedef struct skill_unit* (*HPMHOOK_post_map_id2su) (struct skill_unit* retVal___, int id); -typedef struct pet_data* (*HPMHOOK_pre_map_id2pd) (int *id); -typedef struct pet_data* (*HPMHOOK_post_map_id2pd) (struct pet_data* retVal___, int id); -typedef struct homun_data* (*HPMHOOK_pre_map_id2hd) (int *id); -typedef struct homun_data* (*HPMHOOK_post_map_id2hd) (struct homun_data* retVal___, int id); -typedef struct mercenary_data* (*HPMHOOK_pre_map_id2mc) (int *id); -typedef struct mercenary_data* (*HPMHOOK_post_map_id2mc) (struct mercenary_data* retVal___, int id); -typedef struct elemental_data* (*HPMHOOK_pre_map_id2ed) (int *id); -typedef struct elemental_data* (*HPMHOOK_post_map_id2ed) (struct elemental_data* retVal___, int id); -typedef struct block_list* (*HPMHOOK_pre_map_id2bl) (int *id); -typedef struct block_list* (*HPMHOOK_post_map_id2bl) (struct block_list* retVal___, int id); +typedef struct map_session_data * (*HPMHOOK_pre_map_id2sd) (int *id); +typedef struct map_session_data * (*HPMHOOK_post_map_id2sd) (struct map_session_data * retVal___, int id); +typedef struct npc_data * (*HPMHOOK_pre_map_id2nd) (int *id); +typedef struct npc_data * (*HPMHOOK_post_map_id2nd) (struct npc_data * retVal___, int id); +typedef struct mob_data * (*HPMHOOK_pre_map_id2md) (int *id); +typedef struct mob_data * (*HPMHOOK_post_map_id2md) (struct mob_data * retVal___, int id); +typedef struct flooritem_data * (*HPMHOOK_pre_map_id2fi) (int *id); +typedef struct flooritem_data * (*HPMHOOK_post_map_id2fi) (struct flooritem_data * retVal___, int id); +typedef struct chat_data * (*HPMHOOK_pre_map_id2cd) (int *id); +typedef struct chat_data * (*HPMHOOK_post_map_id2cd) (struct chat_data * retVal___, int id); +typedef struct skill_unit * (*HPMHOOK_pre_map_id2su) (int *id); +typedef struct skill_unit * (*HPMHOOK_post_map_id2su) (struct skill_unit * retVal___, int id); +typedef struct pet_data * (*HPMHOOK_pre_map_id2pd) (int *id); +typedef struct pet_data * (*HPMHOOK_post_map_id2pd) (struct pet_data * retVal___, int id); +typedef struct homun_data * (*HPMHOOK_pre_map_id2hd) (int *id); +typedef struct homun_data * (*HPMHOOK_post_map_id2hd) (struct homun_data * retVal___, int id); +typedef struct mercenary_data * (*HPMHOOK_pre_map_id2mc) (int *id); +typedef struct mercenary_data * (*HPMHOOK_post_map_id2mc) (struct mercenary_data * retVal___, int id); +typedef struct elemental_data * (*HPMHOOK_pre_map_id2ed) (int *id); +typedef struct elemental_data * (*HPMHOOK_post_map_id2ed) (struct elemental_data * retVal___, int id); +typedef struct block_list * (*HPMHOOK_pre_map_id2bl) (int *id); +typedef struct block_list * (*HPMHOOK_post_map_id2bl) (struct block_list * retVal___, int id); typedef bool (*HPMHOOK_pre_map_blid_exists) (int *id); typedef bool (*HPMHOOK_post_map_blid_exists) (bool retVal___, int id); typedef int16 (*HPMHOOK_pre_map_mapindex2mapid) (unsigned short *map_index); @@ -4930,12 +4930,12 @@ typedef void (*HPMHOOK_pre_map_addiddb) (struct block_list **bl); typedef void (*HPMHOOK_post_map_addiddb) (struct block_list *bl); typedef void (*HPMHOOK_pre_map_deliddb) (struct block_list **bl); typedef void (*HPMHOOK_post_map_deliddb) (struct block_list *bl); -typedef struct map_session_data* (*HPMHOOK_pre_map_nick2sd) (const char **nick, bool *allow_partial); -typedef struct map_session_data* (*HPMHOOK_post_map_nick2sd) (struct map_session_data* retVal___, const char *nick, bool allow_partial); -typedef struct mob_data* (*HPMHOOK_pre_map_getmob_boss) (int16 *m); -typedef struct mob_data* (*HPMHOOK_post_map_getmob_boss) (struct mob_data* retVal___, int16 m); -typedef struct mob_data* (*HPMHOOK_pre_map_id2boss) (int *id); -typedef struct mob_data* (*HPMHOOK_post_map_id2boss) (struct mob_data* retVal___, int id); +typedef struct map_session_data * (*HPMHOOK_pre_map_nick2sd) (const char **nick, bool *allow_partial); +typedef struct map_session_data * (*HPMHOOK_post_map_nick2sd) (struct map_session_data * retVal___, const char *nick, bool allow_partial); +typedef struct mob_data * (*HPMHOOK_pre_map_getmob_boss) (int16 *m); +typedef struct mob_data * (*HPMHOOK_post_map_getmob_boss) (struct mob_data * retVal___, int16 m); +typedef struct mob_data * (*HPMHOOK_pre_map_id2boss) (int *id); +typedef struct mob_data * (*HPMHOOK_post_map_id2boss) (struct mob_data * retVal___, int id); typedef uint32 (*HPMHOOK_pre_map_race_id2mask) (int *race); typedef uint32 (*HPMHOOK_post_map_race_id2mask) (uint32 retVal___, int race); typedef void (*HPMHOOK_pre_map_reloadnpc) (bool *clear); @@ -5072,8 +5072,8 @@ typedef bool (*HPMHOOK_pre_map_add_questinfo) (int *m, struct npc_data **nd); typedef bool (*HPMHOOK_post_map_add_questinfo) (bool retVal___, int m, struct npc_data *nd); typedef bool (*HPMHOOK_pre_map_remove_questinfo) (int *m, struct npc_data **nd); typedef bool (*HPMHOOK_post_map_remove_questinfo) (bool retVal___, int m, struct npc_data *nd); -typedef struct map_zone_data* (*HPMHOOK_pre_map_merge_zone) (struct map_zone_data **main, struct map_zone_data **other); -typedef struct map_zone_data* (*HPMHOOK_post_map_merge_zone) (struct map_zone_data* retVal___, struct map_zone_data *main, struct map_zone_data *other); +typedef struct map_zone_data * (*HPMHOOK_pre_map_merge_zone) (struct map_zone_data **main, struct map_zone_data **other); +typedef struct map_zone_data * (*HPMHOOK_post_map_merge_zone) (struct map_zone_data * retVal___, struct map_zone_data *main, struct map_zone_data *other); typedef void (*HPMHOOK_pre_map_zone_clear_single) (struct map_zone_data **zone); typedef void (*HPMHOOK_post_map_zone_clear_single) (struct map_zone_data *zone); typedef void (*HPMHOOK_pre_map_lock_check) (const char **file, const char **func, int *line, int *lock_count); @@ -5406,38 +5406,38 @@ typedef int (*HPMHOOK_pre_mapindex_addmap) (int *index, const char **name); typedef int (*HPMHOOK_post_mapindex_addmap) (int retVal___, int index, const char *name); typedef void (*HPMHOOK_pre_mapindex_removemap) (int *index); typedef void (*HPMHOOK_post_mapindex_removemap) (int index); -typedef const char* (*HPMHOOK_pre_mapindex_getmapname) (const char **string, char **output); -typedef const char* (*HPMHOOK_post_mapindex_getmapname) (const char* retVal___, const char *string, char *output); -typedef const char* (*HPMHOOK_pre_mapindex_getmapname_ext) (const char **string, char **output); -typedef const char* (*HPMHOOK_post_mapindex_getmapname_ext) (const char* retVal___, const char *string, char *output); +typedef const char * (*HPMHOOK_pre_mapindex_getmapname) (const char **string, char **output); +typedef const char * (*HPMHOOK_post_mapindex_getmapname) (const char * retVal___, const char *string, char *output); +typedef const char * (*HPMHOOK_pre_mapindex_getmapname_ext) (const char **string, char **output); +typedef const char * (*HPMHOOK_post_mapindex_getmapname_ext) (const char * retVal___, const char *string, char *output); typedef unsigned short (*HPMHOOK_pre_mapindex_name2id) (const char **p1); typedef unsigned short (*HPMHOOK_post_mapindex_name2id) (unsigned short retVal___, const char *p1); -typedef const char* (*HPMHOOK_pre_mapindex_id2name) (uint16 *id, const char **file, int *line, const char **func); -typedef const char* (*HPMHOOK_post_mapindex_id2name) (const char* retVal___, uint16 id, const char *file, int line, const char *func); +typedef const char * (*HPMHOOK_pre_mapindex_id2name) (uint16 *id, const char **file, int *line, const char **func); +typedef const char * (*HPMHOOK_post_mapindex_id2name) (const char * retVal___, uint16 id, const char *file, int line, const char *func); typedef bool (*HPMHOOK_pre_mapindex_check_default) (void); typedef bool (*HPMHOOK_post_mapindex_check_default) (bool retVal___); #endif // COMMON_MAPINDEX_H #ifdef MAP_MAP_H /* mapit */ -typedef struct s_mapiterator* (*HPMHOOK_pre_mapit_alloc) (enum e_mapitflags *flags, enum bl_type *types); -typedef struct s_mapiterator* (*HPMHOOK_post_mapit_alloc) (struct s_mapiterator* retVal___, enum e_mapitflags flags, enum bl_type types); +typedef struct s_mapiterator * (*HPMHOOK_pre_mapit_alloc) (enum e_mapitflags *flags, enum bl_type *types); +typedef struct s_mapiterator * (*HPMHOOK_post_mapit_alloc) (struct s_mapiterator * retVal___, enum e_mapitflags flags, enum bl_type types); typedef void (*HPMHOOK_pre_mapit_free) (struct s_mapiterator **iter); typedef void (*HPMHOOK_post_mapit_free) (struct s_mapiterator *iter); -typedef struct block_list* (*HPMHOOK_pre_mapit_first) (struct s_mapiterator **iter); -typedef struct block_list* (*HPMHOOK_post_mapit_first) (struct block_list* retVal___, struct s_mapiterator *iter); -typedef struct block_list* (*HPMHOOK_pre_mapit_last) (struct s_mapiterator **iter); -typedef struct block_list* (*HPMHOOK_post_mapit_last) (struct block_list* retVal___, struct s_mapiterator *iter); -typedef struct block_list* (*HPMHOOK_pre_mapit_next) (struct s_mapiterator **iter); -typedef struct block_list* (*HPMHOOK_post_mapit_next) (struct block_list* retVal___, struct s_mapiterator *iter); -typedef struct block_list* (*HPMHOOK_pre_mapit_prev) (struct s_mapiterator **iter); -typedef struct block_list* (*HPMHOOK_post_mapit_prev) (struct block_list* retVal___, struct s_mapiterator *iter); +typedef struct block_list * (*HPMHOOK_pre_mapit_first) (struct s_mapiterator **iter); +typedef struct block_list * (*HPMHOOK_post_mapit_first) (struct block_list * retVal___, struct s_mapiterator *iter); +typedef struct block_list * (*HPMHOOK_pre_mapit_last) (struct s_mapiterator **iter); +typedef struct block_list * (*HPMHOOK_post_mapit_last) (struct block_list * retVal___, struct s_mapiterator *iter); +typedef struct block_list * (*HPMHOOK_pre_mapit_next) (struct s_mapiterator **iter); +typedef struct block_list * (*HPMHOOK_post_mapit_next) (struct block_list * retVal___, struct s_mapiterator *iter); +typedef struct block_list * (*HPMHOOK_pre_mapit_prev) (struct s_mapiterator **iter); +typedef struct block_list * (*HPMHOOK_post_mapit_prev) (struct block_list * retVal___, struct s_mapiterator *iter); typedef bool (*HPMHOOK_pre_mapit_exists) (struct s_mapiterator **iter); typedef bool (*HPMHOOK_post_mapit_exists) (bool retVal___, struct s_mapiterator *iter); #endif // MAP_MAP_H #ifdef MAP_MAPREG_H /* mapreg */ typedef int (*HPMHOOK_pre_mapreg_readreg) (int64 *uid); typedef int (*HPMHOOK_post_mapreg_readreg) (int retVal___, int64 uid); -typedef char* (*HPMHOOK_pre_mapreg_readregstr) (int64 *uid); -typedef char* (*HPMHOOK_post_mapreg_readregstr) (char* retVal___, int64 uid); +typedef char * (*HPMHOOK_pre_mapreg_readregstr) (int64 *uid); +typedef char * (*HPMHOOK_post_mapreg_readregstr) (char * retVal___, int64 uid); typedef bool (*HPMHOOK_pre_mapreg_set_num_db) (int64 *uid, const char **name, unsigned int *index, int *value); typedef bool (*HPMHOOK_post_mapreg_set_num_db) (bool retVal___, int64 uid, const char *name, unsigned int index, int value); typedef bool (*HPMHOOK_pre_mapreg_delete_num_db) (int64 *uid, const char **name, unsigned int *index); @@ -5488,8 +5488,8 @@ typedef void (*HPMHOOK_pre_mercenary_init) (bool *minimal); typedef void (*HPMHOOK_post_mercenary_init) (bool minimal); typedef bool (*HPMHOOK_pre_mercenary_class) (int *class_); typedef bool (*HPMHOOK_post_mercenary_class) (bool retVal___, int class_); -typedef struct view_data* (*HPMHOOK_pre_mercenary_get_viewdata) (int *class_); -typedef struct view_data* (*HPMHOOK_post_mercenary_get_viewdata) (struct view_data* retVal___, int class_); +typedef struct view_data * (*HPMHOOK_pre_mercenary_get_viewdata) (int *class_); +typedef struct view_data * (*HPMHOOK_post_mercenary_get_viewdata) (struct view_data * retVal___, int class_); typedef int (*HPMHOOK_pre_mercenary_create) (struct map_session_data **sd, int *class_, unsigned int *lifetime); typedef int (*HPMHOOK_post_mercenary_create) (int retVal___, struct map_session_data *sd, int class_, unsigned int lifetime); typedef int (*HPMHOOK_pre_mercenary_data_received) (const struct s_mercenary **merc, bool *flag); @@ -5544,10 +5544,10 @@ typedef void (*HPMHOOK_pre_mob_reload) (void); typedef void (*HPMHOOK_post_mob_reload) (void); typedef int (*HPMHOOK_pre_mob_reload_sub_mob) (struct mob_data **md, va_list args); typedef int (*HPMHOOK_post_mob_reload_sub_mob) (int retVal___, struct mob_data *md, va_list args); -typedef struct mob_db* (*HPMHOOK_pre_mob_db) (int *index); -typedef struct mob_db* (*HPMHOOK_post_mob_db) (struct mob_db* retVal___, int index); -typedef struct mob_chat* (*HPMHOOK_pre_mob_chat) (short *id); -typedef struct mob_chat* (*HPMHOOK_post_mob_chat) (struct mob_chat* retVal___, short id); +typedef struct mob_db * (*HPMHOOK_pre_mob_db) (int *index); +typedef struct mob_db * (*HPMHOOK_post_mob_db) (struct mob_db * retVal___, int index); +typedef struct mob_chat * (*HPMHOOK_pre_mob_chat) (short *id); +typedef struct mob_chat * (*HPMHOOK_post_mob_chat) (struct mob_chat * retVal___, short id); typedef int (*HPMHOOK_pre_mob_makedummymobdb) (int *p1); typedef int (*HPMHOOK_post_mob_makedummymobdb) (int retVal___, int p1); typedef int (*HPMHOOK_pre_mob_spawn_guardian_sub) (int *tid, int64 *tick, int *id, intptr_t *data); @@ -5570,22 +5570,22 @@ typedef int (*HPMHOOK_pre_mob_db_searchname_array) (struct mob_db ***data, int * typedef int (*HPMHOOK_post_mob_db_searchname_array) (int retVal___, struct mob_db **data, int size, const char *str, int flag); typedef int (*HPMHOOK_pre_mob_db_checkid) (const int *id); typedef int (*HPMHOOK_post_mob_db_checkid) (int retVal___, const int id); -typedef struct view_data* (*HPMHOOK_pre_mob_get_viewdata) (int *class_); -typedef struct view_data* (*HPMHOOK_post_mob_get_viewdata) (struct view_data* retVal___, int class_); +typedef struct view_data * (*HPMHOOK_pre_mob_get_viewdata) (int *class_); +typedef struct view_data * (*HPMHOOK_post_mob_get_viewdata) (struct view_data * retVal___, int class_); typedef void (*HPMHOOK_pre_mob_set_dynamic_viewdata) (struct mob_data **md); typedef void (*HPMHOOK_post_mob_set_dynamic_viewdata) (struct mob_data *md); typedef void (*HPMHOOK_pre_mob_free_dynamic_viewdata) (struct mob_data **md); typedef void (*HPMHOOK_post_mob_free_dynamic_viewdata) (struct mob_data *md); typedef int (*HPMHOOK_pre_mob_parse_dataset) (struct spawn_data **data); typedef int (*HPMHOOK_post_mob_parse_dataset) (int retVal___, struct spawn_data *data); -typedef struct mob_data* (*HPMHOOK_pre_mob_spawn_dataset) (struct spawn_data **data, int *npc_id); -typedef struct mob_data* (*HPMHOOK_post_mob_spawn_dataset) (struct mob_data* retVal___, struct spawn_data *data, int npc_id); +typedef struct mob_data * (*HPMHOOK_pre_mob_spawn_dataset) (struct spawn_data **data, int *npc_id); +typedef struct mob_data * (*HPMHOOK_post_mob_spawn_dataset) (struct mob_data * retVal___, struct spawn_data *data, int npc_id); typedef int (*HPMHOOK_pre_mob_get_random_id) (enum mob_groups *type, int *flag, int *lv); typedef int (*HPMHOOK_post_mob_get_random_id) (int retVal___, enum mob_groups type, int flag, int lv); typedef bool (*HPMHOOK_pre_mob_ksprotected) (struct block_list **src, struct block_list **target); typedef bool (*HPMHOOK_post_mob_ksprotected) (bool retVal___, struct block_list *src, struct block_list *target); -typedef struct mob_data* (*HPMHOOK_pre_mob_once_spawn_sub) (struct block_list **bl, int16 *m, int16 *x, int16 *y, const char **mobname, int *class_, const char **event, unsigned int *size, unsigned int *ai, int *npc_id); -typedef struct mob_data* (*HPMHOOK_post_mob_once_spawn_sub) (struct mob_data* retVal___, struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai, int npc_id); +typedef struct mob_data * (*HPMHOOK_pre_mob_once_spawn_sub) (struct block_list **bl, int16 *m, int16 *x, int16 *y, const char **mobname, int *class_, const char **event, unsigned int *size, unsigned int *ai, int *npc_id); +typedef struct mob_data * (*HPMHOOK_post_mob_once_spawn_sub) (struct mob_data * retVal___, struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai, int npc_id); typedef int (*HPMHOOK_pre_mob_once_spawn) (struct map_session_data **sd, int16 *m, int16 *x, int16 *y, const char **mobname, int *class_, int *amount, const char **event, unsigned int *size, unsigned int *ai); typedef int (*HPMHOOK_post_mob_once_spawn) (int retVal___, struct map_session_data *sd, int16 m, int16 x, int16 y, const char *mobname, int class_, int amount, const char *event, unsigned int size, unsigned int ai); typedef int (*HPMHOOK_pre_mob_once_spawn_area) (struct map_session_data **sd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, const char **mobname, int *class_, int *amount, const char **event, unsigned int *size, unsigned int *ai); @@ -5644,10 +5644,10 @@ typedef int (*HPMHOOK_pre_mob_ai_hard) (int *tid, int64 *tick, int *id, intptr_t typedef int (*HPMHOOK_post_mob_ai_hard) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef void (*HPMHOOK_pre_mob_setdropitem_options) (struct item **item, struct optdrop_group **options); typedef void (*HPMHOOK_post_mob_setdropitem_options) (struct item *item, struct optdrop_group *options); -typedef struct item_drop* (*HPMHOOK_pre_mob_setdropitem) (int *nameid, struct optdrop_group **options, int *qty, struct item_data **data); -typedef struct item_drop* (*HPMHOOK_post_mob_setdropitem) (struct item_drop* retVal___, int nameid, struct optdrop_group *options, int qty, struct item_data *data); -typedef struct item_drop* (*HPMHOOK_pre_mob_setlootitem) (struct item **item); -typedef struct item_drop* (*HPMHOOK_post_mob_setlootitem) (struct item_drop* retVal___, struct item *item); +typedef struct item_drop * (*HPMHOOK_pre_mob_setdropitem) (int *nameid, struct optdrop_group **options, int *qty, struct item_data **data); +typedef struct item_drop * (*HPMHOOK_post_mob_setdropitem) (struct item_drop * retVal___, int nameid, struct optdrop_group *options, int qty, struct item_data *data); +typedef struct item_drop * (*HPMHOOK_pre_mob_setlootitem) (struct item **item); +typedef struct item_drop * (*HPMHOOK_post_mob_setlootitem) (struct item_drop * retVal___, struct item *item); typedef int (*HPMHOOK_pre_mob_delay_item_drop) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_mob_delay_item_drop) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef void (*HPMHOOK_pre_mob_item_drop) (struct mob_data **md, struct item_drop_list **dlist, struct item_drop **ditem, int *loot, int *drop_rate, unsigned short *flag); @@ -5688,14 +5688,14 @@ typedef int (*HPMHOOK_pre_mob_summonslave) (struct mob_data **md2, int **value, typedef int (*HPMHOOK_post_mob_summonslave) (int retVal___, struct mob_data *md2, int *value, int amount, uint16 skill_id); typedef int (*HPMHOOK_pre_mob_getfriendhprate_sub) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_mob_getfriendhprate_sub) (int retVal___, struct block_list *bl, va_list ap); -typedef struct block_list* (*HPMHOOK_pre_mob_getfriendhprate) (struct mob_data **md, int *min_rate, int *max_rate); -typedef struct block_list* (*HPMHOOK_post_mob_getfriendhprate) (struct block_list* retVal___, struct mob_data *md, int min_rate, int max_rate); -typedef struct block_list* (*HPMHOOK_pre_mob_getmasterhpltmaxrate) (struct mob_data **md, int *rate); -typedef struct block_list* (*HPMHOOK_post_mob_getmasterhpltmaxrate) (struct block_list* retVal___, struct mob_data *md, int rate); +typedef struct block_list * (*HPMHOOK_pre_mob_getfriendhprate) (struct mob_data **md, int *min_rate, int *max_rate); +typedef struct block_list * (*HPMHOOK_post_mob_getfriendhprate) (struct block_list * retVal___, struct mob_data *md, int min_rate, int max_rate); +typedef struct block_list * (*HPMHOOK_pre_mob_getmasterhpltmaxrate) (struct mob_data **md, int *rate); +typedef struct block_list * (*HPMHOOK_post_mob_getmasterhpltmaxrate) (struct block_list * retVal___, struct mob_data *md, int rate); typedef int (*HPMHOOK_pre_mob_getfriendstatus_sub) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_mob_getfriendstatus_sub) (int retVal___, struct block_list *bl, va_list ap); -typedef struct block_list* (*HPMHOOK_pre_mob_getfriendstatus) (struct mob_data **md, int *cond1, int *cond2); -typedef struct block_list* (*HPMHOOK_post_mob_getfriendstatus) (struct block_list* retVal___, struct mob_data *md, int cond1, int cond2); +typedef struct block_list * (*HPMHOOK_pre_mob_getfriendstatus) (struct mob_data **md, int *cond1, int *cond2); +typedef struct block_list * (*HPMHOOK_post_mob_getfriendstatus) (struct block_list * retVal___, struct mob_data *md, int cond1, int cond2); typedef int (*HPMHOOK_pre_mob_use_skill) (struct mob_data **md, int64 *tick, int *event); typedef int (*HPMHOOK_post_mob_use_skill) (int retVal___, struct mob_data *md, int64 tick, int event); typedef int (*HPMHOOK_pre_mob_use_skill_event) (struct mob_data **md, struct block_list **src, int64 *tick, int *flag); @@ -5738,8 +5738,8 @@ typedef void (*HPMHOOK_pre_mob_read_db_mvpdrops_sub) (struct mob_db **entry, str typedef void (*HPMHOOK_post_mob_read_db_mvpdrops_sub) (struct mob_db *entry, struct config_setting_t *t); typedef uint32 (*HPMHOOK_pre_mob_read_db_mode_sub) (struct mob_db **entry, struct config_setting_t **t); typedef uint32 (*HPMHOOK_post_mob_read_db_mode_sub) (uint32 retVal___, struct mob_db *entry, struct config_setting_t *t); -typedef struct optdrop_group* (*HPMHOOK_pre_mob_read_db_drops_option) (struct mob_db **entry, const char **item_name, struct config_setting_t **drop, int **drop_rate); -typedef struct optdrop_group* (*HPMHOOK_post_mob_read_db_drops_option) (struct optdrop_group* retVal___, struct mob_db *entry, const char *item_name, struct config_setting_t *drop, int *drop_rate); +typedef struct optdrop_group * (*HPMHOOK_pre_mob_read_db_drops_option) (struct mob_db **entry, const char **item_name, struct config_setting_t **drop, int **drop_rate); +typedef struct optdrop_group * (*HPMHOOK_post_mob_read_db_drops_option) (struct optdrop_group * retVal___, struct mob_db *entry, const char *item_name, struct config_setting_t *drop, int *drop_rate); typedef void (*HPMHOOK_pre_mob_read_db_stats_sub) (struct mob_db **entry, struct config_setting_t **t); typedef void (*HPMHOOK_post_mob_read_db_stats_sub) (struct mob_db *entry, struct config_setting_t *t); typedef void (*HPMHOOK_pre_mob_read_db_viewdata_sub) (struct mob_db **entry, struct config_setting_t **t); @@ -5762,8 +5762,8 @@ typedef void (*HPMHOOK_pre_mob_load) (bool *minimal); typedef void (*HPMHOOK_post_mob_load) (bool minimal); typedef void (*HPMHOOK_pre_mob_clear_spawninfo) (void); typedef void (*HPMHOOK_post_mob_clear_spawninfo) (void); -typedef struct item_drop_ratio* (*HPMHOOK_pre_mob_get_item_drop_ratio) (int *nameid); -typedef struct item_drop_ratio* (*HPMHOOK_post_mob_get_item_drop_ratio) (struct item_drop_ratio* retVal___, int nameid); +typedef struct item_drop_ratio * (*HPMHOOK_pre_mob_get_item_drop_ratio) (int *nameid); +typedef struct item_drop_ratio * (*HPMHOOK_post_mob_get_item_drop_ratio) (struct item_drop_ratio * retVal___, int nameid); typedef void (*HPMHOOK_pre_mob_set_item_drop_ratio) (int *nameid, struct item_drop_ratio **ratio); typedef void (*HPMHOOK_post_mob_set_item_drop_ratio) (int nameid, struct item_drop_ratio *ratio); typedef int (*HPMHOOK_pre_mob_final_ratio_sub) (union DBKey *key, struct DBData **data, va_list ap); @@ -5788,8 +5788,8 @@ typedef bool (*HPMHOOK_pre_mob_read_group_db_libconfig_sub_group) (struct config typedef bool (*HPMHOOK_post_mob_read_group_db_libconfig_sub_group) (bool retVal___, struct config_setting_t *it, enum mob_groups group_id, const char *source); #endif // MAP_MOB_H #ifdef COMMON_MUTEX_H /* mutex */ -typedef struct mutex_data* (*HPMHOOK_pre_mutex_create) (void); -typedef struct mutex_data* (*HPMHOOK_post_mutex_create) (struct mutex_data* retVal___); +typedef struct mutex_data * (*HPMHOOK_pre_mutex_create) (void); +typedef struct mutex_data * (*HPMHOOK_post_mutex_create) (struct mutex_data * retVal___); typedef void (*HPMHOOK_pre_mutex_destroy) (struct mutex_data **m); typedef void (*HPMHOOK_post_mutex_destroy) (struct mutex_data *m); typedef void (*HPMHOOK_pre_mutex_lock) (struct mutex_data **m); @@ -5798,8 +5798,8 @@ typedef bool (*HPMHOOK_pre_mutex_trylock) (struct mutex_data **m); typedef bool (*HPMHOOK_post_mutex_trylock) (bool retVal___, struct mutex_data *m); typedef void (*HPMHOOK_pre_mutex_unlock) (struct mutex_data **m); typedef void (*HPMHOOK_post_mutex_unlock) (struct mutex_data *m); -typedef struct cond_data* (*HPMHOOK_pre_mutex_cond_create) (void); -typedef struct cond_data* (*HPMHOOK_post_mutex_cond_create) (struct cond_data* retVal___); +typedef struct cond_data * (*HPMHOOK_pre_mutex_cond_create) (void); +typedef struct cond_data * (*HPMHOOK_post_mutex_cond_create) (struct cond_data * retVal___); typedef void (*HPMHOOK_pre_mutex_cond_destroy) (struct cond_data **c); typedef void (*HPMHOOK_post_mutex_cond_destroy) (struct cond_data *c); typedef void (*HPMHOOK_pre_mutex_cond_wait) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks); @@ -5816,16 +5816,16 @@ typedef void (*HPMHOOK_pre_npc_chat_finalize) (struct npc_data **nd); typedef void (*HPMHOOK_post_npc_chat_finalize) (struct npc_data *nd); typedef void (*HPMHOOK_pre_npc_chat_def_pattern) (struct npc_data **nd, int *setid, const char **pattern, const char **label); typedef void (*HPMHOOK_post_npc_chat_def_pattern) (struct npc_data *nd, int setid, const char *pattern, const char *label); -typedef struct pcrematch_entry* (*HPMHOOK_pre_npc_chat_create_pcrematch_entry) (struct pcrematch_set **set); -typedef struct pcrematch_entry* (*HPMHOOK_post_npc_chat_create_pcrematch_entry) (struct pcrematch_entry* retVal___, struct pcrematch_set *set); +typedef struct pcrematch_entry * (*HPMHOOK_pre_npc_chat_create_pcrematch_entry) (struct pcrematch_set **set); +typedef struct pcrematch_entry * (*HPMHOOK_post_npc_chat_create_pcrematch_entry) (struct pcrematch_entry * retVal___, struct pcrematch_set *set); typedef void (*HPMHOOK_pre_npc_chat_delete_pcreset) (struct npc_data **nd, int *setid); typedef void (*HPMHOOK_post_npc_chat_delete_pcreset) (struct npc_data *nd, int setid); typedef void (*HPMHOOK_pre_npc_chat_deactivate_pcreset) (struct npc_data **nd, int *setid); typedef void (*HPMHOOK_post_npc_chat_deactivate_pcreset) (struct npc_data *nd, int setid); typedef void (*HPMHOOK_pre_npc_chat_activate_pcreset) (struct npc_data **nd, int *setid); typedef void (*HPMHOOK_post_npc_chat_activate_pcreset) (struct npc_data *nd, int setid); -typedef struct pcrematch_set* (*HPMHOOK_pre_npc_chat_lookup_pcreset) (struct npc_data **nd, int *setid); -typedef struct pcrematch_set* (*HPMHOOK_post_npc_chat_lookup_pcreset) (struct pcrematch_set* retVal___, struct npc_data *nd, int setid); +typedef struct pcrematch_set * (*HPMHOOK_pre_npc_chat_lookup_pcreset) (struct npc_data **nd, int *setid); +typedef struct pcrematch_set * (*HPMHOOK_post_npc_chat_lookup_pcreset) (struct pcrematch_set * retVal___, struct npc_data *nd, int setid); typedef void (*HPMHOOK_pre_npc_chat_finalize_pcrematch_entry) (struct pcrematch_entry **e); typedef void (*HPMHOOK_post_npc_chat_finalize_pcrematch_entry) (struct pcrematch_entry *e); #endif // MAP_NPC_H @@ -5836,8 +5836,8 @@ typedef int (*HPMHOOK_pre_npc_final) (void); typedef int (*HPMHOOK_post_npc_final) (int retVal___); typedef int (*HPMHOOK_pre_npc_get_new_npc_id) (void); typedef int (*HPMHOOK_post_npc_get_new_npc_id) (int retVal___); -typedef struct view_data* (*HPMHOOK_pre_npc_get_viewdata) (int *class_); -typedef struct view_data* (*HPMHOOK_post_npc_get_viewdata) (struct view_data* retVal___, int class_); +typedef struct view_data * (*HPMHOOK_pre_npc_get_viewdata) (int *class_); +typedef struct view_data * (*HPMHOOK_post_npc_get_viewdata) (struct view_data * retVal___, int class_); typedef int (*HPMHOOK_pre_npc_isnear_sub) (struct block_list **bl, va_list args); typedef int (*HPMHOOK_post_npc_isnear_sub) (int retVal___, struct block_list *bl, va_list args); typedef bool (*HPMHOOK_pre_npc_isnear) (struct block_list **bl); @@ -5852,8 +5852,8 @@ typedef int (*HPMHOOK_pre_npc_enable_sub) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_npc_enable_sub) (int retVal___, struct block_list *bl, va_list ap); typedef int (*HPMHOOK_pre_npc_enable) (const char **name, int *flag); typedef int (*HPMHOOK_post_npc_enable) (int retVal___, const char *name, int flag); -typedef struct npc_data* (*HPMHOOK_pre_npc_name2id) (const char **name); -typedef struct npc_data* (*HPMHOOK_post_npc_name2id) (struct npc_data* retVal___, const char *name); +typedef struct npc_data * (*HPMHOOK_pre_npc_name2id) (const char **name); +typedef struct npc_data * (*HPMHOOK_post_npc_name2id) (struct npc_data * retVal___, const char *name); typedef int (*HPMHOOK_pre_npc_event_dequeue) (struct map_session_data **sd); typedef int (*HPMHOOK_post_npc_event_dequeue) (int retVal___, struct map_session_data *sd); typedef struct DBData (*HPMHOOK_pre_npc_event_export_create) (union DBKey *key, va_list args); @@ -5904,8 +5904,8 @@ typedef int (*HPMHOOK_pre_npc_touch_areanpc2) (struct mob_data **md); typedef int (*HPMHOOK_post_npc_touch_areanpc2) (int retVal___, struct mob_data *md); typedef int (*HPMHOOK_pre_npc_check_areanpc) (int *flag, int16 *m, int16 *x, int16 *y, int16 *range); typedef int (*HPMHOOK_post_npc_check_areanpc) (int retVal___, int flag, int16 m, int16 x, int16 y, int16 range); -typedef struct npc_data* (*HPMHOOK_pre_npc_checknear) (struct map_session_data **sd, struct block_list **bl); -typedef struct npc_data* (*HPMHOOK_post_npc_checknear) (struct npc_data* retVal___, struct map_session_data *sd, struct block_list *bl); +typedef struct npc_data * (*HPMHOOK_pre_npc_checknear) (struct map_session_data **sd, struct block_list **bl); +typedef struct npc_data * (*HPMHOOK_post_npc_checknear) (struct npc_data * retVal___, struct map_session_data *sd, struct block_list *bl); typedef int (*HPMHOOK_pre_npc_globalmessage) (const char **name, const char **mes); typedef int (*HPMHOOK_post_npc_globalmessage) (int retVal___, const char *name, const char *mes); typedef void (*HPMHOOK_pre_npc_run_tomb) (struct map_session_data **sd, struct npc_data **nd); @@ -5948,8 +5948,8 @@ typedef void (*HPMHOOK_pre_npc_addsrcfile) (const char **name); typedef void (*HPMHOOK_post_npc_addsrcfile) (const char *name); typedef void (*HPMHOOK_pre_npc_delsrcfile) (const char **name); typedef void (*HPMHOOK_post_npc_delsrcfile) (const char *name); -typedef const char* (*HPMHOOK_pre_npc_retainpathreference) (const char **filepath); -typedef const char* (*HPMHOOK_post_npc_retainpathreference) (const char* retVal___, const char *filepath); +typedef const char * (*HPMHOOK_pre_npc_retainpathreference) (const char **filepath); +typedef const char * (*HPMHOOK_post_npc_retainpathreference) (const char * retVal___, const char *filepath); typedef void (*HPMHOOK_pre_npc_releasepathreference) (const char **filepath); typedef void (*HPMHOOK_post_npc_releasepathreference) (const char *filepath); typedef void (*HPMHOOK_pre_npc_parsename) (struct npc_data **nd, const char **name, const char **start, const char **buffer, const char **filepath); @@ -5958,22 +5958,22 @@ typedef int (*HPMHOOK_pre_npc_parseview) (const char **w4, const char **start, c typedef int (*HPMHOOK_post_npc_parseview) (int retVal___, const char *w4, const char *start, const char *buffer, const char *filepath); typedef bool (*HPMHOOK_pre_npc_viewisid) (const char **viewid); typedef bool (*HPMHOOK_post_npc_viewisid) (bool retVal___, const char *viewid); -typedef struct npc_data* (*HPMHOOK_pre_npc_create_npc) (enum npc_subtype *subtype, int *m, int *x, int *y, enum unit_dir *dir, int *class_); -typedef struct npc_data* (*HPMHOOK_post_npc_create_npc) (struct npc_data* retVal___, enum npc_subtype subtype, int m, int x, int y, enum unit_dir dir, int class_); -typedef struct npc_data* (*HPMHOOK_pre_npc_add_warp) (char **name, short *from_mapid, short *from_x, short *from_y, short *xs, short *ys, unsigned short *to_mapindex, short *to_x, short *to_y); -typedef struct npc_data* (*HPMHOOK_post_npc_add_warp) (struct npc_data* retVal___, char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y); -typedef const char* (*HPMHOOK_pre_npc_parse_warp) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); -typedef const char* (*HPMHOOK_post_npc_parse_warp) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); -typedef const char* (*HPMHOOK_pre_npc_parse_shop) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); -typedef const char* (*HPMHOOK_post_npc_parse_shop) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); -typedef const char* (*HPMHOOK_pre_npc_parse_unknown_object) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); -typedef const char* (*HPMHOOK_post_npc_parse_unknown_object) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); +typedef struct npc_data * (*HPMHOOK_pre_npc_create_npc) (enum npc_subtype *subtype, int *m, int *x, int *y, enum unit_dir *dir, int *class_); +typedef struct npc_data * (*HPMHOOK_post_npc_create_npc) (struct npc_data * retVal___, enum npc_subtype subtype, int m, int x, int y, enum unit_dir dir, int class_); +typedef struct npc_data * (*HPMHOOK_pre_npc_add_warp) (char **name, short *from_mapid, short *from_x, short *from_y, short *xs, short *ys, unsigned short *to_mapindex, short *to_x, short *to_y); +typedef struct npc_data * (*HPMHOOK_post_npc_add_warp) (struct npc_data * retVal___, char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y); +typedef const char * (*HPMHOOK_pre_npc_parse_warp) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); +typedef const char * (*HPMHOOK_post_npc_parse_warp) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); +typedef const char * (*HPMHOOK_pre_npc_parse_shop) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); +typedef const char * (*HPMHOOK_post_npc_parse_shop) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); +typedef const char * (*HPMHOOK_pre_npc_parse_unknown_object) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); +typedef const char * (*HPMHOOK_post_npc_parse_unknown_object) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); typedef void (*HPMHOOK_pre_npc_convertlabel_db) (struct npc_label_list **label_list, const char **filepath); typedef void (*HPMHOOK_post_npc_convertlabel_db) (struct npc_label_list *label_list, const char *filepath); -typedef const char* (*HPMHOOK_pre_npc_skip_script) (const char **start, const char **buffer, const char **filepath, int **retval); -typedef const char* (*HPMHOOK_post_npc_skip_script) (const char* retVal___, const char *start, const char *buffer, const char *filepath, int *retval); -typedef const char* (*HPMHOOK_pre_npc_parse_script) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval); -typedef const char* (*HPMHOOK_post_npc_parse_script) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval); +typedef const char * (*HPMHOOK_pre_npc_skip_script) (const char **start, const char **buffer, const char **filepath, int **retval); +typedef const char * (*HPMHOOK_post_npc_skip_script) (const char * retVal___, const char *start, const char *buffer, const char *filepath, int *retval); +typedef const char * (*HPMHOOK_pre_npc_parse_script) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval); +typedef const char * (*HPMHOOK_post_npc_parse_script) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval); typedef void (*HPMHOOK_pre_npc_add_to_location) (struct npc_data **nd); typedef void (*HPMHOOK_post_npc_add_to_location) (struct npc_data *nd); typedef bool (*HPMHOOK_pre_npc_duplicate_script_sub) (struct npc_data **nd, const struct npc_data **snd, int *xs, int *ys, int *options); @@ -5984,8 +5984,8 @@ typedef bool (*HPMHOOK_pre_npc_duplicate_warp_sub) (struct npc_data **nd, const typedef bool (*HPMHOOK_post_npc_duplicate_warp_sub) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options); typedef bool (*HPMHOOK_pre_npc_duplicate_sub) (struct npc_data **nd, const struct npc_data **snd, int *xs, int *ys, int *options); typedef bool (*HPMHOOK_post_npc_duplicate_sub) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options); -typedef const char* (*HPMHOOK_pre_npc_parse_duplicate) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval); -typedef const char* (*HPMHOOK_post_npc_parse_duplicate) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval); +typedef const char * (*HPMHOOK_pre_npc_parse_duplicate) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval); +typedef const char * (*HPMHOOK_post_npc_parse_duplicate) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval); typedef int (*HPMHOOK_pre_npc_duplicate4instance) (struct npc_data **snd, int16 *m); typedef int (*HPMHOOK_post_npc_duplicate4instance) (int retVal___, struct npc_data *snd, int16 m); typedef void (*HPMHOOK_pre_npc_setcells) (struct npc_data **nd); @@ -6002,14 +6002,14 @@ typedef void (*HPMHOOK_pre_npc_setclass) (struct npc_data **nd, int *class_); typedef void (*HPMHOOK_post_npc_setclass) (struct npc_data *nd, int class_); typedef int (*HPMHOOK_pre_npc_do_atcmd_event) (struct map_session_data **sd, const char **command, const char **message, const char **eventname); typedef int (*HPMHOOK_post_npc_do_atcmd_event) (int retVal___, struct map_session_data *sd, const char *command, const char *message, const char *eventname); -typedef const char* (*HPMHOOK_pre_npc_parse_function) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); -typedef const char* (*HPMHOOK_post_npc_parse_function) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); +typedef const char * (*HPMHOOK_pre_npc_parse_function) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); +typedef const char * (*HPMHOOK_post_npc_parse_function) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); typedef void (*HPMHOOK_pre_npc_parse_mob2) (struct spawn_data **mobspawn); typedef void (*HPMHOOK_post_npc_parse_mob2) (struct spawn_data *mobspawn); -typedef const char* (*HPMHOOK_pre_npc_parse_mob) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); -typedef const char* (*HPMHOOK_post_npc_parse_mob) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); -typedef const char* (*HPMHOOK_pre_npc_parse_mapflag) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); -typedef const char* (*HPMHOOK_post_npc_parse_mapflag) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); +typedef const char * (*HPMHOOK_pre_npc_parse_mob) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); +typedef const char * (*HPMHOOK_post_npc_parse_mob) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); +typedef const char * (*HPMHOOK_pre_npc_parse_mapflag) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); +typedef const char * (*HPMHOOK_post_npc_parse_mapflag) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); typedef void (*HPMHOOK_pre_npc_parse_unknown_mapflag) (const char **name, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); typedef void (*HPMHOOK_post_npc_parse_unknown_mapflag) (const char *name, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); typedef int (*HPMHOOK_pre_npc_parsesrcfile) (const char **filepath, bool *runOnInit); @@ -6110,14 +6110,14 @@ typedef void (*HPMHOOK_pre_party_init) (bool *minimal); typedef void (*HPMHOOK_post_party_init) (bool minimal); typedef void (*HPMHOOK_pre_party_final) (void); typedef void (*HPMHOOK_post_party_final) (void); -typedef struct party_data* (*HPMHOOK_pre_party_search) (int *party_id); -typedef struct party_data* (*HPMHOOK_post_party_search) (struct party_data* retVal___, int party_id); -typedef struct party_data* (*HPMHOOK_pre_party_searchname) (const char **str); -typedef struct party_data* (*HPMHOOK_post_party_searchname) (struct party_data* retVal___, const char *str); +typedef struct party_data * (*HPMHOOK_pre_party_search) (int *party_id); +typedef struct party_data * (*HPMHOOK_post_party_search) (struct party_data * retVal___, int party_id); +typedef struct party_data * (*HPMHOOK_pre_party_searchname) (const char **str); +typedef struct party_data * (*HPMHOOK_post_party_searchname) (struct party_data * retVal___, const char *str); typedef int (*HPMHOOK_pre_party_getmemberid) (struct party_data **p, struct map_session_data **sd); typedef int (*HPMHOOK_post_party_getmemberid) (int retVal___, struct party_data *p, struct map_session_data *sd); -typedef struct map_session_data* (*HPMHOOK_pre_party_getavailablesd) (struct party_data **p); -typedef struct map_session_data* (*HPMHOOK_post_party_getavailablesd) (struct map_session_data* retVal___, struct party_data *p); +typedef struct map_session_data * (*HPMHOOK_pre_party_getavailablesd) (struct party_data **p); +typedef struct map_session_data * (*HPMHOOK_post_party_getavailablesd) (struct map_session_data * retVal___, struct party_data *p); typedef int (*HPMHOOK_pre_party_create) (struct map_session_data **sd, const char **name, int *item, int *item2); typedef int (*HPMHOOK_post_party_create) (int retVal___, struct map_session_data *sd, const char *name, int item, int item2); typedef void (*HPMHOOK_pre_party_created) (int *account_id, int *char_id, int *fail, int *party_id, const char **name); @@ -6194,12 +6194,12 @@ typedef int (*HPMHOOK_pre_party_send_xy_timer) (int *tid, int64 *tick, int *id, typedef int (*HPMHOOK_post_party_send_xy_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef void (*HPMHOOK_pre_party_fill_member) (struct party_member **member, struct map_session_data **sd, unsigned int *leader); typedef void (*HPMHOOK_post_party_fill_member) (struct party_member *member, struct map_session_data *sd, unsigned int leader); -typedef struct map_session_data* (*HPMHOOK_pre_party_sd_check) (int *party_id, int *account_id, int *char_id); -typedef struct map_session_data* (*HPMHOOK_post_party_sd_check) (struct map_session_data* retVal___, int party_id, int account_id, int char_id); +typedef struct map_session_data * (*HPMHOOK_pre_party_sd_check) (int *party_id, int *account_id, int *char_id); +typedef struct map_session_data * (*HPMHOOK_post_party_sd_check) (struct map_session_data * retVal___, int party_id, int account_id, int char_id); typedef void (*HPMHOOK_pre_party_check_state) (struct party_data **p); typedef void (*HPMHOOK_post_party_check_state) (struct party_data *p); -typedef struct party_booking_ad_info* (*HPMHOOK_pre_party_create_booking_data) (void); -typedef struct party_booking_ad_info* (*HPMHOOK_post_party_create_booking_data) (struct party_booking_ad_info* retVal___); +typedef struct party_booking_ad_info * (*HPMHOOK_pre_party_create_booking_data) (void); +typedef struct party_booking_ad_info * (*HPMHOOK_post_party_create_booking_data) (struct party_booking_ad_info * retVal___); typedef int (*HPMHOOK_pre_party_db_final) (union DBKey *key, struct DBData **data, va_list ap); typedef int (*HPMHOOK_post_party_db_final) (int retVal___, union DBKey key, struct DBData *data, va_list ap); #endif // MAP_PARTY_H @@ -6226,18 +6226,18 @@ typedef void (*HPMHOOK_pre_pcg_final) (void); typedef void (*HPMHOOK_post_pcg_final) (void); typedef void (*HPMHOOK_pre_pcg_reload) (void); typedef void (*HPMHOOK_post_pcg_reload) (void); -typedef GroupSettings* (*HPMHOOK_pre_pcg_get_dummy_group) (void); -typedef GroupSettings* (*HPMHOOK_post_pcg_get_dummy_group) (GroupSettings* retVal___); +typedef GroupSettings * (*HPMHOOK_pre_pcg_get_dummy_group) (void); +typedef GroupSettings * (*HPMHOOK_post_pcg_get_dummy_group) (GroupSettings * retVal___); typedef bool (*HPMHOOK_pre_pcg_exists) (int *group_id); typedef bool (*HPMHOOK_post_pcg_exists) (bool retVal___, int group_id); -typedef GroupSettings* (*HPMHOOK_pre_pcg_id2group) (int *group_id); -typedef GroupSettings* (*HPMHOOK_post_pcg_id2group) (GroupSettings* retVal___, int group_id); +typedef GroupSettings * (*HPMHOOK_pre_pcg_id2group) (int *group_id); +typedef GroupSettings * (*HPMHOOK_post_pcg_id2group) (GroupSettings * retVal___, int group_id); typedef bool (*HPMHOOK_pre_pcg_has_permission) (GroupSettings **group, unsigned int *permission); typedef bool (*HPMHOOK_post_pcg_has_permission) (bool retVal___, GroupSettings *group, unsigned int permission); typedef bool (*HPMHOOK_pre_pcg_should_log_commands) (GroupSettings **group); typedef bool (*HPMHOOK_post_pcg_should_log_commands) (bool retVal___, GroupSettings *group); -typedef const char* (*HPMHOOK_pre_pcg_get_name) (GroupSettings **group); -typedef const char* (*HPMHOOK_post_pcg_get_name) (const char* retVal___, GroupSettings *group); +typedef const char * (*HPMHOOK_pre_pcg_get_name) (GroupSettings **group); +typedef const char * (*HPMHOOK_post_pcg_get_name) (const char * retVal___, GroupSettings *group); typedef int (*HPMHOOK_pre_pcg_get_level) (GroupSettings **group); typedef int (*HPMHOOK_post_pcg_get_level) (int retVal___, GroupSettings *group); typedef int (*HPMHOOK_pre_pcg_get_idx) (GroupSettings **group); @@ -6248,8 +6248,8 @@ typedef void (*HPMHOOK_pre_pc_init) (bool *minimal); typedef void (*HPMHOOK_post_pc_init) (bool minimal); typedef void (*HPMHOOK_pre_pc_final) (void); typedef void (*HPMHOOK_post_pc_final) (void); -typedef struct map_session_data* (*HPMHOOK_pre_pc_get_dummy_sd) (void); -typedef struct map_session_data* (*HPMHOOK_post_pc_get_dummy_sd) (struct map_session_data* retVal___); +typedef struct map_session_data * (*HPMHOOK_pre_pc_get_dummy_sd) (void); +typedef struct map_session_data * (*HPMHOOK_post_pc_get_dummy_sd) (struct map_session_data * retVal___); typedef int (*HPMHOOK_pre_pc_class2idx) (int *class); typedef int (*HPMHOOK_post_pc_class2idx) (int retVal___, int class); typedef bool (*HPMHOOK_pre_pc_can_talk) (struct map_session_data **sd); @@ -6508,16 +6508,16 @@ typedef int (*HPMHOOK_pre_pc_readreg) (struct map_session_data **sd, int64 *reg) typedef int (*HPMHOOK_post_pc_readreg) (int retVal___, struct map_session_data *sd, int64 reg); typedef void (*HPMHOOK_pre_pc_setreg) (struct map_session_data **sd, int64 *reg, int *val); typedef void (*HPMHOOK_post_pc_setreg) (struct map_session_data *sd, int64 reg, int val); -typedef char* (*HPMHOOK_pre_pc_readregstr) (struct map_session_data **sd, int64 *reg); -typedef char* (*HPMHOOK_post_pc_readregstr) (char* retVal___, struct map_session_data *sd, int64 reg); +typedef char * (*HPMHOOK_pre_pc_readregstr) (struct map_session_data **sd, int64 *reg); +typedef char * (*HPMHOOK_post_pc_readregstr) (char * retVal___, struct map_session_data *sd, int64 reg); typedef void (*HPMHOOK_pre_pc_setregstr) (struct map_session_data **sd, int64 *reg, const char **str); typedef void (*HPMHOOK_post_pc_setregstr) (struct map_session_data *sd, int64 reg, const char *str); typedef int (*HPMHOOK_pre_pc_readregistry) (struct map_session_data **sd, int64 *reg); typedef int (*HPMHOOK_post_pc_readregistry) (int retVal___, struct map_session_data *sd, int64 reg); typedef int (*HPMHOOK_pre_pc_setregistry) (struct map_session_data **sd, int64 *reg, int *val); typedef int (*HPMHOOK_post_pc_setregistry) (int retVal___, struct map_session_data *sd, int64 reg, int val); -typedef char* (*HPMHOOK_pre_pc_readregistry_str) (struct map_session_data **sd, int64 *reg); -typedef char* (*HPMHOOK_post_pc_readregistry_str) (char* retVal___, struct map_session_data *sd, int64 reg); +typedef char * (*HPMHOOK_pre_pc_readregistry_str) (struct map_session_data **sd, int64 *reg); +typedef char * (*HPMHOOK_post_pc_readregistry_str) (char * retVal___, struct map_session_data *sd, int64 reg); typedef int (*HPMHOOK_pre_pc_setregistry_str) (struct map_session_data **sd, int64 *reg, const char **val); typedef int (*HPMHOOK_post_pc_setregistry_str) (int retVal___, struct map_session_data *sd, int64 reg, const char *val); typedef int (*HPMHOOK_pre_pc_addeventtimer) (struct map_session_data **sd, int *tick, const char **name); @@ -6540,14 +6540,14 @@ typedef int (*HPMHOOK_pre_pc_marriage) (struct map_session_data **sd, struct map typedef int (*HPMHOOK_post_pc_marriage) (int retVal___, struct map_session_data *sd, struct map_session_data *dstsd); typedef int (*HPMHOOK_pre_pc_divorce) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_divorce) (int retVal___, struct map_session_data *sd); -typedef struct map_session_data* (*HPMHOOK_pre_pc_get_partner) (struct map_session_data **sd); -typedef struct map_session_data* (*HPMHOOK_post_pc_get_partner) (struct map_session_data* retVal___, struct map_session_data *sd); -typedef struct map_session_data* (*HPMHOOK_pre_pc_get_father) (struct map_session_data **sd); -typedef struct map_session_data* (*HPMHOOK_post_pc_get_father) (struct map_session_data* retVal___, struct map_session_data *sd); -typedef struct map_session_data* (*HPMHOOK_pre_pc_get_mother) (struct map_session_data **sd); -typedef struct map_session_data* (*HPMHOOK_post_pc_get_mother) (struct map_session_data* retVal___, struct map_session_data *sd); -typedef struct map_session_data* (*HPMHOOK_pre_pc_get_child) (struct map_session_data **sd); -typedef struct map_session_data* (*HPMHOOK_post_pc_get_child) (struct map_session_data* retVal___, struct map_session_data *sd); +typedef struct map_session_data * (*HPMHOOK_pre_pc_get_partner) (struct map_session_data **sd); +typedef struct map_session_data * (*HPMHOOK_post_pc_get_partner) (struct map_session_data * retVal___, struct map_session_data *sd); +typedef struct map_session_data * (*HPMHOOK_pre_pc_get_father) (struct map_session_data **sd); +typedef struct map_session_data * (*HPMHOOK_post_pc_get_father) (struct map_session_data * retVal___, struct map_session_data *sd); +typedef struct map_session_data * (*HPMHOOK_pre_pc_get_mother) (struct map_session_data **sd); +typedef struct map_session_data * (*HPMHOOK_post_pc_get_mother) (struct map_session_data * retVal___, struct map_session_data *sd); +typedef struct map_session_data * (*HPMHOOK_pre_pc_get_child) (struct map_session_data **sd); +typedef struct map_session_data * (*HPMHOOK_post_pc_get_child) (struct map_session_data * retVal___, struct map_session_data *sd); typedef void (*HPMHOOK_pre_pc_bleeding) (struct map_session_data **sd, unsigned int *diff_tick); typedef void (*HPMHOOK_post_pc_bleeding) (struct map_session_data *sd, unsigned int diff_tick); typedef void (*HPMHOOK_pre_pc_regen) (struct map_session_data **sd, unsigned int *diff_tick); @@ -6560,8 +6560,8 @@ typedef int (*HPMHOOK_pre_pc_jobid2mapid) (int *class); typedef int (*HPMHOOK_post_pc_jobid2mapid) (int retVal___, int class); typedef int (*HPMHOOK_pre_pc_mapid2jobid) (unsigned int *class_, int *sex); typedef int (*HPMHOOK_post_pc_mapid2jobid) (int retVal___, unsigned int class_, int sex); -typedef const char* (*HPMHOOK_pre_pc_job_name) (int *class); -typedef const char* (*HPMHOOK_post_pc_job_name) (const char* retVal___, int class); +typedef const char * (*HPMHOOK_pre_pc_job_name) (int *class); +typedef const char * (*HPMHOOK_post_pc_job_name) (const char * retVal___, int class); typedef void (*HPMHOOK_pre_pc_setinvincibletimer) (struct map_session_data **sd, int *val); typedef void (*HPMHOOK_post_pc_setinvincibletimer) (struct map_session_data *sd, int val); typedef void (*HPMHOOK_pre_pc_delinvincibletimer) (struct map_session_data **sd); @@ -6762,10 +6762,10 @@ typedef void (*HPMHOOK_pre_pc_crimson_marker_clear) (struct map_session_data **s typedef void (*HPMHOOK_post_pc_crimson_marker_clear) (struct map_session_data *sd); #endif // MAP_PC_H #ifdef MAP_NPC_H /* libpcre */ -typedef pcre* (*HPMHOOK_pre_libpcre_compile) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr); -typedef pcre* (*HPMHOOK_post_libpcre_compile) (pcre* retVal___, const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr); -typedef pcre_extra* (*HPMHOOK_pre_libpcre_study) (const pcre **code, int *options, const char ***errptr); -typedef pcre_extra* (*HPMHOOK_post_libpcre_study) (pcre_extra* retVal___, const pcre *code, int options, const char **errptr); +typedef pcre * (*HPMHOOK_pre_libpcre_compile) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr); +typedef pcre * (*HPMHOOK_post_libpcre_compile) (pcre * retVal___, const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr); +typedef pcre_extra * (*HPMHOOK_pre_libpcre_study) (const pcre **code, int *options, const char ***errptr); +typedef pcre_extra * (*HPMHOOK_post_libpcre_study) (pcre_extra * retVal___, const pcre *code, int options, const char **errptr); typedef int (*HPMHOOK_pre_libpcre_exec) (const pcre **code, const pcre_extra **extra, PCRE_SPTR *subject, int *length, int *startoffset, int *options, int **ovector, int *ovecsize); typedef int (*HPMHOOK_post_libpcre_exec) (int retVal___, const pcre *code, const pcre_extra *extra, PCRE_SPTR subject, int length, int startoffset, int options, int *ovector, int ovecsize); typedef void (*HPMHOOK_pre_libpcre_free) (void **ptr); @@ -6914,8 +6914,8 @@ typedef void (*HPMHOOK_pre_quest_final) (void); typedef void (*HPMHOOK_post_quest_final) (void); typedef void (*HPMHOOK_pre_quest_reload) (void); typedef void (*HPMHOOK_post_quest_reload) (void); -typedef struct quest_db* (*HPMHOOK_pre_quest_db) (int *quest_id); -typedef struct quest_db* (*HPMHOOK_post_quest_db) (struct quest_db* retVal___, int quest_id); +typedef struct quest_db * (*HPMHOOK_pre_quest_db) (int *quest_id); +typedef struct quest_db * (*HPMHOOK_post_quest_db) (struct quest_db * retVal___, int quest_id); typedef int (*HPMHOOK_pre_quest_pc_login) (struct map_session_data **sd); typedef int (*HPMHOOK_post_quest_pc_login) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_quest_add) (struct map_session_data **sd, int *quest_id, unsigned int *time_limit); @@ -6936,8 +6936,8 @@ typedef void (*HPMHOOK_pre_quest_clear) (void); typedef void (*HPMHOOK_post_quest_clear) (void); typedef int (*HPMHOOK_pre_quest_read_db) (void); typedef int (*HPMHOOK_post_quest_read_db) (int retVal___); -typedef struct quest_db* (*HPMHOOK_pre_quest_read_db_sub) (struct config_setting_t **cs, int *n, const char **source); -typedef struct quest_db* (*HPMHOOK_post_quest_read_db_sub) (struct quest_db* retVal___, struct config_setting_t *cs, int n, const char *source); +typedef struct quest_db * (*HPMHOOK_pre_quest_read_db_sub) (struct config_setting_t **cs, int *n, const char **source); +typedef struct quest_db * (*HPMHOOK_post_quest_read_db_sub) (struct quest_db * retVal___, struct config_setting_t *cs, int n, const char *source); typedef int (*HPMHOOK_pre_quest_setting_lookup_const) (struct config_setting_t **tt, const char **name, int **value, int *quest_id, int *idx, const char **kind, const char **source); typedef int (*HPMHOOK_post_quest_setting_lookup_const) (int retVal___, struct config_setting_t *tt, const char *name, int *value, int quest_id, int idx, const char *kind, const char *source); typedef int (*HPMHOOK_pre_quest_questinfo_validate_icon) (int *icon); @@ -7044,8 +7044,8 @@ typedef int (*HPMHOOK_pre_rodex_send_mail) (struct map_session_data **sd, const typedef int (*HPMHOOK_post_rodex_send_mail) (int retVal___, struct map_session_data *sd, const char *receiver_name, const char *body, const char *title, int64 zeny); typedef void (*HPMHOOK_pre_rodex_send_mail_result) (struct map_session_data **ssd, struct map_session_data **rsd, bool *result); typedef void (*HPMHOOK_post_rodex_send_mail_result) (struct map_session_data *ssd, struct map_session_data *rsd, bool result); -typedef struct rodex_message* (*HPMHOOK_pre_rodex_get_mail) (struct map_session_data **sd, int64 *mail_id); -typedef struct rodex_message* (*HPMHOOK_post_rodex_get_mail) (struct rodex_message* retVal___, struct map_session_data *sd, int64 mail_id); +typedef struct rodex_message * (*HPMHOOK_pre_rodex_get_mail) (struct map_session_data **sd, int64 *mail_id); +typedef struct rodex_message * (*HPMHOOK_post_rodex_get_mail) (struct rodex_message * retVal___, struct map_session_data *sd, int64 mail_id); typedef void (*HPMHOOK_pre_rodex_read_mail) (struct map_session_data **sd, int64 *mail_id); typedef void (*HPMHOOK_post_rodex_read_mail) (struct map_session_data *sd, int64 mail_id); typedef void (*HPMHOOK_pre_rodex_get_zeny) (struct map_session_data **sd, int8 *opentype, int64 *mail_id); @@ -7068,16 +7068,16 @@ typedef void (*HPMHOOK_pre_script_final) (void); typedef void (*HPMHOOK_post_script_final) (void); typedef int (*HPMHOOK_pre_script_reload) (void); typedef int (*HPMHOOK_post_script_reload) (int retVal___); -typedef struct script_code* (*HPMHOOK_pre_script_parse) (const char **src, const char **file, int *line, int *options, int **retval); -typedef struct script_code* (*HPMHOOK_post_script_parse) (struct script_code* retVal___, const char *src, const char *file, int line, int options, int *retval); +typedef struct script_code * (*HPMHOOK_pre_script_parse) (const char **src, const char **file, int *line, int *options, int **retval); +typedef struct script_code * (*HPMHOOK_post_script_parse) (struct script_code * retVal___, const char *src, const char *file, int line, int options, int *retval); typedef bool (*HPMHOOK_pre_script_add_builtin) (const struct script_function **buildin, bool *override); typedef bool (*HPMHOOK_post_script_add_builtin) (bool retVal___, const struct script_function *buildin, bool override); typedef void (*HPMHOOK_pre_script_parse_builtin) (void); typedef void (*HPMHOOK_post_script_parse_builtin) (void); -typedef const char* (*HPMHOOK_pre_script_parse_subexpr) (const char **p, int *limit); -typedef const char* (*HPMHOOK_post_script_parse_subexpr) (const char* retVal___, const char *p, int limit); -typedef const char* (*HPMHOOK_pre_script_skip_space) (const char **p); -typedef const char* (*HPMHOOK_post_script_skip_space) (const char* retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_subexpr) (const char **p, int *limit); +typedef const char * (*HPMHOOK_post_script_parse_subexpr) (const char * retVal___, const char *p, int limit); +typedef const char * (*HPMHOOK_pre_script_skip_space) (const char **p); +typedef const char * (*HPMHOOK_post_script_skip_space) (const char * retVal___, const char *p); typedef void (*HPMHOOK_pre_script_error) (const char **src, const char **file, int *start_line, const char **error_msg, const char **error_pos); typedef void (*HPMHOOK_post_script_error) (const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos); typedef void (*HPMHOOK_pre_script_warning) (const char **src, const char **file, int *start_line, const char **error_msg, const char **error_pos); @@ -7086,32 +7086,32 @@ typedef bool (*HPMHOOK_pre_script_addScript) (char **name, char **args, bool ( * typedef bool (*HPMHOOK_post_script_addScript) (bool retVal___, char *name, char *args, bool ( *func ) (struct script_state *st), bool isDeprecated); typedef int (*HPMHOOK_pre_script_conv_num) (struct script_state **st, struct script_data **data); typedef int (*HPMHOOK_post_script_conv_num) (int retVal___, struct script_state *st, struct script_data *data); -typedef const char* (*HPMHOOK_pre_script_conv_str) (struct script_state **st, struct script_data **data); -typedef const char* (*HPMHOOK_post_script_conv_str) (const char* retVal___, struct script_state *st, struct script_data *data); -typedef struct map_session_data* (*HPMHOOK_pre_script_rid2sd) (struct script_state **st); -typedef struct map_session_data* (*HPMHOOK_post_script_rid2sd) (struct map_session_data* retVal___, struct script_state *st); -typedef struct map_session_data* (*HPMHOOK_pre_script_id2sd) (struct script_state **st, int *account_id); -typedef struct map_session_data* (*HPMHOOK_post_script_id2sd) (struct map_session_data* retVal___, struct script_state *st, int account_id); -typedef struct map_session_data* (*HPMHOOK_pre_script_charid2sd) (struct script_state **st, int *char_id); -typedef struct map_session_data* (*HPMHOOK_post_script_charid2sd) (struct map_session_data* retVal___, struct script_state *st, int char_id); -typedef struct map_session_data* (*HPMHOOK_pre_script_nick2sd) (struct script_state **st, const char **name); -typedef struct map_session_data* (*HPMHOOK_post_script_nick2sd) (struct map_session_data* retVal___, struct script_state *st, const char *name); +typedef const char * (*HPMHOOK_pre_script_conv_str) (struct script_state **st, struct script_data **data); +typedef const char * (*HPMHOOK_post_script_conv_str) (const char * retVal___, struct script_state *st, struct script_data *data); +typedef struct map_session_data * (*HPMHOOK_pre_script_rid2sd) (struct script_state **st); +typedef struct map_session_data * (*HPMHOOK_post_script_rid2sd) (struct map_session_data * retVal___, struct script_state *st); +typedef struct map_session_data * (*HPMHOOK_pre_script_id2sd) (struct script_state **st, int *account_id); +typedef struct map_session_data * (*HPMHOOK_post_script_id2sd) (struct map_session_data * retVal___, struct script_state *st, int account_id); +typedef struct map_session_data * (*HPMHOOK_pre_script_charid2sd) (struct script_state **st, int *char_id); +typedef struct map_session_data * (*HPMHOOK_post_script_charid2sd) (struct map_session_data * retVal___, struct script_state *st, int char_id); +typedef struct map_session_data * (*HPMHOOK_pre_script_nick2sd) (struct script_state **st, const char **name); +typedef struct map_session_data * (*HPMHOOK_post_script_nick2sd) (struct map_session_data * retVal___, struct script_state *st, const char *name); typedef void (*HPMHOOK_pre_script_detach_rid) (struct script_state **st); typedef void (*HPMHOOK_post_script_detach_rid) (struct script_state *st); -typedef struct script_data* (*HPMHOOK_pre_script_push_val) (struct script_stack **stack, enum c_op *type, int64 *val, struct reg_db **ref); -typedef struct script_data* (*HPMHOOK_post_script_push_val) (struct script_data* retVal___, struct script_stack *stack, enum c_op type, int64 val, struct reg_db *ref); -typedef struct script_data* (*HPMHOOK_pre_script_get_val) (struct script_state **st, struct script_data **data); -typedef struct script_data* (*HPMHOOK_post_script_get_val) (struct script_data* retVal___, struct script_state *st, struct script_data *data); -typedef char* (*HPMHOOK_pre_script_get_val_ref_str) (struct script_state **st, struct reg_db **n, struct script_data **data); -typedef char* (*HPMHOOK_post_script_get_val_ref_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); -typedef char* (*HPMHOOK_pre_script_get_val_pc_ref_str) (struct script_state **st, struct reg_db **n, struct script_data **data); -typedef char* (*HPMHOOK_post_script_get_val_pc_ref_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); -typedef char* (*HPMHOOK_pre_script_get_val_scope_str) (struct script_state **st, struct reg_db **n, struct script_data **data); -typedef char* (*HPMHOOK_post_script_get_val_scope_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); -typedef char* (*HPMHOOK_pre_script_get_val_npc_str) (struct script_state **st, struct reg_db **n, struct script_data **data); -typedef char* (*HPMHOOK_post_script_get_val_npc_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); -typedef char* (*HPMHOOK_pre_script_get_val_instance_str) (struct script_state **st, const char **name, struct script_data **data); -typedef char* (*HPMHOOK_post_script_get_val_instance_str) (char* retVal___, struct script_state *st, const char *name, struct script_data *data); +typedef struct script_data * (*HPMHOOK_pre_script_push_val) (struct script_stack **stack, enum c_op *type, int64 *val, struct reg_db **ref); +typedef struct script_data * (*HPMHOOK_post_script_push_val) (struct script_data * retVal___, struct script_stack *stack, enum c_op type, int64 val, struct reg_db *ref); +typedef struct script_data * (*HPMHOOK_pre_script_get_val) (struct script_state **st, struct script_data **data); +typedef struct script_data * (*HPMHOOK_post_script_get_val) (struct script_data * retVal___, struct script_state *st, struct script_data *data); +typedef char * (*HPMHOOK_pre_script_get_val_ref_str) (struct script_state **st, struct reg_db **n, struct script_data **data); +typedef char * (*HPMHOOK_post_script_get_val_ref_str) (char * retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); +typedef char * (*HPMHOOK_pre_script_get_val_pc_ref_str) (struct script_state **st, struct reg_db **n, struct script_data **data); +typedef char * (*HPMHOOK_post_script_get_val_pc_ref_str) (char * retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); +typedef char * (*HPMHOOK_pre_script_get_val_scope_str) (struct script_state **st, struct reg_db **n, struct script_data **data); +typedef char * (*HPMHOOK_post_script_get_val_scope_str) (char * retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); +typedef char * (*HPMHOOK_pre_script_get_val_npc_str) (struct script_state **st, struct reg_db **n, struct script_data **data); +typedef char * (*HPMHOOK_post_script_get_val_npc_str) (char * retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); +typedef char * (*HPMHOOK_pre_script_get_val_instance_str) (struct script_state **st, const char **name, struct script_data **data); +typedef char * (*HPMHOOK_post_script_get_val_instance_str) (char * retVal___, struct script_state *st, const char *name, struct script_data *data); typedef int (*HPMHOOK_pre_script_get_val_ref_num) (struct script_state **st, struct reg_db **n, struct script_data **data); typedef int (*HPMHOOK_post_script_get_val_ref_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); typedef int (*HPMHOOK_pre_script_get_val_pc_ref_num) (struct script_state **st, struct reg_db **n, struct script_data **data); @@ -7122,14 +7122,14 @@ typedef int (*HPMHOOK_pre_script_get_val_npc_num) (struct script_state **st, str typedef int (*HPMHOOK_post_script_get_val_npc_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); typedef int (*HPMHOOK_pre_script_get_val_instance_num) (struct script_state **st, const char **name, struct script_data **data); typedef int (*HPMHOOK_post_script_get_val_instance_num) (int retVal___, struct script_state *st, const char *name, struct script_data *data); -typedef const void* (*HPMHOOK_pre_script_get_val2) (struct script_state **st, int64 *uid, struct reg_db **ref); -typedef const void* (*HPMHOOK_post_script_get_val2) (const void* retVal___, struct script_state *st, int64 uid, struct reg_db *ref); -typedef struct script_data* (*HPMHOOK_pre_script_push_str) (struct script_stack **stack, char **str); -typedef struct script_data* (*HPMHOOK_post_script_push_str) (struct script_data* retVal___, struct script_stack *stack, char *str); -typedef struct script_data* (*HPMHOOK_pre_script_push_conststr) (struct script_stack **stack, const char **str); -typedef struct script_data* (*HPMHOOK_post_script_push_conststr) (struct script_data* retVal___, struct script_stack *stack, const char *str); -typedef struct script_data* (*HPMHOOK_pre_script_push_copy) (struct script_stack **stack, int *pos); -typedef struct script_data* (*HPMHOOK_post_script_push_copy) (struct script_data* retVal___, struct script_stack *stack, int pos); +typedef const void * (*HPMHOOK_pre_script_get_val2) (struct script_state **st, int64 *uid, struct reg_db **ref); +typedef const void * (*HPMHOOK_post_script_get_val2) (const void * retVal___, struct script_state *st, int64 uid, struct reg_db *ref); +typedef struct script_data * (*HPMHOOK_pre_script_push_str) (struct script_stack **stack, char **str); +typedef struct script_data * (*HPMHOOK_post_script_push_str) (struct script_data * retVal___, struct script_stack *stack, char *str); +typedef struct script_data * (*HPMHOOK_pre_script_push_conststr) (struct script_stack **stack, const char **str); +typedef struct script_data * (*HPMHOOK_post_script_push_conststr) (struct script_data * retVal___, struct script_stack *stack, const char *str); +typedef struct script_data * (*HPMHOOK_pre_script_push_copy) (struct script_stack **stack, int *pos); +typedef struct script_data * (*HPMHOOK_post_script_push_copy) (struct script_data * retVal___, struct script_stack *stack, int pos); typedef void (*HPMHOOK_pre_script_pop_stack) (struct script_state **st, int *start, int *end); typedef void (*HPMHOOK_post_script_pop_stack) (struct script_state *st, int start, int end); typedef void (*HPMHOOK_pre_script_set_constant) (const char **name, int *value, bool *is_parameter, bool *is_deprecated); @@ -7158,8 +7158,8 @@ typedef void (*HPMHOOK_pre_script_free_code) (struct script_code **code); typedef void (*HPMHOOK_post_script_free_code) (struct script_code *code); typedef void (*HPMHOOK_pre_script_free_vars) (struct DBMap **var_storage); typedef void (*HPMHOOK_post_script_free_vars) (struct DBMap *var_storage); -typedef struct script_state* (*HPMHOOK_pre_script_alloc_state) (struct script_code **rootscript, int *pos, int *rid, int *oid); -typedef struct script_state* (*HPMHOOK_post_script_alloc_state) (struct script_state* retVal___, struct script_code *rootscript, int pos, int rid, int oid); +typedef struct script_state * (*HPMHOOK_pre_script_alloc_state) (struct script_code **rootscript, int *pos, int *rid, int *oid); +typedef struct script_state * (*HPMHOOK_post_script_alloc_state) (struct script_state * retVal___, struct script_code *rootscript, int pos, int rid, int oid); typedef void (*HPMHOOK_pre_script_free_state) (struct script_state **st); typedef void (*HPMHOOK_post_script_free_state) (struct script_state *st); typedef void (*HPMHOOK_pre_script_add_pending_ref) (struct script_state **st, struct reg_db **ref); @@ -7176,16 +7176,16 @@ typedef int (*HPMHOOK_pre_script_add_str) (const char **p); typedef int (*HPMHOOK_post_script_add_str) (int retVal___, const char *p); typedef int (*HPMHOOK_pre_script_add_variable) (const char **varname); typedef int (*HPMHOOK_post_script_add_variable) (int retVal___, const char *varname); -typedef const char* (*HPMHOOK_pre_script_get_str) (int *id); -typedef const char* (*HPMHOOK_post_script_get_str) (const char* retVal___, int id); +typedef const char * (*HPMHOOK_pre_script_get_str) (int *id); +typedef const char * (*HPMHOOK_post_script_get_str) (const char * retVal___, int id); typedef int (*HPMHOOK_pre_script_search_str) (const char **p); typedef int (*HPMHOOK_post_script_search_str) (int retVal___, const char *p); typedef void (*HPMHOOK_pre_script_setd_sub) (struct script_state **st, struct map_session_data **sd, const char **varname, int *elem, const void **value, struct reg_db **ref); typedef void (*HPMHOOK_post_script_setd_sub) (struct script_state *st, struct map_session_data *sd, const char *varname, int elem, const void *value, struct reg_db *ref); typedef void (*HPMHOOK_pre_script_attach_state) (struct script_state **st); typedef void (*HPMHOOK_post_script_attach_state) (struct script_state *st); -typedef struct script_queue* (*HPMHOOK_pre_script_queue) (int *idx); -typedef struct script_queue* (*HPMHOOK_post_script_queue) (struct script_queue* retVal___, int idx); +typedef struct script_queue * (*HPMHOOK_pre_script_queue) (int *idx); +typedef struct script_queue * (*HPMHOOK_post_script_queue) (struct script_queue * retVal___, int idx); typedef bool (*HPMHOOK_pre_script_queue_add) (int *idx, int *var); typedef bool (*HPMHOOK_post_script_queue_add) (bool retVal___, int idx, int var); typedef bool (*HPMHOOK_pre_script_queue_del) (int *idx); @@ -7196,22 +7196,22 @@ typedef int (*HPMHOOK_pre_script_queue_create) (void); typedef int (*HPMHOOK_post_script_queue_create) (int retVal___); typedef bool (*HPMHOOK_pre_script_queue_clear) (int *idx); typedef bool (*HPMHOOK_post_script_queue_clear) (bool retVal___, int idx); -typedef const char* (*HPMHOOK_pre_script_parse_curly_close) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_curly_close) (const char* retVal___, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_syntax_close) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_syntax_close) (const char* retVal___, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_syntax_close_sub) (const char **p, int **flag); -typedef const char* (*HPMHOOK_post_script_parse_syntax_close_sub) (const char* retVal___, const char *p, int *flag); -typedef const char* (*HPMHOOK_pre_script_parse_syntax) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_syntax) (const char* retVal___, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_syntax_function) (const char **p, bool *is_public); -typedef const char* (*HPMHOOK_post_script_parse_syntax_function) (const char* retVal___, const char *p, bool is_public); +typedef const char * (*HPMHOOK_pre_script_parse_curly_close) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_curly_close) (const char * retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_syntax_close) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_syntax_close) (const char * retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_syntax_close_sub) (const char **p, int **flag); +typedef const char * (*HPMHOOK_post_script_parse_syntax_close_sub) (const char * retVal___, const char *p, int *flag); +typedef const char * (*HPMHOOK_pre_script_parse_syntax) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_syntax) (const char * retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_syntax_function) (const char **p, bool *is_public); +typedef const char * (*HPMHOOK_post_script_parse_syntax_function) (const char * retVal___, const char *p, bool is_public); typedef c_op (*HPMHOOK_pre_script_get_com) (const struct script_buf **scriptbuf, int **pos); typedef c_op (*HPMHOOK_post_script_get_com) (c_op retVal___, const struct script_buf *scriptbuf, int *pos); typedef int (*HPMHOOK_pre_script_get_num) (const struct script_buf **scriptbuf, int **pos); typedef int (*HPMHOOK_post_script_get_num) (int retVal___, const struct script_buf *scriptbuf, int *pos); -typedef const char* (*HPMHOOK_pre_script_op2name) (int *op); -typedef const char* (*HPMHOOK_post_script_op2name) (const char* retVal___, int op); +typedef const char * (*HPMHOOK_pre_script_op2name) (int *op); +typedef const char * (*HPMHOOK_post_script_op2name) (const char * retVal___, int op); typedef void (*HPMHOOK_pre_script_reportsrc) (struct script_state **st); typedef void (*HPMHOOK_post_script_reportsrc) (struct script_state *st); typedef void (*HPMHOOK_pre_script_reportdata) (struct script_data **data); @@ -7234,40 +7234,40 @@ typedef void (*HPMHOOK_pre_script_addl) (int *l); typedef void (*HPMHOOK_post_script_addl) (int l); typedef void (*HPMHOOK_pre_script_set_label) (int *l, int *pos, const char **script_pos); typedef void (*HPMHOOK_post_script_set_label) (int l, int pos, const char *script_pos); -typedef const char* (*HPMHOOK_pre_script_skip_word) (const char **p); -typedef const char* (*HPMHOOK_post_script_skip_word) (const char* retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_skip_word) (const char **p); +typedef const char * (*HPMHOOK_post_script_skip_word) (const char * retVal___, const char *p); typedef int (*HPMHOOK_pre_script_add_word) (const char **p); typedef int (*HPMHOOK_post_script_add_word) (int retVal___, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_callfunc) (const char **p, int *require_paren, int *is_custom); -typedef const char* (*HPMHOOK_post_script_parse_callfunc) (const char* retVal___, const char *p, int require_paren, int is_custom); +typedef const char * (*HPMHOOK_pre_script_parse_callfunc) (const char **p, int *require_paren, int *is_custom); +typedef const char * (*HPMHOOK_post_script_parse_callfunc) (const char * retVal___, const char *p, int require_paren, int is_custom); typedef void (*HPMHOOK_pre_script_parse_nextline) (bool *first, const char **p); typedef void (*HPMHOOK_post_script_parse_nextline) (bool first, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_variable) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_variable) (const char* retVal___, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_simpleexpr) (const char* retVal___, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_paren) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_paren) (const char* retVal___, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_number) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_number) (const char* retVal___, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_string) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_string) (const char* retVal___, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_name) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_name) (const char* retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_variable) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_variable) (const char * retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_simpleexpr) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_simpleexpr) (const char * retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_simpleexpr_paren) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_simpleexpr_paren) (const char * retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_simpleexpr_number) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_simpleexpr_number) (const char * retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_simpleexpr_string) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_simpleexpr_string) (const char * retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_simpleexpr_name) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_simpleexpr_name) (const char * retVal___, const char *p); typedef void (*HPMHOOK_pre_script_add_translatable_string) (const struct script_string_buf **string, const char **start_point); typedef void (*HPMHOOK_post_script_add_translatable_string) (const struct script_string_buf *string, const char *start_point); -typedef const char* (*HPMHOOK_pre_script_parse_expr) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_expr) (const char* retVal___, const char *p); -typedef const char* (*HPMHOOK_pre_script_parse_line) (const char **p); -typedef const char* (*HPMHOOK_post_script_parse_line) (const char* retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_expr) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_expr) (const char * retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_script_parse_line) (const char **p); +typedef const char * (*HPMHOOK_post_script_parse_line) (const char * retVal___, const char *p); typedef void (*HPMHOOK_pre_script_read_constdb) (bool *reload); typedef void (*HPMHOOK_post_script_read_constdb) (bool reload); typedef void (*HPMHOOK_pre_script_constdb_comment) (const char **comment); typedef void (*HPMHOOK_post_script_constdb_comment) (const char *comment); typedef void (*HPMHOOK_pre_script_load_parameters) (void); typedef void (*HPMHOOK_post_script_load_parameters) (void); -typedef const char* (*HPMHOOK_pre_script_print_line) (StringBuf **buf, const char **p, const char **mark, int *line); -typedef const char* (*HPMHOOK_post_script_print_line) (const char* retVal___, StringBuf *buf, const char *p, const char *mark, int line); +typedef const char * (*HPMHOOK_pre_script_print_line) (StringBuf **buf, const char **p, const char **mark, int *line); +typedef const char * (*HPMHOOK_post_script_print_line) (const char * retVal___, StringBuf *buf, const char *p, const char *mark, int line); typedef void (*HPMHOOK_pre_script_errorwarning_sub) (StringBuf **buf, const char **src, const char **file, int *start_line, const char **error_msg, const char **error_pos); typedef void (*HPMHOOK_post_script_errorwarning_sub) (StringBuf *buf, const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos); typedef bool (*HPMHOOK_pre_script_is_permanent_variable) (const char **name); @@ -7296,8 +7296,8 @@ typedef void (*HPMHOOK_pre_script_set_reg_instance_num) (struct script_state **s typedef void (*HPMHOOK_post_script_set_reg_instance_num) (struct script_state *st, int64 num, const char *name, int val); typedef void (*HPMHOOK_pre_script_stack_expand) (struct script_stack **stack); typedef void (*HPMHOOK_post_script_stack_expand) (struct script_stack *stack); -typedef struct script_data* (*HPMHOOK_pre_script_push_retinfo) (struct script_stack **stack, struct script_retinfo **ri, struct reg_db **ref); -typedef struct script_data* (*HPMHOOK_post_script_push_retinfo) (struct script_data* retVal___, struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref); +typedef struct script_data * (*HPMHOOK_pre_script_push_retinfo) (struct script_stack **stack, struct script_retinfo **ri, struct reg_db **ref); +typedef struct script_data * (*HPMHOOK_post_script_push_retinfo) (struct script_data * retVal___, struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref); typedef void (*HPMHOOK_pre_script_op_3) (struct script_state **st, int *op); typedef void (*HPMHOOK_post_script_op_3) (struct script_state *st, int op); typedef void (*HPMHOOK_pre_script_op_2str) (struct script_state **st, int *op, const char **s1, const char **s2); @@ -7376,12 +7376,12 @@ typedef int (*HPMHOOK_pre_script_run_func) (struct script_state **st); typedef int (*HPMHOOK_post_script_run_func) (int retVal___, struct script_state *st); typedef bool (*HPMHOOK_pre_script_sprintf_helper) (struct script_state **st, int *start, struct StringBuf **out); typedef bool (*HPMHOOK_post_script_sprintf_helper) (bool retVal___, struct script_state *st, int start, struct StringBuf *out); -typedef const char* (*HPMHOOK_pre_script_getfuncname) (struct script_state **st); -typedef const char* (*HPMHOOK_post_script_getfuncname) (const char* retVal___, struct script_state *st); +typedef const char * (*HPMHOOK_pre_script_getfuncname) (struct script_state **st); +typedef const char * (*HPMHOOK_post_script_getfuncname) (const char * retVal___, struct script_state *st); typedef unsigned int (*HPMHOOK_pre_script_calc_hash_ci) (const char **p); typedef unsigned int (*HPMHOOK_post_script_calc_hash_ci) (unsigned int retVal___, const char *p); -typedef struct reg_db* (*HPMHOOK_pre_script_array_src) (struct script_state **st, struct map_session_data **sd, const char **name, struct reg_db **ref); -typedef struct reg_db* (*HPMHOOK_post_script_array_src) (struct reg_db* retVal___, struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref); +typedef struct reg_db * (*HPMHOOK_pre_script_array_src) (struct script_state **st, struct map_session_data **sd, const char **name, struct reg_db **ref); +typedef struct reg_db * (*HPMHOOK_post_script_array_src) (struct reg_db * retVal___, struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref); typedef void (*HPMHOOK_pre_script_array_update) (struct reg_db **src, int64 *num, bool *empty); typedef void (*HPMHOOK_post_script_array_update) (struct reg_db *src, int64 num, bool empty); typedef void (*HPMHOOK_pre_script_array_delete) (struct reg_db **src, struct script_array **sa); @@ -7404,8 +7404,8 @@ typedef int (*HPMHOOK_pre_script_reg_destroy) (union DBKey *key, struct DBData * typedef int (*HPMHOOK_post_script_reg_destroy) (int retVal___, union DBKey key, struct DBData *data, va_list ap); typedef void (*HPMHOOK_pre_script_generic_ui_array_expand) (unsigned int *plus); typedef void (*HPMHOOK_post_script_generic_ui_array_expand) (unsigned int plus); -typedef unsigned int* (*HPMHOOK_pre_script_array_cpy_list) (struct script_array **sa); -typedef unsigned int* (*HPMHOOK_post_script_array_cpy_list) (unsigned int* retVal___, struct script_array *sa); +typedef unsigned int * (*HPMHOOK_pre_script_array_cpy_list) (struct script_array **sa); +typedef unsigned int * (*HPMHOOK_post_script_array_cpy_list) (unsigned int * retVal___, struct script_array *sa); typedef void (*HPMHOOK_pre_script_hardcoded_constants) (void); typedef void (*HPMHOOK_post_script_hardcoded_constants) (void); typedef unsigned short (*HPMHOOK_pre_script_mapindexname2id) (struct script_state **st, const char **name); @@ -7428,8 +7428,8 @@ typedef int (*HPMHOOK_pre_script_parse_cleanup_timer) (int *tid, int64 *tick, in typedef int (*HPMHOOK_post_script_parse_cleanup_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef uint8 (*HPMHOOK_pre_script_add_language) (const char **name); typedef uint8 (*HPMHOOK_post_script_add_language) (uint8 retVal___, const char *name); -typedef const char* (*HPMHOOK_pre_script_get_translation_dir_name) (const char **directory); -typedef const char* (*HPMHOOK_post_script_get_translation_dir_name) (const char* retVal___, const char *directory); +typedef const char * (*HPMHOOK_pre_script_get_translation_dir_name) (const char **directory); +typedef const char * (*HPMHOOK_post_script_get_translation_dir_name) (const char * retVal___, const char *directory); typedef void (*HPMHOOK_pre_script_parser_clean_leftovers) (void); typedef void (*HPMHOOK_post_script_parser_clean_leftovers) (void); typedef void (*HPMHOOK_pre_script_run_use_script) (struct map_session_data **sd, struct item_data **data, int *oid); @@ -7594,10 +7594,10 @@ typedef int (*HPMHOOK_pre_skill_get_cooldown) (int *skill_id, int *skill_lv); typedef int (*HPMHOOK_post_skill_get_cooldown) (int retVal___, int skill_id, int skill_lv); typedef int (*HPMHOOK_pre_skill_tree_get_max) (int *skill_id, int *class); typedef int (*HPMHOOK_post_skill_tree_get_max) (int retVal___, int skill_id, int class); -typedef const char* (*HPMHOOK_pre_skill_get_name) (int *skill_id); -typedef const char* (*HPMHOOK_post_skill_get_name) (const char* retVal___, int skill_id); -typedef const char* (*HPMHOOK_pre_skill_get_desc) (int *skill_id); -typedef const char* (*HPMHOOK_post_skill_get_desc) (const char* retVal___, int skill_id); +typedef const char * (*HPMHOOK_pre_skill_get_name) (int *skill_id); +typedef const char * (*HPMHOOK_post_skill_get_name) (const char * retVal___, int skill_id); +typedef const char * (*HPMHOOK_pre_skill_get_desc) (int *skill_id); +typedef const char * (*HPMHOOK_post_skill_get_desc) (const char * retVal___, int skill_id); typedef int (*HPMHOOK_pre_skill_get_casttype) (int *skill_id); typedef int (*HPMHOOK_post_skill_get_casttype) (int retVal___, int skill_id); typedef int (*HPMHOOK_pre_skill_get_casttype2) (int *index); @@ -7630,16 +7630,16 @@ typedef int (*HPMHOOK_pre_skill_break_equip) (struct block_list **bl, unsigned s typedef int (*HPMHOOK_post_skill_break_equip) (int retVal___, struct block_list *bl, unsigned short where, int rate, int flag); typedef int (*HPMHOOK_pre_skill_strip_equip) (struct block_list **bl, unsigned short *where, int *rate, int *lv, int *time); typedef int (*HPMHOOK_post_skill_strip_equip) (int retVal___, struct block_list *bl, unsigned short where, int rate, int lv, int time); -typedef struct skill_unit_group* (*HPMHOOK_pre_skill_id2group) (int *group_id); -typedef struct skill_unit_group* (*HPMHOOK_post_skill_id2group) (struct skill_unit_group* retVal___, int group_id); -typedef struct skill_unit_group* (*HPMHOOK_pre_skill_unitsetting) (struct block_list **src, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *flag); -typedef struct skill_unit_group* (*HPMHOOK_post_skill_unitsetting) (struct skill_unit_group* retVal___, struct block_list *src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag); -typedef struct skill_unit* (*HPMHOOK_pre_skill_initunit) (struct skill_unit_group **group, int *idx, int *x, int *y, int *val1, int *val2); -typedef struct skill_unit* (*HPMHOOK_post_skill_initunit) (struct skill_unit* retVal___, struct skill_unit_group *group, int idx, int x, int y, int val1, int val2); +typedef struct skill_unit_group * (*HPMHOOK_pre_skill_id2group) (int *group_id); +typedef struct skill_unit_group * (*HPMHOOK_post_skill_id2group) (struct skill_unit_group * retVal___, int group_id); +typedef struct skill_unit_group * (*HPMHOOK_pre_skill_unitsetting) (struct block_list **src, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *flag); +typedef struct skill_unit_group * (*HPMHOOK_post_skill_unitsetting) (struct skill_unit_group * retVal___, struct block_list *src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag); +typedef struct skill_unit * (*HPMHOOK_pre_skill_initunit) (struct skill_unit_group **group, int *idx, int *x, int *y, int *val1, int *val2); +typedef struct skill_unit * (*HPMHOOK_post_skill_initunit) (struct skill_unit * retVal___, struct skill_unit_group *group, int idx, int x, int y, int val1, int val2); typedef int (*HPMHOOK_pre_skill_delunit) (struct skill_unit **su); typedef int (*HPMHOOK_post_skill_delunit) (int retVal___, struct skill_unit *su); -typedef struct skill_unit_group* (*HPMHOOK_pre_skill_init_unitgroup) (struct block_list **src, int *count, uint16 *skill_id, uint16 *skill_lv, int *unit_id, int *limit, int *interval); -typedef struct skill_unit_group* (*HPMHOOK_post_skill_init_unitgroup) (struct skill_unit_group* retVal___, struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval); +typedef struct skill_unit_group * (*HPMHOOK_pre_skill_init_unitgroup) (struct block_list **src, int *count, uint16 *skill_id, uint16 *skill_lv, int *unit_id, int *limit, int *interval); +typedef struct skill_unit_group * (*HPMHOOK_post_skill_init_unitgroup) (struct skill_unit_group * retVal___, struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval); typedef int (*HPMHOOK_pre_skill_del_unitgroup) (struct skill_unit_group **group); typedef int (*HPMHOOK_post_skill_del_unitgroup) (int retVal___, struct skill_unit_group *group); typedef int (*HPMHOOK_pre_skill_clear_unitgroup) (struct block_list **src); @@ -7774,8 +7774,8 @@ typedef int (*HPMHOOK_pre_skill_trap_splash) (struct block_list **bl, va_list ap typedef int (*HPMHOOK_post_skill_trap_splash) (int retVal___, struct block_list *bl, va_list ap); typedef int (*HPMHOOK_pre_skill_check_condition_mercenary) (struct block_list **bl, int *skill_id, int *lv, int *type); typedef int (*HPMHOOK_post_skill_check_condition_mercenary) (int retVal___, struct block_list *bl, int skill_id, int lv, int type); -typedef struct skill_unit_group* (*HPMHOOK_pre_skill_locate_element_field) (struct block_list **bl); -typedef struct skill_unit_group* (*HPMHOOK_post_skill_locate_element_field) (struct skill_unit_group* retVal___, struct block_list *bl); +typedef struct skill_unit_group * (*HPMHOOK_pre_skill_locate_element_field) (struct block_list **bl); +typedef struct skill_unit_group * (*HPMHOOK_post_skill_locate_element_field) (struct skill_unit_group * retVal___, struct block_list *bl); typedef int (*HPMHOOK_pre_skill_graffitiremover) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_skill_graffitiremover) (int retVal___, struct block_list *bl, va_list ap); typedef int (*HPMHOOK_pre_skill_activate_reverberation) (struct block_list **bl, va_list ap); @@ -7784,16 +7784,16 @@ typedef int (*HPMHOOK_pre_skill_dance_overlap_sub) (struct block_list **bl, va_l typedef int (*HPMHOOK_post_skill_dance_overlap_sub) (int retVal___, struct block_list *bl, va_list ap); typedef int (*HPMHOOK_pre_skill_dance_overlap) (struct skill_unit **su, int *flag); typedef int (*HPMHOOK_post_skill_dance_overlap) (int retVal___, struct skill_unit *su, int flag); -typedef struct s_skill_unit_layout* (*HPMHOOK_pre_skill_get_unit_layout) (uint16 *skill_id, uint16 *skill_lv, struct block_list **src, int *x, int *y); -typedef struct s_skill_unit_layout* (*HPMHOOK_post_skill_get_unit_layout) (struct s_skill_unit_layout* retVal___, uint16 skill_id, uint16 skill_lv, struct block_list *src, int x, int y); +typedef struct s_skill_unit_layout * (*HPMHOOK_pre_skill_get_unit_layout) (uint16 *skill_id, uint16 *skill_lv, struct block_list **src, int *x, int *y); +typedef struct s_skill_unit_layout * (*HPMHOOK_post_skill_get_unit_layout) (struct s_skill_unit_layout * retVal___, uint16 skill_id, uint16 skill_lv, struct block_list *src, int x, int y); typedef int (*HPMHOOK_pre_skill_frostjoke_scream) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_skill_frostjoke_scream) (int retVal___, struct block_list *bl, va_list ap); typedef int (*HPMHOOK_pre_skill_greed) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_skill_greed) (int retVal___, struct block_list *bl, va_list ap); typedef int (*HPMHOOK_pre_skill_destroy_trap) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_skill_destroy_trap) (int retVal___, struct block_list *bl, va_list ap); -typedef struct skill_unit_group_tickset* (*HPMHOOK_pre_skill_unitgrouptickset_search) (struct block_list **bl, struct skill_unit_group **group, int64 *tick); -typedef struct skill_unit_group_tickset* (*HPMHOOK_post_skill_unitgrouptickset_search) (struct skill_unit_group_tickset* retVal___, struct block_list *bl, struct skill_unit_group *group, int64 tick); +typedef struct skill_unit_group_tickset * (*HPMHOOK_pre_skill_unitgrouptickset_search) (struct block_list **bl, struct skill_unit_group **group, int64 *tick); +typedef struct skill_unit_group_tickset * (*HPMHOOK_post_skill_unitgrouptickset_search) (struct skill_unit_group_tickset * retVal___, struct block_list *bl, struct skill_unit_group *group, int64 tick); typedef bool (*HPMHOOK_pre_skill_dance_switch) (struct skill_unit **su, int *flag); typedef bool (*HPMHOOK_post_skill_dance_switch) (bool retVal___, struct skill_unit *su, int flag); typedef int (*HPMHOOK_pre_skill_check_condition_char_sub) (struct block_list **bl, va_list ap); @@ -8134,8 +8134,8 @@ typedef void (*HPMHOOK_pre_sockt_set_defaultparse) (ParseFunc *defaultparse); typedef void (*HPMHOOK_post_sockt_set_defaultparse) (ParseFunc defaultparse); typedef uint32 (*HPMHOOK_pre_sockt_host2ip) (const char **hostname); typedef uint32 (*HPMHOOK_post_sockt_host2ip) (uint32 retVal___, const char *hostname); -typedef const char* (*HPMHOOK_pre_sockt_ip2str) (uint32 *ip, char **ip_str); -typedef const char* (*HPMHOOK_post_sockt_ip2str) (const char* retVal___, uint32 ip, char *ip_str); +typedef const char * (*HPMHOOK_pre_sockt_ip2str) (uint32 *ip, char **ip_str); +typedef const char * (*HPMHOOK_post_sockt_ip2str) (const char * retVal___, uint32 ip, char *ip_str); typedef uint32 (*HPMHOOK_pre_sockt_str2ip) (const char **ip_str); typedef uint32 (*HPMHOOK_post_sockt_str2ip) (uint32 retVal___, const char *ip_str); typedef uint16 (*HPMHOOK_pre_sockt_ntows) (uint16 *netshort); @@ -8190,10 +8190,10 @@ typedef void (*HPMHOOK_pre_SQL_ShowDebug_) (struct Sql **self, const char **debu typedef void (*HPMHOOK_post_SQL_ShowDebug_) (struct Sql *self, const char *debug_file, const unsigned long debug_line); typedef void (*HPMHOOK_pre_SQL_Free) (struct Sql **self); typedef void (*HPMHOOK_post_SQL_Free) (struct Sql *self); -typedef struct Sql* (*HPMHOOK_pre_SQL_Malloc) (void); -typedef struct Sql* (*HPMHOOK_post_SQL_Malloc) (struct Sql* retVal___); -typedef struct SqlStmt* (*HPMHOOK_pre_SQL_StmtMalloc) (struct Sql **sql); -typedef struct SqlStmt* (*HPMHOOK_post_SQL_StmtMalloc) (struct SqlStmt* retVal___, struct Sql *sql); +typedef struct Sql * (*HPMHOOK_pre_SQL_Malloc) (void); +typedef struct Sql * (*HPMHOOK_post_SQL_Malloc) (struct Sql * retVal___); +typedef struct SqlStmt * (*HPMHOOK_pre_SQL_StmtMalloc) (struct Sql **sql); +typedef struct SqlStmt * (*HPMHOOK_post_SQL_StmtMalloc) (struct SqlStmt * retVal___, struct Sql *sql); typedef int (*HPMHOOK_pre_SQL_StmtPrepareV) (struct SqlStmt **self, const char **query, va_list args); typedef int (*HPMHOOK_post_SQL_StmtPrepareV) (int retVal___, struct SqlStmt *self, const char *query, va_list args); typedef int (*HPMHOOK_pre_SQL_StmtPrepareStr) (struct SqlStmt **self, const char **query); @@ -8252,14 +8252,14 @@ typedef int (*HPMHOOK_pre_status_revive) (struct block_list **bl, unsigned char typedef int (*HPMHOOK_post_status_revive) (int retVal___, struct block_list *bl, unsigned char per_hp, unsigned char per_sp); typedef int (*HPMHOOK_pre_status_fixed_revive) (struct block_list **bl, unsigned int *per_hp, unsigned int *per_sp); typedef int (*HPMHOOK_post_status_fixed_revive) (int retVal___, struct block_list *bl, unsigned int per_hp, unsigned int per_sp); -typedef struct regen_data* (*HPMHOOK_pre_status_get_regen_data) (struct block_list **bl); -typedef struct regen_data* (*HPMHOOK_post_status_get_regen_data) (struct regen_data* retVal___, struct block_list *bl); -typedef struct status_data* (*HPMHOOK_pre_status_get_status_data) (struct block_list **bl); -typedef struct status_data* (*HPMHOOK_post_status_get_status_data) (struct status_data* retVal___, struct block_list *bl); -typedef struct status_data* (*HPMHOOK_pre_status_get_base_status) (struct block_list **bl); -typedef struct status_data* (*HPMHOOK_post_status_get_base_status) (struct status_data* retVal___, struct block_list *bl); -typedef const char* (*HPMHOOK_pre_status_get_name) (const struct block_list **bl); -typedef const char* (*HPMHOOK_post_status_get_name) (const char* retVal___, const struct block_list *bl); +typedef struct regen_data * (*HPMHOOK_pre_status_get_regen_data) (struct block_list **bl); +typedef struct regen_data * (*HPMHOOK_post_status_get_regen_data) (struct regen_data * retVal___, struct block_list *bl); +typedef struct status_data * (*HPMHOOK_pre_status_get_status_data) (struct block_list **bl); +typedef struct status_data * (*HPMHOOK_post_status_get_status_data) (struct status_data * retVal___, struct block_list *bl); +typedef struct status_data * (*HPMHOOK_pre_status_get_base_status) (struct block_list **bl); +typedef struct status_data * (*HPMHOOK_post_status_get_base_status) (struct status_data * retVal___, struct block_list *bl); +typedef const char * (*HPMHOOK_pre_status_get_name) (const struct block_list **bl); +typedef const char * (*HPMHOOK_post_status_get_name) (const char * retVal___, const struct block_list *bl); typedef int (*HPMHOOK_pre_status_get_class) (const struct block_list **bl); typedef int (*HPMHOOK_post_status_get_class) (int retVal___, const struct block_list *bl); typedef int (*HPMHOOK_pre_status_get_lv) (const struct block_list **bl); @@ -8280,14 +8280,14 @@ typedef int (*HPMHOOK_pre_status_get_mexp) (const struct block_list **bl); typedef int (*HPMHOOK_post_status_get_mexp) (int retVal___, const struct block_list *bl); typedef int (*HPMHOOK_pre_status_get_race2) (const struct block_list **bl); typedef int (*HPMHOOK_post_status_get_race2) (int retVal___, const struct block_list *bl); -typedef struct view_data* (*HPMHOOK_pre_status_get_viewdata) (struct block_list **bl); -typedef struct view_data* (*HPMHOOK_post_status_get_viewdata) (struct view_data* retVal___, struct block_list *bl); +typedef struct view_data * (*HPMHOOK_pre_status_get_viewdata) (struct block_list **bl); +typedef struct view_data * (*HPMHOOK_post_status_get_viewdata) (struct view_data * retVal___, struct block_list *bl); typedef void (*HPMHOOK_pre_status_set_viewdata) (struct block_list **bl, int *class_); typedef void (*HPMHOOK_post_status_set_viewdata) (struct block_list *bl, int class_); typedef void (*HPMHOOK_pre_status_change_init) (struct block_list **bl); typedef void (*HPMHOOK_post_status_change_init) (struct block_list *bl); -typedef struct status_change* (*HPMHOOK_pre_status_get_sc) (struct block_list **bl); -typedef struct status_change* (*HPMHOOK_post_status_get_sc) (struct status_change* retVal___, struct block_list *bl); +typedef struct status_change * (*HPMHOOK_pre_status_get_sc) (struct block_list **bl); +typedef struct status_change * (*HPMHOOK_post_status_get_sc) (struct status_change * retVal___, struct block_list *bl); typedef int (*HPMHOOK_pre_status_isdead) (struct block_list **bl); typedef int (*HPMHOOK_post_status_isdead) (int retVal___, struct block_list *bl); typedef int (*HPMHOOK_pre_status_isimmune) (struct block_list **bl); @@ -8530,8 +8530,8 @@ typedef int (*HPMHOOK_pre_storage_reconnect_sub) (union DBKey *key, struct DBDat typedef int (*HPMHOOK_post_storage_reconnect_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap); #endif // MAP_STORAGE_H #ifdef COMMON_STRLIB_H /* StrBuf */ -typedef StringBuf* (*HPMHOOK_pre_StrBuf_Malloc) (void); -typedef StringBuf* (*HPMHOOK_post_StrBuf_Malloc) (StringBuf* retVal___); +typedef StringBuf * (*HPMHOOK_pre_StrBuf_Malloc) (void); +typedef StringBuf * (*HPMHOOK_post_StrBuf_Malloc) (StringBuf * retVal___); typedef void (*HPMHOOK_pre_StrBuf_Init) (StringBuf **self); typedef void (*HPMHOOK_post_StrBuf_Init) (StringBuf *self); typedef int (*HPMHOOK_pre_StrBuf_Vprintf) (StringBuf **self, const char **fmt, va_list args); @@ -8542,8 +8542,8 @@ typedef int (*HPMHOOK_pre_StrBuf_AppendStr) (StringBuf **self, const char **str) typedef int (*HPMHOOK_post_StrBuf_AppendStr) (int retVal___, StringBuf *self, const char *str); typedef int (*HPMHOOK_pre_StrBuf_Length) (StringBuf **self); typedef int (*HPMHOOK_post_StrBuf_Length) (int retVal___, StringBuf *self); -typedef char* (*HPMHOOK_pre_StrBuf_Value) (StringBuf **self); -typedef char* (*HPMHOOK_post_StrBuf_Value) (char* retVal___, StringBuf *self); +typedef char * (*HPMHOOK_pre_StrBuf_Value) (StringBuf **self); +typedef char * (*HPMHOOK_post_StrBuf_Value) (char * retVal___, StringBuf *self); typedef void (*HPMHOOK_pre_StrBuf_Clear) (StringBuf **self); typedef void (*HPMHOOK_post_StrBuf_Clear) (StringBuf *self); typedef void (*HPMHOOK_pre_StrBuf_Destroy) (StringBuf **self); @@ -8552,30 +8552,30 @@ typedef void (*HPMHOOK_pre_StrBuf_Free) (StringBuf **self); typedef void (*HPMHOOK_post_StrBuf_Free) (StringBuf *self); #endif // COMMON_STRLIB_H #ifdef COMMON_STRLIB_H /* strlib */ -typedef char* (*HPMHOOK_pre_strlib_jstrescape) (char **pt); -typedef char* (*HPMHOOK_post_strlib_jstrescape) (char* retVal___, char *pt); -typedef char* (*HPMHOOK_pre_strlib_jstrescapecpy) (char **pt, const char **spt); -typedef char* (*HPMHOOK_post_strlib_jstrescapecpy) (char* retVal___, char *pt, const char *spt); +typedef char * (*HPMHOOK_pre_strlib_jstrescape) (char **pt); +typedef char * (*HPMHOOK_post_strlib_jstrescape) (char * retVal___, char *pt); +typedef char * (*HPMHOOK_pre_strlib_jstrescapecpy) (char **pt, const char **spt); +typedef char * (*HPMHOOK_post_strlib_jstrescapecpy) (char * retVal___, char *pt, const char *spt); typedef int (*HPMHOOK_pre_strlib_jmemescapecpy) (char **pt, const char **spt, int *size); typedef int (*HPMHOOK_post_strlib_jmemescapecpy) (int retVal___, char *pt, const char *spt, int size); typedef int (*HPMHOOK_pre_strlib_remove_control_chars_) (char **str); typedef int (*HPMHOOK_post_strlib_remove_control_chars_) (int retVal___, char *str); -typedef char* (*HPMHOOK_pre_strlib_trim_) (char **str); -typedef char* (*HPMHOOK_post_strlib_trim_) (char* retVal___, char *str); -typedef char* (*HPMHOOK_pre_strlib_normalize_name_) (char **str, const char **delims); -typedef char* (*HPMHOOK_post_strlib_normalize_name_) (char* retVal___, char *str, const char *delims); -typedef const char* (*HPMHOOK_pre_strlib_stristr_) (const char **haystack, const char **needle); -typedef const char* (*HPMHOOK_post_strlib_stristr_) (const char* retVal___, const char *haystack, const char *needle); +typedef char * (*HPMHOOK_pre_strlib_trim_) (char **str); +typedef char * (*HPMHOOK_post_strlib_trim_) (char * retVal___, char *str); +typedef char * (*HPMHOOK_pre_strlib_normalize_name_) (char **str, const char **delims); +typedef char * (*HPMHOOK_post_strlib_normalize_name_) (char * retVal___, char *str, const char *delims); +typedef const char * (*HPMHOOK_pre_strlib_stristr_) (const char **haystack, const char **needle); +typedef const char * (*HPMHOOK_post_strlib_stristr_) (const char * retVal___, const char *haystack, const char *needle); typedef size_t (*HPMHOOK_pre_strlib_strnlen_) (const char **string, size_t *maxlen); typedef size_t (*HPMHOOK_post_strlib_strnlen_) (size_t retVal___, const char *string, size_t maxlen); -typedef char* (*HPMHOOK_pre_strlib_strtok_r_) (char **s1, const char **s2, char ***lasts); -typedef char* (*HPMHOOK_post_strlib_strtok_r_) (char* retVal___, char *s1, const char *s2, char **lasts); +typedef char * (*HPMHOOK_pre_strlib_strtok_r_) (char **s1, const char **s2, char ***lasts); +typedef char * (*HPMHOOK_post_strlib_strtok_r_) (char * retVal___, char *s1, const char *s2, char **lasts); typedef int (*HPMHOOK_pre_strlib_e_mail_check_) (char **email); typedef int (*HPMHOOK_post_strlib_e_mail_check_) (int retVal___, char *email); typedef int (*HPMHOOK_pre_strlib_config_switch_) (const char **str); typedef int (*HPMHOOK_post_strlib_config_switch_) (int retVal___, const char *str); -typedef char* (*HPMHOOK_pre_strlib_safestrncpy_) (char **dst, const char **src, size_t *n); -typedef char* (*HPMHOOK_post_strlib_safestrncpy_) (char* retVal___, char *dst, const char *src, size_t n); +typedef char * (*HPMHOOK_pre_strlib_safestrncpy_) (char **dst, const char **src, size_t *n); +typedef char * (*HPMHOOK_post_strlib_safestrncpy_) (char * retVal___, char *dst, const char *src, size_t n); typedef size_t (*HPMHOOK_pre_strlib_safestrnlen_) (const char **string, size_t *maxlen); typedef size_t (*HPMHOOK_post_strlib_safestrnlen_) (size_t retVal___, const char *string, size_t maxlen); typedef int (*HPMHOOK_pre_strlib_strline_) (const char **str, size_t *pos); @@ -8614,40 +8614,40 @@ typedef size_t (*HPMHOOK_pre_sv_escape_c) (char **out_dest, const char **src, si typedef size_t (*HPMHOOK_post_sv_escape_c) (size_t retVal___, char *out_dest, const char *src, size_t len, const char *escapes); typedef size_t (*HPMHOOK_pre_sv_unescape_c) (char **out_dest, const char **src, size_t *len); typedef size_t (*HPMHOOK_post_sv_unescape_c) (size_t retVal___, char *out_dest, const char *src, size_t len); -typedef const char* (*HPMHOOK_pre_sv_skip_escaped_c) (const char **p); -typedef const char* (*HPMHOOK_post_sv_skip_escaped_c) (const char* retVal___, const char *p); +typedef const char * (*HPMHOOK_pre_sv_skip_escaped_c) (const char **p); +typedef const char * (*HPMHOOK_post_sv_skip_escaped_c) (const char * retVal___, const char *p); typedef bool (*HPMHOOK_pre_sv_readdb) (const char **directory, const char **filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( **parseproc ) (char *fields[], int columns, int current)); typedef bool (*HPMHOOK_post_sv_readdb) (bool retVal___, const char *directory, const char *filename, char delim, int mincols, int maxcols, int maxrows, bool ( *parseproc ) (char *fields[], int columns, int current)); #endif // COMMON_STRLIB_H #ifdef COMMON_SYSINFO_H /* sysinfo */ typedef long (*HPMHOOK_pre_sysinfo_getpagesize) (void); typedef long (*HPMHOOK_post_sysinfo_getpagesize) (long retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_platform) (void); -typedef const char* (*HPMHOOK_post_sysinfo_platform) (const char* retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_osversion) (void); -typedef const char* (*HPMHOOK_post_sysinfo_osversion) (const char* retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_cpu) (void); -typedef const char* (*HPMHOOK_post_sysinfo_cpu) (const char* retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_platform) (void); +typedef const char * (*HPMHOOK_post_sysinfo_platform) (const char * retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_osversion) (void); +typedef const char * (*HPMHOOK_post_sysinfo_osversion) (const char * retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_cpu) (void); +typedef const char * (*HPMHOOK_post_sysinfo_cpu) (const char * retVal___); typedef int (*HPMHOOK_pre_sysinfo_cpucores) (void); typedef int (*HPMHOOK_post_sysinfo_cpucores) (int retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_arch) (void); -typedef const char* (*HPMHOOK_post_sysinfo_arch) (const char* retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_arch) (void); +typedef const char * (*HPMHOOK_post_sysinfo_arch) (const char * retVal___); typedef bool (*HPMHOOK_pre_sysinfo_is64bit) (void); typedef bool (*HPMHOOK_post_sysinfo_is64bit) (bool retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_compiler) (void); -typedef const char* (*HPMHOOK_post_sysinfo_compiler) (const char* retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_cflags) (void); -typedef const char* (*HPMHOOK_post_sysinfo_cflags) (const char* retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_time) (void); -typedef const char* (*HPMHOOK_post_sysinfo_time) (const char* retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_vcstype) (void); -typedef const char* (*HPMHOOK_post_sysinfo_vcstype) (const char* retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_compiler) (void); +typedef const char * (*HPMHOOK_post_sysinfo_compiler) (const char * retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_cflags) (void); +typedef const char * (*HPMHOOK_post_sysinfo_cflags) (const char * retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_time) (void); +typedef const char * (*HPMHOOK_post_sysinfo_time) (const char * retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_vcstype) (void); +typedef const char * (*HPMHOOK_post_sysinfo_vcstype) (const char * retVal___); typedef int (*HPMHOOK_pre_sysinfo_vcstypeid) (void); typedef int (*HPMHOOK_post_sysinfo_vcstypeid) (int retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_vcsrevision_src) (void); -typedef const char* (*HPMHOOK_post_sysinfo_vcsrevision_src) (const char* retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_vcsrevision_scripts) (void); -typedef const char* (*HPMHOOK_post_sysinfo_vcsrevision_scripts) (const char* retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_vcsrevision_src) (void); +typedef const char * (*HPMHOOK_post_sysinfo_vcsrevision_src) (const char * retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_vcsrevision_scripts) (void); +typedef const char * (*HPMHOOK_post_sysinfo_vcsrevision_scripts) (const char * retVal___); typedef int (*HPMHOOK_pre_sysinfo_build_revision) (void); typedef int (*HPMHOOK_post_sysinfo_build_revision) (int retVal___); typedef uint32 (*HPMHOOK_pre_sysinfo_fflags) (void); @@ -8656,8 +8656,8 @@ typedef void (*HPMHOOK_pre_sysinfo_vcsrevision_reload) (void); typedef void (*HPMHOOK_post_sysinfo_vcsrevision_reload) (void); typedef bool (*HPMHOOK_pre_sysinfo_is_superuser) (void); typedef bool (*HPMHOOK_post_sysinfo_is_superuser) (bool retVal___); -typedef const char* (*HPMHOOK_pre_sysinfo_zlib) (void); -typedef const char* (*HPMHOOK_post_sysinfo_zlib) (const char* retVal___); +typedef const char * (*HPMHOOK_pre_sysinfo_zlib) (void); +typedef const char * (*HPMHOOK_post_sysinfo_zlib) (const char * retVal___); typedef void (*HPMHOOK_pre_sysinfo_init) (void); typedef void (*HPMHOOK_post_sysinfo_init) (void); typedef void (*HPMHOOK_pre_sysinfo_final) (void); @@ -8668,14 +8668,14 @@ typedef void (*HPMHOOK_pre_thread_init) (void); typedef void (*HPMHOOK_post_thread_init) (void); typedef void (*HPMHOOK_pre_thread_final) (void); typedef void (*HPMHOOK_post_thread_final) (void); -typedef struct thread_handle* (*HPMHOOK_pre_thread_create) (threadFunc *entry_point, void **param); -typedef struct thread_handle* (*HPMHOOK_post_thread_create) (struct thread_handle* retVal___, threadFunc entry_point, void *param); -typedef struct thread_handle* (*HPMHOOK_pre_thread_create_opt) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); -typedef struct thread_handle* (*HPMHOOK_post_thread_create_opt) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); +typedef struct thread_handle * (*HPMHOOK_pre_thread_create) (threadFunc *entry_point, void **param); +typedef struct thread_handle * (*HPMHOOK_post_thread_create) (struct thread_handle * retVal___, threadFunc entry_point, void *param); +typedef struct thread_handle * (*HPMHOOK_pre_thread_create_opt) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); +typedef struct thread_handle * (*HPMHOOK_post_thread_create_opt) (struct thread_handle * retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); typedef void (*HPMHOOK_pre_thread_destroy) (struct thread_handle **handle); typedef void (*HPMHOOK_post_thread_destroy) (struct thread_handle *handle); -typedef struct thread_handle* (*HPMHOOK_pre_thread_self) (void); -typedef struct thread_handle* (*HPMHOOK_post_thread_self) (struct thread_handle* retVal___); +typedef struct thread_handle * (*HPMHOOK_pre_thread_self) (void); +typedef struct thread_handle * (*HPMHOOK_post_thread_self) (struct thread_handle * retVal___); typedef int (*HPMHOOK_pre_thread_get_tid) (void); typedef int (*HPMHOOK_post_thread_get_tid) (int retVal___); typedef bool (*HPMHOOK_pre_thread_wait) (struct thread_handle **handle, void ***out_exit_code); @@ -8696,8 +8696,8 @@ typedef int (*HPMHOOK_pre_timer_add) (int64 *tick, TimerFunc *func, int *id, int typedef int (*HPMHOOK_post_timer_add) (int retVal___, int64 tick, TimerFunc func, int id, intptr_t data); typedef int (*HPMHOOK_pre_timer_add_interval) (int64 *tick, TimerFunc *func, int *id, intptr_t *data, int *interval); typedef int (*HPMHOOK_post_timer_add_interval) (int retVal___, int64 tick, TimerFunc func, int id, intptr_t data, int interval); -typedef const struct TimerData* (*HPMHOOK_pre_timer_get) (int *tid); -typedef const struct TimerData* (*HPMHOOK_post_timer_get) (const struct TimerData* retVal___, int tid); +typedef const struct TimerData * (*HPMHOOK_pre_timer_get) (int *tid); +typedef const struct TimerData * (*HPMHOOK_post_timer_get) (const struct TimerData * retVal___, int tid); typedef int (*HPMHOOK_pre_timer_delete) (int *tid, TimerFunc *func); typedef int (*HPMHOOK_post_timer_delete) (int retVal___, int tid, TimerFunc func); typedef int64 (*HPMHOOK_pre_timer_addtick) (int *tid, int64 *tick); @@ -8746,12 +8746,12 @@ typedef int (*HPMHOOK_pre_unit_init) (bool *minimal); typedef int (*HPMHOOK_post_unit_init) (int retVal___, bool minimal); typedef int (*HPMHOOK_pre_unit_final) (void); typedef int (*HPMHOOK_post_unit_final) (int retVal___); -typedef struct unit_data* (*HPMHOOK_pre_unit_bl2ud) (struct block_list **bl); -typedef struct unit_data* (*HPMHOOK_post_unit_bl2ud) (struct unit_data* retVal___, struct block_list *bl); -typedef const struct unit_data* (*HPMHOOK_pre_unit_cbl2ud) (const struct block_list **bl); -typedef const struct unit_data* (*HPMHOOK_post_unit_cbl2ud) (const struct unit_data* retVal___, const struct block_list *bl); -typedef struct unit_data* (*HPMHOOK_pre_unit_bl2ud2) (struct block_list **bl); -typedef struct unit_data* (*HPMHOOK_post_unit_bl2ud2) (struct unit_data* retVal___, struct block_list *bl); +typedef struct unit_data * (*HPMHOOK_pre_unit_bl2ud) (struct block_list **bl); +typedef struct unit_data * (*HPMHOOK_post_unit_bl2ud) (struct unit_data * retVal___, struct block_list *bl); +typedef const struct unit_data * (*HPMHOOK_pre_unit_cbl2ud) (const struct block_list **bl); +typedef const struct unit_data * (*HPMHOOK_post_unit_cbl2ud) (const struct unit_data * retVal___, const struct block_list *bl); +typedef struct unit_data * (*HPMHOOK_pre_unit_bl2ud2) (struct block_list **bl); +typedef struct unit_data * (*HPMHOOK_post_unit_bl2ud2) (struct unit_data * retVal___, struct block_list *bl); typedef void (*HPMHOOK_pre_unit_init_ud) (struct unit_data **ud); typedef void (*HPMHOOK_post_unit_init_ud) (struct unit_data *ud); typedef int (*HPMHOOK_pre_unit_attack_timer) (int *tid, int64 *tick, int *id, intptr_t *data); diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index cabcceb7a0e..1954b335ed5 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -79,11 +79,11 @@ bool HP_HCache_check(const char *file) { } return retVal___; } -FILE* HP_HCache_open(const char *file, const char *opt) { +FILE * HP_HCache_open(const char *file, const char *opt) { int hIndex = 0; - FILE* retVal___ = NULL; + FILE * retVal___ = NULL; if (HPMHooks.count.HP_HCache_open_pre > 0) { - FILE* (*preHookFunc) (const char **file, const char **opt); + FILE * (*preHookFunc) (const char **file, const char **opt); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_HCache_open_pre[hIndex].func; @@ -98,7 +98,7 @@ FILE* HP_HCache_open(const char *file, const char *opt) { retVal___ = HPMHooks.source.HCache.open(file, opt); } if (HPMHooks.count.HP_HCache_open_post > 0) { - FILE* (*postHookFunc) (FILE* retVal___, const char *file, const char *opt); + FILE * (*postHookFunc) (FILE * retVal___, const char *file, const char *opt); for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_post; hIndex++) { postHookFunc = HPMHooks.list.HP_HCache_open_post[hIndex].func; retVal___ = postHookFunc(retVal___, file, opt); @@ -4888,11 +4888,11 @@ bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) { } return retVal___; } -const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) { +const char * HP_cmdline_arg_source(struct CmdlineArgData *arg) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_cmdline_arg_source_pre > 0) { - const char* (*preHookFunc) (struct CmdlineArgData **arg); + const char * (*preHookFunc) (struct CmdlineArgData **arg); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_cmdline_arg_source_pre[hIndex].func; @@ -4907,7 +4907,7 @@ const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) { retVal___ = HPMHooks.source.cmdline.arg_source(arg); } if (HPMHooks.count.HP_cmdline_arg_source_post > 0) { - const char* (*postHookFunc) (const char* retVal___, struct CmdlineArgData *arg); + const char * (*postHookFunc) (const char * retVal___, struct CmdlineArgData *arg); for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++) { postHookFunc = HPMHooks.list.HP_cmdline_arg_source_post[hIndex].func; retVal___ = postHookFunc(retVal___, arg); @@ -5183,11 +5183,11 @@ DBReleaser HP_DB_custom_release(enum DBReleaseOption which) { } return retVal___; } -struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) { +struct DBMap * HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) { int hIndex = 0; - struct DBMap* retVal___ = NULL; + struct DBMap * retVal___ = NULL; if (HPMHooks.count.HP_DB_alloc_pre > 0) { - struct DBMap* (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen); + struct DBMap * (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_DB_alloc_pre[hIndex].func; @@ -5202,7 +5202,7 @@ struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBT retVal___ = HPMHooks.source.DB.alloc(file, func, line, type, options, maxlen); } if (HPMHooks.count.HP_DB_alloc_post > 0) { - struct DBMap* (*postHookFunc) (struct DBMap* retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen); + struct DBMap * (*postHookFunc) (struct DBMap * retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen); for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_DB_alloc_post[hIndex].func; retVal___ = postHookFunc(retVal___, file, func, line, type, options, maxlen); @@ -5480,11 +5480,11 @@ unsigned int HP_DB_data2ui(struct DBData *data) { } return retVal___; } -void* HP_DB_data2ptr(struct DBData *data) { +void * HP_DB_data2ptr(struct DBData *data) { int hIndex = 0; - void* retVal___ = NULL; + void * retVal___ = NULL; if (HPMHooks.count.HP_DB_data2ptr_pre > 0) { - void* (*preHookFunc) (struct DBData **data); + void * (*preHookFunc) (struct DBData **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_DB_data2ptr_pre[hIndex].func; @@ -5499,7 +5499,7 @@ void* HP_DB_data2ptr(struct DBData *data) { retVal___ = HPMHooks.source.DB.data2ptr(data); } if (HPMHooks.count.HP_DB_data2ptr_post > 0) { - void* (*postHookFunc) (void* retVal___, struct DBData *data); + void * (*postHookFunc) (void * retVal___, struct DBData *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++) { postHookFunc = HPMHooks.list.HP_DB_data2ptr_post[hIndex].func; retVal___ = postHookFunc(retVal___, data); @@ -5613,11 +5613,11 @@ void HP_des_decrypt(unsigned char *data, size_t size) { return; } /* geoip_interface */ -const char* HP_geoip_getcountry(uint32 ipnum) { +const char * HP_geoip_getcountry(uint32 ipnum) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_geoip_getcountry_pre > 0) { - const char* (*preHookFunc) (uint32 *ipnum); + const char * (*preHookFunc) (uint32 *ipnum); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_geoip_getcountry_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_geoip_getcountry_pre[hIndex].func; @@ -5632,7 +5632,7 @@ const char* HP_geoip_getcountry(uint32 ipnum) { retVal___ = HPMHooks.source.geoip.getcountry(ipnum); } if (HPMHooks.count.HP_geoip_getcountry_post > 0) { - const char* (*postHookFunc) (const char* retVal___, uint32 ipnum); + const char * (*postHookFunc) (const char * retVal___, uint32 ipnum); for (hIndex = 0; hIndex < HPMHooks.count.HP_geoip_getcountry_post; hIndex++) { postHookFunc = HPMHooks.list.HP_geoip_getcountry_post[hIndex].func; retVal___ = postHookFunc(retVal___, ipnum); @@ -6485,11 +6485,11 @@ bool HP_inter_guild_tosql(struct guild *g, int flag) { } return retVal___; } -struct guild* HP_inter_guild_fromsql(int guild_id) { +struct guild * HP_inter_guild_fromsql(int guild_id) { int hIndex = 0; - struct guild* retVal___ = NULL; + struct guild * retVal___ = NULL; if (HPMHooks.count.HP_inter_guild_fromsql_pre > 0) { - struct guild* (*preHookFunc) (int *guild_id); + struct guild * (*preHookFunc) (int *guild_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_fromsql_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_guild_fromsql_pre[hIndex].func; @@ -6504,7 +6504,7 @@ struct guild* HP_inter_guild_fromsql(int guild_id) { retVal___ = HPMHooks.source.inter_guild.fromsql(guild_id); } if (HPMHooks.count.HP_inter_guild_fromsql_post > 0) { - struct guild* (*postHookFunc) (struct guild* retVal___, int guild_id); + struct guild * (*postHookFunc) (struct guild * retVal___, int guild_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_fromsql_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_guild_fromsql_post[hIndex].func; retVal___ = postHookFunc(retVal___, guild_id); @@ -6539,11 +6539,11 @@ int HP_inter_guild_castle_tosql(struct guild_castle *gc) { } return retVal___; } -struct guild_castle* HP_inter_guild_castle_fromsql(int castle_id) { +struct guild_castle * HP_inter_guild_castle_fromsql(int castle_id) { int hIndex = 0; - struct guild_castle* retVal___ = NULL; + struct guild_castle * retVal___ = NULL; if (HPMHooks.count.HP_inter_guild_castle_fromsql_pre > 0) { - struct guild_castle* (*preHookFunc) (int *castle_id); + struct guild_castle * (*preHookFunc) (int *castle_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_castle_fromsql_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_guild_castle_fromsql_pre[hIndex].func; @@ -6558,7 +6558,7 @@ struct guild_castle* HP_inter_guild_castle_fromsql(int castle_id) { retVal___ = HPMHooks.source.inter_guild.castle_fromsql(castle_id); } if (HPMHooks.count.HP_inter_guild_castle_fromsql_post > 0) { - struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, int castle_id); + struct guild_castle * (*postHookFunc) (struct guild_castle * retVal___, int castle_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_castle_fromsql_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_guild_castle_fromsql_post[hIndex].func; retVal___ = postHookFunc(retVal___, castle_id); @@ -6976,11 +6976,11 @@ int HP_inter_guild_broken(int guild_id) { } return retVal___; } -struct guild* HP_inter_guild_create(const char *name, const struct guild_member *master) { +struct guild * HP_inter_guild_create(const char *name, const struct guild_member *master) { int hIndex = 0; - struct guild* retVal___ = NULL; + struct guild * retVal___ = NULL; if (HPMHooks.count.HP_inter_guild_create_pre > 0) { - struct guild* (*preHookFunc) (const char **name, const struct guild_member **master); + struct guild * (*preHookFunc) (const char **name, const struct guild_member **master); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_guild_create_pre[hIndex].func; @@ -6995,7 +6995,7 @@ struct guild* HP_inter_guild_create(const char *name, const struct guild_member retVal___ = HPMHooks.source.inter_guild.create(name, master); } if (HPMHooks.count.HP_inter_guild_create_post > 0) { - struct guild* (*postHookFunc) (struct guild* retVal___, const char *name, const struct guild_member *master); + struct guild * (*postHookFunc) (struct guild * retVal___, const char *name, const struct guild_member *master); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_guild_create_post[hIndex].func; retVal___ = postHookFunc(retVal___, name, master); @@ -7598,11 +7598,11 @@ bool HP_inter_homunculus_rename(const char *name) { return retVal___; } /* inter_interface */ -const char* HP_inter_msg_txt(int msg_number) { +const char * HP_inter_msg_txt(int msg_number) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_inter_msg_txt_pre > 0) { - const char* (*preHookFunc) (int *msg_number); + const char * (*preHookFunc) (int *msg_number); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_msg_txt_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_msg_txt_pre[hIndex].func; @@ -7617,7 +7617,7 @@ const char* HP_inter_msg_txt(int msg_number) { retVal___ = HPMHooks.source.inter.msg_txt(msg_number); } if (HPMHooks.count.HP_inter_msg_txt_post > 0) { - const char* (*postHookFunc) (const char* retVal___, int msg_number); + const char * (*postHookFunc) (const char * retVal___, int msg_number); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_msg_txt_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_msg_txt_post[hIndex].func; retVal___ = postHookFunc(retVal___, msg_number); @@ -7678,11 +7678,11 @@ void HP_inter_do_final_msg(void) { } return; } -const char* HP_inter_job_name(int class) { +const char * HP_inter_job_name(int class) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_inter_job_name_pre > 0) { - const char* (*preHookFunc) (int *class); + const char * (*preHookFunc) (int *class); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_job_name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_job_name_pre[hIndex].func; @@ -7697,7 +7697,7 @@ const char* HP_inter_job_name(int class) { retVal___ = HPMHooks.source.inter.job_name(class); } if (HPMHooks.count.HP_inter_job_name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, int class); + const char * (*postHookFunc) (const char * retVal___, int class); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_job_name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_job_name_post[hIndex].func; retVal___ = postHookFunc(retVal___, class); @@ -8845,11 +8845,11 @@ int HP_inter_party_del_nonexistent_party(int party_id) { } return retVal___; } -struct party_data* HP_inter_party_fromsql(int party_id) { +struct party_data * HP_inter_party_fromsql(int party_id) { int hIndex = 0; - struct party_data* retVal___ = NULL; + struct party_data * retVal___ = NULL; if (HPMHooks.count.HP_inter_party_fromsql_pre > 0) { - struct party_data* (*preHookFunc) (int *party_id); + struct party_data * (*preHookFunc) (int *party_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_fromsql_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_party_fromsql_pre[hIndex].func; @@ -8864,7 +8864,7 @@ struct party_data* HP_inter_party_fromsql(int party_id) { retVal___ = HPMHooks.source.inter_party.fromsql(party_id); } if (HPMHooks.count.HP_inter_party_fromsql_post > 0) { - struct party_data* (*postHookFunc) (struct party_data* retVal___, int party_id); + struct party_data * (*postHookFunc) (struct party_data * retVal___, int party_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_fromsql_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_party_fromsql_post[hIndex].func; retVal___ = postHookFunc(retVal___, party_id); @@ -8925,11 +8925,11 @@ void HP_inter_party_sql_final(void) { } return; } -struct party_data* HP_inter_party_search_partyname(const char *str) { +struct party_data * HP_inter_party_search_partyname(const char *str) { int hIndex = 0; - struct party_data* retVal___ = NULL; + struct party_data * retVal___ = NULL; if (HPMHooks.count.HP_inter_party_search_partyname_pre > 0) { - struct party_data* (*preHookFunc) (const char **str); + struct party_data * (*preHookFunc) (const char **str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_search_partyname_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_party_search_partyname_pre[hIndex].func; @@ -8944,7 +8944,7 @@ struct party_data* HP_inter_party_search_partyname(const char *str) { retVal___ = HPMHooks.source.inter_party.search_partyname(str); } if (HPMHooks.count.HP_inter_party_search_partyname_post > 0) { - struct party_data* (*postHookFunc) (struct party_data* retVal___, const char *str); + struct party_data * (*postHookFunc) (struct party_data * retVal___, const char *str); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_search_partyname_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_party_search_partyname_post[hIndex].func; retVal___ = postHookFunc(retVal___, str); @@ -9114,11 +9114,11 @@ int HP_inter_party_CharOffline(int char_id, int party_id) { } return retVal___; } -struct party_data* HP_inter_party_create(const char *name, int item, int item2, const struct party_member *leader) { +struct party_data * HP_inter_party_create(const char *name, int item, int item2, const struct party_member *leader) { int hIndex = 0; - struct party_data* retVal___ = NULL; + struct party_data * retVal___ = NULL; if (HPMHooks.count.HP_inter_party_create_pre > 0) { - struct party_data* (*preHookFunc) (const char **name, int *item, int *item2, const struct party_member **leader); + struct party_data * (*preHookFunc) (const char **name, int *item, int *item2, const struct party_member **leader); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_party_create_pre[hIndex].func; @@ -9133,7 +9133,7 @@ struct party_data* HP_inter_party_create(const char *name, int item, int item2, retVal___ = HPMHooks.source.inter_party.create(name, item, item2, leader); } if (HPMHooks.count.HP_inter_party_create_post > 0) { - struct party_data* (*postHookFunc) (struct party_data* retVal___, const char *name, int item, int item2, const struct party_member *leader); + struct party_data * (*postHookFunc) (struct party_data * retVal___, const char *name, int item, int item2, const struct party_member *leader); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_party_create_post[hIndex].func; retVal___ = postHookFunc(retVal___, name, item, item2, leader); @@ -9438,11 +9438,11 @@ int HP_inter_pet_parse_frommap(int fd) { } return retVal___; } -struct s_pet* HP_inter_pet_create(int account_id, int char_id, int pet_class, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name) { +struct s_pet * HP_inter_pet_create(int account_id, int char_id, int pet_class, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name) { int hIndex = 0; - struct s_pet* retVal___ = NULL; + struct s_pet * retVal___ = NULL; if (HPMHooks.count.HP_inter_pet_create_pre > 0) { - struct s_pet* (*preHookFunc) (int *account_id, int *char_id, int *pet_class, int *pet_lv, int *pet_egg_id, int *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, const char **pet_name); + struct s_pet * (*preHookFunc) (int *account_id, int *char_id, int *pet_class, int *pet_lv, int *pet_egg_id, int *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, const char **pet_name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_pet_create_pre[hIndex].func; @@ -9457,7 +9457,7 @@ struct s_pet* HP_inter_pet_create(int account_id, int char_id, int pet_class, in retVal___ = HPMHooks.source.inter_pet.create(account_id, char_id, pet_class, pet_lv, pet_egg_id, pet_equip, intimate, hungry, rename_flag, incubate, pet_name); } if (HPMHooks.count.HP_inter_pet_create_post > 0) { - struct s_pet* (*postHookFunc) (struct s_pet* retVal___, int account_id, int char_id, int pet_class, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name); + struct s_pet * (*postHookFunc) (struct s_pet * retVal___, int account_id, int char_id, int pet_class, int pet_lv, int pet_egg_id, int pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_pet_create_post[hIndex].func; retVal___ = postHookFunc(retVal___, account_id, char_id, pet_class, pet_lv, pet_egg_id, pet_equip, intimate, hungry, rename_flag, incubate, pet_name); @@ -9465,11 +9465,11 @@ struct s_pet* HP_inter_pet_create(int account_id, int char_id, int pet_class, in } return retVal___; } -struct s_pet* HP_inter_pet_load(int account_id, int char_id, int pet_id) { +struct s_pet * HP_inter_pet_load(int account_id, int char_id, int pet_id) { int hIndex = 0; - struct s_pet* retVal___ = NULL; + struct s_pet * retVal___ = NULL; if (HPMHooks.count.HP_inter_pet_load_pre > 0) { - struct s_pet* (*preHookFunc) (int *account_id, int *char_id, int *pet_id); + struct s_pet * (*preHookFunc) (int *account_id, int *char_id, int *pet_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_load_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_pet_load_pre[hIndex].func; @@ -9484,7 +9484,7 @@ struct s_pet* HP_inter_pet_load(int account_id, int char_id, int pet_id) { retVal___ = HPMHooks.source.inter_pet.load(account_id, char_id, pet_id); } if (HPMHooks.count.HP_inter_pet_load_post > 0) { - struct s_pet* (*postHookFunc) (struct s_pet* retVal___, int account_id, int char_id, int pet_id); + struct s_pet * (*postHookFunc) (struct s_pet * retVal___, int account_id, int char_id, int pet_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_load_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_pet_load_post[hIndex].func; retVal___ = postHookFunc(retVal___, account_id, char_id, pet_id); @@ -9520,11 +9520,11 @@ int HP_inter_quest_parse_frommap(int fd) { } return retVal___; } -struct quest* HP_inter_quest_fromsql(int char_id, int *count) { +struct quest * HP_inter_quest_fromsql(int char_id, int *count) { int hIndex = 0; - struct quest* retVal___ = NULL; + struct quest * retVal___ = NULL; if (HPMHooks.count.HP_inter_quest_fromsql_pre > 0) { - struct quest* (*preHookFunc) (int *char_id, int **count); + struct quest * (*preHookFunc) (int *char_id, int **count); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_quest_fromsql_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_inter_quest_fromsql_pre[hIndex].func; @@ -9539,7 +9539,7 @@ struct quest* HP_inter_quest_fromsql(int char_id, int *count) { retVal___ = HPMHooks.source.inter_quest.fromsql(char_id, count); } if (HPMHooks.count.HP_inter_quest_fromsql_post > 0) { - struct quest* (*postHookFunc) (struct quest* retVal___, int char_id, int *count); + struct quest * (*postHookFunc) (struct quest * retVal___, int char_id, int *count); for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_quest_fromsql_post; hIndex++) { postHookFunc = HPMHooks.list.HP_inter_quest_fromsql_post[hIndex].func; retVal___ = postHookFunc(retVal___, char_id, count); @@ -10647,11 +10647,11 @@ int HP_libconfig_setting_get_bool(const struct config_setting_t *setting) { } return retVal___; } -const char* HP_libconfig_setting_get_string(const struct config_setting_t *setting) { +const char * HP_libconfig_setting_get_string(const struct config_setting_t *setting) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_string_pre > 0) { - const char* (*preHookFunc) (const struct config_setting_t **setting); + const char * (*preHookFunc) (const struct config_setting_t **setting); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_pre[hIndex].func; @@ -10666,7 +10666,7 @@ const char* HP_libconfig_setting_get_string(const struct config_setting_t *setti retVal___ = HPMHooks.source.libconfig.setting_get_string(setting); } if (HPMHooks.count.HP_libconfig_setting_get_string_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting); + const char * (*postHookFunc) (const char * retVal___, const struct config_setting_t *setting); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting); @@ -10674,11 +10674,11 @@ const char* HP_libconfig_setting_get_string(const struct config_setting_t *setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_lookup(struct config_setting_t *setting, const char *name) { +struct config_setting_t * HP_libconfig_setting_lookup(struct config_setting_t *setting, const char *name) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_lookup_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, const char **name); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_pre[hIndex].func; @@ -10693,7 +10693,7 @@ struct config_setting_t* HP_libconfig_setting_lookup(struct config_setting_t *se retVal___ = HPMHooks.source.libconfig.setting_lookup(setting, name); } if (HPMHooks.count.HP_libconfig_setting_lookup_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, const char *name); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name); @@ -11133,11 +11133,11 @@ int HP_libconfig_setting_get_bool_elem(const struct config_setting_t *setting, i } return retVal___; } -const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t *setting, int idx) { +const char * HP_libconfig_setting_get_string_elem(const struct config_setting_t *setting, int idx) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_string_elem_pre > 0) { - const char* (*preHookFunc) (const struct config_setting_t **setting, int *idx); + const char * (*preHookFunc) (const struct config_setting_t **setting, int *idx); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_pre[hIndex].func; @@ -11152,7 +11152,7 @@ const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t * retVal___ = HPMHooks.source.libconfig.setting_get_string_elem(setting, idx); } if (HPMHooks.count.HP_libconfig_setting_get_string_elem_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting, int idx); + const char * (*postHookFunc) (const char * retVal___, const struct config_setting_t *setting, int idx); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -11160,11 +11160,11 @@ const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t * } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting_t *setting, int idx, int value) { +struct config_setting_t * HP_libconfig_setting_set_int_elem(struct config_setting_t *setting, int idx, int value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_int_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_pre[hIndex].func; @@ -11179,7 +11179,7 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting retVal___ = HPMHooks.source.libconfig.setting_set_int_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_int_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -11187,11 +11187,11 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { +struct config_setting_t * HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func; @@ -11206,7 +11206,7 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int64 value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -11214,11 +11214,11 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setting_t *setting, int idx, double value) { +struct config_setting_t * HP_libconfig_setting_set_float_elem(struct config_setting_t *setting, int idx, double value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_float_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, double *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, double *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_pre[hIndex].func; @@ -11233,7 +11233,7 @@ struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_float_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_float_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, double value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, double value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -11241,11 +11241,11 @@ struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_setting_t *setting, int idx, int value) { +struct config_setting_t * HP_libconfig_setting_set_bool_elem(struct config_setting_t *setting, int idx, int value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_pre[hIndex].func; @@ -11260,7 +11260,7 @@ struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_settin retVal___ = HPMHooks.source.libconfig.setting_set_bool_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -11268,11 +11268,11 @@ struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_settin } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_string_elem(struct config_setting_t *setting, int idx, const char *value) { +struct config_setting_t * HP_libconfig_setting_set_string_elem(struct config_setting_t *setting, int idx, const char *value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_string_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, const char **value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, const char **value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_pre[hIndex].func; @@ -11287,7 +11287,7 @@ struct config_setting_t* HP_libconfig_setting_set_string_elem(struct config_sett retVal___ = HPMHooks.source.libconfig.setting_set_string_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_string_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, const char *value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, const char *value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -11349,11 +11349,11 @@ int HP_libconfig_setting_length(const struct config_setting_t *setting) { } return retVal___; } -struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setting_t *setting, unsigned int idx) { +struct config_setting_t * HP_libconfig_setting_get_elem(const struct config_setting_t *setting, unsigned int idx) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, unsigned int *idx); + struct config_setting_t * (*preHookFunc) (const struct config_setting_t **setting, unsigned int *idx); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_pre[hIndex].func; @@ -11368,7 +11368,7 @@ struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setti retVal___ = HPMHooks.source.libconfig.setting_get_elem(setting, idx); } if (HPMHooks.count.HP_libconfig_setting_get_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, unsigned int idx); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, const struct config_setting_t *setting, unsigned int idx); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -11376,11 +11376,11 @@ struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_get_member(const struct config_setting_t *setting, const char *name) { +struct config_setting_t * HP_libconfig_setting_get_member(const struct config_setting_t *setting, const char *name) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_member_pre > 0) { - struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, const char **name); + struct config_setting_t * (*preHookFunc) (const struct config_setting_t **setting, const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_pre[hIndex].func; @@ -11395,7 +11395,7 @@ struct config_setting_t* HP_libconfig_setting_get_member(const struct config_set retVal___ = HPMHooks.source.libconfig.setting_get_member(setting, name); } if (HPMHooks.count.HP_libconfig_setting_get_member_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, const char *name); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, const struct config_setting_t *setting, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name); @@ -11403,11 +11403,11 @@ struct config_setting_t* HP_libconfig_setting_get_member(const struct config_set } return retVal___; } -struct config_setting_t* HP_libconfig_setting_add(struct config_setting_t *parent, const char *name, int type) { +struct config_setting_t * HP_libconfig_setting_add(struct config_setting_t *parent, const char *name, int type) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_add_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **parent, const char **name, int *type); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **parent, const char **name, int *type); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_add_pre[hIndex].func; @@ -11422,7 +11422,7 @@ struct config_setting_t* HP_libconfig_setting_add(struct config_setting_t *paren retVal___ = HPMHooks.source.libconfig.setting_add(parent, name, type); } if (HPMHooks.count.HP_libconfig_setting_add_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *parent, const char *name, int type); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *parent, const char *name, int type); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_add_post[hIndex].func; retVal___ = postHookFunc(retVal___, parent, name, type); @@ -11510,11 +11510,11 @@ void HP_libconfig_setting_set_hook(struct config_setting_t *setting, void *hook) } return; } -struct config_setting_t* HP_libconfig_lookup(const struct config_t *config, const char *filepath) { +struct config_setting_t * HP_libconfig_lookup(const struct config_t *config, const char *filepath) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_lookup_pre > 0) { - struct config_setting_t* (*preHookFunc) (const struct config_t **config, const char **filepath); + struct config_setting_t * (*preHookFunc) (const struct config_t **config, const char **filepath); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_lookup_pre[hIndex].func; @@ -11529,7 +11529,7 @@ struct config_setting_t* HP_libconfig_lookup(const struct config_t *config, cons retVal___ = HPMHooks.source.libconfig.lookup(config, filepath); } if (HPMHooks.count.HP_libconfig_lookup_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_t *config, const char *filepath); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, const struct config_t *config, const char *filepath); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_lookup_post[hIndex].func; retVal___ = postHookFunc(retVal___, config, filepath); @@ -16707,11 +16707,11 @@ void HP_mapindex_removemap(int index) { } return; } -const char* HP_mapindex_getmapname(const char *string, char *output) { +const char * HP_mapindex_getmapname(const char *string, char *output) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_mapindex_getmapname_pre > 0) { - const char* (*preHookFunc) (const char **string, char **output); + const char * (*preHookFunc) (const char **string, char **output); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapindex_getmapname_pre[hIndex].func; @@ -16726,7 +16726,7 @@ const char* HP_mapindex_getmapname(const char *string, char *output) { retVal___ = HPMHooks.source.mapindex.getmapname(string, output); } if (HPMHooks.count.HP_mapindex_getmapname_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *string, char *output); + const char * (*postHookFunc) (const char * retVal___, const char *string, char *output); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapindex_getmapname_post[hIndex].func; retVal___ = postHookFunc(retVal___, string, output); @@ -16734,11 +16734,11 @@ const char* HP_mapindex_getmapname(const char *string, char *output) { } return retVal___; } -const char* HP_mapindex_getmapname_ext(const char *string, char *output) { +const char * HP_mapindex_getmapname_ext(const char *string, char *output) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_mapindex_getmapname_ext_pre > 0) { - const char* (*preHookFunc) (const char **string, char **output); + const char * (*preHookFunc) (const char **string, char **output); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapindex_getmapname_ext_pre[hIndex].func; @@ -16753,7 +16753,7 @@ const char* HP_mapindex_getmapname_ext(const char *string, char *output) { retVal___ = HPMHooks.source.mapindex.getmapname_ext(string, output); } if (HPMHooks.count.HP_mapindex_getmapname_ext_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *string, char *output); + const char * (*postHookFunc) (const char * retVal___, const char *string, char *output); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapindex_getmapname_ext_post[hIndex].func; retVal___ = postHookFunc(retVal___, string, output); @@ -16788,11 +16788,11 @@ unsigned short HP_mapindex_name2id(const char *p1) { } return retVal___; } -const char* HP_mapindex_id2name(uint16 id, const char *file, int line, const char *func) { +const char * HP_mapindex_id2name(uint16 id, const char *file, int line, const char *func) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_mapindex_id2name_pre > 0) { - const char* (*preHookFunc) (uint16 *id, const char **file, int *line, const char **func); + const char * (*preHookFunc) (uint16 *id, const char **file, int *line, const char **func); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapindex_id2name_pre[hIndex].func; @@ -16807,7 +16807,7 @@ const char* HP_mapindex_id2name(uint16 id, const char *file, int line, const cha retVal___ = HPMHooks.source.mapindex.id2name(id, file, line, func); } if (HPMHooks.count.HP_mapindex_id2name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, uint16 id, const char *file, int line, const char *func); + const char * (*postHookFunc) (const char * retVal___, uint16 id, const char *file, int line, const char *func); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapindex_id2name_post[hIndex].func; retVal___ = postHookFunc(retVal___, id, file, line, func); @@ -16922,11 +16922,11 @@ void HP_md5_salt(int len, char *output) { return; } /* mutex_interface */ -struct mutex_data* HP_mutex_create(void) { +struct mutex_data * HP_mutex_create(void) { int hIndex = 0; - struct mutex_data* retVal___ = NULL; + struct mutex_data * retVal___ = NULL; if (HPMHooks.count.HP_mutex_create_pre > 0) { - struct mutex_data* (*preHookFunc) (void); + struct mutex_data * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func; @@ -16941,7 +16941,7 @@ struct mutex_data* HP_mutex_create(void) { retVal___ = HPMHooks.source.mutex.create(); } if (HPMHooks.count.HP_mutex_create_post > 0) { - struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___); + struct mutex_data * (*postHookFunc) (struct mutex_data * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -17054,11 +17054,11 @@ void HP_mutex_unlock(struct mutex_data *m) { } return; } -struct cond_data* HP_mutex_cond_create(void) { +struct cond_data * HP_mutex_cond_create(void) { int hIndex = 0; - struct cond_data* retVal___ = NULL; + struct cond_data * retVal___ = NULL; if (HPMHooks.count.HP_mutex_cond_create_pre > 0) { - struct cond_data* (*preHookFunc) (void); + struct cond_data * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func; @@ -17073,7 +17073,7 @@ struct cond_data* HP_mutex_cond_create(void) { retVal___ = HPMHooks.source.mutex.cond_create(); } if (HPMHooks.count.HP_mutex_cond_create_post > 0) { - struct cond_data* (*postHookFunc) (struct cond_data* retVal___); + struct cond_data * (*postHookFunc) (struct cond_data * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -18751,11 +18751,11 @@ uint32 HP_sockt_host2ip(const char *hostname) { } return retVal___; } -const char* HP_sockt_ip2str(uint32 ip, char *ip_str) { +const char * HP_sockt_ip2str(uint32 ip, char *ip_str) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sockt_ip2str_pre > 0) { - const char* (*preHookFunc) (uint32 *ip, char **ip_str); + const char * (*preHookFunc) (uint32 *ip, char **ip_str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sockt_ip2str_pre[hIndex].func; @@ -18770,7 +18770,7 @@ const char* HP_sockt_ip2str(uint32 ip, char *ip_str) { retVal___ = HPMHooks.source.sockt.ip2str(ip, ip_str); } if (HPMHooks.count.HP_sockt_ip2str_post > 0) { - const char* (*postHookFunc) (const char* retVal___, uint32 ip, char *ip_str); + const char * (*postHookFunc) (const char * retVal___, uint32 ip, char *ip_str); for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sockt_ip2str_post[hIndex].func; retVal___ = postHookFunc(retVal___, ip, ip_str); @@ -19482,11 +19482,11 @@ void HP_SQL_Free(struct Sql *self) { } return; } -struct Sql* HP_SQL_Malloc(void) { +struct Sql * HP_SQL_Malloc(void) { int hIndex = 0; - struct Sql* retVal___ = NULL; + struct Sql * retVal___ = NULL; if (HPMHooks.count.HP_SQL_Malloc_pre > 0) { - struct Sql* (*preHookFunc) (void); + struct Sql * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_SQL_Malloc_pre[hIndex].func; @@ -19501,7 +19501,7 @@ struct Sql* HP_SQL_Malloc(void) { retVal___ = HPMHooks.source.SQL.Malloc(); } if (HPMHooks.count.HP_SQL_Malloc_post > 0) { - struct Sql* (*postHookFunc) (struct Sql* retVal___); + struct Sql * (*postHookFunc) (struct Sql * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_SQL_Malloc_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -19509,11 +19509,11 @@ struct Sql* HP_SQL_Malloc(void) { } return retVal___; } -struct SqlStmt* HP_SQL_StmtMalloc(struct Sql *sql) { +struct SqlStmt * HP_SQL_StmtMalloc(struct Sql *sql) { int hIndex = 0; - struct SqlStmt* retVal___ = NULL; + struct SqlStmt * retVal___ = NULL; if (HPMHooks.count.HP_SQL_StmtMalloc_pre > 0) { - struct SqlStmt* (*preHookFunc) (struct Sql **sql); + struct SqlStmt * (*preHookFunc) (struct Sql **sql); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_pre[hIndex].func; @@ -19528,7 +19528,7 @@ struct SqlStmt* HP_SQL_StmtMalloc(struct Sql *sql) { retVal___ = HPMHooks.source.SQL.StmtMalloc(sql); } if (HPMHooks.count.HP_SQL_StmtMalloc_post > 0) { - struct SqlStmt* (*postHookFunc) (struct SqlStmt* retVal___, struct Sql *sql); + struct SqlStmt * (*postHookFunc) (struct SqlStmt * retVal___, struct Sql *sql); for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_post[hIndex].func; retVal___ = postHookFunc(retVal___, sql); @@ -19891,11 +19891,11 @@ void HP_SQL_StmtShowDebug_(struct SqlStmt *self, const char *debug_file, const u return; } /* stringbuf_interface */ -StringBuf* HP_StrBuf_Malloc(void) { +StringBuf * HP_StrBuf_Malloc(void) { int hIndex = 0; - StringBuf* retVal___ = NULL; + StringBuf * retVal___ = NULL; if (HPMHooks.count.HP_StrBuf_Malloc_pre > 0) { - StringBuf* (*preHookFunc) (void); + StringBuf * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_StrBuf_Malloc_pre[hIndex].func; @@ -19910,7 +19910,7 @@ StringBuf* HP_StrBuf_Malloc(void) { retVal___ = HPMHooks.source.StrBuf.Malloc(); } if (HPMHooks.count.HP_StrBuf_Malloc_post > 0) { - StringBuf* (*postHookFunc) (StringBuf* retVal___); + StringBuf * (*postHookFunc) (StringBuf * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_StrBuf_Malloc_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -20058,11 +20058,11 @@ int HP_StrBuf_Length(StringBuf *self) { } return retVal___; } -char* HP_StrBuf_Value(StringBuf *self) { +char * HP_StrBuf_Value(StringBuf *self) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_StrBuf_Value_pre > 0) { - char* (*preHookFunc) (StringBuf **self); + char * (*preHookFunc) (StringBuf **self); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_StrBuf_Value_pre[hIndex].func; @@ -20077,7 +20077,7 @@ char* HP_StrBuf_Value(StringBuf *self) { retVal___ = HPMHooks.source.StrBuf.Value(self); } if (HPMHooks.count.HP_StrBuf_Value_post > 0) { - char* (*postHookFunc) (char* retVal___, StringBuf *self); + char * (*postHookFunc) (char * retVal___, StringBuf *self); for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_post; hIndex++) { postHookFunc = HPMHooks.list.HP_StrBuf_Value_post[hIndex].func; retVal___ = postHookFunc(retVal___, self); @@ -20164,11 +20164,11 @@ void HP_StrBuf_Free(StringBuf *self) { return; } /* strlib_interface */ -char* HP_strlib_jstrescape(char *pt) { +char * HP_strlib_jstrescape(char *pt) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_jstrescape_pre > 0) { - char* (*preHookFunc) (char **pt); + char * (*preHookFunc) (char **pt); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_jstrescape_pre[hIndex].func; @@ -20183,7 +20183,7 @@ char* HP_strlib_jstrescape(char *pt) { retVal___ = HPMHooks.source.strlib.jstrescape(pt); } if (HPMHooks.count.HP_strlib_jstrescape_post > 0) { - char* (*postHookFunc) (char* retVal___, char *pt); + char * (*postHookFunc) (char * retVal___, char *pt); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_jstrescape_post[hIndex].func; retVal___ = postHookFunc(retVal___, pt); @@ -20191,11 +20191,11 @@ char* HP_strlib_jstrescape(char *pt) { } return retVal___; } -char* HP_strlib_jstrescapecpy(char *pt, const char *spt) { +char * HP_strlib_jstrescapecpy(char *pt, const char *spt) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_jstrescapecpy_pre > 0) { - char* (*preHookFunc) (char **pt, const char **spt); + char * (*preHookFunc) (char **pt, const char **spt); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_pre[hIndex].func; @@ -20210,7 +20210,7 @@ char* HP_strlib_jstrescapecpy(char *pt, const char *spt) { retVal___ = HPMHooks.source.strlib.jstrescapecpy(pt, spt); } if (HPMHooks.count.HP_strlib_jstrescapecpy_post > 0) { - char* (*postHookFunc) (char* retVal___, char *pt, const char *spt); + char * (*postHookFunc) (char * retVal___, char *pt, const char *spt); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_post[hIndex].func; retVal___ = postHookFunc(retVal___, pt, spt); @@ -20272,11 +20272,11 @@ int HP_strlib_remove_control_chars_(char *str) { } return retVal___; } -char* HP_strlib_trim_(char *str) { +char * HP_strlib_trim_(char *str) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_trim__pre > 0) { - char* (*preHookFunc) (char **str); + char * (*preHookFunc) (char **str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_trim__pre[hIndex].func; @@ -20291,7 +20291,7 @@ char* HP_strlib_trim_(char *str) { retVal___ = HPMHooks.source.strlib.trim_(str); } if (HPMHooks.count.HP_strlib_trim__post > 0) { - char* (*postHookFunc) (char* retVal___, char *str); + char * (*postHookFunc) (char * retVal___, char *str); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_trim__post[hIndex].func; retVal___ = postHookFunc(retVal___, str); @@ -20299,11 +20299,11 @@ char* HP_strlib_trim_(char *str) { } return retVal___; } -char* HP_strlib_normalize_name_(char *str, const char *delims) { +char * HP_strlib_normalize_name_(char *str, const char *delims) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_normalize_name__pre > 0) { - char* (*preHookFunc) (char **str, const char **delims); + char * (*preHookFunc) (char **str, const char **delims); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_normalize_name__pre[hIndex].func; @@ -20318,7 +20318,7 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) { retVal___ = HPMHooks.source.strlib.normalize_name_(str, delims); } if (HPMHooks.count.HP_strlib_normalize_name__post > 0) { - char* (*postHookFunc) (char* retVal___, char *str, const char *delims); + char * (*postHookFunc) (char * retVal___, char *str, const char *delims); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_normalize_name__post[hIndex].func; retVal___ = postHookFunc(retVal___, str, delims); @@ -20326,11 +20326,11 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) { } return retVal___; } -const char* HP_strlib_stristr_(const char *haystack, const char *needle) { +const char * HP_strlib_stristr_(const char *haystack, const char *needle) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_stristr__pre > 0) { - const char* (*preHookFunc) (const char **haystack, const char **needle); + const char * (*preHookFunc) (const char **haystack, const char **needle); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_stristr__pre[hIndex].func; @@ -20345,7 +20345,7 @@ const char* HP_strlib_stristr_(const char *haystack, const char *needle) { retVal___ = HPMHooks.source.strlib.stristr_(haystack, needle); } if (HPMHooks.count.HP_strlib_stristr__post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *haystack, const char *needle); + const char * (*postHookFunc) (const char * retVal___, const char *haystack, const char *needle); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_stristr__post[hIndex].func; retVal___ = postHookFunc(retVal___, haystack, needle); @@ -20380,11 +20380,11 @@ size_t HP_strlib_strnlen_(const char *string, size_t maxlen) { } return retVal___; } -char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) { +char * HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_strtok_r__pre > 0) { - char* (*preHookFunc) (char **s1, const char **s2, char ***lasts); + char * (*preHookFunc) (char **s1, const char **s2, char ***lasts); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_strtok_r__pre[hIndex].func; @@ -20399,7 +20399,7 @@ char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) { retVal___ = HPMHooks.source.strlib.strtok_r_(s1, s2, lasts); } if (HPMHooks.count.HP_strlib_strtok_r__post > 0) { - char* (*postHookFunc) (char* retVal___, char *s1, const char *s2, char **lasts); + char * (*postHookFunc) (char * retVal___, char *s1, const char *s2, char **lasts); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_strtok_r__post[hIndex].func; retVal___ = postHookFunc(retVal___, s1, s2, lasts); @@ -20461,11 +20461,11 @@ int HP_strlib_config_switch_(const char *str) { } return retVal___; } -char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) { +char * HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_safestrncpy__pre > 0) { - char* (*preHookFunc) (char **dst, const char **src, size_t *n); + char * (*preHookFunc) (char **dst, const char **src, size_t *n); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_safestrncpy__pre[hIndex].func; @@ -20480,7 +20480,7 @@ char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) { retVal___ = HPMHooks.source.strlib.safestrncpy_(dst, src, n); } if (HPMHooks.count.HP_strlib_safestrncpy__post > 0) { - char* (*postHookFunc) (char* retVal___, char *dst, const char *src, size_t n); + char * (*postHookFunc) (char * retVal___, char *dst, const char *src, size_t n); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_safestrncpy__post[hIndex].func; retVal___ = postHookFunc(retVal___, dst, src, n); @@ -20705,11 +20705,11 @@ size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) { } return retVal___; } -const char* HP_sv_skip_escaped_c(const char *p) { +const char * HP_sv_skip_escaped_c(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sv_skip_escaped_c_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_pre[hIndex].func; @@ -20724,7 +20724,7 @@ const char* HP_sv_skip_escaped_c(const char *p) { retVal___ = HPMHooks.source.sv.skip_escaped_c(p); } if (HPMHooks.count.HP_sv_skip_escaped_c_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -20787,11 +20787,11 @@ long HP_sysinfo_getpagesize(void) { } return retVal___; } -const char* HP_sysinfo_platform(void) { +const char * HP_sysinfo_platform(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_platform_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_platform_pre[hIndex].func; @@ -20806,7 +20806,7 @@ const char* HP_sysinfo_platform(void) { retVal___ = HPMHooks.source.sysinfo.platform(); } if (HPMHooks.count.HP_sysinfo_platform_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_platform_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -20814,11 +20814,11 @@ const char* HP_sysinfo_platform(void) { } return retVal___; } -const char* HP_sysinfo_osversion(void) { +const char * HP_sysinfo_osversion(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_osversion_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_osversion_pre[hIndex].func; @@ -20833,7 +20833,7 @@ const char* HP_sysinfo_osversion(void) { retVal___ = HPMHooks.source.sysinfo.osversion(); } if (HPMHooks.count.HP_sysinfo_osversion_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_osversion_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -20841,11 +20841,11 @@ const char* HP_sysinfo_osversion(void) { } return retVal___; } -const char* HP_sysinfo_cpu(void) { +const char * HP_sysinfo_cpu(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_cpu_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_cpu_pre[hIndex].func; @@ -20860,7 +20860,7 @@ const char* HP_sysinfo_cpu(void) { retVal___ = HPMHooks.source.sysinfo.cpu(); } if (HPMHooks.count.HP_sysinfo_cpu_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_cpu_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -20895,11 +20895,11 @@ int HP_sysinfo_cpucores(void) { } return retVal___; } -const char* HP_sysinfo_arch(void) { +const char * HP_sysinfo_arch(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_arch_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_arch_pre[hIndex].func; @@ -20914,7 +20914,7 @@ const char* HP_sysinfo_arch(void) { retVal___ = HPMHooks.source.sysinfo.arch(); } if (HPMHooks.count.HP_sysinfo_arch_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_arch_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -20949,11 +20949,11 @@ bool HP_sysinfo_is64bit(void) { } return retVal___; } -const char* HP_sysinfo_compiler(void) { +const char * HP_sysinfo_compiler(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_compiler_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_compiler_pre[hIndex].func; @@ -20968,7 +20968,7 @@ const char* HP_sysinfo_compiler(void) { retVal___ = HPMHooks.source.sysinfo.compiler(); } if (HPMHooks.count.HP_sysinfo_compiler_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_compiler_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -20976,11 +20976,11 @@ const char* HP_sysinfo_compiler(void) { } return retVal___; } -const char* HP_sysinfo_cflags(void) { +const char * HP_sysinfo_cflags(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_cflags_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_cflags_pre[hIndex].func; @@ -20995,7 +20995,7 @@ const char* HP_sysinfo_cflags(void) { retVal___ = HPMHooks.source.sysinfo.cflags(); } if (HPMHooks.count.HP_sysinfo_cflags_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_cflags_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -21003,11 +21003,11 @@ const char* HP_sysinfo_cflags(void) { } return retVal___; } -const char* HP_sysinfo_time(void) { +const char * HP_sysinfo_time(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_time_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_time_pre[hIndex].func; @@ -21022,7 +21022,7 @@ const char* HP_sysinfo_time(void) { retVal___ = HPMHooks.source.sysinfo.time(); } if (HPMHooks.count.HP_sysinfo_time_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_time_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -21030,11 +21030,11 @@ const char* HP_sysinfo_time(void) { } return retVal___; } -const char* HP_sysinfo_vcstype(void) { +const char * HP_sysinfo_vcstype(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_vcstype_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_vcstype_pre[hIndex].func; @@ -21049,7 +21049,7 @@ const char* HP_sysinfo_vcstype(void) { retVal___ = HPMHooks.source.sysinfo.vcstype(); } if (HPMHooks.count.HP_sysinfo_vcstype_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_vcstype_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -21084,11 +21084,11 @@ int HP_sysinfo_vcstypeid(void) { } return retVal___; } -const char* HP_sysinfo_vcsrevision_src(void) { +const char * HP_sysinfo_vcsrevision_src(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_vcsrevision_src_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_pre[hIndex].func; @@ -21103,7 +21103,7 @@ const char* HP_sysinfo_vcsrevision_src(void) { retVal___ = HPMHooks.source.sysinfo.vcsrevision_src(); } if (HPMHooks.count.HP_sysinfo_vcsrevision_src_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -21111,11 +21111,11 @@ const char* HP_sysinfo_vcsrevision_src(void) { } return retVal___; } -const char* HP_sysinfo_vcsrevision_scripts(void) { +const char * HP_sysinfo_vcsrevision_scripts(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_pre[hIndex].func; @@ -21130,7 +21130,7 @@ const char* HP_sysinfo_vcsrevision_scripts(void) { retVal___ = HPMHooks.source.sysinfo.vcsrevision_scripts(); } if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -21245,11 +21245,11 @@ bool HP_sysinfo_is_superuser(void) { } return retVal___; } -const char* HP_sysinfo_zlib(void) { +const char * HP_sysinfo_zlib(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_zlib_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_zlib_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_zlib_pre[hIndex].func; @@ -21264,7 +21264,7 @@ const char* HP_sysinfo_zlib(void) { retVal___ = HPMHooks.source.sysinfo.zlib(); } if (HPMHooks.count.HP_sysinfo_zlib_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_zlib_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_zlib_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -21377,11 +21377,11 @@ void HP_thread_final(void) { } return; } -struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { +struct thread_handle * HP_thread_create(threadFunc entry_point, void *param) { int hIndex = 0; - struct thread_handle* retVal___ = NULL; + struct thread_handle * retVal___ = NULL; if (HPMHooks.count.HP_thread_create_pre > 0) { - struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param); + struct thread_handle * (*preHookFunc) (threadFunc *entry_point, void **param); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func; @@ -21396,7 +21396,7 @@ struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { retVal___ = HPMHooks.source.thread.create(entry_point, param); } if (HPMHooks.count.HP_thread_create_post > 0) { - struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param); + struct thread_handle * (*postHookFunc) (struct thread_handle * retVal___, threadFunc entry_point, void *param); for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func; retVal___ = postHookFunc(retVal___, entry_point, param); @@ -21404,11 +21404,11 @@ struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { } return retVal___; } -struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { +struct thread_handle * HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { int hIndex = 0; - struct thread_handle* retVal___ = NULL; + struct thread_handle * retVal___ = NULL; if (HPMHooks.count.HP_thread_create_opt_pre > 0) { - struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); + struct thread_handle * (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func; @@ -21423,7 +21423,7 @@ struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio); } if (HPMHooks.count.HP_thread_create_opt_post > 0) { - struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); + struct thread_handle * (*postHookFunc) (struct thread_handle * retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++) { postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func; retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio); @@ -21457,11 +21457,11 @@ void HP_thread_destroy(struct thread_handle *handle) { } return; } -struct thread_handle* HP_thread_self(void) { +struct thread_handle * HP_thread_self(void) { int hIndex = 0; - struct thread_handle* retVal___ = NULL; + struct thread_handle * retVal___ = NULL; if (HPMHooks.count.HP_thread_self_pre > 0) { - struct thread_handle* (*preHookFunc) (void); + struct thread_handle * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func; @@ -21476,7 +21476,7 @@ struct thread_handle* HP_thread_self(void) { retVal___ = HPMHooks.source.thread.self(); } if (HPMHooks.count.HP_thread_self_post > 0) { - struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___); + struct thread_handle * (*postHookFunc) (struct thread_handle * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++) { postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -21726,11 +21726,11 @@ int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int } return retVal___; } -const struct TimerData* HP_timer_get(int tid) { +const struct TimerData * HP_timer_get(int tid) { int hIndex = 0; - const struct TimerData* retVal___ = NULL; + const struct TimerData * retVal___ = NULL; if (HPMHooks.count.HP_timer_get_pre > 0) { - const struct TimerData* (*preHookFunc) (int *tid); + const struct TimerData * (*preHookFunc) (int *tid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_timer_get_pre[hIndex].func; @@ -21745,7 +21745,7 @@ const struct TimerData* HP_timer_get(int tid) { retVal___ = HPMHooks.source.timer.get(tid); } if (HPMHooks.count.HP_timer_get_post > 0) { - const struct TimerData* (*postHookFunc) (const struct TimerData* retVal___, int tid); + const struct TimerData * (*postHookFunc) (const struct TimerData * retVal___, int tid); for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_post; hIndex++) { postHookFunc = HPMHooks.list.HP_timer_get_post[hIndex].func; retVal___ = postHookFunc(retVal___, tid); diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 4f0fce39d34..207cf632951 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -79,11 +79,11 @@ bool HP_HCache_check(const char *file) { } return retVal___; } -FILE* HP_HCache_open(const char *file, const char *opt) { +FILE * HP_HCache_open(const char *file, const char *opt) { int hIndex = 0; - FILE* retVal___ = NULL; + FILE * retVal___ = NULL; if (HPMHooks.count.HP_HCache_open_pre > 0) { - FILE* (*preHookFunc) (const char **file, const char **opt); + FILE * (*preHookFunc) (const char **file, const char **opt); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_HCache_open_pre[hIndex].func; @@ -98,7 +98,7 @@ FILE* HP_HCache_open(const char *file, const char *opt) { retVal___ = HPMHooks.source.HCache.open(file, opt); } if (HPMHooks.count.HP_HCache_open_post > 0) { - FILE* (*postHookFunc) (FILE* retVal___, const char *file, const char *opt); + FILE * (*postHookFunc) (FILE * retVal___, const char *file, const char *opt); for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_post; hIndex++) { postHookFunc = HPMHooks.list.HP_HCache_open_post[hIndex].func; retVal___ = postHookFunc(retVal___, file, opt); @@ -107,11 +107,11 @@ FILE* HP_HCache_open(const char *file, const char *opt) { return retVal___; } /* account_interface */ -struct Sql* HP_account_db_sql_up(AccountDB *self) { +struct Sql * HP_account_db_sql_up(AccountDB *self) { int hIndex = 0; - struct Sql* retVal___ = NULL; + struct Sql * retVal___ = NULL; if (HPMHooks.count.HP_account_db_sql_up_pre > 0) { - struct Sql* (*preHookFunc) (AccountDB **self); + struct Sql * (*preHookFunc) (AccountDB **self); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_up_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_account_db_sql_up_pre[hIndex].func; @@ -126,7 +126,7 @@ struct Sql* HP_account_db_sql_up(AccountDB *self) { retVal___ = HPMHooks.source.account.db_sql_up(self); } if (HPMHooks.count.HP_account_db_sql_up_post > 0) { - struct Sql* (*postHookFunc) (struct Sql* retVal___, AccountDB *self); + struct Sql * (*postHookFunc) (struct Sql * retVal___, AccountDB *self); for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_up_post; hIndex++) { postHookFunc = HPMHooks.list.HP_account_db_sql_up_post[hIndex].func; retVal___ = postHookFunc(retVal___, self); @@ -240,11 +240,11 @@ bool HP_account_mmo_auth_tosql(AccountDB_SQL *db, const struct mmo_account *acc, } return retVal___; } -AccountDB* HP_account_db_sql(void) { +AccountDB * HP_account_db_sql(void) { int hIndex = 0; - AccountDB* retVal___ = NULL; + AccountDB * retVal___ = NULL; if (HPMHooks.count.HP_account_db_sql_pre > 0) { - AccountDB* (*preHookFunc) (void); + AccountDB * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_account_db_sql_pre[hIndex].func; @@ -259,7 +259,7 @@ AccountDB* HP_account_db_sql(void) { retVal___ = HPMHooks.source.account.db_sql(); } if (HPMHooks.count.HP_account_db_sql_post > 0) { - AccountDB* (*postHookFunc) (AccountDB* retVal___); + AccountDB * (*postHookFunc) (AccountDB * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_post; hIndex++) { postHookFunc = HPMHooks.list.HP_account_db_sql_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -509,11 +509,11 @@ bool HP_account_db_sql_load_str(AccountDB *self, struct mmo_account *acc, const } return retVal___; } -AccountDBIterator* HP_account_db_sql_iterator(AccountDB *self) { +AccountDBIterator * HP_account_db_sql_iterator(AccountDB *self) { int hIndex = 0; - AccountDBIterator* retVal___ = NULL; + AccountDBIterator * retVal___ = NULL; if (HPMHooks.count.HP_account_db_sql_iterator_pre > 0) { - AccountDBIterator* (*preHookFunc) (AccountDB **self); + AccountDBIterator * (*preHookFunc) (AccountDB **self); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iterator_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_account_db_sql_iterator_pre[hIndex].func; @@ -528,7 +528,7 @@ AccountDBIterator* HP_account_db_sql_iterator(AccountDB *self) { retVal___ = HPMHooks.source.account.db_sql_iterator(self); } if (HPMHooks.count.HP_account_db_sql_iterator_post > 0) { - AccountDBIterator* (*postHookFunc) (AccountDBIterator* retVal___, AccountDB *self); + AccountDBIterator * (*postHookFunc) (AccountDBIterator * retVal___, AccountDB *self); for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iterator_post; hIndex++) { postHookFunc = HPMHooks.list.HP_account_db_sql_iterator_post[hIndex].func; retVal___ = postHookFunc(retVal___, self); @@ -750,11 +750,11 @@ bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) { } return retVal___; } -const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) { +const char * HP_cmdline_arg_source(struct CmdlineArgData *arg) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_cmdline_arg_source_pre > 0) { - const char* (*preHookFunc) (struct CmdlineArgData **arg); + const char * (*preHookFunc) (struct CmdlineArgData **arg); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_cmdline_arg_source_pre[hIndex].func; @@ -769,7 +769,7 @@ const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) { retVal___ = HPMHooks.source.cmdline.arg_source(arg); } if (HPMHooks.count.HP_cmdline_arg_source_post > 0) { - const char* (*postHookFunc) (const char* retVal___, struct CmdlineArgData *arg); + const char * (*postHookFunc) (const char * retVal___, struct CmdlineArgData *arg); for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++) { postHookFunc = HPMHooks.list.HP_cmdline_arg_source_post[hIndex].func; retVal___ = postHookFunc(retVal___, arg); @@ -1045,11 +1045,11 @@ DBReleaser HP_DB_custom_release(enum DBReleaseOption which) { } return retVal___; } -struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) { +struct DBMap * HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) { int hIndex = 0; - struct DBMap* retVal___ = NULL; + struct DBMap * retVal___ = NULL; if (HPMHooks.count.HP_DB_alloc_pre > 0) { - struct DBMap* (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen); + struct DBMap * (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_DB_alloc_pre[hIndex].func; @@ -1064,7 +1064,7 @@ struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBT retVal___ = HPMHooks.source.DB.alloc(file, func, line, type, options, maxlen); } if (HPMHooks.count.HP_DB_alloc_post > 0) { - struct DBMap* (*postHookFunc) (struct DBMap* retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen); + struct DBMap * (*postHookFunc) (struct DBMap * retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen); for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_DB_alloc_post[hIndex].func; retVal___ = postHookFunc(retVal___, file, func, line, type, options, maxlen); @@ -1342,11 +1342,11 @@ unsigned int HP_DB_data2ui(struct DBData *data) { } return retVal___; } -void* HP_DB_data2ptr(struct DBData *data) { +void * HP_DB_data2ptr(struct DBData *data) { int hIndex = 0; - void* retVal___ = NULL; + void * retVal___ = NULL; if (HPMHooks.count.HP_DB_data2ptr_pre > 0) { - void* (*preHookFunc) (struct DBData **data); + void * (*preHookFunc) (struct DBData **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_DB_data2ptr_pre[hIndex].func; @@ -1361,7 +1361,7 @@ void* HP_DB_data2ptr(struct DBData *data) { retVal___ = HPMHooks.source.DB.data2ptr(data); } if (HPMHooks.count.HP_DB_data2ptr_post > 0) { - void* (*postHookFunc) (void* retVal___, struct DBData *data); + void * (*postHookFunc) (void * retVal___, struct DBData *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++) { postHookFunc = HPMHooks.list.HP_DB_data2ptr_post[hIndex].func; retVal___ = postHookFunc(retVal___, data); @@ -2004,11 +2004,11 @@ void HP_lclif_coding_key(int fd, struct login_session_data *sd) { } return; } -const struct login_packet_db* HP_lclif_packet(int16 packet_id) { +const struct login_packet_db * HP_lclif_packet(int16 packet_id) { int hIndex = 0; - const struct login_packet_db* retVal___ = NULL; + const struct login_packet_db * retVal___ = NULL; if (HPMHooks.count.HP_lclif_packet_pre > 0) { - const struct login_packet_db* (*preHookFunc) (int16 *packet_id); + const struct login_packet_db * (*preHookFunc) (int16 *packet_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_packet_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_lclif_packet_pre[hIndex].func; @@ -2023,7 +2023,7 @@ const struct login_packet_db* HP_lclif_packet(int16 packet_id) { retVal___ = HPMHooks.source.lclif.packet(packet_id); } if (HPMHooks.count.HP_lclif_packet_post > 0) { - const struct login_packet_db* (*postHookFunc) (const struct login_packet_db* retVal___, int16 packet_id); + const struct login_packet_db * (*postHookFunc) (const struct login_packet_db * retVal___, int16 packet_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_packet_post; hIndex++) { postHookFunc = HPMHooks.list.HP_lclif_packet_post[hIndex].func; retVal___ = postHookFunc(retVal___, packet_id); @@ -2969,11 +2969,11 @@ int HP_libconfig_setting_get_bool(const struct config_setting_t *setting) { } return retVal___; } -const char* HP_libconfig_setting_get_string(const struct config_setting_t *setting) { +const char * HP_libconfig_setting_get_string(const struct config_setting_t *setting) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_string_pre > 0) { - const char* (*preHookFunc) (const struct config_setting_t **setting); + const char * (*preHookFunc) (const struct config_setting_t **setting); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_pre[hIndex].func; @@ -2988,7 +2988,7 @@ const char* HP_libconfig_setting_get_string(const struct config_setting_t *setti retVal___ = HPMHooks.source.libconfig.setting_get_string(setting); } if (HPMHooks.count.HP_libconfig_setting_get_string_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting); + const char * (*postHookFunc) (const char * retVal___, const struct config_setting_t *setting); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting); @@ -2996,11 +2996,11 @@ const char* HP_libconfig_setting_get_string(const struct config_setting_t *setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_lookup(struct config_setting_t *setting, const char *name) { +struct config_setting_t * HP_libconfig_setting_lookup(struct config_setting_t *setting, const char *name) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_lookup_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, const char **name); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_pre[hIndex].func; @@ -3015,7 +3015,7 @@ struct config_setting_t* HP_libconfig_setting_lookup(struct config_setting_t *se retVal___ = HPMHooks.source.libconfig.setting_lookup(setting, name); } if (HPMHooks.count.HP_libconfig_setting_lookup_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, const char *name); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name); @@ -3455,11 +3455,11 @@ int HP_libconfig_setting_get_bool_elem(const struct config_setting_t *setting, i } return retVal___; } -const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t *setting, int idx) { +const char * HP_libconfig_setting_get_string_elem(const struct config_setting_t *setting, int idx) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_string_elem_pre > 0) { - const char* (*preHookFunc) (const struct config_setting_t **setting, int *idx); + const char * (*preHookFunc) (const struct config_setting_t **setting, int *idx); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_pre[hIndex].func; @@ -3474,7 +3474,7 @@ const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t * retVal___ = HPMHooks.source.libconfig.setting_get_string_elem(setting, idx); } if (HPMHooks.count.HP_libconfig_setting_get_string_elem_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting, int idx); + const char * (*postHookFunc) (const char * retVal___, const struct config_setting_t *setting, int idx); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -3482,11 +3482,11 @@ const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t * } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting_t *setting, int idx, int value) { +struct config_setting_t * HP_libconfig_setting_set_int_elem(struct config_setting_t *setting, int idx, int value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_int_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_pre[hIndex].func; @@ -3501,7 +3501,7 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting retVal___ = HPMHooks.source.libconfig.setting_set_int_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_int_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -3509,11 +3509,11 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { +struct config_setting_t * HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func; @@ -3528,7 +3528,7 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int64 value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -3536,11 +3536,11 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setting_t *setting, int idx, double value) { +struct config_setting_t * HP_libconfig_setting_set_float_elem(struct config_setting_t *setting, int idx, double value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_float_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, double *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, double *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_pre[hIndex].func; @@ -3555,7 +3555,7 @@ struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_float_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_float_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, double value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, double value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -3563,11 +3563,11 @@ struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_setting_t *setting, int idx, int value) { +struct config_setting_t * HP_libconfig_setting_set_bool_elem(struct config_setting_t *setting, int idx, int value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_pre[hIndex].func; @@ -3582,7 +3582,7 @@ struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_settin retVal___ = HPMHooks.source.libconfig.setting_set_bool_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -3590,11 +3590,11 @@ struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_settin } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_string_elem(struct config_setting_t *setting, int idx, const char *value) { +struct config_setting_t * HP_libconfig_setting_set_string_elem(struct config_setting_t *setting, int idx, const char *value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_string_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, const char **value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, const char **value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_pre[hIndex].func; @@ -3609,7 +3609,7 @@ struct config_setting_t* HP_libconfig_setting_set_string_elem(struct config_sett retVal___ = HPMHooks.source.libconfig.setting_set_string_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_string_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, const char *value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, const char *value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -3671,11 +3671,11 @@ int HP_libconfig_setting_length(const struct config_setting_t *setting) { } return retVal___; } -struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setting_t *setting, unsigned int idx) { +struct config_setting_t * HP_libconfig_setting_get_elem(const struct config_setting_t *setting, unsigned int idx) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, unsigned int *idx); + struct config_setting_t * (*preHookFunc) (const struct config_setting_t **setting, unsigned int *idx); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_pre[hIndex].func; @@ -3690,7 +3690,7 @@ struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setti retVal___ = HPMHooks.source.libconfig.setting_get_elem(setting, idx); } if (HPMHooks.count.HP_libconfig_setting_get_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, unsigned int idx); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, const struct config_setting_t *setting, unsigned int idx); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -3698,11 +3698,11 @@ struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_get_member(const struct config_setting_t *setting, const char *name) { +struct config_setting_t * HP_libconfig_setting_get_member(const struct config_setting_t *setting, const char *name) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_member_pre > 0) { - struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, const char **name); + struct config_setting_t * (*preHookFunc) (const struct config_setting_t **setting, const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_pre[hIndex].func; @@ -3717,7 +3717,7 @@ struct config_setting_t* HP_libconfig_setting_get_member(const struct config_set retVal___ = HPMHooks.source.libconfig.setting_get_member(setting, name); } if (HPMHooks.count.HP_libconfig_setting_get_member_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, const char *name); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, const struct config_setting_t *setting, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name); @@ -3725,11 +3725,11 @@ struct config_setting_t* HP_libconfig_setting_get_member(const struct config_set } return retVal___; } -struct config_setting_t* HP_libconfig_setting_add(struct config_setting_t *parent, const char *name, int type) { +struct config_setting_t * HP_libconfig_setting_add(struct config_setting_t *parent, const char *name, int type) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_add_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **parent, const char **name, int *type); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **parent, const char **name, int *type); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_add_pre[hIndex].func; @@ -3744,7 +3744,7 @@ struct config_setting_t* HP_libconfig_setting_add(struct config_setting_t *paren retVal___ = HPMHooks.source.libconfig.setting_add(parent, name, type); } if (HPMHooks.count.HP_libconfig_setting_add_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *parent, const char *name, int type); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *parent, const char *name, int type); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_add_post[hIndex].func; retVal___ = postHookFunc(retVal___, parent, name, type); @@ -3832,11 +3832,11 @@ void HP_libconfig_setting_set_hook(struct config_setting_t *setting, void *hook) } return; } -struct config_setting_t* HP_libconfig_lookup(const struct config_t *config, const char *filepath) { +struct config_setting_t * HP_libconfig_lookup(const struct config_t *config, const char *filepath) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_lookup_pre > 0) { - struct config_setting_t* (*preHookFunc) (const struct config_t **config, const char **filepath); + struct config_setting_t * (*preHookFunc) (const struct config_t **config, const char **filepath); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_lookup_pre[hIndex].func; @@ -3851,7 +3851,7 @@ struct config_setting_t* HP_libconfig_lookup(const struct config_t *config, cons retVal___ = HPMHooks.source.libconfig.lookup(config, filepath); } if (HPMHooks.count.HP_libconfig_lookup_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_t *config, const char *filepath); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, const struct config_t *config, const char *filepath); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_lookup_post[hIndex].func; retVal___ = postHookFunc(retVal___, config, filepath); @@ -4511,11 +4511,11 @@ struct DBData HP_login_create_online_user(union DBKey key, va_list args) { } return retVal___; } -struct online_login_data* HP_login_add_online_user(int char_server, int account_id) { +struct online_login_data * HP_login_add_online_user(int char_server, int account_id) { int hIndex = 0; - struct online_login_data* retVal___ = NULL; + struct online_login_data * retVal___ = NULL; if (HPMHooks.count.HP_login_add_online_user_pre > 0) { - struct online_login_data* (*preHookFunc) (int *char_server, int *account_id); + struct online_login_data * (*preHookFunc) (int *char_server, int *account_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_login_add_online_user_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_login_add_online_user_pre[hIndex].func; @@ -4530,7 +4530,7 @@ struct online_login_data* HP_login_add_online_user(int char_server, int account_ retVal___ = HPMHooks.source.login.add_online_user(char_server, account_id); } if (HPMHooks.count.HP_login_add_online_user_post > 0) { - struct online_login_data* (*postHookFunc) (struct online_login_data* retVal___, int char_server, int account_id); + struct online_login_data * (*postHookFunc) (struct online_login_data * retVal___, int char_server, int account_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_login_add_online_user_post; hIndex++) { postHookFunc = HPMHooks.list.HP_login_add_online_user_post[hIndex].func; retVal___ = postHookFunc(retVal___, char_server, account_id); @@ -6401,11 +6401,11 @@ void HP_md5_salt(int len, char *output) { return; } /* mutex_interface */ -struct mutex_data* HP_mutex_create(void) { +struct mutex_data * HP_mutex_create(void) { int hIndex = 0; - struct mutex_data* retVal___ = NULL; + struct mutex_data * retVal___ = NULL; if (HPMHooks.count.HP_mutex_create_pre > 0) { - struct mutex_data* (*preHookFunc) (void); + struct mutex_data * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func; @@ -6420,7 +6420,7 @@ struct mutex_data* HP_mutex_create(void) { retVal___ = HPMHooks.source.mutex.create(); } if (HPMHooks.count.HP_mutex_create_post > 0) { - struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___); + struct mutex_data * (*postHookFunc) (struct mutex_data * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -6533,11 +6533,11 @@ void HP_mutex_unlock(struct mutex_data *m) { } return; } -struct cond_data* HP_mutex_cond_create(void) { +struct cond_data * HP_mutex_cond_create(void) { int hIndex = 0; - struct cond_data* retVal___ = NULL; + struct cond_data * retVal___ = NULL; if (HPMHooks.count.HP_mutex_cond_create_pre > 0) { - struct cond_data* (*preHookFunc) (void); + struct cond_data * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func; @@ -6552,7 +6552,7 @@ struct cond_data* HP_mutex_cond_create(void) { retVal___ = HPMHooks.source.mutex.cond_create(); } if (HPMHooks.count.HP_mutex_cond_create_post > 0) { - struct cond_data* (*postHookFunc) (struct cond_data* retVal___); + struct cond_data * (*postHookFunc) (struct cond_data * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -7810,11 +7810,11 @@ uint32 HP_sockt_host2ip(const char *hostname) { } return retVal___; } -const char* HP_sockt_ip2str(uint32 ip, char *ip_str) { +const char * HP_sockt_ip2str(uint32 ip, char *ip_str) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sockt_ip2str_pre > 0) { - const char* (*preHookFunc) (uint32 *ip, char **ip_str); + const char * (*preHookFunc) (uint32 *ip, char **ip_str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sockt_ip2str_pre[hIndex].func; @@ -7829,7 +7829,7 @@ const char* HP_sockt_ip2str(uint32 ip, char *ip_str) { retVal___ = HPMHooks.source.sockt.ip2str(ip, ip_str); } if (HPMHooks.count.HP_sockt_ip2str_post > 0) { - const char* (*postHookFunc) (const char* retVal___, uint32 ip, char *ip_str); + const char * (*postHookFunc) (const char * retVal___, uint32 ip, char *ip_str); for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sockt_ip2str_post[hIndex].func; retVal___ = postHookFunc(retVal___, ip, ip_str); @@ -8541,11 +8541,11 @@ void HP_SQL_Free(struct Sql *self) { } return; } -struct Sql* HP_SQL_Malloc(void) { +struct Sql * HP_SQL_Malloc(void) { int hIndex = 0; - struct Sql* retVal___ = NULL; + struct Sql * retVal___ = NULL; if (HPMHooks.count.HP_SQL_Malloc_pre > 0) { - struct Sql* (*preHookFunc) (void); + struct Sql * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_SQL_Malloc_pre[hIndex].func; @@ -8560,7 +8560,7 @@ struct Sql* HP_SQL_Malloc(void) { retVal___ = HPMHooks.source.SQL.Malloc(); } if (HPMHooks.count.HP_SQL_Malloc_post > 0) { - struct Sql* (*postHookFunc) (struct Sql* retVal___); + struct Sql * (*postHookFunc) (struct Sql * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_SQL_Malloc_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -8568,11 +8568,11 @@ struct Sql* HP_SQL_Malloc(void) { } return retVal___; } -struct SqlStmt* HP_SQL_StmtMalloc(struct Sql *sql) { +struct SqlStmt * HP_SQL_StmtMalloc(struct Sql *sql) { int hIndex = 0; - struct SqlStmt* retVal___ = NULL; + struct SqlStmt * retVal___ = NULL; if (HPMHooks.count.HP_SQL_StmtMalloc_pre > 0) { - struct SqlStmt* (*preHookFunc) (struct Sql **sql); + struct SqlStmt * (*preHookFunc) (struct Sql **sql); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_pre[hIndex].func; @@ -8587,7 +8587,7 @@ struct SqlStmt* HP_SQL_StmtMalloc(struct Sql *sql) { retVal___ = HPMHooks.source.SQL.StmtMalloc(sql); } if (HPMHooks.count.HP_SQL_StmtMalloc_post > 0) { - struct SqlStmt* (*postHookFunc) (struct SqlStmt* retVal___, struct Sql *sql); + struct SqlStmt * (*postHookFunc) (struct SqlStmt * retVal___, struct Sql *sql); for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_post[hIndex].func; retVal___ = postHookFunc(retVal___, sql); @@ -8950,11 +8950,11 @@ void HP_SQL_StmtShowDebug_(struct SqlStmt *self, const char *debug_file, const u return; } /* stringbuf_interface */ -StringBuf* HP_StrBuf_Malloc(void) { +StringBuf * HP_StrBuf_Malloc(void) { int hIndex = 0; - StringBuf* retVal___ = NULL; + StringBuf * retVal___ = NULL; if (HPMHooks.count.HP_StrBuf_Malloc_pre > 0) { - StringBuf* (*preHookFunc) (void); + StringBuf * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_StrBuf_Malloc_pre[hIndex].func; @@ -8969,7 +8969,7 @@ StringBuf* HP_StrBuf_Malloc(void) { retVal___ = HPMHooks.source.StrBuf.Malloc(); } if (HPMHooks.count.HP_StrBuf_Malloc_post > 0) { - StringBuf* (*postHookFunc) (StringBuf* retVal___); + StringBuf * (*postHookFunc) (StringBuf * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_StrBuf_Malloc_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -9117,11 +9117,11 @@ int HP_StrBuf_Length(StringBuf *self) { } return retVal___; } -char* HP_StrBuf_Value(StringBuf *self) { +char * HP_StrBuf_Value(StringBuf *self) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_StrBuf_Value_pre > 0) { - char* (*preHookFunc) (StringBuf **self); + char * (*preHookFunc) (StringBuf **self); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_StrBuf_Value_pre[hIndex].func; @@ -9136,7 +9136,7 @@ char* HP_StrBuf_Value(StringBuf *self) { retVal___ = HPMHooks.source.StrBuf.Value(self); } if (HPMHooks.count.HP_StrBuf_Value_post > 0) { - char* (*postHookFunc) (char* retVal___, StringBuf *self); + char * (*postHookFunc) (char * retVal___, StringBuf *self); for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_post; hIndex++) { postHookFunc = HPMHooks.list.HP_StrBuf_Value_post[hIndex].func; retVal___ = postHookFunc(retVal___, self); @@ -9223,11 +9223,11 @@ void HP_StrBuf_Free(StringBuf *self) { return; } /* strlib_interface */ -char* HP_strlib_jstrescape(char *pt) { +char * HP_strlib_jstrescape(char *pt) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_jstrescape_pre > 0) { - char* (*preHookFunc) (char **pt); + char * (*preHookFunc) (char **pt); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_jstrescape_pre[hIndex].func; @@ -9242,7 +9242,7 @@ char* HP_strlib_jstrescape(char *pt) { retVal___ = HPMHooks.source.strlib.jstrescape(pt); } if (HPMHooks.count.HP_strlib_jstrescape_post > 0) { - char* (*postHookFunc) (char* retVal___, char *pt); + char * (*postHookFunc) (char * retVal___, char *pt); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_jstrescape_post[hIndex].func; retVal___ = postHookFunc(retVal___, pt); @@ -9250,11 +9250,11 @@ char* HP_strlib_jstrescape(char *pt) { } return retVal___; } -char* HP_strlib_jstrescapecpy(char *pt, const char *spt) { +char * HP_strlib_jstrescapecpy(char *pt, const char *spt) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_jstrescapecpy_pre > 0) { - char* (*preHookFunc) (char **pt, const char **spt); + char * (*preHookFunc) (char **pt, const char **spt); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_pre[hIndex].func; @@ -9269,7 +9269,7 @@ char* HP_strlib_jstrescapecpy(char *pt, const char *spt) { retVal___ = HPMHooks.source.strlib.jstrescapecpy(pt, spt); } if (HPMHooks.count.HP_strlib_jstrescapecpy_post > 0) { - char* (*postHookFunc) (char* retVal___, char *pt, const char *spt); + char * (*postHookFunc) (char * retVal___, char *pt, const char *spt); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_post[hIndex].func; retVal___ = postHookFunc(retVal___, pt, spt); @@ -9331,11 +9331,11 @@ int HP_strlib_remove_control_chars_(char *str) { } return retVal___; } -char* HP_strlib_trim_(char *str) { +char * HP_strlib_trim_(char *str) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_trim__pre > 0) { - char* (*preHookFunc) (char **str); + char * (*preHookFunc) (char **str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_trim__pre[hIndex].func; @@ -9350,7 +9350,7 @@ char* HP_strlib_trim_(char *str) { retVal___ = HPMHooks.source.strlib.trim_(str); } if (HPMHooks.count.HP_strlib_trim__post > 0) { - char* (*postHookFunc) (char* retVal___, char *str); + char * (*postHookFunc) (char * retVal___, char *str); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_trim__post[hIndex].func; retVal___ = postHookFunc(retVal___, str); @@ -9358,11 +9358,11 @@ char* HP_strlib_trim_(char *str) { } return retVal___; } -char* HP_strlib_normalize_name_(char *str, const char *delims) { +char * HP_strlib_normalize_name_(char *str, const char *delims) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_normalize_name__pre > 0) { - char* (*preHookFunc) (char **str, const char **delims); + char * (*preHookFunc) (char **str, const char **delims); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_normalize_name__pre[hIndex].func; @@ -9377,7 +9377,7 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) { retVal___ = HPMHooks.source.strlib.normalize_name_(str, delims); } if (HPMHooks.count.HP_strlib_normalize_name__post > 0) { - char* (*postHookFunc) (char* retVal___, char *str, const char *delims); + char * (*postHookFunc) (char * retVal___, char *str, const char *delims); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_normalize_name__post[hIndex].func; retVal___ = postHookFunc(retVal___, str, delims); @@ -9385,11 +9385,11 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) { } return retVal___; } -const char* HP_strlib_stristr_(const char *haystack, const char *needle) { +const char * HP_strlib_stristr_(const char *haystack, const char *needle) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_stristr__pre > 0) { - const char* (*preHookFunc) (const char **haystack, const char **needle); + const char * (*preHookFunc) (const char **haystack, const char **needle); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_stristr__pre[hIndex].func; @@ -9404,7 +9404,7 @@ const char* HP_strlib_stristr_(const char *haystack, const char *needle) { retVal___ = HPMHooks.source.strlib.stristr_(haystack, needle); } if (HPMHooks.count.HP_strlib_stristr__post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *haystack, const char *needle); + const char * (*postHookFunc) (const char * retVal___, const char *haystack, const char *needle); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_stristr__post[hIndex].func; retVal___ = postHookFunc(retVal___, haystack, needle); @@ -9439,11 +9439,11 @@ size_t HP_strlib_strnlen_(const char *string, size_t maxlen) { } return retVal___; } -char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) { +char * HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_strtok_r__pre > 0) { - char* (*preHookFunc) (char **s1, const char **s2, char ***lasts); + char * (*preHookFunc) (char **s1, const char **s2, char ***lasts); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_strtok_r__pre[hIndex].func; @@ -9458,7 +9458,7 @@ char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) { retVal___ = HPMHooks.source.strlib.strtok_r_(s1, s2, lasts); } if (HPMHooks.count.HP_strlib_strtok_r__post > 0) { - char* (*postHookFunc) (char* retVal___, char *s1, const char *s2, char **lasts); + char * (*postHookFunc) (char * retVal___, char *s1, const char *s2, char **lasts); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_strtok_r__post[hIndex].func; retVal___ = postHookFunc(retVal___, s1, s2, lasts); @@ -9520,11 +9520,11 @@ int HP_strlib_config_switch_(const char *str) { } return retVal___; } -char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) { +char * HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_safestrncpy__pre > 0) { - char* (*preHookFunc) (char **dst, const char **src, size_t *n); + char * (*preHookFunc) (char **dst, const char **src, size_t *n); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_safestrncpy__pre[hIndex].func; @@ -9539,7 +9539,7 @@ char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) { retVal___ = HPMHooks.source.strlib.safestrncpy_(dst, src, n); } if (HPMHooks.count.HP_strlib_safestrncpy__post > 0) { - char* (*postHookFunc) (char* retVal___, char *dst, const char *src, size_t n); + char * (*postHookFunc) (char * retVal___, char *dst, const char *src, size_t n); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_safestrncpy__post[hIndex].func; retVal___ = postHookFunc(retVal___, dst, src, n); @@ -9764,11 +9764,11 @@ size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) { } return retVal___; } -const char* HP_sv_skip_escaped_c(const char *p) { +const char * HP_sv_skip_escaped_c(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sv_skip_escaped_c_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_pre[hIndex].func; @@ -9783,7 +9783,7 @@ const char* HP_sv_skip_escaped_c(const char *p) { retVal___ = HPMHooks.source.sv.skip_escaped_c(p); } if (HPMHooks.count.HP_sv_skip_escaped_c_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -9846,11 +9846,11 @@ long HP_sysinfo_getpagesize(void) { } return retVal___; } -const char* HP_sysinfo_platform(void) { +const char * HP_sysinfo_platform(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_platform_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_platform_pre[hIndex].func; @@ -9865,7 +9865,7 @@ const char* HP_sysinfo_platform(void) { retVal___ = HPMHooks.source.sysinfo.platform(); } if (HPMHooks.count.HP_sysinfo_platform_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_platform_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -9873,11 +9873,11 @@ const char* HP_sysinfo_platform(void) { } return retVal___; } -const char* HP_sysinfo_osversion(void) { +const char * HP_sysinfo_osversion(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_osversion_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_osversion_pre[hIndex].func; @@ -9892,7 +9892,7 @@ const char* HP_sysinfo_osversion(void) { retVal___ = HPMHooks.source.sysinfo.osversion(); } if (HPMHooks.count.HP_sysinfo_osversion_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_osversion_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -9900,11 +9900,11 @@ const char* HP_sysinfo_osversion(void) { } return retVal___; } -const char* HP_sysinfo_cpu(void) { +const char * HP_sysinfo_cpu(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_cpu_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_cpu_pre[hIndex].func; @@ -9919,7 +9919,7 @@ const char* HP_sysinfo_cpu(void) { retVal___ = HPMHooks.source.sysinfo.cpu(); } if (HPMHooks.count.HP_sysinfo_cpu_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_cpu_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -9954,11 +9954,11 @@ int HP_sysinfo_cpucores(void) { } return retVal___; } -const char* HP_sysinfo_arch(void) { +const char * HP_sysinfo_arch(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_arch_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_arch_pre[hIndex].func; @@ -9973,7 +9973,7 @@ const char* HP_sysinfo_arch(void) { retVal___ = HPMHooks.source.sysinfo.arch(); } if (HPMHooks.count.HP_sysinfo_arch_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_arch_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -10008,11 +10008,11 @@ bool HP_sysinfo_is64bit(void) { } return retVal___; } -const char* HP_sysinfo_compiler(void) { +const char * HP_sysinfo_compiler(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_compiler_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_compiler_pre[hIndex].func; @@ -10027,7 +10027,7 @@ const char* HP_sysinfo_compiler(void) { retVal___ = HPMHooks.source.sysinfo.compiler(); } if (HPMHooks.count.HP_sysinfo_compiler_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_compiler_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -10035,11 +10035,11 @@ const char* HP_sysinfo_compiler(void) { } return retVal___; } -const char* HP_sysinfo_cflags(void) { +const char * HP_sysinfo_cflags(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_cflags_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_cflags_pre[hIndex].func; @@ -10054,7 +10054,7 @@ const char* HP_sysinfo_cflags(void) { retVal___ = HPMHooks.source.sysinfo.cflags(); } if (HPMHooks.count.HP_sysinfo_cflags_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_cflags_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -10062,11 +10062,11 @@ const char* HP_sysinfo_cflags(void) { } return retVal___; } -const char* HP_sysinfo_time(void) { +const char * HP_sysinfo_time(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_time_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_time_pre[hIndex].func; @@ -10081,7 +10081,7 @@ const char* HP_sysinfo_time(void) { retVal___ = HPMHooks.source.sysinfo.time(); } if (HPMHooks.count.HP_sysinfo_time_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_time_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -10089,11 +10089,11 @@ const char* HP_sysinfo_time(void) { } return retVal___; } -const char* HP_sysinfo_vcstype(void) { +const char * HP_sysinfo_vcstype(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_vcstype_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_vcstype_pre[hIndex].func; @@ -10108,7 +10108,7 @@ const char* HP_sysinfo_vcstype(void) { retVal___ = HPMHooks.source.sysinfo.vcstype(); } if (HPMHooks.count.HP_sysinfo_vcstype_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_vcstype_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -10143,11 +10143,11 @@ int HP_sysinfo_vcstypeid(void) { } return retVal___; } -const char* HP_sysinfo_vcsrevision_src(void) { +const char * HP_sysinfo_vcsrevision_src(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_vcsrevision_src_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_pre[hIndex].func; @@ -10162,7 +10162,7 @@ const char* HP_sysinfo_vcsrevision_src(void) { retVal___ = HPMHooks.source.sysinfo.vcsrevision_src(); } if (HPMHooks.count.HP_sysinfo_vcsrevision_src_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -10170,11 +10170,11 @@ const char* HP_sysinfo_vcsrevision_src(void) { } return retVal___; } -const char* HP_sysinfo_vcsrevision_scripts(void) { +const char * HP_sysinfo_vcsrevision_scripts(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_pre[hIndex].func; @@ -10189,7 +10189,7 @@ const char* HP_sysinfo_vcsrevision_scripts(void) { retVal___ = HPMHooks.source.sysinfo.vcsrevision_scripts(); } if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -10304,11 +10304,11 @@ bool HP_sysinfo_is_superuser(void) { } return retVal___; } -const char* HP_sysinfo_zlib(void) { +const char * HP_sysinfo_zlib(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_zlib_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_zlib_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_zlib_pre[hIndex].func; @@ -10323,7 +10323,7 @@ const char* HP_sysinfo_zlib(void) { retVal___ = HPMHooks.source.sysinfo.zlib(); } if (HPMHooks.count.HP_sysinfo_zlib_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_zlib_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_zlib_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -10436,11 +10436,11 @@ void HP_thread_final(void) { } return; } -struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { +struct thread_handle * HP_thread_create(threadFunc entry_point, void *param) { int hIndex = 0; - struct thread_handle* retVal___ = NULL; + struct thread_handle * retVal___ = NULL; if (HPMHooks.count.HP_thread_create_pre > 0) { - struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param); + struct thread_handle * (*preHookFunc) (threadFunc *entry_point, void **param); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func; @@ -10455,7 +10455,7 @@ struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { retVal___ = HPMHooks.source.thread.create(entry_point, param); } if (HPMHooks.count.HP_thread_create_post > 0) { - struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param); + struct thread_handle * (*postHookFunc) (struct thread_handle * retVal___, threadFunc entry_point, void *param); for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func; retVal___ = postHookFunc(retVal___, entry_point, param); @@ -10463,11 +10463,11 @@ struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { } return retVal___; } -struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { +struct thread_handle * HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { int hIndex = 0; - struct thread_handle* retVal___ = NULL; + struct thread_handle * retVal___ = NULL; if (HPMHooks.count.HP_thread_create_opt_pre > 0) { - struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); + struct thread_handle * (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func; @@ -10482,7 +10482,7 @@ struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio); } if (HPMHooks.count.HP_thread_create_opt_post > 0) { - struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); + struct thread_handle * (*postHookFunc) (struct thread_handle * retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++) { postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func; retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio); @@ -10516,11 +10516,11 @@ void HP_thread_destroy(struct thread_handle *handle) { } return; } -struct thread_handle* HP_thread_self(void) { +struct thread_handle * HP_thread_self(void) { int hIndex = 0; - struct thread_handle* retVal___ = NULL; + struct thread_handle * retVal___ = NULL; if (HPMHooks.count.HP_thread_self_pre > 0) { - struct thread_handle* (*preHookFunc) (void); + struct thread_handle * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func; @@ -10535,7 +10535,7 @@ struct thread_handle* HP_thread_self(void) { retVal___ = HPMHooks.source.thread.self(); } if (HPMHooks.count.HP_thread_self_post > 0) { - struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___); + struct thread_handle * (*postHookFunc) (struct thread_handle * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++) { postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -10785,11 +10785,11 @@ int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int } return retVal___; } -const struct TimerData* HP_timer_get(int tid) { +const struct TimerData * HP_timer_get(int tid) { int hIndex = 0; - const struct TimerData* retVal___ = NULL; + const struct TimerData * retVal___ = NULL; if (HPMHooks.count.HP_timer_get_pre > 0) { - const struct TimerData* (*preHookFunc) (int *tid); + const struct TimerData * (*preHookFunc) (int *tid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_timer_get_pre[hIndex].func; @@ -10804,7 +10804,7 @@ const struct TimerData* HP_timer_get(int tid) { retVal___ = HPMHooks.source.timer.get(tid); } if (HPMHooks.count.HP_timer_get_post > 0) { - const struct TimerData* (*postHookFunc) (const struct TimerData* retVal___, int tid); + const struct TimerData * (*postHookFunc) (const struct TimerData * retVal___, int tid); for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_post; hIndex++) { postHookFunc = HPMHooks.list.HP_timer_get_post[hIndex].func; retVal___ = postHookFunc(retVal___, tid); diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index fabdc1708a8..363a2fd6e51 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -79,11 +79,11 @@ bool HP_HCache_check(const char *file) { } return retVal___; } -FILE* HP_HCache_open(const char *file, const char *opt) { +FILE * HP_HCache_open(const char *file, const char *opt) { int hIndex = 0; - FILE* retVal___ = NULL; + FILE * retVal___ = NULL; if (HPMHooks.count.HP_HCache_open_pre > 0) { - FILE* (*preHookFunc) (const char **file, const char **opt); + FILE * (*preHookFunc) (const char **file, const char **opt); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_HCache_open_pre[hIndex].func; @@ -98,7 +98,7 @@ FILE* HP_HCache_open(const char *file, const char *opt) { retVal___ = HPMHooks.source.HCache.open(file, opt); } if (HPMHooks.count.HP_HCache_open_post > 0) { - FILE* (*postHookFunc) (FILE* retVal___, const char *file, const char *opt); + FILE * (*postHookFunc) (FILE * retVal___, const char *file, const char *opt); for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_post; hIndex++) { postHookFunc = HPMHooks.list.HP_HCache_open_post[hIndex].func; retVal___ = postHookFunc(retVal___, file, opt); @@ -645,11 +645,11 @@ void HP_achievement_readdb_ranks(void) { } return; } -const struct achievement_data* HP_achievement_get(int aid) { +const struct achievement_data * HP_achievement_get(int aid) { int hIndex = 0; - const struct achievement_data* retVal___ = NULL; + const struct achievement_data * retVal___ = NULL; if (HPMHooks.count.HP_achievement_get_pre > 0) { - const struct achievement_data* (*preHookFunc) (int *aid); + const struct achievement_data * (*preHookFunc) (int *aid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_achievement_get_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_achievement_get_pre[hIndex].func; @@ -664,7 +664,7 @@ const struct achievement_data* HP_achievement_get(int aid) { retVal___ = HPMHooks.source.achievement.get(aid); } if (HPMHooks.count.HP_achievement_get_post > 0) { - const struct achievement_data* (*postHookFunc) (const struct achievement_data* retVal___, int aid); + const struct achievement_data * (*postHookFunc) (const struct achievement_data * retVal___, int aid); for (hIndex = 0; hIndex < HPMHooks.count.HP_achievement_get_post; hIndex++) { postHookFunc = HPMHooks.list.HP_achievement_get_post[hIndex].func; retVal___ = postHookFunc(retVal___, aid); @@ -672,11 +672,11 @@ const struct achievement_data* HP_achievement_get(int aid) { } return retVal___; } -struct achievement* HP_achievement_ensure(struct map_session_data *sd, const struct achievement_data *ad) { +struct achievement * HP_achievement_ensure(struct map_session_data *sd, const struct achievement_data *ad) { int hIndex = 0; - struct achievement* retVal___ = NULL; + struct achievement * retVal___ = NULL; if (HPMHooks.count.HP_achievement_ensure_pre > 0) { - struct achievement* (*preHookFunc) (struct map_session_data **sd, const struct achievement_data **ad); + struct achievement * (*preHookFunc) (struct map_session_data **sd, const struct achievement_data **ad); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_achievement_ensure_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_achievement_ensure_pre[hIndex].func; @@ -691,7 +691,7 @@ struct achievement* HP_achievement_ensure(struct map_session_data *sd, const str retVal___ = HPMHooks.source.achievement.ensure(sd, ad); } if (HPMHooks.count.HP_achievement_ensure_post > 0) { - struct achievement* (*postHookFunc) (struct achievement* retVal___, struct map_session_data *sd, const struct achievement_data *ad); + struct achievement * (*postHookFunc) (struct achievement * retVal___, struct map_session_data *sd, const struct achievement_data *ad); for (hIndex = 0; hIndex < HPMHooks.count.HP_achievement_ensure_post; hIndex++) { postHookFunc = HPMHooks.list.HP_achievement_ensure_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, ad); @@ -1725,11 +1725,11 @@ void HP_atcommand_load_groups(GroupSettings **groups, struct config_setting_t ** } return; } -AtCommandInfo* HP_atcommand_exists(const char *name) { +AtCommandInfo * HP_atcommand_exists(const char *name) { int hIndex = 0; - AtCommandInfo* retVal___ = NULL; + AtCommandInfo * retVal___ = NULL; if (HPMHooks.count.HP_atcommand_exists_pre > 0) { - AtCommandInfo* (*preHookFunc) (const char **name); + AtCommandInfo * (*preHookFunc) (const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_exists_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_atcommand_exists_pre[hIndex].func; @@ -1744,7 +1744,7 @@ AtCommandInfo* HP_atcommand_exists(const char *name) { retVal___ = HPMHooks.source.atcommand.exists(name); } if (HPMHooks.count.HP_atcommand_exists_post > 0) { - AtCommandInfo* (*postHookFunc) (AtCommandInfo* retVal___, const char *name); + AtCommandInfo * (*postHookFunc) (AtCommandInfo * retVal___, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_exists_post; hIndex++) { postHookFunc = HPMHooks.list.HP_atcommand_exists_post[hIndex].func; retVal___ = postHookFunc(retVal___, name); @@ -1805,11 +1805,11 @@ void HP_atcommand_final_msg(void) { } return; } -struct atcmd_binding_data* HP_atcommand_get_bind_byname(const char *name) { +struct atcmd_binding_data * HP_atcommand_get_bind_byname(const char *name) { int hIndex = 0; - struct atcmd_binding_data* retVal___ = NULL; + struct atcmd_binding_data * retVal___ = NULL; if (HPMHooks.count.HP_atcommand_get_bind_byname_pre > 0) { - struct atcmd_binding_data* (*preHookFunc) (const char **name); + struct atcmd_binding_data * (*preHookFunc) (const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_bind_byname_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_atcommand_get_bind_byname_pre[hIndex].func; @@ -1824,7 +1824,7 @@ struct atcmd_binding_data* HP_atcommand_get_bind_byname(const char *name) { retVal___ = HPMHooks.source.atcommand.get_bind_byname(name); } if (HPMHooks.count.HP_atcommand_get_bind_byname_post > 0) { - struct atcmd_binding_data* (*postHookFunc) (struct atcmd_binding_data* retVal___, const char *name); + struct atcmd_binding_data * (*postHookFunc) (struct atcmd_binding_data * retVal___, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_bind_byname_post; hIndex++) { postHookFunc = HPMHooks.list.HP_atcommand_get_bind_byname_post[hIndex].func; retVal___ = postHookFunc(retVal___, name); @@ -1832,11 +1832,11 @@ struct atcmd_binding_data* HP_atcommand_get_bind_byname(const char *name) { } return retVal___; } -AtCommandInfo* HP_atcommand_get_info_byname(const char *name) { +AtCommandInfo * HP_atcommand_get_info_byname(const char *name) { int hIndex = 0; - AtCommandInfo* retVal___ = NULL; + AtCommandInfo * retVal___ = NULL; if (HPMHooks.count.HP_atcommand_get_info_byname_pre > 0) { - AtCommandInfo* (*preHookFunc) (const char **name); + AtCommandInfo * (*preHookFunc) (const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_info_byname_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_atcommand_get_info_byname_pre[hIndex].func; @@ -1851,7 +1851,7 @@ AtCommandInfo* HP_atcommand_get_info_byname(const char *name) { retVal___ = HPMHooks.source.atcommand.get_info_byname(name); } if (HPMHooks.count.HP_atcommand_get_info_byname_post > 0) { - AtCommandInfo* (*postHookFunc) (AtCommandInfo* retVal___, const char *name); + AtCommandInfo * (*postHookFunc) (AtCommandInfo * retVal___, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_info_byname_post; hIndex++) { postHookFunc = HPMHooks.list.HP_atcommand_get_info_byname_post[hIndex].func; retVal___ = postHookFunc(retVal___, name); @@ -1859,11 +1859,11 @@ AtCommandInfo* HP_atcommand_get_info_byname(const char *name) { } return retVal___; } -const char* HP_atcommand_check_alias(const char *aliasname) { +const char * HP_atcommand_check_alias(const char *aliasname) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_atcommand_check_alias_pre > 0) { - const char* (*preHookFunc) (const char **aliasname); + const char * (*preHookFunc) (const char **aliasname); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_check_alias_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_atcommand_check_alias_pre[hIndex].func; @@ -1878,7 +1878,7 @@ const char* HP_atcommand_check_alias(const char *aliasname) { retVal___ = HPMHooks.source.atcommand.check_alias(aliasname); } if (HPMHooks.count.HP_atcommand_check_alias_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *aliasname); + const char * (*postHookFunc) (const char * retVal___, const char *aliasname); for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_check_alias_post; hIndex++) { postHookFunc = HPMHooks.list.HP_atcommand_check_alias_post[hIndex].func; retVal___ = postHookFunc(retVal___, aliasname); @@ -2404,11 +2404,11 @@ bool HP_atcommand_add(char *name, AtCommandFunc func, bool replace) { } return retVal___; } -const char* HP_atcommand_msg(int msg_number) { +const char * HP_atcommand_msg(int msg_number) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_atcommand_msg_pre > 0) { - const char* (*preHookFunc) (int *msg_number); + const char * (*preHookFunc) (int *msg_number); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msg_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_atcommand_msg_pre[hIndex].func; @@ -2423,7 +2423,7 @@ const char* HP_atcommand_msg(int msg_number) { retVal___ = HPMHooks.source.atcommand.msg(msg_number); } if (HPMHooks.count.HP_atcommand_msg_post > 0) { - const char* (*postHookFunc) (const char* retVal___, int msg_number); + const char * (*postHookFunc) (const char * retVal___, int msg_number); for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msg_post; hIndex++) { postHookFunc = HPMHooks.list.HP_atcommand_msg_post[hIndex].func; retVal___ = postHookFunc(retVal___, msg_number); @@ -2457,11 +2457,11 @@ void HP_atcommand_expand_message_table(void) { } return; } -const char* HP_atcommand_msgfd(int fd, int msg_number) { +const char * HP_atcommand_msgfd(int fd, int msg_number) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_atcommand_msgfd_pre > 0) { - const char* (*preHookFunc) (int *fd, int *msg_number); + const char * (*preHookFunc) (int *fd, int *msg_number); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgfd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_atcommand_msgfd_pre[hIndex].func; @@ -2476,7 +2476,7 @@ const char* HP_atcommand_msgfd(int fd, int msg_number) { retVal___ = HPMHooks.source.atcommand.msgfd(fd, msg_number); } if (HPMHooks.count.HP_atcommand_msgfd_post > 0) { - const char* (*postHookFunc) (const char* retVal___, int fd, int msg_number); + const char * (*postHookFunc) (const char * retVal___, int fd, int msg_number); for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgfd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_atcommand_msgfd_post[hIndex].func; retVal___ = postHookFunc(retVal___, fd, msg_number); @@ -2484,11 +2484,11 @@ const char* HP_atcommand_msgfd(int fd, int msg_number) { } return retVal___; } -const char* HP_atcommand_msgsd(struct map_session_data *sd, int msg_number) { +const char * HP_atcommand_msgsd(struct map_session_data *sd, int msg_number) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_atcommand_msgsd_pre > 0) { - const char* (*preHookFunc) (struct map_session_data **sd, int *msg_number); + const char * (*preHookFunc) (struct map_session_data **sd, int *msg_number); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgsd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_atcommand_msgsd_pre[hIndex].func; @@ -2503,7 +2503,7 @@ const char* HP_atcommand_msgsd(struct map_session_data *sd, int msg_number) { retVal___ = HPMHooks.source.atcommand.msgsd(sd, msg_number); } if (HPMHooks.count.HP_atcommand_msgsd_post > 0) { - const char* (*postHookFunc) (const char* retVal___, struct map_session_data *sd, int msg_number); + const char * (*postHookFunc) (const char * retVal___, struct map_session_data *sd, int msg_number); for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgsd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_atcommand_msgsd_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, msg_number); @@ -3182,11 +3182,11 @@ int64 HP_battle_calc_defense(int attack_type, struct block_list *src, struct blo } return retVal___; } -struct block_list* HP_battle_get_master(struct block_list *src) { +struct block_list * HP_battle_get_master(struct block_list *src) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_battle_get_master_pre > 0) { - struct block_list* (*preHookFunc) (struct block_list **src); + struct block_list * (*preHookFunc) (struct block_list **src); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_master_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_battle_get_master_pre[hIndex].func; @@ -3201,7 +3201,7 @@ struct block_list* HP_battle_get_master(struct block_list *src) { retVal___ = HPMHooks.source.battle.get_master(src); } if (HPMHooks.count.HP_battle_get_master_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct block_list *src); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct block_list *src); for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_master_post; hIndex++) { postHookFunc = HPMHooks.list.HP_battle_get_master_post[hIndex].func; retVal___ = postHookFunc(retVal___, src); @@ -3209,11 +3209,11 @@ struct block_list* HP_battle_get_master(struct block_list *src) { } return retVal___; } -struct block_list* HP_battle_get_targeted(struct block_list *target) { +struct block_list * HP_battle_get_targeted(struct block_list *target) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_battle_get_targeted_pre > 0) { - struct block_list* (*preHookFunc) (struct block_list **target); + struct block_list * (*preHookFunc) (struct block_list **target); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_targeted_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_battle_get_targeted_pre[hIndex].func; @@ -3228,7 +3228,7 @@ struct block_list* HP_battle_get_targeted(struct block_list *target) { retVal___ = HPMHooks.source.battle.get_targeted(target); } if (HPMHooks.count.HP_battle_get_targeted_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct block_list *target); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct block_list *target); for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_targeted_post; hIndex++) { postHookFunc = HPMHooks.list.HP_battle_get_targeted_post[hIndex].func; retVal___ = postHookFunc(retVal___, target); @@ -3236,11 +3236,11 @@ struct block_list* HP_battle_get_targeted(struct block_list *target) { } return retVal___; } -struct block_list* HP_battle_get_enemy(struct block_list *target, int type, int range) { +struct block_list * HP_battle_get_enemy(struct block_list *target, int type, int range) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_battle_get_enemy_pre > 0) { - struct block_list* (*preHookFunc) (struct block_list **target, int *type, int *range); + struct block_list * (*preHookFunc) (struct block_list **target, int *type, int *range); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_battle_get_enemy_pre[hIndex].func; @@ -3255,7 +3255,7 @@ struct block_list* HP_battle_get_enemy(struct block_list *target, int type, int retVal___ = HPMHooks.source.battle.get_enemy(target, type, range); } if (HPMHooks.count.HP_battle_get_enemy_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct block_list *target, int type, int range); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct block_list *target, int type, int range); for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_post; hIndex++) { postHookFunc = HPMHooks.list.HP_battle_get_enemy_post[hIndex].func; retVal___ = postHookFunc(retVal___, target, type, range); @@ -3953,11 +3953,11 @@ void HP_battle_config_adjust(void) { } return; } -struct block_list* HP_battle_get_enemy_area(struct block_list *src, int x, int y, int range, int type, int ignore_id) { +struct block_list * HP_battle_get_enemy_area(struct block_list *src, int x, int y, int range, int type, int ignore_id) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_battle_get_enemy_area_pre > 0) { - struct block_list* (*preHookFunc) (struct block_list **src, int *x, int *y, int *range, int *type, int *ignore_id); + struct block_list * (*preHookFunc) (struct block_list **src, int *x, int *y, int *range, int *type, int *ignore_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_area_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_battle_get_enemy_area_pre[hIndex].func; @@ -3972,7 +3972,7 @@ struct block_list* HP_battle_get_enemy_area(struct block_list *src, int x, int y retVal___ = HPMHooks.source.battle.get_enemy_area(src, x, y, range, type, ignore_id); } if (HPMHooks.count.HP_battle_get_enemy_area_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct block_list *src, int x, int y, int range, int type, int ignore_id); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct block_list *src, int x, int y, int range, int type, int ignore_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_area_post; hIndex++) { postHookFunc = HPMHooks.list.HP_battle_get_enemy_area_post[hIndex].func; retVal___ = postHookFunc(retVal___, src, x, y, range, type, ignore_id); @@ -4170,11 +4170,11 @@ void HP_bg_final(void) { } return; } -struct bg_arena* HP_bg_name2arena(const char *name) { +struct bg_arena * HP_bg_name2arena(const char *name) { int hIndex = 0; - struct bg_arena* retVal___ = NULL; + struct bg_arena * retVal___ = NULL; if (HPMHooks.count.HP_bg_name2arena_pre > 0) { - struct bg_arena* (*preHookFunc) (const char **name); + struct bg_arena * (*preHookFunc) (const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_name2arena_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_bg_name2arena_pre[hIndex].func; @@ -4189,7 +4189,7 @@ struct bg_arena* HP_bg_name2arena(const char *name) { retVal___ = HPMHooks.source.bg.name2arena(name); } if (HPMHooks.count.HP_bg_name2arena_post > 0) { - struct bg_arena* (*postHookFunc) (struct bg_arena* retVal___, const char *name); + struct bg_arena * (*postHookFunc) (struct bg_arena * retVal___, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_name2arena_post; hIndex++) { postHookFunc = HPMHooks.list.HP_bg_name2arena_post[hIndex].func; retVal___ = postHookFunc(retVal___, name); @@ -4487,11 +4487,11 @@ void HP_bg_queue_check(struct bg_arena *arena) { } return; } -struct battleground_data* HP_bg_team_search(int bg_id) { +struct battleground_data * HP_bg_team_search(int bg_id) { int hIndex = 0; - struct battleground_data* retVal___ = NULL; + struct battleground_data * retVal___ = NULL; if (HPMHooks.count.HP_bg_team_search_pre > 0) { - struct battleground_data* (*preHookFunc) (int *bg_id); + struct battleground_data * (*preHookFunc) (int *bg_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_search_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_bg_team_search_pre[hIndex].func; @@ -4506,7 +4506,7 @@ struct battleground_data* HP_bg_team_search(int bg_id) { retVal___ = HPMHooks.source.bg.team_search(bg_id); } if (HPMHooks.count.HP_bg_team_search_post > 0) { - struct battleground_data* (*postHookFunc) (struct battleground_data* retVal___, int bg_id); + struct battleground_data * (*postHookFunc) (struct battleground_data * retVal___, int bg_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_search_post; hIndex++) { postHookFunc = HPMHooks.list.HP_bg_team_search_post[hIndex].func; retVal___ = postHookFunc(retVal___, bg_id); @@ -4514,11 +4514,11 @@ struct battleground_data* HP_bg_team_search(int bg_id) { } return retVal___; } -struct map_session_data* HP_bg_getavailablesd(struct battleground_data *bgd) { +struct map_session_data * HP_bg_getavailablesd(struct battleground_data *bgd) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_bg_getavailablesd_pre > 0) { - struct map_session_data* (*preHookFunc) (struct battleground_data **bgd); + struct map_session_data * (*preHookFunc) (struct battleground_data **bgd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_getavailablesd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_bg_getavailablesd_pre[hIndex].func; @@ -4533,7 +4533,7 @@ struct map_session_data* HP_bg_getavailablesd(struct battleground_data *bgd) { retVal___ = HPMHooks.source.bg.getavailablesd(bgd); } if (HPMHooks.count.HP_bg_getavailablesd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct battleground_data *bgd); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct battleground_data *bgd); for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_getavailablesd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_bg_getavailablesd_post[hIndex].func; retVal___ = postHookFunc(retVal___, bgd); @@ -5223,11 +5223,11 @@ void HP_channel_final(void) { } return; } -struct channel_data* HP_channel_search(const char *name, struct map_session_data *sd) { +struct channel_data * HP_channel_search(const char *name, struct map_session_data *sd) { int hIndex = 0; - struct channel_data* retVal___ = NULL; + struct channel_data * retVal___ = NULL; if (HPMHooks.count.HP_channel_search_pre > 0) { - struct channel_data* (*preHookFunc) (const char **name, struct map_session_data **sd); + struct channel_data * (*preHookFunc) (const char **name, struct map_session_data **sd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_search_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_channel_search_pre[hIndex].func; @@ -5242,7 +5242,7 @@ struct channel_data* HP_channel_search(const char *name, struct map_session_data retVal___ = HPMHooks.source.channel.search(name, sd); } if (HPMHooks.count.HP_channel_search_post > 0) { - struct channel_data* (*postHookFunc) (struct channel_data* retVal___, const char *name, struct map_session_data *sd); + struct channel_data * (*postHookFunc) (struct channel_data * retVal___, const char *name, struct map_session_data *sd); for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_search_post; hIndex++) { postHookFunc = HPMHooks.list.HP_channel_search_post[hIndex].func; retVal___ = postHookFunc(retVal___, name, sd); @@ -5250,11 +5250,11 @@ struct channel_data* HP_channel_search(const char *name, struct map_session_data } return retVal___; } -struct channel_data* HP_channel_create(enum channel_types type, const char *name, unsigned char color) { +struct channel_data * HP_channel_create(enum channel_types type, const char *name, unsigned char color) { int hIndex = 0; - struct channel_data* retVal___ = NULL; + struct channel_data * retVal___ = NULL; if (HPMHooks.count.HP_channel_create_pre > 0) { - struct channel_data* (*preHookFunc) (enum channel_types *type, const char **name, unsigned char *color); + struct channel_data * (*preHookFunc) (enum channel_types *type, const char **name, unsigned char *color); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_channel_create_pre[hIndex].func; @@ -5269,7 +5269,7 @@ struct channel_data* HP_channel_create(enum channel_types type, const char *name retVal___ = HPMHooks.source.channel.create(type, name, color); } if (HPMHooks.count.HP_channel_create_post > 0) { - struct channel_data* (*postHookFunc) (struct channel_data* retVal___, enum channel_types type, const char *name, unsigned char color); + struct channel_data * (*postHookFunc) (struct channel_data * retVal___, enum channel_types type, const char *name, unsigned char color); for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_channel_create_post[hIndex].func; retVal___ = postHookFunc(retVal___, type, name, color); @@ -6047,11 +6047,11 @@ bool HP_chat_trigger_event(struct chat_data *cd) { } return retVal___; } -struct chat_data* HP_chat_create(struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level) { +struct chat_data * HP_chat_create(struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level) { int hIndex = 0; - struct chat_data* retVal___ = NULL; + struct chat_data * retVal___ = NULL; if (HPMHooks.count.HP_chat_create_pre > 0) { - struct chat_data* (*preHookFunc) (struct block_list **bl, const char **title, const char **pass, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level); + struct chat_data * (*preHookFunc) (struct block_list **bl, const char **title, const char **pass, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_chat_create_pre[hIndex].func; @@ -6066,7 +6066,7 @@ struct chat_data* HP_chat_create(struct block_list *bl, const char *title, const retVal___ = HPMHooks.source.chat.create(bl, title, pass, limit, pub, trigger, ev, zeny, min_level, max_level); } if (HPMHooks.count.HP_chat_create_post > 0) { - struct chat_data* (*postHookFunc) (struct chat_data* retVal___, struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level); + struct chat_data * (*postHookFunc) (struct chat_data * retVal___, struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level); for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_chat_create_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl, title, pass, limit, pub, trigger, ev, zeny, min_level, max_level); @@ -6311,11 +6311,11 @@ void HP_chrif_check_shutdown(void) { } return; } -struct auth_node* HP_chrif_search(int account_id) { +struct auth_node * HP_chrif_search(int account_id) { int hIndex = 0; - struct auth_node* retVal___ = NULL; + struct auth_node * retVal___ = NULL; if (HPMHooks.count.HP_chrif_search_pre > 0) { - struct auth_node* (*preHookFunc) (int *account_id); + struct auth_node * (*preHookFunc) (int *account_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_search_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_chrif_search_pre[hIndex].func; @@ -6330,7 +6330,7 @@ struct auth_node* HP_chrif_search(int account_id) { retVal___ = HPMHooks.source.chrif.search(account_id); } if (HPMHooks.count.HP_chrif_search_post > 0) { - struct auth_node* (*postHookFunc) (struct auth_node* retVal___, int account_id); + struct auth_node * (*postHookFunc) (struct auth_node * retVal___, int account_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_search_post; hIndex++) { postHookFunc = HPMHooks.list.HP_chrif_search_post[hIndex].func; retVal___ = postHookFunc(retVal___, account_id); @@ -6338,11 +6338,11 @@ struct auth_node* HP_chrif_search(int account_id) { } return retVal___; } -struct auth_node* HP_chrif_auth_check(int account_id, int char_id, enum sd_state state) { +struct auth_node * HP_chrif_auth_check(int account_id, int char_id, enum sd_state state) { int hIndex = 0; - struct auth_node* retVal___ = NULL; + struct auth_node * retVal___ = NULL; if (HPMHooks.count.HP_chrif_auth_check_pre > 0) { - struct auth_node* (*preHookFunc) (int *account_id, int *char_id, enum sd_state *state); + struct auth_node * (*preHookFunc) (int *account_id, int *char_id, enum sd_state *state); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_check_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_chrif_auth_check_pre[hIndex].func; @@ -6357,7 +6357,7 @@ struct auth_node* HP_chrif_auth_check(int account_id, int char_id, enum sd_state retVal___ = HPMHooks.source.chrif.auth_check(account_id, char_id, state); } if (HPMHooks.count.HP_chrif_auth_check_post > 0) { - struct auth_node* (*postHookFunc) (struct auth_node* retVal___, int account_id, int char_id, enum sd_state state); + struct auth_node * (*postHookFunc) (struct auth_node * retVal___, int account_id, int char_id, enum sd_state state); for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_check_post; hIndex++) { postHookFunc = HPMHooks.list.HP_chrif_auth_check_post[hIndex].func; retVal___ = postHookFunc(retVal___, account_id, char_id, state); @@ -8138,11 +8138,11 @@ void HP_clan_read_buffs(struct clan *c, struct config_setting_t *buff, const cha } return; } -struct clan* HP_clan_search(int clan_id) { +struct clan * HP_clan_search(int clan_id) { int hIndex = 0; - struct clan* retVal___ = NULL; + struct clan * retVal___ = NULL; if (HPMHooks.count.HP_clan_search_pre > 0) { - struct clan* (*preHookFunc) (int *clan_id); + struct clan * (*preHookFunc) (int *clan_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_search_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clan_search_pre[hIndex].func; @@ -8157,7 +8157,7 @@ struct clan* HP_clan_search(int clan_id) { retVal___ = HPMHooks.source.clan.search(clan_id); } if (HPMHooks.count.HP_clan_search_post > 0) { - struct clan* (*postHookFunc) (struct clan* retVal___, int clan_id); + struct clan * (*postHookFunc) (struct clan * retVal___, int clan_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_search_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clan_search_post[hIndex].func; retVal___ = postHookFunc(retVal___, clan_id); @@ -8165,11 +8165,11 @@ struct clan* HP_clan_search(int clan_id) { } return retVal___; } -struct clan* HP_clan_searchname(const char *name) { +struct clan * HP_clan_searchname(const char *name) { int hIndex = 0; - struct clan* retVal___ = NULL; + struct clan * retVal___ = NULL; if (HPMHooks.count.HP_clan_searchname_pre > 0) { - struct clan* (*preHookFunc) (const char **name); + struct clan * (*preHookFunc) (const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_searchname_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clan_searchname_pre[hIndex].func; @@ -8184,7 +8184,7 @@ struct clan* HP_clan_searchname(const char *name) { retVal___ = HPMHooks.source.clan.searchname(name); } if (HPMHooks.count.HP_clan_searchname_post > 0) { - struct clan* (*postHookFunc) (struct clan* retVal___, const char *name); + struct clan * (*postHookFunc) (struct clan * retVal___, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_searchname_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clan_searchname_post[hIndex].func; retVal___ = postHookFunc(retVal___, name); @@ -8192,11 +8192,11 @@ struct clan* HP_clan_searchname(const char *name) { } return retVal___; } -struct map_session_data* HP_clan_getonlinesd(struct clan *c) { +struct map_session_data * HP_clan_getonlinesd(struct clan *c) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_clan_getonlinesd_pre > 0) { - struct map_session_data* (*preHookFunc) (struct clan **c); + struct map_session_data * (*preHookFunc) (struct clan **c); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_getonlinesd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clan_getonlinesd_pre[hIndex].func; @@ -8211,7 +8211,7 @@ struct map_session_data* HP_clan_getonlinesd(struct clan *c) { retVal___ = HPMHooks.source.clan.getonlinesd(c); } if (HPMHooks.count.HP_clan_getonlinesd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct clan *c); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct clan *c); for (hIndex = 0; hIndex < HPMHooks.count.HP_clan_getonlinesd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clan_getonlinesd_post[hIndex].func; retVal___ = postHookFunc(retVal___, c); @@ -8925,11 +8925,11 @@ int HP_clif_parse(int fd) { } return retVal___; } -const struct s_packet_db* HP_clif_packet(int packet_id) { +const struct s_packet_db * HP_clif_packet(int packet_id) { int hIndex = 0; - const struct s_packet_db* retVal___ = NULL; + const struct s_packet_db * retVal___ = NULL; if (HPMHooks.count.HP_clif_packet_pre > 0) { - const struct s_packet_db* (*preHookFunc) (int *packet_id); + const struct s_packet_db * (*preHookFunc) (int *packet_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_packet_pre[hIndex].func; @@ -8944,7 +8944,7 @@ const struct s_packet_db* HP_clif_packet(int packet_id) { retVal___ = HPMHooks.source.clif.packet(packet_id); } if (HPMHooks.count.HP_clif_packet_post > 0) { - const struct s_packet_db* (*postHookFunc) (const struct s_packet_db* retVal___, int packet_id); + const struct s_packet_db * (*postHookFunc) (const struct s_packet_db * retVal___, int packet_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_packet_post[hIndex].func; retVal___ = postHookFunc(retVal___, packet_id); @@ -15601,14 +15601,14 @@ void HP_clif_playBGM(struct map_session_data *sd, const char *name, enum play_np } return; } -void HP_clif_soundeffect(struct map_session_data *sd, struct block_list *bl, const char *name, int type) { +void HP_clif_soundeffect(struct map_session_data *sd, struct block_list *bl, const char *name, enum play_sound_act type, int term) { int hIndex = 0; if (HPMHooks.count.HP_clif_soundeffect_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, struct block_list **bl, const char **name, int *type); + void (*preHookFunc) (struct map_session_data **sd, struct block_list **bl, const char **name, enum play_sound_act *type, int *term); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffect_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_soundeffect_pre[hIndex].func; - preHookFunc(&sd, &bl, &name, &type); + preHookFunc(&sd, &bl, &name, &type, &term); } if (*HPMforce_return) { *HPMforce_return = false; @@ -15616,25 +15616,25 @@ void HP_clif_soundeffect(struct map_session_data *sd, struct block_list *bl, con } } { - HPMHooks.source.clif.soundeffect(sd, bl, name, type); + HPMHooks.source.clif.soundeffect(sd, bl, name, type, term); } if (HPMHooks.count.HP_clif_soundeffect_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, struct block_list *bl, const char *name, int type); + void (*postHookFunc) (struct map_session_data *sd, struct block_list *bl, const char *name, enum play_sound_act type, int term); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffect_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_soundeffect_post[hIndex].func; - postHookFunc(sd, bl, name, type); + postHookFunc(sd, bl, name, type, term); } } return; } -void HP_clif_soundeffectall(struct block_list *bl, const char *name, int type, enum send_target coverage) { +void HP_clif_soundeffectall(struct block_list *bl, const char *name, enum play_sound_act type, int term, enum send_target coverage) { int hIndex = 0; if (HPMHooks.count.HP_clif_soundeffectall_pre > 0) { - void (*preHookFunc) (struct block_list **bl, const char **name, int *type, enum send_target *coverage); + void (*preHookFunc) (struct block_list **bl, const char **name, enum play_sound_act *type, int *term, enum send_target *coverage); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffectall_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_soundeffectall_pre[hIndex].func; - preHookFunc(&bl, &name, &type, &coverage); + preHookFunc(&bl, &name, &type, &term, &coverage); } if (*HPMforce_return) { *HPMforce_return = false; @@ -15642,13 +15642,13 @@ void HP_clif_soundeffectall(struct block_list *bl, const char *name, int type, e } } { - HPMHooks.source.clif.soundeffectall(bl, name, type, coverage); + HPMHooks.source.clif.soundeffectall(bl, name, type, term, coverage); } if (HPMHooks.count.HP_clif_soundeffectall_post > 0) { - void (*postHookFunc) (struct block_list *bl, const char *name, int type, enum send_target coverage); + void (*postHookFunc) (struct block_list *bl, const char *name, enum play_sound_act type, int term, enum send_target coverage); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffectall_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_soundeffectall_post[hIndex].func; - postHookFunc(bl, name, type, coverage); + postHookFunc(bl, name, type, term, coverage); } } return; @@ -16407,11 +16407,11 @@ void HP_clif_messageln(const int fd, const char *mes) { } return; } -const char* HP_clif_process_chat_message(struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen) { +const char * HP_clif_process_chat_message(struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_clif_process_chat_message_pre > 0) { - const char* (*preHookFunc) (struct map_session_data **sd, const struct packet_chat_message **packet, char **out_buf, int *out_buflen); + const char * (*preHookFunc) (struct map_session_data **sd, const struct packet_chat_message **packet, char **out_buf, int *out_buflen); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_process_chat_message_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_process_chat_message_pre[hIndex].func; @@ -16426,7 +16426,7 @@ const char* HP_clif_process_chat_message(struct map_session_data *sd, const stru retVal___ = HPMHooks.source.clif.process_chat_message(sd, packet, out_buf, out_buflen); } if (HPMHooks.count.HP_clif_process_chat_message_post > 0) { - const char* (*postHookFunc) (const char* retVal___, struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen); + const char * (*postHookFunc) (const char * retVal___, struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_process_chat_message_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_process_chat_message_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, packet, out_buf, out_buflen); @@ -28724,11 +28724,11 @@ void HP_clif_pSelectCart(int fd, struct map_session_data *sd) { } return; } -const char* HP_clif_get_bl_name(const struct block_list *bl) { +const char * HP_clif_get_bl_name(const struct block_list *bl) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_clif_get_bl_name_pre > 0) { - const char* (*preHookFunc) (const struct block_list **bl); + const char * (*preHookFunc) (const struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_get_bl_name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_get_bl_name_pre[hIndex].func; @@ -28743,7 +28743,7 @@ const char* HP_clif_get_bl_name(const struct block_list *bl) { retVal___ = HPMHooks.source.clif.get_bl_name(bl); } if (HPMHooks.count.HP_clif_get_bl_name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const struct block_list *bl); + const char * (*postHookFunc) (const char * retVal___, const struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_get_bl_name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_get_bl_name_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); @@ -32340,11 +32340,11 @@ bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) { } return retVal___; } -const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) { +const char * HP_cmdline_arg_source(struct CmdlineArgData *arg) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_cmdline_arg_source_pre > 0) { - const char* (*preHookFunc) (struct CmdlineArgData **arg); + const char * (*preHookFunc) (struct CmdlineArgData **arg); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_cmdline_arg_source_pre[hIndex].func; @@ -32359,7 +32359,7 @@ const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) { retVal___ = HPMHooks.source.cmdline.arg_source(arg); } if (HPMHooks.count.HP_cmdline_arg_source_post > 0) { - const char* (*postHookFunc) (const char* retVal___, struct CmdlineArgData *arg); + const char * (*postHookFunc) (const char * retVal___, struct CmdlineArgData *arg); for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++) { postHookFunc = HPMHooks.list.HP_cmdline_arg_source_post[hIndex].func; retVal___ = postHookFunc(retVal___, arg); @@ -32635,11 +32635,11 @@ DBReleaser HP_DB_custom_release(enum DBReleaseOption which) { } return retVal___; } -struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) { +struct DBMap * HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) { int hIndex = 0; - struct DBMap* retVal___ = NULL; + struct DBMap * retVal___ = NULL; if (HPMHooks.count.HP_DB_alloc_pre > 0) { - struct DBMap* (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen); + struct DBMap * (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_DB_alloc_pre[hIndex].func; @@ -32654,7 +32654,7 @@ struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBT retVal___ = HPMHooks.source.DB.alloc(file, func, line, type, options, maxlen); } if (HPMHooks.count.HP_DB_alloc_post > 0) { - struct DBMap* (*postHookFunc) (struct DBMap* retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen); + struct DBMap * (*postHookFunc) (struct DBMap * retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen); for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_DB_alloc_post[hIndex].func; retVal___ = postHookFunc(retVal___, file, func, line, type, options, maxlen); @@ -32932,11 +32932,11 @@ unsigned int HP_DB_data2ui(struct DBData *data) { } return retVal___; } -void* HP_DB_data2ptr(struct DBData *data) { +void * HP_DB_data2ptr(struct DBData *data) { int hIndex = 0; - void* retVal___ = NULL; + void * retVal___ = NULL; if (HPMHooks.count.HP_DB_data2ptr_pre > 0) { - void* (*preHookFunc) (struct DBData **data); + void * (*preHookFunc) (struct DBData **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_DB_data2ptr_pre[hIndex].func; @@ -32951,7 +32951,7 @@ void* HP_DB_data2ptr(struct DBData *data) { retVal___ = HPMHooks.source.DB.data2ptr(data); } if (HPMHooks.count.HP_DB_data2ptr_post > 0) { - void* (*postHookFunc) (void* retVal___, struct DBData *data); + void * (*postHookFunc) (void * retVal___, struct DBData *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++) { postHookFunc = HPMHooks.list.HP_DB_data2ptr_post[hIndex].func; retVal___ = postHookFunc(retVal___, data); @@ -33382,11 +33382,11 @@ bool HP_elemental_class(int class_) { } return retVal___; } -struct view_data* HP_elemental_get_viewdata(int class_) { +struct view_data * HP_elemental_get_viewdata(int class_) { int hIndex = 0; - struct view_data* retVal___ = NULL; + struct view_data * retVal___ = NULL; if (HPMHooks.count.HP_elemental_get_viewdata_pre > 0) { - struct view_data* (*preHookFunc) (int *class_); + struct view_data * (*preHookFunc) (int *class_); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_get_viewdata_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_elemental_get_viewdata_pre[hIndex].func; @@ -33401,7 +33401,7 @@ struct view_data* HP_elemental_get_viewdata(int class_) { retVal___ = HPMHooks.source.elemental.get_viewdata(class_); } if (HPMHooks.count.HP_elemental_get_viewdata_post > 0) { - struct view_data* (*postHookFunc) (struct view_data* retVal___, int class_); + struct view_data * (*postHookFunc) (struct view_data * retVal___, int class_); for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_get_viewdata_post; hIndex++) { postHookFunc = HPMHooks.list.HP_elemental_get_viewdata_post[hIndex].func; retVal___ = postHookFunc(retVal___, class_); @@ -34441,11 +34441,11 @@ bool HP_grader_announce_behavior_string2enum(const char *str, enum grade_announc } return retVal___; } -const struct s_grade_info* HP_grader_get_grade_info(int grade) { +const struct s_grade_info * HP_grader_get_grade_info(int grade) { int hIndex = 0; - const struct s_grade_info* retVal___ = NULL; + const struct s_grade_info * retVal___ = NULL; if (HPMHooks.count.HP_grader_get_grade_info_pre > 0) { - const struct s_grade_info* (*preHookFunc) (int *grade); + const struct s_grade_info * (*preHookFunc) (int *grade); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_grader_get_grade_info_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_grader_get_grade_info_pre[hIndex].func; @@ -34460,7 +34460,7 @@ const struct s_grade_info* HP_grader_get_grade_info(int grade) { retVal___ = HPMHooks.source.grader.get_grade_info(grade); } if (HPMHooks.count.HP_grader_get_grade_info_post > 0) { - const struct s_grade_info* (*postHookFunc) (const struct s_grade_info* retVal___, int grade); + const struct s_grade_info * (*postHookFunc) (const struct s_grade_info * retVal___, int grade); for (hIndex = 0; hIndex < HPMHooks.count.HP_grader_get_grade_info_post; hIndex++) { postHookFunc = HPMHooks.list.HP_grader_get_grade_info_post[hIndex].func; retVal___ = postHookFunc(retVal___, grade); @@ -34573,11 +34573,11 @@ void HP_grfio_final(void) { } return; } -void* HP_grfio_reads(const char *fname, int *size) { +void * HP_grfio_reads(const char *fname, int *size) { int hIndex = 0; - void* retVal___ = NULL; + void * retVal___ = NULL; if (HPMHooks.count.HP_grfio_reads_pre > 0) { - void* (*preHookFunc) (const char **fname, int **size); + void * (*preHookFunc) (const char **fname, int **size); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_reads_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_grfio_reads_pre[hIndex].func; @@ -34592,7 +34592,7 @@ void* HP_grfio_reads(const char *fname, int *size) { retVal___ = HPMHooks.source.grfio.reads(fname, size); } if (HPMHooks.count.HP_grfio_reads_post > 0) { - void* (*postHookFunc) (void* retVal___, const char *fname, int *size); + void * (*postHookFunc) (void * retVal___, const char *fname, int *size); for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_reads_post; hIndex++) { postHookFunc = HPMHooks.list.HP_grfio_reads_post[hIndex].func; retVal___ = postHookFunc(retVal___, fname, size); @@ -34600,11 +34600,11 @@ void* HP_grfio_reads(const char *fname, int *size) { } return retVal___; } -const char* HP_grfio_find_file(const char *fname) { +const char * HP_grfio_find_file(const char *fname) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_grfio_find_file_pre > 0) { - const char* (*preHookFunc) (const char **fname); + const char * (*preHookFunc) (const char **fname); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_find_file_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_grfio_find_file_pre[hIndex].func; @@ -34619,7 +34619,7 @@ const char* HP_grfio_find_file(const char *fname) { retVal___ = HPMHooks.source.grfio.find_file(fname); } if (HPMHooks.count.HP_grfio_find_file_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *fname); + const char * (*postHookFunc) (const char * retVal___, const char *fname); for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_find_file_post; hIndex++) { postHookFunc = HPMHooks.list.HP_grfio_find_file_post[hIndex].func; retVal___ = postHookFunc(retVal___, fname); @@ -34734,11 +34734,11 @@ void HP_grfio_report_error(int err) { } return; } -char* HP_grfio_decode_filename(unsigned char *buf, int len) { +char * HP_grfio_decode_filename(unsigned char *buf, int len) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_grfio_decode_filename_pre > 0) { - char* (*preHookFunc) (unsigned char **buf, int *len); + char * (*preHookFunc) (unsigned char **buf, int *len); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_decode_filename_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_grfio_decode_filename_pre[hIndex].func; @@ -34753,7 +34753,7 @@ char* HP_grfio_decode_filename(unsigned char *buf, int len) { retVal___ = HPMHooks.source.grfio.decode_filename(buf, len); } if (HPMHooks.count.HP_grfio_decode_filename_post > 0) { - char* (*postHookFunc) (char* retVal___, unsigned char *buf, int len); + char * (*postHookFunc) (char * retVal___, unsigned char *buf, int len); for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_decode_filename_post; hIndex++) { postHookFunc = HPMHooks.list.HP_grfio_decode_filename_post[hIndex].func; retVal___ = postHookFunc(retVal___, buf, len); @@ -34949,11 +34949,11 @@ bool HP_guild_isallied(int guild_id, int guild_id2) { } return retVal___; } -struct guild* HP_guild_search(int guild_id) { +struct guild * HP_guild_search(int guild_id) { int hIndex = 0; - struct guild* retVal___ = NULL; + struct guild * retVal___ = NULL; if (HPMHooks.count.HP_guild_search_pre > 0) { - struct guild* (*preHookFunc) (int *guild_id); + struct guild * (*preHookFunc) (int *guild_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_search_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_guild_search_pre[hIndex].func; @@ -34968,7 +34968,7 @@ struct guild* HP_guild_search(int guild_id) { retVal___ = HPMHooks.source.guild.search(guild_id); } if (HPMHooks.count.HP_guild_search_post > 0) { - struct guild* (*postHookFunc) (struct guild* retVal___, int guild_id); + struct guild * (*postHookFunc) (struct guild * retVal___, int guild_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_search_post; hIndex++) { postHookFunc = HPMHooks.list.HP_guild_search_post[hIndex].func; retVal___ = postHookFunc(retVal___, guild_id); @@ -34976,11 +34976,11 @@ struct guild* HP_guild_search(int guild_id) { } return retVal___; } -struct guild* HP_guild_searchname(const char *str) { +struct guild * HP_guild_searchname(const char *str) { int hIndex = 0; - struct guild* retVal___ = NULL; + struct guild * retVal___ = NULL; if (HPMHooks.count.HP_guild_searchname_pre > 0) { - struct guild* (*preHookFunc) (const char **str); + struct guild * (*preHookFunc) (const char **str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_searchname_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_guild_searchname_pre[hIndex].func; @@ -34995,7 +34995,7 @@ struct guild* HP_guild_searchname(const char *str) { retVal___ = HPMHooks.source.guild.searchname(str); } if (HPMHooks.count.HP_guild_searchname_post > 0) { - struct guild* (*postHookFunc) (struct guild* retVal___, const char *str); + struct guild * (*postHookFunc) (struct guild * retVal___, const char *str); for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_searchname_post; hIndex++) { postHookFunc = HPMHooks.list.HP_guild_searchname_post[hIndex].func; retVal___ = postHookFunc(retVal___, str); @@ -35003,11 +35003,11 @@ struct guild* HP_guild_searchname(const char *str) { } return retVal___; } -struct guild_castle* HP_guild_castle_search(int gcid) { +struct guild_castle * HP_guild_castle_search(int gcid) { int hIndex = 0; - struct guild_castle* retVal___ = NULL; + struct guild_castle * retVal___ = NULL; if (HPMHooks.count.HP_guild_castle_search_pre > 0) { - struct guild_castle* (*preHookFunc) (int *gcid); + struct guild_castle * (*preHookFunc) (int *gcid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_search_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_guild_castle_search_pre[hIndex].func; @@ -35022,7 +35022,7 @@ struct guild_castle* HP_guild_castle_search(int gcid) { retVal___ = HPMHooks.source.guild.castle_search(gcid); } if (HPMHooks.count.HP_guild_castle_search_post > 0) { - struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, int gcid); + struct guild_castle * (*postHookFunc) (struct guild_castle * retVal___, int gcid); for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_search_post; hIndex++) { postHookFunc = HPMHooks.list.HP_guild_castle_search_post[hIndex].func; retVal___ = postHookFunc(retVal___, gcid); @@ -35030,11 +35030,11 @@ struct guild_castle* HP_guild_castle_search(int gcid) { } return retVal___; } -struct guild_castle* HP_guild_mapname2gc(const char *mapname) { +struct guild_castle * HP_guild_mapname2gc(const char *mapname) { int hIndex = 0; - struct guild_castle* retVal___ = NULL; + struct guild_castle * retVal___ = NULL; if (HPMHooks.count.HP_guild_mapname2gc_pre > 0) { - struct guild_castle* (*preHookFunc) (const char **mapname); + struct guild_castle * (*preHookFunc) (const char **mapname); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapname2gc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_guild_mapname2gc_pre[hIndex].func; @@ -35049,7 +35049,7 @@ struct guild_castle* HP_guild_mapname2gc(const char *mapname) { retVal___ = HPMHooks.source.guild.mapname2gc(mapname); } if (HPMHooks.count.HP_guild_mapname2gc_post > 0) { - struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, const char *mapname); + struct guild_castle * (*postHookFunc) (struct guild_castle * retVal___, const char *mapname); for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapname2gc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_guild_mapname2gc_post[hIndex].func; retVal___ = postHookFunc(retVal___, mapname); @@ -35057,11 +35057,11 @@ struct guild_castle* HP_guild_mapname2gc(const char *mapname) { } return retVal___; } -struct guild_castle* HP_guild_mapindex2gc(short map_index) { +struct guild_castle * HP_guild_mapindex2gc(short map_index) { int hIndex = 0; - struct guild_castle* retVal___ = NULL; + struct guild_castle * retVal___ = NULL; if (HPMHooks.count.HP_guild_mapindex2gc_pre > 0) { - struct guild_castle* (*preHookFunc) (short *map_index); + struct guild_castle * (*preHookFunc) (short *map_index); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapindex2gc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_guild_mapindex2gc_pre[hIndex].func; @@ -35076,7 +35076,7 @@ struct guild_castle* HP_guild_mapindex2gc(short map_index) { retVal___ = HPMHooks.source.guild.mapindex2gc(map_index); } if (HPMHooks.count.HP_guild_mapindex2gc_post > 0) { - struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, short map_index); + struct guild_castle * (*postHookFunc) (struct guild_castle * retVal___, short map_index); for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapindex2gc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_guild_mapindex2gc_post[hIndex].func; retVal___ = postHookFunc(retVal___, map_index); @@ -35084,11 +35084,11 @@ struct guild_castle* HP_guild_mapindex2gc(short map_index) { } return retVal___; } -struct map_session_data* HP_guild_getavailablesd(struct guild *g) { +struct map_session_data * HP_guild_getavailablesd(struct guild *g) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_guild_getavailablesd_pre > 0) { - struct map_session_data* (*preHookFunc) (struct guild **g); + struct map_session_data * (*preHookFunc) (struct guild **g); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_getavailablesd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_guild_getavailablesd_pre[hIndex].func; @@ -35103,7 +35103,7 @@ struct map_session_data* HP_guild_getavailablesd(struct guild *g) { retVal___ = HPMHooks.source.guild.getavailablesd(g); } if (HPMHooks.count.HP_guild_getavailablesd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct guild *g); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct guild *g); for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_getavailablesd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_guild_getavailablesd_post[hIndex].func; retVal___ = postHookFunc(retVal___, g); @@ -36610,11 +36610,11 @@ int HP_guild_payexp_timer(int tid, int64 tick, int id, intptr_t data) { } return retVal___; } -struct map_session_data* HP_guild_sd_check(int guild_id, int account_id, int char_id) { +struct map_session_data * HP_guild_sd_check(int guild_id, int account_id, int char_id) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_guild_sd_check_pre > 0) { - struct map_session_data* (*preHookFunc) (int *guild_id, int *account_id, int *char_id); + struct map_session_data * (*preHookFunc) (int *guild_id, int *account_id, int *char_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_sd_check_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_guild_sd_check_pre[hIndex].func; @@ -36629,7 +36629,7 @@ struct map_session_data* HP_guild_sd_check(int guild_id, int account_id, int cha retVal___ = HPMHooks.source.guild.sd_check(guild_id, account_id, char_id); } if (HPMHooks.count.HP_guild_sd_check_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int guild_id, int account_id, int char_id); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, int guild_id, int account_id, int char_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_sd_check_post; hIndex++) { postHookFunc = HPMHooks.list.HP_guild_sd_check_post[hIndex].func; retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id); @@ -37182,11 +37182,11 @@ int HP_guild_castle_owner_change_foreach(struct map_session_data *sd, va_list ap return retVal___; } /* guild_storage_interface */ -struct guild_storage* HP_gstorage_ensure(int guild_id) { +struct guild_storage * HP_gstorage_ensure(int guild_id) { int hIndex = 0; - struct guild_storage* retVal___ = NULL; + struct guild_storage * retVal___ = NULL; if (HPMHooks.count.HP_gstorage_ensure_pre > 0) { - struct guild_storage* (*preHookFunc) (int *guild_id); + struct guild_storage * (*preHookFunc) (int *guild_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_ensure_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_gstorage_ensure_pre[hIndex].func; @@ -37201,7 +37201,7 @@ struct guild_storage* HP_gstorage_ensure(int guild_id) { retVal___ = HPMHooks.source.gstorage.ensure(guild_id); } if (HPMHooks.count.HP_gstorage_ensure_post > 0) { - struct guild_storage* (*postHookFunc) (struct guild_storage* retVal___, int guild_id); + struct guild_storage * (*postHookFunc) (struct guild_storage * retVal___, int guild_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_ensure_post; hIndex++) { postHookFunc = HPMHooks.list.HP_gstorage_ensure_post[hIndex].func; retVal___ = postHookFunc(retVal___, guild_id); @@ -37755,11 +37755,11 @@ void HP_homun_reload_skill(void) { } return; } -struct view_data* HP_homun_get_viewdata(int class_) { +struct view_data * HP_homun_get_viewdata(int class_) { int hIndex = 0; - struct view_data* retVal___ = NULL; + struct view_data * retVal___ = NULL; if (HPMHooks.count.HP_homun_get_viewdata_pre > 0) { - struct view_data* (*preHookFunc) (int *class_); + struct view_data * (*preHookFunc) (int *class_); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_get_viewdata_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_homun_get_viewdata_pre[hIndex].func; @@ -37774,7 +37774,7 @@ struct view_data* HP_homun_get_viewdata(int class_) { retVal___ = HPMHooks.source.homun.get_viewdata(class_); } if (HPMHooks.count.HP_homun_get_viewdata_post > 0) { - struct view_data* (*postHookFunc) (struct view_data* retVal___, int class_); + struct view_data * (*postHookFunc) (struct view_data * retVal___, int class_); for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_get_viewdata_post; hIndex++) { postHookFunc = HPMHooks.list.HP_homun_get_viewdata_post[hIndex].func; retVal___ = postHookFunc(retVal___, class_); @@ -43421,11 +43421,11 @@ void HP_ircbot_parse_source(char *source, char *nick, char *ident, char *host) { } return; } -struct irc_func* HP_ircbot_func_search(char *function_name) { +struct irc_func * HP_ircbot_func_search(char *function_name) { int hIndex = 0; - struct irc_func* retVal___ = NULL; + struct irc_func * retVal___ = NULL; if (HPMHooks.count.HP_ircbot_func_search_pre > 0) { - struct irc_func* (*preHookFunc) (char **function_name); + struct irc_func * (*preHookFunc) (char **function_name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_func_search_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_ircbot_func_search_pre[hIndex].func; @@ -43440,7 +43440,7 @@ struct irc_func* HP_ircbot_func_search(char *function_name) { retVal___ = HPMHooks.source.ircbot.func_search(function_name); } if (HPMHooks.count.HP_ircbot_func_search_post > 0) { - struct irc_func* (*postHookFunc) (struct irc_func* retVal___, char *function_name); + struct irc_func * (*postHookFunc) (struct irc_func * retVal___, char *function_name); for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_func_search_post; hIndex++) { postHookFunc = HPMHooks.list.HP_ircbot_func_search_post[hIndex].func; retVal___ = postHookFunc(retVal___, function_name); @@ -44052,11 +44052,11 @@ bool HP_itemdb_read_cached_packages(const char *config_filename) { } return retVal___; } -struct item_data* HP_itemdb_name2id(const char *str) { +struct item_data * HP_itemdb_name2id(const char *str) { int hIndex = 0; - struct item_data* retVal___ = NULL; + struct item_data * retVal___ = NULL; if (HPMHooks.count.HP_itemdb_name2id_pre > 0) { - struct item_data* (*preHookFunc) (const char **str); + struct item_data * (*preHookFunc) (const char **str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_name2id_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_itemdb_name2id_pre[hIndex].func; @@ -44071,7 +44071,7 @@ struct item_data* HP_itemdb_name2id(const char *str) { retVal___ = HPMHooks.source.itemdb.name2id(str); } if (HPMHooks.count.HP_itemdb_name2id_post > 0) { - struct item_data* (*postHookFunc) (struct item_data* retVal___, const char *str); + struct item_data * (*postHookFunc) (struct item_data * retVal___, const char *str); for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_name2id_post; hIndex++) { postHookFunc = HPMHooks.list.HP_itemdb_name2id_post[hIndex].func; retVal___ = postHookFunc(retVal___, str); @@ -44079,11 +44079,11 @@ struct item_data* HP_itemdb_name2id(const char *str) { } return retVal___; } -struct item_data* HP_itemdb_search_name(const char *name) { +struct item_data * HP_itemdb_search_name(const char *name) { int hIndex = 0; - struct item_data* retVal___ = NULL; + struct item_data * retVal___ = NULL; if (HPMHooks.count.HP_itemdb_search_name_pre > 0) { - struct item_data* (*preHookFunc) (const char **name); + struct item_data * (*preHookFunc) (const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_itemdb_search_name_pre[hIndex].func; @@ -44098,7 +44098,7 @@ struct item_data* HP_itemdb_search_name(const char *name) { retVal___ = HPMHooks.source.itemdb.search_name(name); } if (HPMHooks.count.HP_itemdb_search_name_post > 0) { - struct item_data* (*postHookFunc) (struct item_data* retVal___, const char *name); + struct item_data * (*postHookFunc) (struct item_data * retVal___, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_itemdb_search_name_post[hIndex].func; retVal___ = postHookFunc(retVal___, name); @@ -44133,11 +44133,11 @@ int HP_itemdb_search_name_array(struct item_data **data, const int size, const c } return retVal___; } -struct item_data* HP_itemdb_load(int nameid) { +struct item_data * HP_itemdb_load(int nameid) { int hIndex = 0; - struct item_data* retVal___ = NULL; + struct item_data * retVal___ = NULL; if (HPMHooks.count.HP_itemdb_load_pre > 0) { - struct item_data* (*preHookFunc) (int *nameid); + struct item_data * (*preHookFunc) (int *nameid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_load_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_itemdb_load_pre[hIndex].func; @@ -44152,7 +44152,7 @@ struct item_data* HP_itemdb_load(int nameid) { retVal___ = HPMHooks.source.itemdb.load(nameid); } if (HPMHooks.count.HP_itemdb_load_post > 0) { - struct item_data* (*postHookFunc) (struct item_data* retVal___, int nameid); + struct item_data * (*postHookFunc) (struct item_data * retVal___, int nameid); for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_load_post; hIndex++) { postHookFunc = HPMHooks.list.HP_itemdb_load_post[hIndex].func; retVal___ = postHookFunc(retVal___, nameid); @@ -44160,11 +44160,11 @@ struct item_data* HP_itemdb_load(int nameid) { } return retVal___; } -struct item_data* HP_itemdb_search(int nameid) { +struct item_data * HP_itemdb_search(int nameid) { int hIndex = 0; - struct item_data* retVal___ = NULL; + struct item_data * retVal___ = NULL; if (HPMHooks.count.HP_itemdb_search_pre > 0) { - struct item_data* (*preHookFunc) (int *nameid); + struct item_data * (*preHookFunc) (int *nameid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_itemdb_search_pre[hIndex].func; @@ -44179,7 +44179,7 @@ struct item_data* HP_itemdb_search(int nameid) { retVal___ = HPMHooks.source.itemdb.search(nameid); } if (HPMHooks.count.HP_itemdb_search_post > 0) { - struct item_data* (*postHookFunc) (struct item_data* retVal___, int nameid); + struct item_data * (*postHookFunc) (struct item_data * retVal___, int nameid); for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_post; hIndex++) { postHookFunc = HPMHooks.list.HP_itemdb_search_post[hIndex].func; retVal___ = postHookFunc(retVal___, nameid); @@ -44187,11 +44187,11 @@ struct item_data* HP_itemdb_search(int nameid) { } return retVal___; } -struct item_data* HP_itemdb_exists(int nameid) { +struct item_data * HP_itemdb_exists(int nameid) { int hIndex = 0; - struct item_data* retVal___ = NULL; + struct item_data * retVal___ = NULL; if (HPMHooks.count.HP_itemdb_exists_pre > 0) { - struct item_data* (*preHookFunc) (int *nameid); + struct item_data * (*preHookFunc) (int *nameid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_exists_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_itemdb_exists_pre[hIndex].func; @@ -44206,7 +44206,7 @@ struct item_data* HP_itemdb_exists(int nameid) { retVal___ = HPMHooks.source.itemdb.exists(nameid); } if (HPMHooks.count.HP_itemdb_exists_post > 0) { - struct item_data* (*postHookFunc) (struct item_data* retVal___, int nameid); + struct item_data * (*postHookFunc) (struct item_data * retVal___, int nameid); for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_exists_post; hIndex++) { postHookFunc = HPMHooks.list.HP_itemdb_exists_post[hIndex].func; retVal___ = postHookFunc(retVal___, nameid); @@ -44214,11 +44214,11 @@ struct item_data* HP_itemdb_exists(int nameid) { } return retVal___; } -struct itemdb_option* HP_itemdb_option_exists(int idx) { +struct itemdb_option * HP_itemdb_option_exists(int idx) { int hIndex = 0; - struct itemdb_option* retVal___ = NULL; + struct itemdb_option * retVal___ = NULL; if (HPMHooks.count.HP_itemdb_option_exists_pre > 0) { - struct itemdb_option* (*preHookFunc) (int *idx); + struct itemdb_option * (*preHookFunc) (int *idx); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_option_exists_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_itemdb_option_exists_pre[hIndex].func; @@ -44233,7 +44233,7 @@ struct itemdb_option* HP_itemdb_option_exists(int idx) { retVal___ = HPMHooks.source.itemdb.option_exists(idx); } if (HPMHooks.count.HP_itemdb_option_exists_post > 0) { - struct itemdb_option* (*postHookFunc) (struct itemdb_option* retVal___, int idx); + struct itemdb_option * (*postHookFunc) (struct itemdb_option * retVal___, int idx); for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_option_exists_post; hIndex++) { postHookFunc = HPMHooks.list.HP_itemdb_option_exists_post[hIndex].func; retVal___ = postHookFunc(retVal___, idx); @@ -44441,11 +44441,11 @@ int HP_itemdb_searchrandomid(struct item_group *group) { } return retVal___; } -const char* HP_itemdb_typename(enum item_types type) { +const char * HP_itemdb_typename(enum item_types type) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_itemdb_typename_pre > 0) { - const char* (*preHookFunc) (enum item_types *type); + const char * (*preHookFunc) (enum item_types *type); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_typename_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_itemdb_typename_pre[hIndex].func; @@ -44460,7 +44460,7 @@ const char* HP_itemdb_typename(enum item_types type) { retVal___ = HPMHooks.source.itemdb.typename(type); } if (HPMHooks.count.HP_itemdb_typename_post > 0) { - const char* (*postHookFunc) (const char* retVal___, enum item_types type); + const char * (*postHookFunc) (const char * retVal___, enum item_types type); for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_typename_post; hIndex++) { postHookFunc = HPMHooks.list.HP_itemdb_typename_post[hIndex].func; retVal___ = postHookFunc(retVal___, type); @@ -44546,11 +44546,11 @@ void HP_itemdb_create_dummy_data(void) { } return; } -struct item_data* HP_itemdb_create_item_data(int nameid) { +struct item_data * HP_itemdb_create_item_data(int nameid) { int hIndex = 0; - struct item_data* retVal___ = NULL; + struct item_data * retVal___ = NULL; if (HPMHooks.count.HP_itemdb_create_item_data_pre > 0) { - struct item_data* (*preHookFunc) (int *nameid); + struct item_data * (*preHookFunc) (int *nameid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_create_item_data_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_itemdb_create_item_data_pre[hIndex].func; @@ -44565,7 +44565,7 @@ struct item_data* HP_itemdb_create_item_data(int nameid) { retVal___ = HPMHooks.source.itemdb.create_item_data(nameid); } if (HPMHooks.count.HP_itemdb_create_item_data_post > 0) { - struct item_data* (*postHookFunc) (struct item_data* retVal___, int nameid); + struct item_data * (*postHookFunc) (struct item_data * retVal___, int nameid); for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_create_item_data_post; hIndex++) { postHookFunc = HPMHooks.list.HP_itemdb_create_item_data_post[hIndex].func; retVal___ = postHookFunc(retVal___, nameid); @@ -45416,11 +45416,11 @@ void HP_itemdb_clear(bool total) { } return; } -struct item_combo* HP_itemdb_id2combo(int id) { +struct item_combo * HP_itemdb_id2combo(int id) { int hIndex = 0; - struct item_combo* retVal___ = NULL; + struct item_combo * retVal___ = NULL; if (HPMHooks.count.HP_itemdb_id2combo_pre > 0) { - struct item_combo* (*preHookFunc) (int *id); + struct item_combo * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_id2combo_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_itemdb_id2combo_pre[hIndex].func; @@ -45435,7 +45435,7 @@ struct item_combo* HP_itemdb_id2combo(int id) { retVal___ = HPMHooks.source.itemdb.id2combo(id); } if (HPMHooks.count.HP_itemdb_id2combo_post > 0) { - struct item_combo* (*postHookFunc) (struct item_combo* retVal___, int id); + struct item_combo * (*postHookFunc) (struct item_combo * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_id2combo_post; hIndex++) { postHookFunc = HPMHooks.list.HP_itemdb_id2combo_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -46171,11 +46171,11 @@ int HP_libconfig_setting_get_bool(const struct config_setting_t *setting) { } return retVal___; } -const char* HP_libconfig_setting_get_string(const struct config_setting_t *setting) { +const char * HP_libconfig_setting_get_string(const struct config_setting_t *setting) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_string_pre > 0) { - const char* (*preHookFunc) (const struct config_setting_t **setting); + const char * (*preHookFunc) (const struct config_setting_t **setting); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_pre[hIndex].func; @@ -46190,7 +46190,7 @@ const char* HP_libconfig_setting_get_string(const struct config_setting_t *setti retVal___ = HPMHooks.source.libconfig.setting_get_string(setting); } if (HPMHooks.count.HP_libconfig_setting_get_string_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting); + const char * (*postHookFunc) (const char * retVal___, const struct config_setting_t *setting); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting); @@ -46198,11 +46198,11 @@ const char* HP_libconfig_setting_get_string(const struct config_setting_t *setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_lookup(struct config_setting_t *setting, const char *name) { +struct config_setting_t * HP_libconfig_setting_lookup(struct config_setting_t *setting, const char *name) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_lookup_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, const char **name); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_pre[hIndex].func; @@ -46217,7 +46217,7 @@ struct config_setting_t* HP_libconfig_setting_lookup(struct config_setting_t *se retVal___ = HPMHooks.source.libconfig.setting_lookup(setting, name); } if (HPMHooks.count.HP_libconfig_setting_lookup_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, const char *name); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name); @@ -46657,11 +46657,11 @@ int HP_libconfig_setting_get_bool_elem(const struct config_setting_t *setting, i } return retVal___; } -const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t *setting, int idx) { +const char * HP_libconfig_setting_get_string_elem(const struct config_setting_t *setting, int idx) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_string_elem_pre > 0) { - const char* (*preHookFunc) (const struct config_setting_t **setting, int *idx); + const char * (*preHookFunc) (const struct config_setting_t **setting, int *idx); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_pre[hIndex].func; @@ -46676,7 +46676,7 @@ const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t * retVal___ = HPMHooks.source.libconfig.setting_get_string_elem(setting, idx); } if (HPMHooks.count.HP_libconfig_setting_get_string_elem_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting, int idx); + const char * (*postHookFunc) (const char * retVal___, const struct config_setting_t *setting, int idx); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -46684,11 +46684,11 @@ const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t * } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting_t *setting, int idx, int value) { +struct config_setting_t * HP_libconfig_setting_set_int_elem(struct config_setting_t *setting, int idx, int value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_int_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_pre[hIndex].func; @@ -46703,7 +46703,7 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting retVal___ = HPMHooks.source.libconfig.setting_set_int_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_int_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -46711,11 +46711,11 @@ struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { +struct config_setting_t * HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func; @@ -46730,7 +46730,7 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int64 value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -46738,11 +46738,11 @@ struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setting_t *setting, int idx, double value) { +struct config_setting_t * HP_libconfig_setting_set_float_elem(struct config_setting_t *setting, int idx, double value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_float_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, double *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, double *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_pre[hIndex].func; @@ -46757,7 +46757,7 @@ struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setti retVal___ = HPMHooks.source.libconfig.setting_set_float_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_float_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, double value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, double value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -46765,11 +46765,11 @@ struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_setting_t *setting, int idx, int value) { +struct config_setting_t * HP_libconfig_setting_set_bool_elem(struct config_setting_t *setting, int idx, int value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_pre[hIndex].func; @@ -46784,7 +46784,7 @@ struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_settin retVal___ = HPMHooks.source.libconfig.setting_set_bool_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, int value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -46792,11 +46792,11 @@ struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_settin } return retVal___; } -struct config_setting_t* HP_libconfig_setting_set_string_elem(struct config_setting_t *setting, int idx, const char *value) { +struct config_setting_t * HP_libconfig_setting_set_string_elem(struct config_setting_t *setting, int idx, const char *value) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_set_string_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, const char **value); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **setting, int *idx, const char **value); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_pre[hIndex].func; @@ -46811,7 +46811,7 @@ struct config_setting_t* HP_libconfig_setting_set_string_elem(struct config_sett retVal___ = HPMHooks.source.libconfig.setting_set_string_elem(setting, idx, value); } if (HPMHooks.count.HP_libconfig_setting_set_string_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, const char *value); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *setting, int idx, const char *value); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx, value); @@ -46873,11 +46873,11 @@ int HP_libconfig_setting_length(const struct config_setting_t *setting) { } return retVal___; } -struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setting_t *setting, unsigned int idx) { +struct config_setting_t * HP_libconfig_setting_get_elem(const struct config_setting_t *setting, unsigned int idx) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_elem_pre > 0) { - struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, unsigned int *idx); + struct config_setting_t * (*preHookFunc) (const struct config_setting_t **setting, unsigned int *idx); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_pre[hIndex].func; @@ -46892,7 +46892,7 @@ struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setti retVal___ = HPMHooks.source.libconfig.setting_get_elem(setting, idx); } if (HPMHooks.count.HP_libconfig_setting_get_elem_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, unsigned int idx); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, const struct config_setting_t *setting, unsigned int idx); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, idx); @@ -46900,11 +46900,11 @@ struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setti } return retVal___; } -struct config_setting_t* HP_libconfig_setting_get_member(const struct config_setting_t *setting, const char *name) { +struct config_setting_t * HP_libconfig_setting_get_member(const struct config_setting_t *setting, const char *name) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_get_member_pre > 0) { - struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, const char **name); + struct config_setting_t * (*preHookFunc) (const struct config_setting_t **setting, const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_pre[hIndex].func; @@ -46919,7 +46919,7 @@ struct config_setting_t* HP_libconfig_setting_get_member(const struct config_set retVal___ = HPMHooks.source.libconfig.setting_get_member(setting, name); } if (HPMHooks.count.HP_libconfig_setting_get_member_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, const char *name); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, const struct config_setting_t *setting, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_post[hIndex].func; retVal___ = postHookFunc(retVal___, setting, name); @@ -46927,11 +46927,11 @@ struct config_setting_t* HP_libconfig_setting_get_member(const struct config_set } return retVal___; } -struct config_setting_t* HP_libconfig_setting_add(struct config_setting_t *parent, const char *name, int type) { +struct config_setting_t * HP_libconfig_setting_add(struct config_setting_t *parent, const char *name, int type) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_setting_add_pre > 0) { - struct config_setting_t* (*preHookFunc) (struct config_setting_t **parent, const char **name, int *type); + struct config_setting_t * (*preHookFunc) (struct config_setting_t **parent, const char **name, int *type); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_setting_add_pre[hIndex].func; @@ -46946,7 +46946,7 @@ struct config_setting_t* HP_libconfig_setting_add(struct config_setting_t *paren retVal___ = HPMHooks.source.libconfig.setting_add(parent, name, type); } if (HPMHooks.count.HP_libconfig_setting_add_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *parent, const char *name, int type); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, struct config_setting_t *parent, const char *name, int type); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_setting_add_post[hIndex].func; retVal___ = postHookFunc(retVal___, parent, name, type); @@ -47034,11 +47034,11 @@ void HP_libconfig_setting_set_hook(struct config_setting_t *setting, void *hook) } return; } -struct config_setting_t* HP_libconfig_lookup(const struct config_t *config, const char *filepath) { +struct config_setting_t * HP_libconfig_lookup(const struct config_t *config, const char *filepath) { int hIndex = 0; - struct config_setting_t* retVal___ = NULL; + struct config_setting_t * retVal___ = NULL; if (HPMHooks.count.HP_libconfig_lookup_pre > 0) { - struct config_setting_t* (*preHookFunc) (const struct config_t **config, const char **filepath); + struct config_setting_t * (*preHookFunc) (const struct config_t **config, const char **filepath); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libconfig_lookup_pre[hIndex].func; @@ -47053,7 +47053,7 @@ struct config_setting_t* HP_libconfig_lookup(const struct config_t *config, cons retVal___ = HPMHooks.source.libconfig.lookup(config, filepath); } if (HPMHooks.count.HP_libconfig_lookup_post > 0) { - struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_t *config, const char *filepath); + struct config_setting_t * (*postHookFunc) (struct config_setting_t * retVal___, const struct config_t *config, const char *filepath); for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libconfig_lookup_post[hIndex].func; retVal___ = postHookFunc(retVal___, config, filepath); @@ -49350,11 +49350,11 @@ int HP_map_count_oncell(int16 m, int16 x, int16 y, int type, int flag) { } return retVal___; } -struct skill_unit* HP_map_find_skill_unit_oncell(struct block_list *target, int16 x, int16 y, uint16 skill_id, struct skill_unit *out_unit, int flag) { +struct skill_unit * HP_map_find_skill_unit_oncell(struct block_list *target, int16 x, int16 y, uint16 skill_id, struct skill_unit *out_unit, int flag) { int hIndex = 0; - struct skill_unit* retVal___ = NULL; + struct skill_unit * retVal___ = NULL; if (HPMHooks.count.HP_map_find_skill_unit_oncell_pre > 0) { - struct skill_unit* (*preHookFunc) (struct block_list **target, int16 *x, int16 *y, uint16 *skill_id, struct skill_unit **out_unit, int *flag); + struct skill_unit * (*preHookFunc) (struct block_list **target, int16 *x, int16 *y, uint16 *skill_id, struct skill_unit **out_unit, int *flag); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_find_skill_unit_oncell_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_find_skill_unit_oncell_pre[hIndex].func; @@ -49369,7 +49369,7 @@ struct skill_unit* HP_map_find_skill_unit_oncell(struct block_list *target, int1 retVal___ = HPMHooks.source.map.find_skill_unit_oncell(target, x, y, skill_id, out_unit, flag); } if (HPMHooks.count.HP_map_find_skill_unit_oncell_post > 0) { - struct skill_unit* (*postHookFunc) (struct skill_unit* retVal___, struct block_list *target, int16 x, int16 y, uint16 skill_id, struct skill_unit *out_unit, int flag); + struct skill_unit * (*postHookFunc) (struct skill_unit * retVal___, struct block_list *target, int16 x, int16 y, uint16 skill_id, struct skill_unit *out_unit, int flag); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_find_skill_unit_oncell_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_find_skill_unit_oncell_post[hIndex].func; retVal___ = postHookFunc(retVal___, target, x, y, skill_id, out_unit, flag); @@ -49697,11 +49697,11 @@ void HP_map_reqnickdb(struct map_session_data *sd, int charid) { } return; } -const char* HP_map_charid2nick(int charid) { +const char * HP_map_charid2nick(int charid) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_map_charid2nick_pre > 0) { - const char* (*preHookFunc) (int *charid); + const char * (*preHookFunc) (int *charid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2nick_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_charid2nick_pre[hIndex].func; @@ -49716,7 +49716,7 @@ const char* HP_map_charid2nick(int charid) { retVal___ = HPMHooks.source.map.charid2nick(charid); } if (HPMHooks.count.HP_map_charid2nick_post > 0) { - const char* (*postHookFunc) (const char* retVal___, int charid); + const char * (*postHookFunc) (const char * retVal___, int charid); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2nick_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_charid2nick_post[hIndex].func; retVal___ = postHookFunc(retVal___, charid); @@ -49724,11 +49724,11 @@ const char* HP_map_charid2nick(int charid) { } return retVal___; } -struct map_session_data* HP_map_charid2sd(int charid) { +struct map_session_data * HP_map_charid2sd(int charid) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_map_charid2sd_pre > 0) { - struct map_session_data* (*preHookFunc) (int *charid); + struct map_session_data * (*preHookFunc) (int *charid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2sd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_charid2sd_pre[hIndex].func; @@ -49743,7 +49743,7 @@ struct map_session_data* HP_map_charid2sd(int charid) { retVal___ = HPMHooks.source.map.charid2sd(charid); } if (HPMHooks.count.HP_map_charid2sd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int charid); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, int charid); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2sd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_charid2sd_post[hIndex].func; retVal___ = postHookFunc(retVal___, charid); @@ -50241,11 +50241,11 @@ int HP_map_vforeachininstance(int ( *func ) (struct block_list *, va_list), int1 } return retVal___; } -struct map_session_data* HP_map_id2sd(int id) { +struct map_session_data * HP_map_id2sd(int id) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_map_id2sd_pre > 0) { - struct map_session_data* (*preHookFunc) (int *id); + struct map_session_data * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2sd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2sd_pre[hIndex].func; @@ -50260,7 +50260,7 @@ struct map_session_data* HP_map_id2sd(int id) { retVal___ = HPMHooks.source.map.id2sd(id); } if (HPMHooks.count.HP_map_id2sd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int id); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2sd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2sd_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50268,11 +50268,11 @@ struct map_session_data* HP_map_id2sd(int id) { } return retVal___; } -struct npc_data* HP_map_id2nd(int id) { +struct npc_data * HP_map_id2nd(int id) { int hIndex = 0; - struct npc_data* retVal___ = NULL; + struct npc_data * retVal___ = NULL; if (HPMHooks.count.HP_map_id2nd_pre > 0) { - struct npc_data* (*preHookFunc) (int *id); + struct npc_data * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2nd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2nd_pre[hIndex].func; @@ -50287,7 +50287,7 @@ struct npc_data* HP_map_id2nd(int id) { retVal___ = HPMHooks.source.map.id2nd(id); } if (HPMHooks.count.HP_map_id2nd_post > 0) { - struct npc_data* (*postHookFunc) (struct npc_data* retVal___, int id); + struct npc_data * (*postHookFunc) (struct npc_data * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2nd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2nd_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50295,11 +50295,11 @@ struct npc_data* HP_map_id2nd(int id) { } return retVal___; } -struct mob_data* HP_map_id2md(int id) { +struct mob_data * HP_map_id2md(int id) { int hIndex = 0; - struct mob_data* retVal___ = NULL; + struct mob_data * retVal___ = NULL; if (HPMHooks.count.HP_map_id2md_pre > 0) { - struct mob_data* (*preHookFunc) (int *id); + struct mob_data * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2md_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2md_pre[hIndex].func; @@ -50314,7 +50314,7 @@ struct mob_data* HP_map_id2md(int id) { retVal___ = HPMHooks.source.map.id2md(id); } if (HPMHooks.count.HP_map_id2md_post > 0) { - struct mob_data* (*postHookFunc) (struct mob_data* retVal___, int id); + struct mob_data * (*postHookFunc) (struct mob_data * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2md_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2md_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50322,11 +50322,11 @@ struct mob_data* HP_map_id2md(int id) { } return retVal___; } -struct flooritem_data* HP_map_id2fi(int id) { +struct flooritem_data * HP_map_id2fi(int id) { int hIndex = 0; - struct flooritem_data* retVal___ = NULL; + struct flooritem_data * retVal___ = NULL; if (HPMHooks.count.HP_map_id2fi_pre > 0) { - struct flooritem_data* (*preHookFunc) (int *id); + struct flooritem_data * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2fi_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2fi_pre[hIndex].func; @@ -50341,7 +50341,7 @@ struct flooritem_data* HP_map_id2fi(int id) { retVal___ = HPMHooks.source.map.id2fi(id); } if (HPMHooks.count.HP_map_id2fi_post > 0) { - struct flooritem_data* (*postHookFunc) (struct flooritem_data* retVal___, int id); + struct flooritem_data * (*postHookFunc) (struct flooritem_data * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2fi_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2fi_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50349,11 +50349,11 @@ struct flooritem_data* HP_map_id2fi(int id) { } return retVal___; } -struct chat_data* HP_map_id2cd(int id) { +struct chat_data * HP_map_id2cd(int id) { int hIndex = 0; - struct chat_data* retVal___ = NULL; + struct chat_data * retVal___ = NULL; if (HPMHooks.count.HP_map_id2cd_pre > 0) { - struct chat_data* (*preHookFunc) (int *id); + struct chat_data * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2cd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2cd_pre[hIndex].func; @@ -50368,7 +50368,7 @@ struct chat_data* HP_map_id2cd(int id) { retVal___ = HPMHooks.source.map.id2cd(id); } if (HPMHooks.count.HP_map_id2cd_post > 0) { - struct chat_data* (*postHookFunc) (struct chat_data* retVal___, int id); + struct chat_data * (*postHookFunc) (struct chat_data * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2cd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2cd_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50376,11 +50376,11 @@ struct chat_data* HP_map_id2cd(int id) { } return retVal___; } -struct skill_unit* HP_map_id2su(int id) { +struct skill_unit * HP_map_id2su(int id) { int hIndex = 0; - struct skill_unit* retVal___ = NULL; + struct skill_unit * retVal___ = NULL; if (HPMHooks.count.HP_map_id2su_pre > 0) { - struct skill_unit* (*preHookFunc) (int *id); + struct skill_unit * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2su_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2su_pre[hIndex].func; @@ -50395,7 +50395,7 @@ struct skill_unit* HP_map_id2su(int id) { retVal___ = HPMHooks.source.map.id2su(id); } if (HPMHooks.count.HP_map_id2su_post > 0) { - struct skill_unit* (*postHookFunc) (struct skill_unit* retVal___, int id); + struct skill_unit * (*postHookFunc) (struct skill_unit * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2su_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2su_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50403,11 +50403,11 @@ struct skill_unit* HP_map_id2su(int id) { } return retVal___; } -struct pet_data* HP_map_id2pd(int id) { +struct pet_data * HP_map_id2pd(int id) { int hIndex = 0; - struct pet_data* retVal___ = NULL; + struct pet_data * retVal___ = NULL; if (HPMHooks.count.HP_map_id2pd_pre > 0) { - struct pet_data* (*preHookFunc) (int *id); + struct pet_data * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2pd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2pd_pre[hIndex].func; @@ -50422,7 +50422,7 @@ struct pet_data* HP_map_id2pd(int id) { retVal___ = HPMHooks.source.map.id2pd(id); } if (HPMHooks.count.HP_map_id2pd_post > 0) { - struct pet_data* (*postHookFunc) (struct pet_data* retVal___, int id); + struct pet_data * (*postHookFunc) (struct pet_data * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2pd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2pd_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50430,11 +50430,11 @@ struct pet_data* HP_map_id2pd(int id) { } return retVal___; } -struct homun_data* HP_map_id2hd(int id) { +struct homun_data * HP_map_id2hd(int id) { int hIndex = 0; - struct homun_data* retVal___ = NULL; + struct homun_data * retVal___ = NULL; if (HPMHooks.count.HP_map_id2hd_pre > 0) { - struct homun_data* (*preHookFunc) (int *id); + struct homun_data * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2hd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2hd_pre[hIndex].func; @@ -50449,7 +50449,7 @@ struct homun_data* HP_map_id2hd(int id) { retVal___ = HPMHooks.source.map.id2hd(id); } if (HPMHooks.count.HP_map_id2hd_post > 0) { - struct homun_data* (*postHookFunc) (struct homun_data* retVal___, int id); + struct homun_data * (*postHookFunc) (struct homun_data * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2hd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2hd_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50457,11 +50457,11 @@ struct homun_data* HP_map_id2hd(int id) { } return retVal___; } -struct mercenary_data* HP_map_id2mc(int id) { +struct mercenary_data * HP_map_id2mc(int id) { int hIndex = 0; - struct mercenary_data* retVal___ = NULL; + struct mercenary_data * retVal___ = NULL; if (HPMHooks.count.HP_map_id2mc_pre > 0) { - struct mercenary_data* (*preHookFunc) (int *id); + struct mercenary_data * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2mc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2mc_pre[hIndex].func; @@ -50476,7 +50476,7 @@ struct mercenary_data* HP_map_id2mc(int id) { retVal___ = HPMHooks.source.map.id2mc(id); } if (HPMHooks.count.HP_map_id2mc_post > 0) { - struct mercenary_data* (*postHookFunc) (struct mercenary_data* retVal___, int id); + struct mercenary_data * (*postHookFunc) (struct mercenary_data * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2mc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2mc_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50484,11 +50484,11 @@ struct mercenary_data* HP_map_id2mc(int id) { } return retVal___; } -struct elemental_data* HP_map_id2ed(int id) { +struct elemental_data * HP_map_id2ed(int id) { int hIndex = 0; - struct elemental_data* retVal___ = NULL; + struct elemental_data * retVal___ = NULL; if (HPMHooks.count.HP_map_id2ed_pre > 0) { - struct elemental_data* (*preHookFunc) (int *id); + struct elemental_data * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2ed_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2ed_pre[hIndex].func; @@ -50503,7 +50503,7 @@ struct elemental_data* HP_map_id2ed(int id) { retVal___ = HPMHooks.source.map.id2ed(id); } if (HPMHooks.count.HP_map_id2ed_post > 0) { - struct elemental_data* (*postHookFunc) (struct elemental_data* retVal___, int id); + struct elemental_data * (*postHookFunc) (struct elemental_data * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2ed_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2ed_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50511,11 +50511,11 @@ struct elemental_data* HP_map_id2ed(int id) { } return retVal___; } -struct block_list* HP_map_id2bl(int id) { +struct block_list * HP_map_id2bl(int id) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_map_id2bl_pre > 0) { - struct block_list* (*preHookFunc) (int *id); + struct block_list * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2bl_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2bl_pre[hIndex].func; @@ -50530,7 +50530,7 @@ struct block_list* HP_map_id2bl(int id) { retVal___ = HPMHooks.source.map.id2bl(id); } if (HPMHooks.count.HP_map_id2bl_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, int id); + struct block_list * (*postHookFunc) (struct block_list * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2bl_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2bl_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -50779,11 +50779,11 @@ void HP_map_deliddb(struct block_list *bl) { } return; } -struct map_session_data* HP_map_nick2sd(const char *nick, bool allow_partial) { +struct map_session_data * HP_map_nick2sd(const char *nick, bool allow_partial) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_map_nick2sd_pre > 0) { - struct map_session_data* (*preHookFunc) (const char **nick, bool *allow_partial); + struct map_session_data * (*preHookFunc) (const char **nick, bool *allow_partial); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_nick2sd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_nick2sd_pre[hIndex].func; @@ -50798,7 +50798,7 @@ struct map_session_data* HP_map_nick2sd(const char *nick, bool allow_partial) { retVal___ = HPMHooks.source.map.nick2sd(nick, allow_partial); } if (HPMHooks.count.HP_map_nick2sd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, const char *nick, bool allow_partial); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, const char *nick, bool allow_partial); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_nick2sd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_nick2sd_post[hIndex].func; retVal___ = postHookFunc(retVal___, nick, allow_partial); @@ -50806,11 +50806,11 @@ struct map_session_data* HP_map_nick2sd(const char *nick, bool allow_partial) { } return retVal___; } -struct mob_data* HP_map_getmob_boss(int16 m) { +struct mob_data * HP_map_getmob_boss(int16 m) { int hIndex = 0; - struct mob_data* retVal___ = NULL; + struct mob_data * retVal___ = NULL; if (HPMHooks.count.HP_map_getmob_boss_pre > 0) { - struct mob_data* (*preHookFunc) (int16 *m); + struct mob_data * (*preHookFunc) (int16 *m); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_getmob_boss_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_getmob_boss_pre[hIndex].func; @@ -50825,7 +50825,7 @@ struct mob_data* HP_map_getmob_boss(int16 m) { retVal___ = HPMHooks.source.map.getmob_boss(m); } if (HPMHooks.count.HP_map_getmob_boss_post > 0) { - struct mob_data* (*postHookFunc) (struct mob_data* retVal___, int16 m); + struct mob_data * (*postHookFunc) (struct mob_data * retVal___, int16 m); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_getmob_boss_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_getmob_boss_post[hIndex].func; retVal___ = postHookFunc(retVal___, m); @@ -50833,11 +50833,11 @@ struct mob_data* HP_map_getmob_boss(int16 m) { } return retVal___; } -struct mob_data* HP_map_id2boss(int id) { +struct mob_data * HP_map_id2boss(int id) { int hIndex = 0; - struct mob_data* retVal___ = NULL; + struct mob_data * retVal___ = NULL; if (HPMHooks.count.HP_map_id2boss_pre > 0) { - struct mob_data* (*preHookFunc) (int *id); + struct mob_data * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2boss_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_id2boss_pre[hIndex].func; @@ -50852,7 +50852,7 @@ struct mob_data* HP_map_id2boss(int id) { retVal___ = HPMHooks.source.map.id2boss(id); } if (HPMHooks.count.HP_map_id2boss_post > 0) { - struct mob_data* (*postHookFunc) (struct mob_data* retVal___, int id); + struct mob_data * (*postHookFunc) (struct mob_data * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2boss_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_id2boss_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -52739,11 +52739,11 @@ bool HP_map_remove_questinfo(int m, struct npc_data *nd) { } return retVal___; } -struct map_zone_data* HP_map_merge_zone(struct map_zone_data *main, struct map_zone_data *other) { +struct map_zone_data * HP_map_merge_zone(struct map_zone_data *main, struct map_zone_data *other) { int hIndex = 0; - struct map_zone_data* retVal___ = NULL; + struct map_zone_data * retVal___ = NULL; if (HPMHooks.count.HP_map_merge_zone_pre > 0) { - struct map_zone_data* (*preHookFunc) (struct map_zone_data **main, struct map_zone_data **other); + struct map_zone_data * (*preHookFunc) (struct map_zone_data **main, struct map_zone_data **other); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_merge_zone_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_merge_zone_pre[hIndex].func; @@ -52758,7 +52758,7 @@ struct map_zone_data* HP_map_merge_zone(struct map_zone_data *main, struct map_z retVal___ = HPMHooks.source.map.merge_zone(main, other); } if (HPMHooks.count.HP_map_merge_zone_post > 0) { - struct map_zone_data* (*postHookFunc) (struct map_zone_data* retVal___, struct map_zone_data *main, struct map_zone_data *other); + struct map_zone_data * (*postHookFunc) (struct map_zone_data * retVal___, struct map_zone_data *main, struct map_zone_data *other); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_merge_zone_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_merge_zone_post[hIndex].func; retVal___ = postHookFunc(retVal___, main, other); @@ -52979,11 +52979,11 @@ void HP_mapindex_removemap(int index) { } return; } -const char* HP_mapindex_getmapname(const char *string, char *output) { +const char * HP_mapindex_getmapname(const char *string, char *output) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_mapindex_getmapname_pre > 0) { - const char* (*preHookFunc) (const char **string, char **output); + const char * (*preHookFunc) (const char **string, char **output); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapindex_getmapname_pre[hIndex].func; @@ -52998,7 +52998,7 @@ const char* HP_mapindex_getmapname(const char *string, char *output) { retVal___ = HPMHooks.source.mapindex.getmapname(string, output); } if (HPMHooks.count.HP_mapindex_getmapname_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *string, char *output); + const char * (*postHookFunc) (const char * retVal___, const char *string, char *output); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapindex_getmapname_post[hIndex].func; retVal___ = postHookFunc(retVal___, string, output); @@ -53006,11 +53006,11 @@ const char* HP_mapindex_getmapname(const char *string, char *output) { } return retVal___; } -const char* HP_mapindex_getmapname_ext(const char *string, char *output) { +const char * HP_mapindex_getmapname_ext(const char *string, char *output) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_mapindex_getmapname_ext_pre > 0) { - const char* (*preHookFunc) (const char **string, char **output); + const char * (*preHookFunc) (const char **string, char **output); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapindex_getmapname_ext_pre[hIndex].func; @@ -53025,7 +53025,7 @@ const char* HP_mapindex_getmapname_ext(const char *string, char *output) { retVal___ = HPMHooks.source.mapindex.getmapname_ext(string, output); } if (HPMHooks.count.HP_mapindex_getmapname_ext_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *string, char *output); + const char * (*postHookFunc) (const char * retVal___, const char *string, char *output); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapindex_getmapname_ext_post[hIndex].func; retVal___ = postHookFunc(retVal___, string, output); @@ -53060,11 +53060,11 @@ unsigned short HP_mapindex_name2id(const char *p1) { } return retVal___; } -const char* HP_mapindex_id2name(uint16 id, const char *file, int line, const char *func) { +const char * HP_mapindex_id2name(uint16 id, const char *file, int line, const char *func) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_mapindex_id2name_pre > 0) { - const char* (*preHookFunc) (uint16 *id, const char **file, int *line, const char **func); + const char * (*preHookFunc) (uint16 *id, const char **file, int *line, const char **func); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapindex_id2name_pre[hIndex].func; @@ -53079,7 +53079,7 @@ const char* HP_mapindex_id2name(uint16 id, const char *file, int line, const cha retVal___ = HPMHooks.source.mapindex.id2name(id, file, line, func); } if (HPMHooks.count.HP_mapindex_id2name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, uint16 id, const char *file, int line, const char *func); + const char * (*postHookFunc) (const char * retVal___, uint16 id, const char *file, int line, const char *func); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapindex_id2name_post[hIndex].func; retVal___ = postHookFunc(retVal___, id, file, line, func); @@ -53115,11 +53115,11 @@ bool HP_mapindex_check_default(void) { return retVal___; } /* mapit_interface */ -struct s_mapiterator* HP_mapit_alloc(enum e_mapitflags flags, enum bl_type types) { +struct s_mapiterator * HP_mapit_alloc(enum e_mapitflags flags, enum bl_type types) { int hIndex = 0; - struct s_mapiterator* retVal___ = NULL; + struct s_mapiterator * retVal___ = NULL; if (HPMHooks.count.HP_mapit_alloc_pre > 0) { - struct s_mapiterator* (*preHookFunc) (enum e_mapitflags *flags, enum bl_type *types); + struct s_mapiterator * (*preHookFunc) (enum e_mapitflags *flags, enum bl_type *types); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_alloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapit_alloc_pre[hIndex].func; @@ -53134,7 +53134,7 @@ struct s_mapiterator* HP_mapit_alloc(enum e_mapitflags flags, enum bl_type types retVal___ = HPMHooks.source.mapit.alloc(flags, types); } if (HPMHooks.count.HP_mapit_alloc_post > 0) { - struct s_mapiterator* (*postHookFunc) (struct s_mapiterator* retVal___, enum e_mapitflags flags, enum bl_type types); + struct s_mapiterator * (*postHookFunc) (struct s_mapiterator * retVal___, enum e_mapitflags flags, enum bl_type types); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_alloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapit_alloc_post[hIndex].func; retVal___ = postHookFunc(retVal___, flags, types); @@ -53168,11 +53168,11 @@ void HP_mapit_free(struct s_mapiterator *iter) { } return; } -struct block_list* HP_mapit_first(struct s_mapiterator *iter) { +struct block_list * HP_mapit_first(struct s_mapiterator *iter) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_mapit_first_pre > 0) { - struct block_list* (*preHookFunc) (struct s_mapiterator **iter); + struct block_list * (*preHookFunc) (struct s_mapiterator **iter); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_first_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapit_first_pre[hIndex].func; @@ -53187,7 +53187,7 @@ struct block_list* HP_mapit_first(struct s_mapiterator *iter) { retVal___ = HPMHooks.source.mapit.first(iter); } if (HPMHooks.count.HP_mapit_first_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct s_mapiterator *iter); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct s_mapiterator *iter); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_first_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapit_first_post[hIndex].func; retVal___ = postHookFunc(retVal___, iter); @@ -53195,11 +53195,11 @@ struct block_list* HP_mapit_first(struct s_mapiterator *iter) { } return retVal___; } -struct block_list* HP_mapit_last(struct s_mapiterator *iter) { +struct block_list * HP_mapit_last(struct s_mapiterator *iter) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_mapit_last_pre > 0) { - struct block_list* (*preHookFunc) (struct s_mapiterator **iter); + struct block_list * (*preHookFunc) (struct s_mapiterator **iter); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_last_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapit_last_pre[hIndex].func; @@ -53214,7 +53214,7 @@ struct block_list* HP_mapit_last(struct s_mapiterator *iter) { retVal___ = HPMHooks.source.mapit.last(iter); } if (HPMHooks.count.HP_mapit_last_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct s_mapiterator *iter); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct s_mapiterator *iter); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_last_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapit_last_post[hIndex].func; retVal___ = postHookFunc(retVal___, iter); @@ -53222,11 +53222,11 @@ struct block_list* HP_mapit_last(struct s_mapiterator *iter) { } return retVal___; } -struct block_list* HP_mapit_next(struct s_mapiterator *iter) { +struct block_list * HP_mapit_next(struct s_mapiterator *iter) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_mapit_next_pre > 0) { - struct block_list* (*preHookFunc) (struct s_mapiterator **iter); + struct block_list * (*preHookFunc) (struct s_mapiterator **iter); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_next_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapit_next_pre[hIndex].func; @@ -53241,7 +53241,7 @@ struct block_list* HP_mapit_next(struct s_mapiterator *iter) { retVal___ = HPMHooks.source.mapit.next(iter); } if (HPMHooks.count.HP_mapit_next_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct s_mapiterator *iter); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct s_mapiterator *iter); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_next_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapit_next_post[hIndex].func; retVal___ = postHookFunc(retVal___, iter); @@ -53249,11 +53249,11 @@ struct block_list* HP_mapit_next(struct s_mapiterator *iter) { } return retVal___; } -struct block_list* HP_mapit_prev(struct s_mapiterator *iter) { +struct block_list * HP_mapit_prev(struct s_mapiterator *iter) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_mapit_prev_pre > 0) { - struct block_list* (*preHookFunc) (struct s_mapiterator **iter); + struct block_list * (*preHookFunc) (struct s_mapiterator **iter); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_prev_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapit_prev_pre[hIndex].func; @@ -53268,7 +53268,7 @@ struct block_list* HP_mapit_prev(struct s_mapiterator *iter) { retVal___ = HPMHooks.source.mapit.prev(iter); } if (HPMHooks.count.HP_mapit_prev_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct s_mapiterator *iter); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct s_mapiterator *iter); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_prev_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapit_prev_post[hIndex].func; retVal___ = postHookFunc(retVal___, iter); @@ -53331,11 +53331,11 @@ int HP_mapreg_readreg(int64 uid) { } return retVal___; } -char* HP_mapreg_readregstr(int64 uid) { +char * HP_mapreg_readregstr(int64 uid) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_mapreg_readregstr_pre > 0) { - char* (*preHookFunc) (int64 *uid); + char * (*preHookFunc) (int64 *uid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_readregstr_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mapreg_readregstr_pre[hIndex].func; @@ -53350,7 +53350,7 @@ char* HP_mapreg_readregstr(int64 uid) { retVal___ = HPMHooks.source.mapreg.readregstr(uid); } if (HPMHooks.count.HP_mapreg_readregstr_post > 0) { - char* (*postHookFunc) (char* retVal___, int64 uid); + char * (*postHookFunc) (char * retVal___, int64 uid); for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_readregstr_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mapreg_readregstr_post[hIndex].func; retVal___ = postHookFunc(retVal___, uid); @@ -53974,11 +53974,11 @@ bool HP_mercenary_class(int class_) { } return retVal___; } -struct view_data* HP_mercenary_get_viewdata(int class_) { +struct view_data * HP_mercenary_get_viewdata(int class_) { int hIndex = 0; - struct view_data* retVal___ = NULL; + struct view_data * retVal___ = NULL; if (HPMHooks.count.HP_mercenary_get_viewdata_pre > 0) { - struct view_data* (*preHookFunc) (int *class_); + struct view_data * (*preHookFunc) (int *class_); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_viewdata_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mercenary_get_viewdata_pre[hIndex].func; @@ -53993,7 +53993,7 @@ struct view_data* HP_mercenary_get_viewdata(int class_) { retVal___ = HPMHooks.source.mercenary.get_viewdata(class_); } if (HPMHooks.count.HP_mercenary_get_viewdata_post > 0) { - struct view_data* (*postHookFunc) (struct view_data* retVal___, int class_); + struct view_data * (*postHookFunc) (struct view_data * retVal___, int class_); for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_viewdata_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mercenary_get_viewdata_post[hIndex].func; retVal___ = postHookFunc(retVal___, class_); @@ -54706,11 +54706,11 @@ int HP_mob_reload_sub_mob(struct mob_data *md, va_list args) { } return retVal___; } -struct mob_db* HP_mob_db(int index) { +struct mob_db * HP_mob_db(int index) { int hIndex = 0; - struct mob_db* retVal___ = NULL; + struct mob_db * retVal___ = NULL; if (HPMHooks.count.HP_mob_db_pre > 0) { - struct mob_db* (*preHookFunc) (int *index); + struct mob_db * (*preHookFunc) (int *index); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_db_pre[hIndex].func; @@ -54725,7 +54725,7 @@ struct mob_db* HP_mob_db(int index) { retVal___ = HPMHooks.source.mob.db(index); } if (HPMHooks.count.HP_mob_db_post > 0) { - struct mob_db* (*postHookFunc) (struct mob_db* retVal___, int index); + struct mob_db * (*postHookFunc) (struct mob_db * retVal___, int index); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_db_post[hIndex].func; retVal___ = postHookFunc(retVal___, index); @@ -54733,11 +54733,11 @@ struct mob_db* HP_mob_db(int index) { } return retVal___; } -struct mob_chat* HP_mob_chat(short id) { +struct mob_chat * HP_mob_chat(short id) { int hIndex = 0; - struct mob_chat* retVal___ = NULL; + struct mob_chat * retVal___ = NULL; if (HPMHooks.count.HP_mob_chat_pre > 0) { - struct mob_chat* (*preHookFunc) (short *id); + struct mob_chat * (*preHookFunc) (short *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_chat_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_chat_pre[hIndex].func; @@ -54752,7 +54752,7 @@ struct mob_chat* HP_mob_chat(short id) { retVal___ = HPMHooks.source.mob.chat(id); } if (HPMHooks.count.HP_mob_chat_post > 0) { - struct mob_chat* (*postHookFunc) (struct mob_chat* retVal___, short id); + struct mob_chat * (*postHookFunc) (struct mob_chat * retVal___, short id); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_chat_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_chat_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -55054,11 +55054,11 @@ int HP_mob_db_checkid(const int id) { } return retVal___; } -struct view_data* HP_mob_get_viewdata(int class_) { +struct view_data * HP_mob_get_viewdata(int class_) { int hIndex = 0; - struct view_data* retVal___ = NULL; + struct view_data * retVal___ = NULL; if (HPMHooks.count.HP_mob_get_viewdata_pre > 0) { - struct view_data* (*preHookFunc) (int *class_); + struct view_data * (*preHookFunc) (int *class_); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_viewdata_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_get_viewdata_pre[hIndex].func; @@ -55073,7 +55073,7 @@ struct view_data* HP_mob_get_viewdata(int class_) { retVal___ = HPMHooks.source.mob.get_viewdata(class_); } if (HPMHooks.count.HP_mob_get_viewdata_post > 0) { - struct view_data* (*postHookFunc) (struct view_data* retVal___, int class_); + struct view_data * (*postHookFunc) (struct view_data * retVal___, int class_); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_viewdata_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_get_viewdata_post[hIndex].func; retVal___ = postHookFunc(retVal___, class_); @@ -55160,11 +55160,11 @@ int HP_mob_parse_dataset(struct spawn_data *data) { } return retVal___; } -struct mob_data* HP_mob_spawn_dataset(struct spawn_data *data, int npc_id) { +struct mob_data * HP_mob_spawn_dataset(struct spawn_data *data, int npc_id) { int hIndex = 0; - struct mob_data* retVal___ = NULL; + struct mob_data * retVal___ = NULL; if (HPMHooks.count.HP_mob_spawn_dataset_pre > 0) { - struct mob_data* (*preHookFunc) (struct spawn_data **data, int *npc_id); + struct mob_data * (*preHookFunc) (struct spawn_data **data, int *npc_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_dataset_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_spawn_dataset_pre[hIndex].func; @@ -55179,7 +55179,7 @@ struct mob_data* HP_mob_spawn_dataset(struct spawn_data *data, int npc_id) { retVal___ = HPMHooks.source.mob.spawn_dataset(data, npc_id); } if (HPMHooks.count.HP_mob_spawn_dataset_post > 0) { - struct mob_data* (*postHookFunc) (struct mob_data* retVal___, struct spawn_data *data, int npc_id); + struct mob_data * (*postHookFunc) (struct mob_data * retVal___, struct spawn_data *data, int npc_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_dataset_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_spawn_dataset_post[hIndex].func; retVal___ = postHookFunc(retVal___, data, npc_id); @@ -55241,11 +55241,11 @@ bool HP_mob_ksprotected(struct block_list *src, struct block_list *target) { } return retVal___; } -struct mob_data* HP_mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai, int npc_id) { +struct mob_data * HP_mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai, int npc_id) { int hIndex = 0; - struct mob_data* retVal___ = NULL; + struct mob_data * retVal___ = NULL; if (HPMHooks.count.HP_mob_once_spawn_sub_pre > 0) { - struct mob_data* (*preHookFunc) (struct block_list **bl, int16 *m, int16 *x, int16 *y, const char **mobname, int *class_, const char **event, unsigned int *size, unsigned int *ai, int *npc_id); + struct mob_data * (*preHookFunc) (struct block_list **bl, int16 *m, int16 *x, int16 *y, const char **mobname, int *class_, const char **event, unsigned int *size, unsigned int *ai, int *npc_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_sub_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_once_spawn_sub_pre[hIndex].func; @@ -55260,7 +55260,7 @@ struct mob_data* HP_mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x, retVal___ = HPMHooks.source.mob.once_spawn_sub(bl, m, x, y, mobname, class_, event, size, ai, npc_id); } if (HPMHooks.count.HP_mob_once_spawn_sub_post > 0) { - struct mob_data* (*postHookFunc) (struct mob_data* retVal___, struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai, int npc_id); + struct mob_data * (*postHookFunc) (struct mob_data * retVal___, struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai, int npc_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_sub_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_once_spawn_sub_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl, m, x, y, mobname, class_, event, size, ai, npc_id); @@ -56110,11 +56110,11 @@ void HP_mob_setdropitem_options(struct item *item, struct optdrop_group *options } return; } -struct item_drop* HP_mob_setdropitem(int nameid, struct optdrop_group *options, int qty, struct item_data *data) { +struct item_drop * HP_mob_setdropitem(int nameid, struct optdrop_group *options, int qty, struct item_data *data) { int hIndex = 0; - struct item_drop* retVal___ = NULL; + struct item_drop * retVal___ = NULL; if (HPMHooks.count.HP_mob_setdropitem_pre > 0) { - struct item_drop* (*preHookFunc) (int *nameid, struct optdrop_group **options, int *qty, struct item_data **data); + struct item_drop * (*preHookFunc) (int *nameid, struct optdrop_group **options, int *qty, struct item_data **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_setdropitem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_setdropitem_pre[hIndex].func; @@ -56129,7 +56129,7 @@ struct item_drop* HP_mob_setdropitem(int nameid, struct optdrop_group *options, retVal___ = HPMHooks.source.mob.setdropitem(nameid, options, qty, data); } if (HPMHooks.count.HP_mob_setdropitem_post > 0) { - struct item_drop* (*postHookFunc) (struct item_drop* retVal___, int nameid, struct optdrop_group *options, int qty, struct item_data *data); + struct item_drop * (*postHookFunc) (struct item_drop * retVal___, int nameid, struct optdrop_group *options, int qty, struct item_data *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_setdropitem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_setdropitem_post[hIndex].func; retVal___ = postHookFunc(retVal___, nameid, options, qty, data); @@ -56137,11 +56137,11 @@ struct item_drop* HP_mob_setdropitem(int nameid, struct optdrop_group *options, } return retVal___; } -struct item_drop* HP_mob_setlootitem(struct item *item) { +struct item_drop * HP_mob_setlootitem(struct item *item) { int hIndex = 0; - struct item_drop* retVal___ = NULL; + struct item_drop * retVal___ = NULL; if (HPMHooks.count.HP_mob_setlootitem_pre > 0) { - struct item_drop* (*preHookFunc) (struct item **item); + struct item_drop * (*preHookFunc) (struct item **item); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_setlootitem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_setlootitem_pre[hIndex].func; @@ -56156,7 +56156,7 @@ struct item_drop* HP_mob_setlootitem(struct item *item) { retVal___ = HPMHooks.source.mob.setlootitem(item); } if (HPMHooks.count.HP_mob_setlootitem_post > 0) { - struct item_drop* (*postHookFunc) (struct item_drop* retVal___, struct item *item); + struct item_drop * (*postHookFunc) (struct item_drop * retVal___, struct item *item); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_setlootitem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_setlootitem_post[hIndex].func; retVal___ = postHookFunc(retVal___, item); @@ -56723,11 +56723,11 @@ int HP_mob_getfriendhprate_sub(struct block_list *bl, va_list ap) { } return retVal___; } -struct block_list* HP_mob_getfriendhprate(struct mob_data *md, int min_rate, int max_rate) { +struct block_list * HP_mob_getfriendhprate(struct mob_data *md, int min_rate, int max_rate) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_mob_getfriendhprate_pre > 0) { - struct block_list* (*preHookFunc) (struct mob_data **md, int *min_rate, int *max_rate); + struct block_list * (*preHookFunc) (struct mob_data **md, int *min_rate, int *max_rate); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendhprate_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_getfriendhprate_pre[hIndex].func; @@ -56742,7 +56742,7 @@ struct block_list* HP_mob_getfriendhprate(struct mob_data *md, int min_rate, int retVal___ = HPMHooks.source.mob.getfriendhprate(md, min_rate, max_rate); } if (HPMHooks.count.HP_mob_getfriendhprate_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct mob_data *md, int min_rate, int max_rate); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct mob_data *md, int min_rate, int max_rate); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendhprate_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_getfriendhprate_post[hIndex].func; retVal___ = postHookFunc(retVal___, md, min_rate, max_rate); @@ -56750,11 +56750,11 @@ struct block_list* HP_mob_getfriendhprate(struct mob_data *md, int min_rate, int } return retVal___; } -struct block_list* HP_mob_getmasterhpltmaxrate(struct mob_data *md, int rate) { +struct block_list * HP_mob_getmasterhpltmaxrate(struct mob_data *md, int rate) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_mob_getmasterhpltmaxrate_pre > 0) { - struct block_list* (*preHookFunc) (struct mob_data **md, int *rate); + struct block_list * (*preHookFunc) (struct mob_data **md, int *rate); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getmasterhpltmaxrate_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_getmasterhpltmaxrate_pre[hIndex].func; @@ -56769,7 +56769,7 @@ struct block_list* HP_mob_getmasterhpltmaxrate(struct mob_data *md, int rate) { retVal___ = HPMHooks.source.mob.getmasterhpltmaxrate(md, rate); } if (HPMHooks.count.HP_mob_getmasterhpltmaxrate_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct mob_data *md, int rate); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct mob_data *md, int rate); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getmasterhpltmaxrate_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_getmasterhpltmaxrate_post[hIndex].func; retVal___ = postHookFunc(retVal___, md, rate); @@ -56810,11 +56810,11 @@ int HP_mob_getfriendstatus_sub(struct block_list *bl, va_list ap) { } return retVal___; } -struct block_list* HP_mob_getfriendstatus(struct mob_data *md, int cond1, int cond2) { +struct block_list * HP_mob_getfriendstatus(struct mob_data *md, int cond1, int cond2) { int hIndex = 0; - struct block_list* retVal___ = NULL; + struct block_list * retVal___ = NULL; if (HPMHooks.count.HP_mob_getfriendstatus_pre > 0) { - struct block_list* (*preHookFunc) (struct mob_data **md, int *cond1, int *cond2); + struct block_list * (*preHookFunc) (struct mob_data **md, int *cond1, int *cond2); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendstatus_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_getfriendstatus_pre[hIndex].func; @@ -56829,7 +56829,7 @@ struct block_list* HP_mob_getfriendstatus(struct mob_data *md, int cond1, int co retVal___ = HPMHooks.source.mob.getfriendstatus(md, cond1, cond2); } if (HPMHooks.count.HP_mob_getfriendstatus_post > 0) { - struct block_list* (*postHookFunc) (struct block_list* retVal___, struct mob_data *md, int cond1, int cond2); + struct block_list * (*postHookFunc) (struct block_list * retVal___, struct mob_data *md, int cond1, int cond2); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendstatus_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_getfriendstatus_post[hIndex].func; retVal___ = postHookFunc(retVal___, md, cond1, cond2); @@ -57399,11 +57399,11 @@ uint32 HP_mob_read_db_mode_sub(struct mob_db *entry, struct config_setting_t *t) } return retVal___; } -struct optdrop_group* HP_mob_read_db_drops_option(struct mob_db *entry, const char *item_name, struct config_setting_t *drop, int *drop_rate) { +struct optdrop_group * HP_mob_read_db_drops_option(struct mob_db *entry, const char *item_name, struct config_setting_t *drop, int *drop_rate) { int hIndex = 0; - struct optdrop_group* retVal___ = NULL; + struct optdrop_group * retVal___ = NULL; if (HPMHooks.count.HP_mob_read_db_drops_option_pre > 0) { - struct optdrop_group* (*preHookFunc) (struct mob_db **entry, const char **item_name, struct config_setting_t **drop, int **drop_rate); + struct optdrop_group * (*preHookFunc) (struct mob_db **entry, const char **item_name, struct config_setting_t **drop, int **drop_rate); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_drops_option_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_read_db_drops_option_pre[hIndex].func; @@ -57418,7 +57418,7 @@ struct optdrop_group* HP_mob_read_db_drops_option(struct mob_db *entry, const ch retVal___ = HPMHooks.source.mob.read_db_drops_option(entry, item_name, drop, drop_rate); } if (HPMHooks.count.HP_mob_read_db_drops_option_post > 0) { - struct optdrop_group* (*postHookFunc) (struct optdrop_group* retVal___, struct mob_db *entry, const char *item_name, struct config_setting_t *drop, int *drop_rate); + struct optdrop_group * (*postHookFunc) (struct optdrop_group * retVal___, struct mob_db *entry, const char *item_name, struct config_setting_t *drop, int *drop_rate); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_drops_option_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_read_db_drops_option_post[hIndex].func; retVal___ = postHookFunc(retVal___, entry, item_name, drop, drop_rate); @@ -57715,11 +57715,11 @@ void HP_mob_clear_spawninfo(void) { } return; } -struct item_drop_ratio* HP_mob_get_item_drop_ratio(int nameid) { +struct item_drop_ratio * HP_mob_get_item_drop_ratio(int nameid) { int hIndex = 0; - struct item_drop_ratio* retVal___ = NULL; + struct item_drop_ratio * retVal___ = NULL; if (HPMHooks.count.HP_mob_get_item_drop_ratio_pre > 0) { - struct item_drop_ratio* (*preHookFunc) (int *nameid); + struct item_drop_ratio * (*preHookFunc) (int *nameid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_item_drop_ratio_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mob_get_item_drop_ratio_pre[hIndex].func; @@ -57734,7 +57734,7 @@ struct item_drop_ratio* HP_mob_get_item_drop_ratio(int nameid) { retVal___ = HPMHooks.source.mob.get_item_drop_ratio(nameid); } if (HPMHooks.count.HP_mob_get_item_drop_ratio_post > 0) { - struct item_drop_ratio* (*postHookFunc) (struct item_drop_ratio* retVal___, int nameid); + struct item_drop_ratio * (*postHookFunc) (struct item_drop_ratio * retVal___, int nameid); for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_item_drop_ratio_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mob_get_item_drop_ratio_post[hIndex].func; retVal___ = postHookFunc(retVal___, nameid); @@ -58042,11 +58042,11 @@ bool HP_mob_read_group_db_libconfig_sub_group(struct config_setting_t *it, enum return retVal___; } /* mutex_interface */ -struct mutex_data* HP_mutex_create(void) { +struct mutex_data * HP_mutex_create(void) { int hIndex = 0; - struct mutex_data* retVal___ = NULL; + struct mutex_data * retVal___ = NULL; if (HPMHooks.count.HP_mutex_create_pre > 0) { - struct mutex_data* (*preHookFunc) (void); + struct mutex_data * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func; @@ -58061,7 +58061,7 @@ struct mutex_data* HP_mutex_create(void) { retVal___ = HPMHooks.source.mutex.create(); } if (HPMHooks.count.HP_mutex_create_post > 0) { - struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___); + struct mutex_data * (*postHookFunc) (struct mutex_data * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -58174,11 +58174,11 @@ void HP_mutex_unlock(struct mutex_data *m) { } return; } -struct cond_data* HP_mutex_cond_create(void) { +struct cond_data * HP_mutex_cond_create(void) { int hIndex = 0; - struct cond_data* retVal___ = NULL; + struct cond_data * retVal___ = NULL; if (HPMHooks.count.HP_mutex_cond_create_pre > 0) { - struct cond_data* (*preHookFunc) (void); + struct cond_data * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func; @@ -58193,7 +58193,7 @@ struct cond_data* HP_mutex_cond_create(void) { retVal___ = HPMHooks.source.mutex.cond_create(); } if (HPMHooks.count.HP_mutex_cond_create_post > 0) { - struct cond_data* (*postHookFunc) (struct cond_data* retVal___); + struct cond_data * (*postHookFunc) (struct cond_data * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -58391,11 +58391,11 @@ void HP_npc_chat_def_pattern(struct npc_data *nd, int setid, const char *pattern } return; } -struct pcrematch_entry* HP_npc_chat_create_pcrematch_entry(struct pcrematch_set *set) { +struct pcrematch_entry * HP_npc_chat_create_pcrematch_entry(struct pcrematch_set *set) { int hIndex = 0; - struct pcrematch_entry* retVal___ = NULL; + struct pcrematch_entry * retVal___ = NULL; if (HPMHooks.count.HP_npc_chat_create_pcrematch_entry_pre > 0) { - struct pcrematch_entry* (*preHookFunc) (struct pcrematch_set **set); + struct pcrematch_entry * (*preHookFunc) (struct pcrematch_set **set); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_create_pcrematch_entry_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_chat_create_pcrematch_entry_pre[hIndex].func; @@ -58410,7 +58410,7 @@ struct pcrematch_entry* HP_npc_chat_create_pcrematch_entry(struct pcrematch_set retVal___ = HPMHooks.source.npc_chat.create_pcrematch_entry(set); } if (HPMHooks.count.HP_npc_chat_create_pcrematch_entry_post > 0) { - struct pcrematch_entry* (*postHookFunc) (struct pcrematch_entry* retVal___, struct pcrematch_set *set); + struct pcrematch_entry * (*postHookFunc) (struct pcrematch_entry * retVal___, struct pcrematch_set *set); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_create_pcrematch_entry_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_chat_create_pcrematch_entry_post[hIndex].func; retVal___ = postHookFunc(retVal___, set); @@ -58496,11 +58496,11 @@ void HP_npc_chat_activate_pcreset(struct npc_data *nd, int setid) { } return; } -struct pcrematch_set* HP_npc_chat_lookup_pcreset(struct npc_data *nd, int setid) { +struct pcrematch_set * HP_npc_chat_lookup_pcreset(struct npc_data *nd, int setid) { int hIndex = 0; - struct pcrematch_set* retVal___ = NULL; + struct pcrematch_set * retVal___ = NULL; if (HPMHooks.count.HP_npc_chat_lookup_pcreset_pre > 0) { - struct pcrematch_set* (*preHookFunc) (struct npc_data **nd, int *setid); + struct pcrematch_set * (*preHookFunc) (struct npc_data **nd, int *setid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_lookup_pcreset_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_chat_lookup_pcreset_pre[hIndex].func; @@ -58515,7 +58515,7 @@ struct pcrematch_set* HP_npc_chat_lookup_pcreset(struct npc_data *nd, int setid) retVal___ = HPMHooks.source.npc_chat.lookup_pcreset(nd, setid); } if (HPMHooks.count.HP_npc_chat_lookup_pcreset_post > 0) { - struct pcrematch_set* (*postHookFunc) (struct pcrematch_set* retVal___, struct npc_data *nd, int setid); + struct pcrematch_set * (*postHookFunc) (struct pcrematch_set * retVal___, struct npc_data *nd, int setid); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_lookup_pcreset_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_chat_lookup_pcreset_post[hIndex].func; retVal___ = postHookFunc(retVal___, nd, setid); @@ -58631,11 +58631,11 @@ int HP_npc_get_new_npc_id(void) { } return retVal___; } -struct view_data* HP_npc_get_viewdata(int class_) { +struct view_data * HP_npc_get_viewdata(int class_) { int hIndex = 0; - struct view_data* retVal___ = NULL; + struct view_data * retVal___ = NULL; if (HPMHooks.count.HP_npc_get_viewdata_pre > 0) { - struct view_data* (*preHookFunc) (int *class_); + struct view_data * (*preHookFunc) (int *class_); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_get_viewdata_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_get_viewdata_pre[hIndex].func; @@ -58650,7 +58650,7 @@ struct view_data* HP_npc_get_viewdata(int class_) { retVal___ = HPMHooks.source.npc.get_viewdata(class_); } if (HPMHooks.count.HP_npc_get_viewdata_post > 0) { - struct view_data* (*postHookFunc) (struct view_data* retVal___, int class_); + struct view_data * (*postHookFunc) (struct view_data * retVal___, int class_); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_get_viewdata_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_get_viewdata_post[hIndex].func; retVal___ = postHookFunc(retVal___, class_); @@ -58859,11 +58859,11 @@ int HP_npc_enable(const char *name, int flag) { } return retVal___; } -struct npc_data* HP_npc_name2id(const char *name) { +struct npc_data * HP_npc_name2id(const char *name) { int hIndex = 0; - struct npc_data* retVal___ = NULL; + struct npc_data * retVal___ = NULL; if (HPMHooks.count.HP_npc_name2id_pre > 0) { - struct npc_data* (*preHookFunc) (const char **name); + struct npc_data * (*preHookFunc) (const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_name2id_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_name2id_pre[hIndex].func; @@ -58878,7 +58878,7 @@ struct npc_data* HP_npc_name2id(const char *name) { retVal___ = HPMHooks.source.npc.name2id(name); } if (HPMHooks.count.HP_npc_name2id_post > 0) { - struct npc_data* (*postHookFunc) (struct npc_data* retVal___, const char *name); + struct npc_data * (*postHookFunc) (struct npc_data * retVal___, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_name2id_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_name2id_post[hIndex].func; retVal___ = postHookFunc(retVal___, name); @@ -59576,11 +59576,11 @@ int HP_npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range) { } return retVal___; } -struct npc_data* HP_npc_checknear(struct map_session_data *sd, struct block_list *bl) { +struct npc_data * HP_npc_checknear(struct map_session_data *sd, struct block_list *bl) { int hIndex = 0; - struct npc_data* retVal___ = NULL; + struct npc_data * retVal___ = NULL; if (HPMHooks.count.HP_npc_checknear_pre > 0) { - struct npc_data* (*preHookFunc) (struct map_session_data **sd, struct block_list **bl); + struct npc_data * (*preHookFunc) (struct map_session_data **sd, struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_checknear_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_checknear_pre[hIndex].func; @@ -59595,7 +59595,7 @@ struct npc_data* HP_npc_checknear(struct map_session_data *sd, struct block_list retVal___ = HPMHooks.source.npc.checknear(sd, bl); } if (HPMHooks.count.HP_npc_checknear_post > 0) { - struct npc_data* (*postHookFunc) (struct npc_data* retVal___, struct map_session_data *sd, struct block_list *bl); + struct npc_data * (*postHookFunc) (struct npc_data * retVal___, struct map_session_data *sd, struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_checknear_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_checknear_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, bl); @@ -60189,11 +60189,11 @@ void HP_npc_delsrcfile(const char *name) { } return; } -const char* HP_npc_retainpathreference(const char *filepath) { +const char * HP_npc_retainpathreference(const char *filepath) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_npc_retainpathreference_pre > 0) { - const char* (*preHookFunc) (const char **filepath); + const char * (*preHookFunc) (const char **filepath); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_retainpathreference_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_retainpathreference_pre[hIndex].func; @@ -60208,7 +60208,7 @@ const char* HP_npc_retainpathreference(const char *filepath) { retVal___ = HPMHooks.source.npc.retainpathreference(filepath); } if (HPMHooks.count.HP_npc_retainpathreference_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *filepath); + const char * (*postHookFunc) (const char * retVal___, const char *filepath); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_retainpathreference_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_retainpathreference_post[hIndex].func; retVal___ = postHookFunc(retVal___, filepath); @@ -60322,11 +60322,11 @@ bool HP_npc_viewisid(const char *viewid) { } return retVal___; } -struct npc_data* HP_npc_create_npc(enum npc_subtype subtype, int m, int x, int y, enum unit_dir dir, int class_) { +struct npc_data * HP_npc_create_npc(enum npc_subtype subtype, int m, int x, int y, enum unit_dir dir, int class_) { int hIndex = 0; - struct npc_data* retVal___ = NULL; + struct npc_data * retVal___ = NULL; if (HPMHooks.count.HP_npc_create_npc_pre > 0) { - struct npc_data* (*preHookFunc) (enum npc_subtype *subtype, int *m, int *x, int *y, enum unit_dir *dir, int *class_); + struct npc_data * (*preHookFunc) (enum npc_subtype *subtype, int *m, int *x, int *y, enum unit_dir *dir, int *class_); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_create_npc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_create_npc_pre[hIndex].func; @@ -60341,7 +60341,7 @@ struct npc_data* HP_npc_create_npc(enum npc_subtype subtype, int m, int x, int y retVal___ = HPMHooks.source.npc.create_npc(subtype, m, x, y, dir, class_); } if (HPMHooks.count.HP_npc_create_npc_post > 0) { - struct npc_data* (*postHookFunc) (struct npc_data* retVal___, enum npc_subtype subtype, int m, int x, int y, enum unit_dir dir, int class_); + struct npc_data * (*postHookFunc) (struct npc_data * retVal___, enum npc_subtype subtype, int m, int x, int y, enum unit_dir dir, int class_); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_create_npc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_create_npc_post[hIndex].func; retVal___ = postHookFunc(retVal___, subtype, m, x, y, dir, class_); @@ -60349,11 +60349,11 @@ struct npc_data* HP_npc_create_npc(enum npc_subtype subtype, int m, int x, int y } return retVal___; } -struct npc_data* HP_npc_add_warp(char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y) { +struct npc_data * HP_npc_add_warp(char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y) { int hIndex = 0; - struct npc_data* retVal___ = NULL; + struct npc_data * retVal___ = NULL; if (HPMHooks.count.HP_npc_add_warp_pre > 0) { - struct npc_data* (*preHookFunc) (char **name, short *from_mapid, short *from_x, short *from_y, short *xs, short *ys, unsigned short *to_mapindex, short *to_x, short *to_y); + struct npc_data * (*preHookFunc) (char **name, short *from_mapid, short *from_x, short *from_y, short *xs, short *ys, unsigned short *to_mapindex, short *to_x, short *to_y); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_warp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_add_warp_pre[hIndex].func; @@ -60368,7 +60368,7 @@ struct npc_data* HP_npc_add_warp(char *name, short from_mapid, short from_x, sho retVal___ = HPMHooks.source.npc.add_warp(name, from_mapid, from_x, from_y, xs, ys, to_mapindex, to_x, to_y); } if (HPMHooks.count.HP_npc_add_warp_post > 0) { - struct npc_data* (*postHookFunc) (struct npc_data* retVal___, char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y); + struct npc_data * (*postHookFunc) (struct npc_data * retVal___, char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_warp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_add_warp_post[hIndex].func; retVal___ = postHookFunc(retVal___, name, from_mapid, from_x, from_y, xs, ys, to_mapindex, to_x, to_y); @@ -60376,11 +60376,11 @@ struct npc_data* HP_npc_add_warp(char *name, short from_mapid, short from_x, sho } return retVal___; } -const char* HP_npc_parse_warp(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char * HP_npc_parse_warp(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_npc_parse_warp_pre > 0) { - const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); + const char * (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_warp_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_parse_warp_pre[hIndex].func; @@ -60395,7 +60395,7 @@ const char* HP_npc_parse_warp(const char *w1, const char *w2, const char *w3, co retVal___ = HPMHooks.source.npc.parse_warp(w1, w2, w3, w4, start, buffer, filepath, retval); } if (HPMHooks.count.HP_npc_parse_warp_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char * (*postHookFunc) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_warp_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_parse_warp_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -60403,11 +60403,11 @@ const char* HP_npc_parse_warp(const char *w1, const char *w2, const char *w3, co } return retVal___; } -const char* HP_npc_parse_shop(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char * HP_npc_parse_shop(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_npc_parse_shop_pre > 0) { - const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); + const char * (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_shop_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_parse_shop_pre[hIndex].func; @@ -60422,7 +60422,7 @@ const char* HP_npc_parse_shop(const char *w1, const char *w2, const char *w3, co retVal___ = HPMHooks.source.npc.parse_shop(w1, w2, w3, w4, start, buffer, filepath, retval); } if (HPMHooks.count.HP_npc_parse_shop_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char * (*postHookFunc) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_shop_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_parse_shop_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -60430,11 +60430,11 @@ const char* HP_npc_parse_shop(const char *w1, const char *w2, const char *w3, co } return retVal___; } -const char* HP_npc_parse_unknown_object(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char * HP_npc_parse_unknown_object(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_npc_parse_unknown_object_pre > 0) { - const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); + const char * (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_object_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_parse_unknown_object_pre[hIndex].func; @@ -60449,7 +60449,7 @@ const char* HP_npc_parse_unknown_object(const char *w1, const char *w2, const ch retVal___ = HPMHooks.source.npc.parse_unknown_object(w1, w2, w3, w4, start, buffer, filepath, retval); } if (HPMHooks.count.HP_npc_parse_unknown_object_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char * (*postHookFunc) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_object_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_parse_unknown_object_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -60483,11 +60483,11 @@ void HP_npc_convertlabel_db(struct npc_label_list *label_list, const char *filep } return; } -const char* HP_npc_skip_script(const char *start, const char *buffer, const char *filepath, int *retval) { +const char * HP_npc_skip_script(const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_npc_skip_script_pre > 0) { - const char* (*preHookFunc) (const char **start, const char **buffer, const char **filepath, int **retval); + const char * (*preHookFunc) (const char **start, const char **buffer, const char **filepath, int **retval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_skip_script_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_skip_script_pre[hIndex].func; @@ -60502,7 +60502,7 @@ const char* HP_npc_skip_script(const char *start, const char *buffer, const char retVal___ = HPMHooks.source.npc.skip_script(start, buffer, filepath, retval); } if (HPMHooks.count.HP_npc_skip_script_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *start, const char *buffer, const char *filepath, int *retval); + const char * (*postHookFunc) (const char * retVal___, const char *start, const char *buffer, const char *filepath, int *retval); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_skip_script_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_skip_script_post[hIndex].func; retVal___ = postHookFunc(retVal___, start, buffer, filepath, retval); @@ -60510,11 +60510,11 @@ const char* HP_npc_skip_script(const char *start, const char *buffer, const char } return retVal___; } -const char* HP_npc_parse_script(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) { +const char * HP_npc_parse_script(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_npc_parse_script_pre > 0) { - const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval); + const char * (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_script_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_parse_script_pre[hIndex].func; @@ -60529,7 +60529,7 @@ const char* HP_npc_parse_script(const char *w1, const char *w2, const char *w3, retVal___ = HPMHooks.source.npc.parse_script(w1, w2, w3, w4, start, buffer, filepath, options, retval); } if (HPMHooks.count.HP_npc_parse_script_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval); + const char * (*postHookFunc) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_script_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_parse_script_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, options, retval); @@ -60671,11 +60671,11 @@ bool HP_npc_duplicate_sub(struct npc_data *nd, const struct npc_data *snd, int x } return retVal___; } -const char* HP_npc_parse_duplicate(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) { +const char * HP_npc_parse_duplicate(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_npc_parse_duplicate_pre > 0) { - const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval); + const char * (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_duplicate_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_parse_duplicate_pre[hIndex].func; @@ -60690,7 +60690,7 @@ const char* HP_npc_parse_duplicate(const char *w1, const char *w2, const char *w retVal___ = HPMHooks.source.npc.parse_duplicate(w1, w2, w3, w4, start, buffer, filepath, options, retval); } if (HPMHooks.count.HP_npc_parse_duplicate_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval); + const char * (*postHookFunc) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_duplicate_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_parse_duplicate_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, options, retval); @@ -60915,11 +60915,11 @@ int HP_npc_do_atcmd_event(struct map_session_data *sd, const char *command, cons } return retVal___; } -const char* HP_npc_parse_function(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char * HP_npc_parse_function(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_npc_parse_function_pre > 0) { - const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); + const char * (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_function_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_parse_function_pre[hIndex].func; @@ -60934,7 +60934,7 @@ const char* HP_npc_parse_function(const char *w1, const char *w2, const char *w3 retVal___ = HPMHooks.source.npc.parse_function(w1, w2, w3, w4, start, buffer, filepath, retval); } if (HPMHooks.count.HP_npc_parse_function_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char * (*postHookFunc) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_function_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_parse_function_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -60968,11 +60968,11 @@ void HP_npc_parse_mob2(struct spawn_data *mobspawn) { } return; } -const char* HP_npc_parse_mob(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char * HP_npc_parse_mob(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_npc_parse_mob_pre > 0) { - const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); + const char * (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_parse_mob_pre[hIndex].func; @@ -60987,7 +60987,7 @@ const char* HP_npc_parse_mob(const char *w1, const char *w2, const char *w3, con retVal___ = HPMHooks.source.npc.parse_mob(w1, w2, w3, w4, start, buffer, filepath, retval); } if (HPMHooks.count.HP_npc_parse_mob_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char * (*postHookFunc) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_parse_mob_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -60995,11 +60995,11 @@ const char* HP_npc_parse_mob(const char *w1, const char *w2, const char *w3, con } return retVal___; } -const char* HP_npc_parse_mapflag(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { +const char * HP_npc_parse_mapflag(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_npc_parse_mapflag_pre > 0) { - const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); + const char * (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mapflag_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_npc_parse_mapflag_pre[hIndex].func; @@ -61014,7 +61014,7 @@ const char* HP_npc_parse_mapflag(const char *w1, const char *w2, const char *w3, retVal___ = HPMHooks.source.npc.parse_mapflag(w1, w2, w3, w4, start, buffer, filepath, retval); } if (HPMHooks.count.HP_npc_parse_mapflag_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); + const char * (*postHookFunc) (const char * retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval); for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mapflag_post; hIndex++) { postHookFunc = HPMHooks.list.HP_npc_parse_mapflag_post[hIndex].func; retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval); @@ -62272,11 +62272,11 @@ void HP_party_final(void) { } return; } -struct party_data* HP_party_search(int party_id) { +struct party_data * HP_party_search(int party_id) { int hIndex = 0; - struct party_data* retVal___ = NULL; + struct party_data * retVal___ = NULL; if (HPMHooks.count.HP_party_search_pre > 0) { - struct party_data* (*preHookFunc) (int *party_id); + struct party_data * (*preHookFunc) (int *party_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_party_search_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_party_search_pre[hIndex].func; @@ -62291,7 +62291,7 @@ struct party_data* HP_party_search(int party_id) { retVal___ = HPMHooks.source.party.search(party_id); } if (HPMHooks.count.HP_party_search_post > 0) { - struct party_data* (*postHookFunc) (struct party_data* retVal___, int party_id); + struct party_data * (*postHookFunc) (struct party_data * retVal___, int party_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_party_search_post; hIndex++) { postHookFunc = HPMHooks.list.HP_party_search_post[hIndex].func; retVal___ = postHookFunc(retVal___, party_id); @@ -62299,11 +62299,11 @@ struct party_data* HP_party_search(int party_id) { } return retVal___; } -struct party_data* HP_party_searchname(const char *str) { +struct party_data * HP_party_searchname(const char *str) { int hIndex = 0; - struct party_data* retVal___ = NULL; + struct party_data * retVal___ = NULL; if (HPMHooks.count.HP_party_searchname_pre > 0) { - struct party_data* (*preHookFunc) (const char **str); + struct party_data * (*preHookFunc) (const char **str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_party_searchname_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_party_searchname_pre[hIndex].func; @@ -62318,7 +62318,7 @@ struct party_data* HP_party_searchname(const char *str) { retVal___ = HPMHooks.source.party.searchname(str); } if (HPMHooks.count.HP_party_searchname_post > 0) { - struct party_data* (*postHookFunc) (struct party_data* retVal___, const char *str); + struct party_data * (*postHookFunc) (struct party_data * retVal___, const char *str); for (hIndex = 0; hIndex < HPMHooks.count.HP_party_searchname_post; hIndex++) { postHookFunc = HPMHooks.list.HP_party_searchname_post[hIndex].func; retVal___ = postHookFunc(retVal___, str); @@ -62353,11 +62353,11 @@ int HP_party_getmemberid(struct party_data *p, struct map_session_data *sd) { } return retVal___; } -struct map_session_data* HP_party_getavailablesd(struct party_data *p) { +struct map_session_data * HP_party_getavailablesd(struct party_data *p) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_party_getavailablesd_pre > 0) { - struct map_session_data* (*preHookFunc) (struct party_data **p); + struct map_session_data * (*preHookFunc) (struct party_data **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_party_getavailablesd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_party_getavailablesd_pre[hIndex].func; @@ -62372,7 +62372,7 @@ struct map_session_data* HP_party_getavailablesd(struct party_data *p) { retVal___ = HPMHooks.source.party.getavailablesd(p); } if (HPMHooks.count.HP_party_getavailablesd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct party_data *p); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct party_data *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_party_getavailablesd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_party_getavailablesd_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -63412,11 +63412,11 @@ void HP_party_fill_member(struct party_member *member, struct map_session_data * } return; } -struct map_session_data* HP_party_sd_check(int party_id, int account_id, int char_id) { +struct map_session_data * HP_party_sd_check(int party_id, int account_id, int char_id) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_party_sd_check_pre > 0) { - struct map_session_data* (*preHookFunc) (int *party_id, int *account_id, int *char_id); + struct map_session_data * (*preHookFunc) (int *party_id, int *account_id, int *char_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_party_sd_check_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_party_sd_check_pre[hIndex].func; @@ -63431,7 +63431,7 @@ struct map_session_data* HP_party_sd_check(int party_id, int account_id, int cha retVal___ = HPMHooks.source.party.sd_check(party_id, account_id, char_id); } if (HPMHooks.count.HP_party_sd_check_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int party_id, int account_id, int char_id); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, int party_id, int account_id, int char_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_party_sd_check_post; hIndex++) { postHookFunc = HPMHooks.list.HP_party_sd_check_post[hIndex].func; retVal___ = postHookFunc(retVal___, party_id, account_id, char_id); @@ -63465,11 +63465,11 @@ void HP_party_check_state(struct party_data *p) { } return; } -struct party_booking_ad_info* HP_party_create_booking_data(void) { +struct party_booking_ad_info * HP_party_create_booking_data(void) { int hIndex = 0; - struct party_booking_ad_info* retVal___ = NULL; + struct party_booking_ad_info * retVal___ = NULL; if (HPMHooks.count.HP_party_create_booking_data_pre > 0) { - struct party_booking_ad_info* (*preHookFunc) (void); + struct party_booking_ad_info * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_party_create_booking_data_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_party_create_booking_data_pre[hIndex].func; @@ -63484,7 +63484,7 @@ struct party_booking_ad_info* HP_party_create_booking_data(void) { retVal___ = HPMHooks.source.party.create_booking_data(); } if (HPMHooks.count.HP_party_create_booking_data_post > 0) { - struct party_booking_ad_info* (*postHookFunc) (struct party_booking_ad_info* retVal___); + struct party_booking_ad_info * (*postHookFunc) (struct party_booking_ad_info * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_party_create_booking_data_post; hIndex++) { postHookFunc = HPMHooks.list.HP_party_create_booking_data_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -63794,11 +63794,11 @@ void HP_pcg_reload(void) { } return; } -GroupSettings* HP_pcg_get_dummy_group(void) { +GroupSettings * HP_pcg_get_dummy_group(void) { int hIndex = 0; - GroupSettings* retVal___ = NULL; + GroupSettings * retVal___ = NULL; if (HPMHooks.count.HP_pcg_get_dummy_group_pre > 0) { - GroupSettings* (*preHookFunc) (void); + GroupSettings * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_dummy_group_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pcg_get_dummy_group_pre[hIndex].func; @@ -63813,7 +63813,7 @@ GroupSettings* HP_pcg_get_dummy_group(void) { retVal___ = HPMHooks.source.pcg.get_dummy_group(); } if (HPMHooks.count.HP_pcg_get_dummy_group_post > 0) { - GroupSettings* (*postHookFunc) (GroupSettings* retVal___); + GroupSettings * (*postHookFunc) (GroupSettings * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_dummy_group_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pcg_get_dummy_group_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -63848,11 +63848,11 @@ bool HP_pcg_exists(int group_id) { } return retVal___; } -GroupSettings* HP_pcg_id2group(int group_id) { +GroupSettings * HP_pcg_id2group(int group_id) { int hIndex = 0; - GroupSettings* retVal___ = NULL; + GroupSettings * retVal___ = NULL; if (HPMHooks.count.HP_pcg_id2group_pre > 0) { - GroupSettings* (*preHookFunc) (int *group_id); + GroupSettings * (*preHookFunc) (int *group_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_id2group_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pcg_id2group_pre[hIndex].func; @@ -63867,7 +63867,7 @@ GroupSettings* HP_pcg_id2group(int group_id) { retVal___ = HPMHooks.source.pcg.id2group(group_id); } if (HPMHooks.count.HP_pcg_id2group_post > 0) { - GroupSettings* (*postHookFunc) (GroupSettings* retVal___, int group_id); + GroupSettings * (*postHookFunc) (GroupSettings * retVal___, int group_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_id2group_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pcg_id2group_post[hIndex].func; retVal___ = postHookFunc(retVal___, group_id); @@ -63929,11 +63929,11 @@ bool HP_pcg_should_log_commands(GroupSettings *group) { } return retVal___; } -const char* HP_pcg_get_name(GroupSettings *group) { +const char * HP_pcg_get_name(GroupSettings *group) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_pcg_get_name_pre > 0) { - const char* (*preHookFunc) (GroupSettings **group); + const char * (*preHookFunc) (GroupSettings **group); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pcg_get_name_pre[hIndex].func; @@ -63948,7 +63948,7 @@ const char* HP_pcg_get_name(GroupSettings *group) { retVal___ = HPMHooks.source.pcg.get_name(group); } if (HPMHooks.count.HP_pcg_get_name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, GroupSettings *group); + const char * (*postHookFunc) (const char * retVal___, GroupSettings *group); for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pcg_get_name_post[hIndex].func; retVal___ = postHookFunc(retVal___, group); @@ -64063,11 +64063,11 @@ void HP_pc_final(void) { } return; } -struct map_session_data* HP_pc_get_dummy_sd(void) { +struct map_session_data * HP_pc_get_dummy_sd(void) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_pc_get_dummy_sd_pre > 0) { - struct map_session_data* (*preHookFunc) (void); + struct map_session_data * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_dummy_sd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_get_dummy_sd_pre[hIndex].func; @@ -64082,7 +64082,7 @@ struct map_session_data* HP_pc_get_dummy_sd(void) { retVal___ = HPMHooks.source.pc.get_dummy_sd(); } if (HPMHooks.count.HP_pc_get_dummy_sd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_dummy_sd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_get_dummy_sd_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -67551,11 +67551,11 @@ void HP_pc_setreg(struct map_session_data *sd, int64 reg, int val) { } return; } -char* HP_pc_readregstr(struct map_session_data *sd, int64 reg) { +char * HP_pc_readregstr(struct map_session_data *sd, int64 reg) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_pc_readregstr_pre > 0) { - char* (*preHookFunc) (struct map_session_data **sd, int64 *reg); + char * (*preHookFunc) (struct map_session_data **sd, int64 *reg); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregstr_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_readregstr_pre[hIndex].func; @@ -67570,7 +67570,7 @@ char* HP_pc_readregstr(struct map_session_data *sd, int64 reg) { retVal___ = HPMHooks.source.pc.readregstr(sd, reg); } if (HPMHooks.count.HP_pc_readregstr_post > 0) { - char* (*postHookFunc) (char* retVal___, struct map_session_data *sd, int64 reg); + char * (*postHookFunc) (char * retVal___, struct map_session_data *sd, int64 reg); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregstr_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_readregstr_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, reg); @@ -67658,11 +67658,11 @@ int HP_pc_setregistry(struct map_session_data *sd, int64 reg, int val) { } return retVal___; } -char* HP_pc_readregistry_str(struct map_session_data *sd, int64 reg) { +char * HP_pc_readregistry_str(struct map_session_data *sd, int64 reg) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_pc_readregistry_str_pre > 0) { - char* (*preHookFunc) (struct map_session_data **sd, int64 *reg); + char * (*preHookFunc) (struct map_session_data **sd, int64 *reg); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregistry_str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_readregistry_str_pre[hIndex].func; @@ -67677,7 +67677,7 @@ char* HP_pc_readregistry_str(struct map_session_data *sd, int64 reg) { retVal___ = HPMHooks.source.pc.readregistry_str(sd, reg); } if (HPMHooks.count.HP_pc_readregistry_str_post > 0) { - char* (*postHookFunc) (char* retVal___, struct map_session_data *sd, int64 reg); + char * (*postHookFunc) (char * retVal___, struct map_session_data *sd, int64 reg); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregistry_str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_readregistry_str_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, reg); @@ -67988,11 +67988,11 @@ int HP_pc_divorce(struct map_session_data *sd) { } return retVal___; } -struct map_session_data* HP_pc_get_partner(struct map_session_data *sd) { +struct map_session_data * HP_pc_get_partner(struct map_session_data *sd) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_pc_get_partner_pre > 0) { - struct map_session_data* (*preHookFunc) (struct map_session_data **sd); + struct map_session_data * (*preHookFunc) (struct map_session_data **sd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_partner_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_get_partner_pre[hIndex].func; @@ -68007,7 +68007,7 @@ struct map_session_data* HP_pc_get_partner(struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.get_partner(sd); } if (HPMHooks.count.HP_pc_get_partner_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct map_session_data *sd); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct map_session_data *sd); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_partner_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_get_partner_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -68015,11 +68015,11 @@ struct map_session_data* HP_pc_get_partner(struct map_session_data *sd) { } return retVal___; } -struct map_session_data* HP_pc_get_father(struct map_session_data *sd) { +struct map_session_data * HP_pc_get_father(struct map_session_data *sd) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_pc_get_father_pre > 0) { - struct map_session_data* (*preHookFunc) (struct map_session_data **sd); + struct map_session_data * (*preHookFunc) (struct map_session_data **sd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_father_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_get_father_pre[hIndex].func; @@ -68034,7 +68034,7 @@ struct map_session_data* HP_pc_get_father(struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.get_father(sd); } if (HPMHooks.count.HP_pc_get_father_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct map_session_data *sd); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct map_session_data *sd); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_father_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_get_father_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -68042,11 +68042,11 @@ struct map_session_data* HP_pc_get_father(struct map_session_data *sd) { } return retVal___; } -struct map_session_data* HP_pc_get_mother(struct map_session_data *sd) { +struct map_session_data * HP_pc_get_mother(struct map_session_data *sd) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_pc_get_mother_pre > 0) { - struct map_session_data* (*preHookFunc) (struct map_session_data **sd); + struct map_session_data * (*preHookFunc) (struct map_session_data **sd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_mother_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_get_mother_pre[hIndex].func; @@ -68061,7 +68061,7 @@ struct map_session_data* HP_pc_get_mother(struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.get_mother(sd); } if (HPMHooks.count.HP_pc_get_mother_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct map_session_data *sd); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct map_session_data *sd); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_mother_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_get_mother_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -68069,11 +68069,11 @@ struct map_session_data* HP_pc_get_mother(struct map_session_data *sd) { } return retVal___; } -struct map_session_data* HP_pc_get_child(struct map_session_data *sd) { +struct map_session_data * HP_pc_get_child(struct map_session_data *sd) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_pc_get_child_pre > 0) { - struct map_session_data* (*preHookFunc) (struct map_session_data **sd); + struct map_session_data * (*preHookFunc) (struct map_session_data **sd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_child_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_get_child_pre[hIndex].func; @@ -68088,7 +68088,7 @@ struct map_session_data* HP_pc_get_child(struct map_session_data *sd) { retVal___ = HPMHooks.source.pc.get_child(sd); } if (HPMHooks.count.HP_pc_get_child_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct map_session_data *sd); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct map_session_data *sd); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_child_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_get_child_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd); @@ -68255,11 +68255,11 @@ int HP_pc_mapid2jobid(unsigned int class_, int sex) { } return retVal___; } -const char* HP_pc_job_name(int class) { +const char * HP_pc_job_name(int class) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_pc_job_name_pre > 0) { - const char* (*preHookFunc) (int *class); + const char * (*preHookFunc) (int *class); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_job_name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_job_name_pre[hIndex].func; @@ -68274,7 +68274,7 @@ const char* HP_pc_job_name(int class) { retVal___ = HPMHooks.source.pc.job_name(class); } if (HPMHooks.count.HP_pc_job_name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, int class); + const char * (*postHookFunc) (const char * retVal___, int class); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_job_name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_job_name_post[hIndex].func; retVal___ = postHookFunc(retVal___, class); @@ -70958,11 +70958,11 @@ void HP_pc_crimson_marker_clear(struct map_session_data *sd) { return; } /* pcre_interface */ -pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) { +pcre * HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) { int hIndex = 0; - pcre* retVal___ = NULL; + pcre * retVal___ = NULL; if (HPMHooks.count.HP_libpcre_compile_pre > 0) { - pcre* (*preHookFunc) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr); + pcre * (*preHookFunc) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_compile_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libpcre_compile_pre[hIndex].func; @@ -70977,7 +70977,7 @@ pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, retVal___ = HPMHooks.source.libpcre.compile(pattern, options, errptr, erroffset, tableptr); } if (HPMHooks.count.HP_libpcre_compile_post > 0) { - pcre* (*postHookFunc) (pcre* retVal___, const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr); + pcre * (*postHookFunc) (pcre * retVal___, const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr); for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_compile_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libpcre_compile_post[hIndex].func; retVal___ = postHookFunc(retVal___, pattern, options, errptr, erroffset, tableptr); @@ -70985,11 +70985,11 @@ pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, } return retVal___; } -pcre_extra* HP_libpcre_study(const pcre *code, int options, const char **errptr) { +pcre_extra * HP_libpcre_study(const pcre *code, int options, const char **errptr) { int hIndex = 0; - pcre_extra* retVal___ = NULL; + pcre_extra * retVal___ = NULL; if (HPMHooks.count.HP_libpcre_study_pre > 0) { - pcre_extra* (*preHookFunc) (const pcre **code, int *options, const char ***errptr); + pcre_extra * (*preHookFunc) (const pcre **code, int *options, const char ***errptr); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_study_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_libpcre_study_pre[hIndex].func; @@ -71004,7 +71004,7 @@ pcre_extra* HP_libpcre_study(const pcre *code, int options, const char **errptr) retVal___ = HPMHooks.source.libpcre.study(code, options, errptr); } if (HPMHooks.count.HP_libpcre_study_post > 0) { - pcre_extra* (*postHookFunc) (pcre_extra* retVal___, const pcre *code, int options, const char **errptr); + pcre_extra * (*postHookFunc) (pcre_extra * retVal___, const pcre *code, int options, const char **errptr); for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_study_post; hIndex++) { postHookFunc = HPMHooks.list.HP_libpcre_study_post[hIndex].func; retVal___ = postHookFunc(retVal___, code, options, errptr); @@ -72502,11 +72502,11 @@ void HP_quest_reload(void) { } return; } -struct quest_db* HP_quest_db(int quest_id) { +struct quest_db * HP_quest_db(int quest_id) { int hIndex = 0; - struct quest_db* retVal___ = NULL; + struct quest_db * retVal___ = NULL; if (HPMHooks.count.HP_quest_db_pre > 0) { - struct quest_db* (*preHookFunc) (int *quest_id); + struct quest_db * (*preHookFunc) (int *quest_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_db_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_quest_db_pre[hIndex].func; @@ -72521,7 +72521,7 @@ struct quest_db* HP_quest_db(int quest_id) { retVal___ = HPMHooks.source.quest.db(quest_id); } if (HPMHooks.count.HP_quest_db_post > 0) { - struct quest_db* (*postHookFunc) (struct quest_db* retVal___, int quest_id); + struct quest_db * (*postHookFunc) (struct quest_db * retVal___, int quest_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_db_post; hIndex++) { postHookFunc = HPMHooks.list.HP_quest_db_post[hIndex].func; retVal___ = postHookFunc(retVal___, quest_id); @@ -72803,11 +72803,11 @@ int HP_quest_read_db(void) { } return retVal___; } -struct quest_db* HP_quest_read_db_sub(struct config_setting_t *cs, int n, const char *source) { +struct quest_db * HP_quest_read_db_sub(struct config_setting_t *cs, int n, const char *source) { int hIndex = 0; - struct quest_db* retVal___ = NULL; + struct quest_db * retVal___ = NULL; if (HPMHooks.count.HP_quest_read_db_sub_pre > 0) { - struct quest_db* (*preHookFunc) (struct config_setting_t **cs, int *n, const char **source); + struct quest_db * (*preHookFunc) (struct config_setting_t **cs, int *n, const char **source); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_read_db_sub_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_quest_read_db_sub_pre[hIndex].func; @@ -72822,7 +72822,7 @@ struct quest_db* HP_quest_read_db_sub(struct config_setting_t *cs, int n, const retVal___ = HPMHooks.source.quest.read_db_sub(cs, n, source); } if (HPMHooks.count.HP_quest_read_db_sub_post > 0) { - struct quest_db* (*postHookFunc) (struct quest_db* retVal___, struct config_setting_t *cs, int n, const char *source); + struct quest_db * (*postHookFunc) (struct quest_db * retVal___, struct config_setting_t *cs, int n, const char *source); for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_read_db_sub_post; hIndex++) { postHookFunc = HPMHooks.list.HP_quest_read_db_sub_post[hIndex].func; retVal___ = postHookFunc(retVal___, cs, n, source); @@ -74141,11 +74141,11 @@ void HP_rodex_send_mail_result(struct map_session_data *ssd, struct map_session_ } return; } -struct rodex_message* HP_rodex_get_mail(struct map_session_data *sd, int64 mail_id) { +struct rodex_message * HP_rodex_get_mail(struct map_session_data *sd, int64 mail_id) { int hIndex = 0; - struct rodex_message* retVal___ = NULL; + struct rodex_message * retVal___ = NULL; if (HPMHooks.count.HP_rodex_get_mail_pre > 0) { - struct rodex_message* (*preHookFunc) (struct map_session_data **sd, int64 *mail_id); + struct rodex_message * (*preHookFunc) (struct map_session_data **sd, int64 *mail_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_rodex_get_mail_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_rodex_get_mail_pre[hIndex].func; @@ -74160,7 +74160,7 @@ struct rodex_message* HP_rodex_get_mail(struct map_session_data *sd, int64 mail_ retVal___ = HPMHooks.source.rodex.get_mail(sd, mail_id); } if (HPMHooks.count.HP_rodex_get_mail_post > 0) { - struct rodex_message* (*postHookFunc) (struct rodex_message* retVal___, struct map_session_data *sd, int64 mail_id); + struct rodex_message * (*postHookFunc) (struct rodex_message * retVal___, struct map_session_data *sd, int64 mail_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_rodex_get_mail_post; hIndex++) { postHookFunc = HPMHooks.list.HP_rodex_get_mail_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, mail_id); @@ -74430,11 +74430,11 @@ int HP_script_reload(void) { } return retVal___; } -struct script_code* HP_script_parse(const char *src, const char *file, int line, int options, int *retval) { +struct script_code * HP_script_parse(const char *src, const char *file, int line, int options, int *retval) { int hIndex = 0; - struct script_code* retVal___ = NULL; + struct script_code * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_pre > 0) { - struct script_code* (*preHookFunc) (const char **src, const char **file, int *line, int *options, int **retval); + struct script_code * (*preHookFunc) (const char **src, const char **file, int *line, int *options, int **retval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_pre[hIndex].func; @@ -74449,7 +74449,7 @@ struct script_code* HP_script_parse(const char *src, const char *file, int line, retVal___ = HPMHooks.source.script.parse(src, file, line, options, retval); } if (HPMHooks.count.HP_script_parse_post > 0) { - struct script_code* (*postHookFunc) (struct script_code* retVal___, const char *src, const char *file, int line, int options, int *retval); + struct script_code * (*postHookFunc) (struct script_code * retVal___, const char *src, const char *file, int line, int options, int *retval); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_post[hIndex].func; retVal___ = postHookFunc(retVal___, src, file, line, options, retval); @@ -74510,11 +74510,11 @@ void HP_script_parse_builtin(void) { } return; } -const char* HP_script_parse_subexpr(const char *p, int limit) { +const char * HP_script_parse_subexpr(const char *p, int limit) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_subexpr_pre > 0) { - const char* (*preHookFunc) (const char **p, int *limit); + const char * (*preHookFunc) (const char **p, int *limit); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_subexpr_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_subexpr_pre[hIndex].func; @@ -74529,7 +74529,7 @@ const char* HP_script_parse_subexpr(const char *p, int limit) { retVal___ = HPMHooks.source.script.parse_subexpr(p, limit); } if (HPMHooks.count.HP_script_parse_subexpr_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p, int limit); + const char * (*postHookFunc) (const char * retVal___, const char *p, int limit); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_subexpr_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_subexpr_post[hIndex].func; retVal___ = postHookFunc(retVal___, p, limit); @@ -74537,11 +74537,11 @@ const char* HP_script_parse_subexpr(const char *p, int limit) { } return retVal___; } -const char* HP_script_skip_space(const char *p) { +const char * HP_script_skip_space(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_skip_space_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_space_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_skip_space_pre[hIndex].func; @@ -74556,7 +74556,7 @@ const char* HP_script_skip_space(const char *p) { retVal___ = HPMHooks.source.script.skip_space(p); } if (HPMHooks.count.HP_script_skip_space_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_space_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_skip_space_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -74670,11 +74670,11 @@ int HP_script_conv_num(struct script_state *st, struct script_data *data) { } return retVal___; } -const char* HP_script_conv_str(struct script_state *st, struct script_data *data) { +const char * HP_script_conv_str(struct script_state *st, struct script_data *data) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_conv_str_pre > 0) { - const char* (*preHookFunc) (struct script_state **st, struct script_data **data); + const char * (*preHookFunc) (struct script_state **st, struct script_data **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_conv_str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_conv_str_pre[hIndex].func; @@ -74689,7 +74689,7 @@ const char* HP_script_conv_str(struct script_state *st, struct script_data *data retVal___ = HPMHooks.source.script.conv_str(st, data); } if (HPMHooks.count.HP_script_conv_str_post > 0) { - const char* (*postHookFunc) (const char* retVal___, struct script_state *st, struct script_data *data); + const char * (*postHookFunc) (const char * retVal___, struct script_state *st, struct script_data *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_conv_str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_conv_str_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, data); @@ -74697,11 +74697,11 @@ const char* HP_script_conv_str(struct script_state *st, struct script_data *data } return retVal___; } -struct map_session_data* HP_script_rid2sd(struct script_state *st) { +struct map_session_data * HP_script_rid2sd(struct script_state *st) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_script_rid2sd_pre > 0) { - struct map_session_data* (*preHookFunc) (struct script_state **st); + struct map_session_data * (*preHookFunc) (struct script_state **st); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_rid2sd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_rid2sd_pre[hIndex].func; @@ -74716,7 +74716,7 @@ struct map_session_data* HP_script_rid2sd(struct script_state *st) { retVal___ = HPMHooks.source.script.rid2sd(st); } if (HPMHooks.count.HP_script_rid2sd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct script_state *st); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct script_state *st); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_rid2sd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_rid2sd_post[hIndex].func; retVal___ = postHookFunc(retVal___, st); @@ -74724,11 +74724,11 @@ struct map_session_data* HP_script_rid2sd(struct script_state *st) { } return retVal___; } -struct map_session_data* HP_script_id2sd(struct script_state *st, int account_id) { +struct map_session_data * HP_script_id2sd(struct script_state *st, int account_id) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_script_id2sd_pre > 0) { - struct map_session_data* (*preHookFunc) (struct script_state **st, int *account_id); + struct map_session_data * (*preHookFunc) (struct script_state **st, int *account_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_id2sd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_id2sd_pre[hIndex].func; @@ -74743,7 +74743,7 @@ struct map_session_data* HP_script_id2sd(struct script_state *st, int account_id retVal___ = HPMHooks.source.script.id2sd(st, account_id); } if (HPMHooks.count.HP_script_id2sd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct script_state *st, int account_id); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct script_state *st, int account_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_id2sd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_id2sd_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, account_id); @@ -74751,11 +74751,11 @@ struct map_session_data* HP_script_id2sd(struct script_state *st, int account_id } return retVal___; } -struct map_session_data* HP_script_charid2sd(struct script_state *st, int char_id) { +struct map_session_data * HP_script_charid2sd(struct script_state *st, int char_id) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_script_charid2sd_pre > 0) { - struct map_session_data* (*preHookFunc) (struct script_state **st, int *char_id); + struct map_session_data * (*preHookFunc) (struct script_state **st, int *char_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_charid2sd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_charid2sd_pre[hIndex].func; @@ -74770,7 +74770,7 @@ struct map_session_data* HP_script_charid2sd(struct script_state *st, int char_i retVal___ = HPMHooks.source.script.charid2sd(st, char_id); } if (HPMHooks.count.HP_script_charid2sd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct script_state *st, int char_id); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct script_state *st, int char_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_charid2sd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_charid2sd_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, char_id); @@ -74778,11 +74778,11 @@ struct map_session_data* HP_script_charid2sd(struct script_state *st, int char_i } return retVal___; } -struct map_session_data* HP_script_nick2sd(struct script_state *st, const char *name) { +struct map_session_data * HP_script_nick2sd(struct script_state *st, const char *name) { int hIndex = 0; - struct map_session_data* retVal___ = NULL; + struct map_session_data * retVal___ = NULL; if (HPMHooks.count.HP_script_nick2sd_pre > 0) { - struct map_session_data* (*preHookFunc) (struct script_state **st, const char **name); + struct map_session_data * (*preHookFunc) (struct script_state **st, const char **name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_nick2sd_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_nick2sd_pre[hIndex].func; @@ -74797,7 +74797,7 @@ struct map_session_data* HP_script_nick2sd(struct script_state *st, const char * retVal___ = HPMHooks.source.script.nick2sd(st, name); } if (HPMHooks.count.HP_script_nick2sd_post > 0) { - struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct script_state *st, const char *name); + struct map_session_data * (*postHookFunc) (struct map_session_data * retVal___, struct script_state *st, const char *name); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_nick2sd_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_nick2sd_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, name); @@ -74831,11 +74831,11 @@ void HP_script_detach_rid(struct script_state *st) { } return; } -struct script_data* HP_script_push_val(struct script_stack *stack, enum c_op type, int64 val, struct reg_db *ref) { +struct script_data * HP_script_push_val(struct script_stack *stack, enum c_op type, int64 val, struct reg_db *ref) { int hIndex = 0; - struct script_data* retVal___ = NULL; + struct script_data * retVal___ = NULL; if (HPMHooks.count.HP_script_push_val_pre > 0) { - struct script_data* (*preHookFunc) (struct script_stack **stack, enum c_op *type, int64 *val, struct reg_db **ref); + struct script_data * (*preHookFunc) (struct script_stack **stack, enum c_op *type, int64 *val, struct reg_db **ref); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_val_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_push_val_pre[hIndex].func; @@ -74850,7 +74850,7 @@ struct script_data* HP_script_push_val(struct script_stack *stack, enum c_op typ retVal___ = HPMHooks.source.script.push_val(stack, type, val, ref); } if (HPMHooks.count.HP_script_push_val_post > 0) { - struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, enum c_op type, int64 val, struct reg_db *ref); + struct script_data * (*postHookFunc) (struct script_data * retVal___, struct script_stack *stack, enum c_op type, int64 val, struct reg_db *ref); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_val_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_push_val_post[hIndex].func; retVal___ = postHookFunc(retVal___, stack, type, val, ref); @@ -74858,11 +74858,11 @@ struct script_data* HP_script_push_val(struct script_stack *stack, enum c_op typ } return retVal___; } -struct script_data* HP_script_get_val(struct script_state *st, struct script_data *data) { +struct script_data * HP_script_get_val(struct script_state *st, struct script_data *data) { int hIndex = 0; - struct script_data* retVal___ = NULL; + struct script_data * retVal___ = NULL; if (HPMHooks.count.HP_script_get_val_pre > 0) { - struct script_data* (*preHookFunc) (struct script_state **st, struct script_data **data); + struct script_data * (*preHookFunc) (struct script_state **st, struct script_data **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_get_val_pre[hIndex].func; @@ -74877,7 +74877,7 @@ struct script_data* HP_script_get_val(struct script_state *st, struct script_dat retVal___ = HPMHooks.source.script.get_val(st, data); } if (HPMHooks.count.HP_script_get_val_post > 0) { - struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_state *st, struct script_data *data); + struct script_data * (*postHookFunc) (struct script_data * retVal___, struct script_state *st, struct script_data *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_get_val_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, data); @@ -74885,11 +74885,11 @@ struct script_data* HP_script_get_val(struct script_state *st, struct script_dat } return retVal___; } -char* HP_script_get_val_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) { +char * HP_script_get_val_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_script_get_val_ref_str_pre > 0) { - char* (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); + char * (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_get_val_ref_str_pre[hIndex].func; @@ -74904,7 +74904,7 @@ char* HP_script_get_val_ref_str(struct script_state *st, struct reg_db *n, struc retVal___ = HPMHooks.source.script.get_val_ref_str(st, n, data); } if (HPMHooks.count.HP_script_get_val_ref_str_post > 0) { - char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); + char * (*postHookFunc) (char * retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_get_val_ref_str_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, n, data); @@ -74912,11 +74912,11 @@ char* HP_script_get_val_ref_str(struct script_state *st, struct reg_db *n, struc } return retVal___; } -char* HP_script_get_val_pc_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) { +char * HP_script_get_val_pc_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_script_get_val_pc_ref_str_pre > 0) { - char* (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); + char * (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_str_pre[hIndex].func; @@ -74931,7 +74931,7 @@ char* HP_script_get_val_pc_ref_str(struct script_state *st, struct reg_db *n, st retVal___ = HPMHooks.source.script.get_val_pc_ref_str(st, n, data); } if (HPMHooks.count.HP_script_get_val_pc_ref_str_post > 0) { - char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); + char * (*postHookFunc) (char * retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_str_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, n, data); @@ -74939,11 +74939,11 @@ char* HP_script_get_val_pc_ref_str(struct script_state *st, struct reg_db *n, st } return retVal___; } -char* HP_script_get_val_scope_str(struct script_state *st, struct reg_db *n, struct script_data *data) { +char * HP_script_get_val_scope_str(struct script_state *st, struct reg_db *n, struct script_data *data) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_script_get_val_scope_str_pre > 0) { - char* (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); + char * (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_get_val_scope_str_pre[hIndex].func; @@ -74958,7 +74958,7 @@ char* HP_script_get_val_scope_str(struct script_state *st, struct reg_db *n, str retVal___ = HPMHooks.source.script.get_val_scope_str(st, n, data); } if (HPMHooks.count.HP_script_get_val_scope_str_post > 0) { - char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); + char * (*postHookFunc) (char * retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_get_val_scope_str_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, n, data); @@ -74966,11 +74966,11 @@ char* HP_script_get_val_scope_str(struct script_state *st, struct reg_db *n, str } return retVal___; } -char* HP_script_get_val_npc_str(struct script_state *st, struct reg_db *n, struct script_data *data) { +char * HP_script_get_val_npc_str(struct script_state *st, struct reg_db *n, struct script_data *data) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_script_get_val_npc_str_pre > 0) { - char* (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); + char * (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_get_val_npc_str_pre[hIndex].func; @@ -74985,7 +74985,7 @@ char* HP_script_get_val_npc_str(struct script_state *st, struct reg_db *n, struc retVal___ = HPMHooks.source.script.get_val_npc_str(st, n, data); } if (HPMHooks.count.HP_script_get_val_npc_str_post > 0) { - char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); + char * (*postHookFunc) (char * retVal___, struct script_state *st, struct reg_db *n, struct script_data *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_get_val_npc_str_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, n, data); @@ -74993,11 +74993,11 @@ char* HP_script_get_val_npc_str(struct script_state *st, struct reg_db *n, struc } return retVal___; } -char* HP_script_get_val_instance_str(struct script_state *st, const char *name, struct script_data *data) { +char * HP_script_get_val_instance_str(struct script_state *st, const char *name, struct script_data *data) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_script_get_val_instance_str_pre > 0) { - char* (*preHookFunc) (struct script_state **st, const char **name, struct script_data **data); + char * (*preHookFunc) (struct script_state **st, const char **name, struct script_data **data); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_get_val_instance_str_pre[hIndex].func; @@ -75012,7 +75012,7 @@ char* HP_script_get_val_instance_str(struct script_state *st, const char *name, retVal___ = HPMHooks.source.script.get_val_instance_str(st, name, data); } if (HPMHooks.count.HP_script_get_val_instance_str_post > 0) { - char* (*postHookFunc) (char* retVal___, struct script_state *st, const char *name, struct script_data *data); + char * (*postHookFunc) (char * retVal___, struct script_state *st, const char *name, struct script_data *data); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_get_val_instance_str_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, name, data); @@ -75155,11 +75155,11 @@ int HP_script_get_val_instance_num(struct script_state *st, const char *name, st } return retVal___; } -const void* HP_script_get_val2(struct script_state *st, int64 uid, struct reg_db *ref) { +const void * HP_script_get_val2(struct script_state *st, int64 uid, struct reg_db *ref) { int hIndex = 0; - const void* retVal___ = NULL; + const void * retVal___ = NULL; if (HPMHooks.count.HP_script_get_val2_pre > 0) { - const void* (*preHookFunc) (struct script_state **st, int64 *uid, struct reg_db **ref); + const void * (*preHookFunc) (struct script_state **st, int64 *uid, struct reg_db **ref); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val2_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_get_val2_pre[hIndex].func; @@ -75174,7 +75174,7 @@ const void* HP_script_get_val2(struct script_state *st, int64 uid, struct reg_db retVal___ = HPMHooks.source.script.get_val2(st, uid, ref); } if (HPMHooks.count.HP_script_get_val2_post > 0) { - const void* (*postHookFunc) (const void* retVal___, struct script_state *st, int64 uid, struct reg_db *ref); + const void * (*postHookFunc) (const void * retVal___, struct script_state *st, int64 uid, struct reg_db *ref); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val2_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_get_val2_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, uid, ref); @@ -75182,11 +75182,11 @@ const void* HP_script_get_val2(struct script_state *st, int64 uid, struct reg_db } return retVal___; } -struct script_data* HP_script_push_str(struct script_stack *stack, char *str) { +struct script_data * HP_script_push_str(struct script_stack *stack, char *str) { int hIndex = 0; - struct script_data* retVal___ = NULL; + struct script_data * retVal___ = NULL; if (HPMHooks.count.HP_script_push_str_pre > 0) { - struct script_data* (*preHookFunc) (struct script_stack **stack, char **str); + struct script_data * (*preHookFunc) (struct script_stack **stack, char **str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_push_str_pre[hIndex].func; @@ -75201,7 +75201,7 @@ struct script_data* HP_script_push_str(struct script_stack *stack, char *str) { retVal___ = HPMHooks.source.script.push_str(stack, str); } if (HPMHooks.count.HP_script_push_str_post > 0) { - struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, char *str); + struct script_data * (*postHookFunc) (struct script_data * retVal___, struct script_stack *stack, char *str); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_push_str_post[hIndex].func; retVal___ = postHookFunc(retVal___, stack, str); @@ -75209,11 +75209,11 @@ struct script_data* HP_script_push_str(struct script_stack *stack, char *str) { } return retVal___; } -struct script_data* HP_script_push_conststr(struct script_stack *stack, const char *str) { +struct script_data * HP_script_push_conststr(struct script_stack *stack, const char *str) { int hIndex = 0; - struct script_data* retVal___ = NULL; + struct script_data * retVal___ = NULL; if (HPMHooks.count.HP_script_push_conststr_pre > 0) { - struct script_data* (*preHookFunc) (struct script_stack **stack, const char **str); + struct script_data * (*preHookFunc) (struct script_stack **stack, const char **str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_conststr_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_push_conststr_pre[hIndex].func; @@ -75228,7 +75228,7 @@ struct script_data* HP_script_push_conststr(struct script_stack *stack, const ch retVal___ = HPMHooks.source.script.push_conststr(stack, str); } if (HPMHooks.count.HP_script_push_conststr_post > 0) { - struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, const char *str); + struct script_data * (*postHookFunc) (struct script_data * retVal___, struct script_stack *stack, const char *str); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_conststr_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_push_conststr_post[hIndex].func; retVal___ = postHookFunc(retVal___, stack, str); @@ -75236,11 +75236,11 @@ struct script_data* HP_script_push_conststr(struct script_stack *stack, const ch } return retVal___; } -struct script_data* HP_script_push_copy(struct script_stack *stack, int pos) { +struct script_data * HP_script_push_copy(struct script_stack *stack, int pos) { int hIndex = 0; - struct script_data* retVal___ = NULL; + struct script_data * retVal___ = NULL; if (HPMHooks.count.HP_script_push_copy_pre > 0) { - struct script_data* (*preHookFunc) (struct script_stack **stack, int *pos); + struct script_data * (*preHookFunc) (struct script_stack **stack, int *pos); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_copy_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_push_copy_pre[hIndex].func; @@ -75255,7 +75255,7 @@ struct script_data* HP_script_push_copy(struct script_stack *stack, int pos) { retVal___ = HPMHooks.source.script.push_copy(stack, pos); } if (HPMHooks.count.HP_script_push_copy_post > 0) { - struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, int pos); + struct script_data * (*postHookFunc) (struct script_data * retVal___, struct script_stack *stack, int pos); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_copy_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_push_copy_post[hIndex].func; retVal___ = postHookFunc(retVal___, stack, pos); @@ -75630,11 +75630,11 @@ void HP_script_free_vars(struct DBMap *var_storage) { } return; } -struct script_state* HP_script_alloc_state(struct script_code *rootscript, int pos, int rid, int oid) { +struct script_state * HP_script_alloc_state(struct script_code *rootscript, int pos, int rid, int oid) { int hIndex = 0; - struct script_state* retVal___ = NULL; + struct script_state * retVal___ = NULL; if (HPMHooks.count.HP_script_alloc_state_pre > 0) { - struct script_state* (*preHookFunc) (struct script_code **rootscript, int *pos, int *rid, int *oid); + struct script_state * (*preHookFunc) (struct script_code **rootscript, int *pos, int *rid, int *oid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_alloc_state_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_alloc_state_pre[hIndex].func; @@ -75649,7 +75649,7 @@ struct script_state* HP_script_alloc_state(struct script_code *rootscript, int p retVal___ = HPMHooks.source.script.alloc_state(rootscript, pos, rid, oid); } if (HPMHooks.count.HP_script_alloc_state_post > 0) { - struct script_state* (*postHookFunc) (struct script_state* retVal___, struct script_code *rootscript, int pos, int rid, int oid); + struct script_state * (*postHookFunc) (struct script_state * retVal___, struct script_code *rootscript, int pos, int rid, int oid); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_alloc_state_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_alloc_state_post[hIndex].func; retVal___ = postHookFunc(retVal___, rootscript, pos, rid, oid); @@ -75868,11 +75868,11 @@ int HP_script_add_variable(const char *varname) { } return retVal___; } -const char* HP_script_get_str(int id) { +const char * HP_script_get_str(int id) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_get_str_pre > 0) { - const char* (*preHookFunc) (int *id); + const char * (*preHookFunc) (int *id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_get_str_pre[hIndex].func; @@ -75887,7 +75887,7 @@ const char* HP_script_get_str(int id) { retVal___ = HPMHooks.source.script.get_str(id); } if (HPMHooks.count.HP_script_get_str_post > 0) { - const char* (*postHookFunc) (const char* retVal___, int id); + const char * (*postHookFunc) (const char * retVal___, int id); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_get_str_post[hIndex].func; retVal___ = postHookFunc(retVal___, id); @@ -75974,11 +75974,11 @@ void HP_script_attach_state(struct script_state *st) { } return; } -struct script_queue* HP_script_queue(int idx) { +struct script_queue * HP_script_queue(int idx) { int hIndex = 0; - struct script_queue* retVal___ = NULL; + struct script_queue * retVal___ = NULL; if (HPMHooks.count.HP_script_queue_pre > 0) { - struct script_queue* (*preHookFunc) (int *idx); + struct script_queue * (*preHookFunc) (int *idx); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_queue_pre[hIndex].func; @@ -75993,7 +75993,7 @@ struct script_queue* HP_script_queue(int idx) { retVal___ = HPMHooks.source.script.queue(idx); } if (HPMHooks.count.HP_script_queue_post > 0) { - struct script_queue* (*postHookFunc) (struct script_queue* retVal___, int idx); + struct script_queue * (*postHookFunc) (struct script_queue * retVal___, int idx); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_queue_post[hIndex].func; retVal___ = postHookFunc(retVal___, idx); @@ -76136,11 +76136,11 @@ bool HP_script_queue_clear(int idx) { } return retVal___; } -const char* HP_script_parse_curly_close(const char *p) { +const char * HP_script_parse_curly_close(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_curly_close_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_curly_close_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_curly_close_pre[hIndex].func; @@ -76155,7 +76155,7 @@ const char* HP_script_parse_curly_close(const char *p) { retVal___ = HPMHooks.source.script.parse_curly_close(p); } if (HPMHooks.count.HP_script_parse_curly_close_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_curly_close_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_curly_close_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76163,11 +76163,11 @@ const char* HP_script_parse_curly_close(const char *p) { } return retVal___; } -const char* HP_script_parse_syntax_close(const char *p) { +const char * HP_script_parse_syntax_close(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_syntax_close_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_syntax_close_pre[hIndex].func; @@ -76182,7 +76182,7 @@ const char* HP_script_parse_syntax_close(const char *p) { retVal___ = HPMHooks.source.script.parse_syntax_close(p); } if (HPMHooks.count.HP_script_parse_syntax_close_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_syntax_close_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76190,11 +76190,11 @@ const char* HP_script_parse_syntax_close(const char *p) { } return retVal___; } -const char* HP_script_parse_syntax_close_sub(const char *p, int *flag) { +const char * HP_script_parse_syntax_close_sub(const char *p, int *flag) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_syntax_close_sub_pre > 0) { - const char* (*preHookFunc) (const char **p, int **flag); + const char * (*preHookFunc) (const char **p, int **flag); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_sub_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_syntax_close_sub_pre[hIndex].func; @@ -76209,7 +76209,7 @@ const char* HP_script_parse_syntax_close_sub(const char *p, int *flag) { retVal___ = HPMHooks.source.script.parse_syntax_close_sub(p, flag); } if (HPMHooks.count.HP_script_parse_syntax_close_sub_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p, int *flag); + const char * (*postHookFunc) (const char * retVal___, const char *p, int *flag); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_sub_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_syntax_close_sub_post[hIndex].func; retVal___ = postHookFunc(retVal___, p, flag); @@ -76217,11 +76217,11 @@ const char* HP_script_parse_syntax_close_sub(const char *p, int *flag) { } return retVal___; } -const char* HP_script_parse_syntax(const char *p) { +const char * HP_script_parse_syntax(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_syntax_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_syntax_pre[hIndex].func; @@ -76236,7 +76236,7 @@ const char* HP_script_parse_syntax(const char *p) { retVal___ = HPMHooks.source.script.parse_syntax(p); } if (HPMHooks.count.HP_script_parse_syntax_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_syntax_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76244,11 +76244,11 @@ const char* HP_script_parse_syntax(const char *p) { } return retVal___; } -const char* HP_script_parse_syntax_function(const char *p, bool is_public) { +const char * HP_script_parse_syntax_function(const char *p, bool is_public) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_syntax_function_pre > 0) { - const char* (*preHookFunc) (const char **p, bool *is_public); + const char * (*preHookFunc) (const char **p, bool *is_public); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_function_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_syntax_function_pre[hIndex].func; @@ -76263,7 +76263,7 @@ const char* HP_script_parse_syntax_function(const char *p, bool is_public) { retVal___ = HPMHooks.source.script.parse_syntax_function(p, is_public); } if (HPMHooks.count.HP_script_parse_syntax_function_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p, bool is_public); + const char * (*postHookFunc) (const char * retVal___, const char *p, bool is_public); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_function_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_syntax_function_post[hIndex].func; retVal___ = postHookFunc(retVal___, p, is_public); @@ -76325,11 +76325,11 @@ int HP_script_get_num(const struct script_buf *scriptbuf, int *pos) { } return retVal___; } -const char* HP_script_op2name(int op) { +const char * HP_script_op2name(int op) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_op2name_pre > 0) { - const char* (*preHookFunc) (int *op); + const char * (*preHookFunc) (int *op); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op2name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_op2name_pre[hIndex].func; @@ -76344,7 +76344,7 @@ const char* HP_script_op2name(int op) { retVal___ = HPMHooks.source.script.op2name(op); } if (HPMHooks.count.HP_script_op2name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, int op); + const char * (*postHookFunc) (const char * retVal___, int op); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op2name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_op2name_post[hIndex].func; retVal___ = postHookFunc(retVal___, op); @@ -76639,11 +76639,11 @@ void HP_script_set_label(int l, int pos, const char *script_pos) { } return; } -const char* HP_script_skip_word(const char *p) { +const char * HP_script_skip_word(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_skip_word_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_word_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_skip_word_pre[hIndex].func; @@ -76658,7 +76658,7 @@ const char* HP_script_skip_word(const char *p) { retVal___ = HPMHooks.source.script.skip_word(p); } if (HPMHooks.count.HP_script_skip_word_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_word_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_skip_word_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76693,11 +76693,11 @@ int HP_script_add_word(const char *p) { } return retVal___; } -const char* HP_script_parse_callfunc(const char *p, int require_paren, int is_custom) { +const char * HP_script_parse_callfunc(const char *p, int require_paren, int is_custom) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_callfunc_pre > 0) { - const char* (*preHookFunc) (const char **p, int *require_paren, int *is_custom); + const char * (*preHookFunc) (const char **p, int *require_paren, int *is_custom); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_callfunc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_callfunc_pre[hIndex].func; @@ -76712,7 +76712,7 @@ const char* HP_script_parse_callfunc(const char *p, int require_paren, int is_cu retVal___ = HPMHooks.source.script.parse_callfunc(p, require_paren, is_custom); } if (HPMHooks.count.HP_script_parse_callfunc_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p, int require_paren, int is_custom); + const char * (*postHookFunc) (const char * retVal___, const char *p, int require_paren, int is_custom); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_callfunc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_callfunc_post[hIndex].func; retVal___ = postHookFunc(retVal___, p, require_paren, is_custom); @@ -76746,11 +76746,11 @@ void HP_script_parse_nextline(bool first, const char *p) { } return; } -const char* HP_script_parse_variable(const char *p) { +const char * HP_script_parse_variable(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_variable_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_variable_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_variable_pre[hIndex].func; @@ -76765,7 +76765,7 @@ const char* HP_script_parse_variable(const char *p) { retVal___ = HPMHooks.source.script.parse_variable(p); } if (HPMHooks.count.HP_script_parse_variable_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_variable_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_variable_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76773,11 +76773,11 @@ const char* HP_script_parse_variable(const char *p) { } return retVal___; } -const char* HP_script_parse_simpleexpr(const char *p) { +const char * HP_script_parse_simpleexpr(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_simpleexpr_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_pre[hIndex].func; @@ -76792,7 +76792,7 @@ const char* HP_script_parse_simpleexpr(const char *p) { retVal___ = HPMHooks.source.script.parse_simpleexpr(p); } if (HPMHooks.count.HP_script_parse_simpleexpr_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76800,11 +76800,11 @@ const char* HP_script_parse_simpleexpr(const char *p) { } return retVal___; } -const char* HP_script_parse_simpleexpr_paren(const char *p) { +const char * HP_script_parse_simpleexpr_paren(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_simpleexpr_paren_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_paren_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_paren_pre[hIndex].func; @@ -76819,7 +76819,7 @@ const char* HP_script_parse_simpleexpr_paren(const char *p) { retVal___ = HPMHooks.source.script.parse_simpleexpr_paren(p); } if (HPMHooks.count.HP_script_parse_simpleexpr_paren_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_paren_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_paren_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76827,11 +76827,11 @@ const char* HP_script_parse_simpleexpr_paren(const char *p) { } return retVal___; } -const char* HP_script_parse_simpleexpr_number(const char *p) { +const char * HP_script_parse_simpleexpr_number(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_simpleexpr_number_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_number_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_number_pre[hIndex].func; @@ -76846,7 +76846,7 @@ const char* HP_script_parse_simpleexpr_number(const char *p) { retVal___ = HPMHooks.source.script.parse_simpleexpr_number(p); } if (HPMHooks.count.HP_script_parse_simpleexpr_number_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_number_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_number_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76854,11 +76854,11 @@ const char* HP_script_parse_simpleexpr_number(const char *p) { } return retVal___; } -const char* HP_script_parse_simpleexpr_string(const char *p) { +const char * HP_script_parse_simpleexpr_string(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_simpleexpr_string_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_string_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_string_pre[hIndex].func; @@ -76873,7 +76873,7 @@ const char* HP_script_parse_simpleexpr_string(const char *p) { retVal___ = HPMHooks.source.script.parse_simpleexpr_string(p); } if (HPMHooks.count.HP_script_parse_simpleexpr_string_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_string_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_string_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76881,11 +76881,11 @@ const char* HP_script_parse_simpleexpr_string(const char *p) { } return retVal___; } -const char* HP_script_parse_simpleexpr_name(const char *p) { +const char * HP_script_parse_simpleexpr_name(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_simpleexpr_name_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_name_pre[hIndex].func; @@ -76900,7 +76900,7 @@ const char* HP_script_parse_simpleexpr_name(const char *p) { retVal___ = HPMHooks.source.script.parse_simpleexpr_name(p); } if (HPMHooks.count.HP_script_parse_simpleexpr_name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_name_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76934,11 +76934,11 @@ void HP_script_add_translatable_string(const struct script_string_buf *string, c } return; } -const char* HP_script_parse_expr(const char *p) { +const char * HP_script_parse_expr(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_expr_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_expr_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_expr_pre[hIndex].func; @@ -76953,7 +76953,7 @@ const char* HP_script_parse_expr(const char *p) { retVal___ = HPMHooks.source.script.parse_expr(p); } if (HPMHooks.count.HP_script_parse_expr_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_expr_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_expr_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -76961,11 +76961,11 @@ const char* HP_script_parse_expr(const char *p) { } return retVal___; } -const char* HP_script_parse_line(const char *p) { +const char * HP_script_parse_line(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_parse_line_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_line_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_parse_line_pre[hIndex].func; @@ -76980,7 +76980,7 @@ const char* HP_script_parse_line(const char *p) { retVal___ = HPMHooks.source.script.parse_line(p); } if (HPMHooks.count.HP_script_parse_line_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_line_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_parse_line_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -77066,11 +77066,11 @@ void HP_script_load_parameters(void) { } return; } -const char* HP_script_print_line(StringBuf *buf, const char *p, const char *mark, int line) { +const char * HP_script_print_line(StringBuf *buf, const char *p, const char *mark, int line) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_print_line_pre > 0) { - const char* (*preHookFunc) (StringBuf **buf, const char **p, const char **mark, int *line); + const char * (*preHookFunc) (StringBuf **buf, const char **p, const char **mark, int *line); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_print_line_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_print_line_pre[hIndex].func; @@ -77085,7 +77085,7 @@ const char* HP_script_print_line(StringBuf *buf, const char *p, const char *mark retVal___ = HPMHooks.source.script.print_line(buf, p, mark, line); } if (HPMHooks.count.HP_script_print_line_post > 0) { - const char* (*postHookFunc) (const char* retVal___, StringBuf *buf, const char *p, const char *mark, int line); + const char * (*postHookFunc) (const char * retVal___, StringBuf *buf, const char *p, const char *mark, int line); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_print_line_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_print_line_post[hIndex].func; retVal___ = postHookFunc(retVal___, buf, p, mark, line); @@ -77459,11 +77459,11 @@ void HP_script_stack_expand(struct script_stack *stack) { } return; } -struct script_data* HP_script_push_retinfo(struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref) { +struct script_data * HP_script_push_retinfo(struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref) { int hIndex = 0; - struct script_data* retVal___ = NULL; + struct script_data * retVal___ = NULL; if (HPMHooks.count.HP_script_push_retinfo_pre > 0) { - struct script_data* (*preHookFunc) (struct script_stack **stack, struct script_retinfo **ri, struct reg_db **ref); + struct script_data * (*preHookFunc) (struct script_stack **stack, struct script_retinfo **ri, struct reg_db **ref); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_retinfo_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_push_retinfo_pre[hIndex].func; @@ -77478,7 +77478,7 @@ struct script_data* HP_script_push_retinfo(struct script_stack *stack, struct sc retVal___ = HPMHooks.source.script.push_retinfo(stack, ri, ref); } if (HPMHooks.count.HP_script_push_retinfo_post > 0) { - struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref); + struct script_data * (*postHookFunc) (struct script_data * retVal___, struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_retinfo_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_push_retinfo_post[hIndex].func; retVal___ = postHookFunc(retVal___, stack, ri, ref); @@ -78669,11 +78669,11 @@ bool HP_script_sprintf_helper(struct script_state *st, int start, struct StringB } return retVal___; } -const char* HP_script_getfuncname(struct script_state *st) { +const char * HP_script_getfuncname(struct script_state *st) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_getfuncname_pre > 0) { - const char* (*preHookFunc) (struct script_state **st); + const char * (*preHookFunc) (struct script_state **st); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_getfuncname_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_getfuncname_pre[hIndex].func; @@ -78688,7 +78688,7 @@ const char* HP_script_getfuncname(struct script_state *st) { retVal___ = HPMHooks.source.script.getfuncname(st); } if (HPMHooks.count.HP_script_getfuncname_post > 0) { - const char* (*postHookFunc) (const char* retVal___, struct script_state *st); + const char * (*postHookFunc) (const char * retVal___, struct script_state *st); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_getfuncname_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_getfuncname_post[hIndex].func; retVal___ = postHookFunc(retVal___, st); @@ -78723,11 +78723,11 @@ unsigned int HP_script_calc_hash_ci(const char *p) { } return retVal___; } -struct reg_db* HP_script_array_src(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) { +struct reg_db * HP_script_array_src(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) { int hIndex = 0; - struct reg_db* retVal___ = NULL; + struct reg_db * retVal___ = NULL; if (HPMHooks.count.HP_script_array_src_pre > 0) { - struct reg_db* (*preHookFunc) (struct script_state **st, struct map_session_data **sd, const char **name, struct reg_db **ref); + struct reg_db * (*preHookFunc) (struct script_state **st, struct map_session_data **sd, const char **name, struct reg_db **ref); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_src_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_array_src_pre[hIndex].func; @@ -78742,7 +78742,7 @@ struct reg_db* HP_script_array_src(struct script_state *st, struct map_session_d retVal___ = HPMHooks.source.script.array_src(st, sd, name, ref); } if (HPMHooks.count.HP_script_array_src_post > 0) { - struct reg_db* (*postHookFunc) (struct reg_db* retVal___, struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref); + struct reg_db * (*postHookFunc) (struct reg_db * retVal___, struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_src_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_array_src_post[hIndex].func; retVal___ = postHookFunc(retVal___, st, sd, name, ref); @@ -79052,11 +79052,11 @@ void HP_script_generic_ui_array_expand(unsigned int plus) { } return; } -unsigned int* HP_script_array_cpy_list(struct script_array *sa) { +unsigned int * HP_script_array_cpy_list(struct script_array *sa) { int hIndex = 0; - unsigned int* retVal___ = NULL; + unsigned int * retVal___ = NULL; if (HPMHooks.count.HP_script_array_cpy_list_pre > 0) { - unsigned int* (*preHookFunc) (struct script_array **sa); + unsigned int * (*preHookFunc) (struct script_array **sa); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_cpy_list_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_array_cpy_list_pre[hIndex].func; @@ -79071,7 +79071,7 @@ unsigned int* HP_script_array_cpy_list(struct script_array *sa) { retVal___ = HPMHooks.source.script.array_cpy_list(sa); } if (HPMHooks.count.HP_script_array_cpy_list_post > 0) { - unsigned int* (*postHookFunc) (unsigned int* retVal___, struct script_array *sa); + unsigned int * (*postHookFunc) (unsigned int * retVal___, struct script_array *sa); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_cpy_list_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_array_cpy_list_post[hIndex].func; retVal___ = postHookFunc(retVal___, sa); @@ -79379,11 +79379,11 @@ uint8 HP_script_add_language(const char *name) { } return retVal___; } -const char* HP_script_get_translation_dir_name(const char *directory) { +const char * HP_script_get_translation_dir_name(const char *directory) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_script_get_translation_dir_name_pre > 0) { - const char* (*preHookFunc) (const char **directory); + const char * (*preHookFunc) (const char **directory); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_translation_dir_name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_script_get_translation_dir_name_pre[hIndex].func; @@ -79398,7 +79398,7 @@ const char* HP_script_get_translation_dir_name(const char *directory) { retVal___ = HPMHooks.source.script.get_translation_dir_name(directory); } if (HPMHooks.count.HP_script_get_translation_dir_name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *directory); + const char * (*postHookFunc) (const char * retVal___, const char *directory); for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_translation_dir_name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_script_get_translation_dir_name_post[hIndex].func; retVal___ = postHookFunc(retVal___, directory); @@ -81528,11 +81528,11 @@ int HP_skill_tree_get_max(int skill_id, int class) { } return retVal___; } -const char* HP_skill_get_name(int skill_id) { +const char * HP_skill_get_name(int skill_id) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_skill_get_name_pre > 0) { - const char* (*preHookFunc) (int *skill_id); + const char * (*preHookFunc) (int *skill_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_skill_get_name_pre[hIndex].func; @@ -81547,7 +81547,7 @@ const char* HP_skill_get_name(int skill_id) { retVal___ = HPMHooks.source.skill.get_name(skill_id); } if (HPMHooks.count.HP_skill_get_name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, int skill_id); + const char * (*postHookFunc) (const char * retVal___, int skill_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_skill_get_name_post[hIndex].func; retVal___ = postHookFunc(retVal___, skill_id); @@ -81555,11 +81555,11 @@ const char* HP_skill_get_name(int skill_id) { } return retVal___; } -const char* HP_skill_get_desc(int skill_id) { +const char * HP_skill_get_desc(int skill_id) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_skill_get_desc_pre > 0) { - const char* (*preHookFunc) (int *skill_id); + const char * (*preHookFunc) (int *skill_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_desc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_skill_get_desc_pre[hIndex].func; @@ -81574,7 +81574,7 @@ const char* HP_skill_get_desc(int skill_id) { retVal___ = HPMHooks.source.skill.get_desc(skill_id); } if (HPMHooks.count.HP_skill_get_desc_post > 0) { - const char* (*postHookFunc) (const char* retVal___, int skill_id); + const char * (*postHookFunc) (const char * retVal___, int skill_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_desc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_skill_get_desc_post[hIndex].func; retVal___ = postHookFunc(retVal___, skill_id); @@ -82014,11 +82014,11 @@ int HP_skill_strip_equip(struct block_list *bl, unsigned short where, int rate, } return retVal___; } -struct skill_unit_group* HP_skill_id2group(int group_id) { +struct skill_unit_group * HP_skill_id2group(int group_id) { int hIndex = 0; - struct skill_unit_group* retVal___ = NULL; + struct skill_unit_group * retVal___ = NULL; if (HPMHooks.count.HP_skill_id2group_pre > 0) { - struct skill_unit_group* (*preHookFunc) (int *group_id); + struct skill_unit_group * (*preHookFunc) (int *group_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_id2group_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_skill_id2group_pre[hIndex].func; @@ -82033,7 +82033,7 @@ struct skill_unit_group* HP_skill_id2group(int group_id) { retVal___ = HPMHooks.source.skill.id2group(group_id); } if (HPMHooks.count.HP_skill_id2group_post > 0) { - struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, int group_id); + struct skill_unit_group * (*postHookFunc) (struct skill_unit_group * retVal___, int group_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_id2group_post; hIndex++) { postHookFunc = HPMHooks.list.HP_skill_id2group_post[hIndex].func; retVal___ = postHookFunc(retVal___, group_id); @@ -82041,11 +82041,11 @@ struct skill_unit_group* HP_skill_id2group(int group_id) { } return retVal___; } -struct skill_unit_group* HP_skill_unitsetting(struct block_list *src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag) { +struct skill_unit_group * HP_skill_unitsetting(struct block_list *src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag) { int hIndex = 0; - struct skill_unit_group* retVal___ = NULL; + struct skill_unit_group * retVal___ = NULL; if (HPMHooks.count.HP_skill_unitsetting_pre > 0) { - struct skill_unit_group* (*preHookFunc) (struct block_list **src, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *flag); + struct skill_unit_group * (*preHookFunc) (struct block_list **src, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *flag); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_skill_unitsetting_pre[hIndex].func; @@ -82060,7 +82060,7 @@ struct skill_unit_group* HP_skill_unitsetting(struct block_list *src, uint16 ski retVal___ = HPMHooks.source.skill.unitsetting(src, skill_id, skill_lv, x, y, flag); } if (HPMHooks.count.HP_skill_unitsetting_post > 0) { - struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, struct block_list *src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag); + struct skill_unit_group * (*postHookFunc) (struct skill_unit_group * retVal___, struct block_list *src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag); for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting_post; hIndex++) { postHookFunc = HPMHooks.list.HP_skill_unitsetting_post[hIndex].func; retVal___ = postHookFunc(retVal___, src, skill_id, skill_lv, x, y, flag); @@ -82068,11 +82068,11 @@ struct skill_unit_group* HP_skill_unitsetting(struct block_list *src, uint16 ski } return retVal___; } -struct skill_unit* HP_skill_initunit(struct skill_unit_group *group, int idx, int x, int y, int val1, int val2) { +struct skill_unit * HP_skill_initunit(struct skill_unit_group *group, int idx, int x, int y, int val1, int val2) { int hIndex = 0; - struct skill_unit* retVal___ = NULL; + struct skill_unit * retVal___ = NULL; if (HPMHooks.count.HP_skill_initunit_pre > 0) { - struct skill_unit* (*preHookFunc) (struct skill_unit_group **group, int *idx, int *x, int *y, int *val1, int *val2); + struct skill_unit * (*preHookFunc) (struct skill_unit_group **group, int *idx, int *x, int *y, int *val1, int *val2); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_initunit_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_skill_initunit_pre[hIndex].func; @@ -82087,7 +82087,7 @@ struct skill_unit* HP_skill_initunit(struct skill_unit_group *group, int idx, in retVal___ = HPMHooks.source.skill.initunit(group, idx, x, y, val1, val2); } if (HPMHooks.count.HP_skill_initunit_post > 0) { - struct skill_unit* (*postHookFunc) (struct skill_unit* retVal___, struct skill_unit_group *group, int idx, int x, int y, int val1, int val2); + struct skill_unit * (*postHookFunc) (struct skill_unit * retVal___, struct skill_unit_group *group, int idx, int x, int y, int val1, int val2); for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_initunit_post; hIndex++) { postHookFunc = HPMHooks.list.HP_skill_initunit_post[hIndex].func; retVal___ = postHookFunc(retVal___, group, idx, x, y, val1, val2); @@ -82122,11 +82122,11 @@ int HP_skill_delunit(struct skill_unit *su) { } return retVal___; } -struct skill_unit_group* HP_skill_init_unitgroup(struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval) { +struct skill_unit_group * HP_skill_init_unitgroup(struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval) { int hIndex = 0; - struct skill_unit_group* retVal___ = NULL; + struct skill_unit_group * retVal___ = NULL; if (HPMHooks.count.HP_skill_init_unitgroup_pre > 0) { - struct skill_unit_group* (*preHookFunc) (struct block_list **src, int *count, uint16 *skill_id, uint16 *skill_lv, int *unit_id, int *limit, int *interval); + struct skill_unit_group * (*preHookFunc) (struct block_list **src, int *count, uint16 *skill_id, uint16 *skill_lv, int *unit_id, int *limit, int *interval); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unitgroup_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_skill_init_unitgroup_pre[hIndex].func; @@ -82141,7 +82141,7 @@ struct skill_unit_group* HP_skill_init_unitgroup(struct block_list *src, int cou retVal___ = HPMHooks.source.skill.init_unitgroup(src, count, skill_id, skill_lv, unit_id, limit, interval); } if (HPMHooks.count.HP_skill_init_unitgroup_post > 0) { - struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval); + struct skill_unit_group * (*postHookFunc) (struct skill_unit_group * retVal___, struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval); for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unitgroup_post; hIndex++) { postHookFunc = HPMHooks.list.HP_skill_init_unitgroup_post[hIndex].func; retVal___ = postHookFunc(retVal___, src, count, skill_id, skill_lv, unit_id, limit, interval); @@ -84004,11 +84004,11 @@ int HP_skill_check_condition_mercenary(struct block_list *bl, int skill_id, int } return retVal___; } -struct skill_unit_group* HP_skill_locate_element_field(struct block_list *bl) { +struct skill_unit_group * HP_skill_locate_element_field(struct block_list *bl) { int hIndex = 0; - struct skill_unit_group* retVal___ = NULL; + struct skill_unit_group * retVal___ = NULL; if (HPMHooks.count.HP_skill_locate_element_field_pre > 0) { - struct skill_unit_group* (*preHookFunc) (struct block_list **bl); + struct skill_unit_group * (*preHookFunc) (struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_locate_element_field_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_skill_locate_element_field_pre[hIndex].func; @@ -84023,7 +84023,7 @@ struct skill_unit_group* HP_skill_locate_element_field(struct block_list *bl) { retVal___ = HPMHooks.source.skill.locate_element_field(bl); } if (HPMHooks.count.HP_skill_locate_element_field_post > 0) { - struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, struct block_list *bl); + struct skill_unit_group * (*postHookFunc) (struct skill_unit_group * retVal___, struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_locate_element_field_post; hIndex++) { postHookFunc = HPMHooks.list.HP_skill_locate_element_field_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); @@ -84157,11 +84157,11 @@ int HP_skill_dance_overlap(struct skill_unit *su, int flag) { } return retVal___; } -struct s_skill_unit_layout* HP_skill_get_unit_layout(uint16 skill_id, uint16 skill_lv, struct block_list *src, int x, int y) { +struct s_skill_unit_layout * HP_skill_get_unit_layout(uint16 skill_id, uint16 skill_lv, struct block_list *src, int x, int y) { int hIndex = 0; - struct s_skill_unit_layout* retVal___ = NULL; + struct s_skill_unit_layout * retVal___ = NULL; if (HPMHooks.count.HP_skill_get_unit_layout_pre > 0) { - struct s_skill_unit_layout* (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv, struct block_list **src, int *x, int *y); + struct s_skill_unit_layout * (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv, struct block_list **src, int *x, int *y); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_layout_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_skill_get_unit_layout_pre[hIndex].func; @@ -84176,7 +84176,7 @@ struct s_skill_unit_layout* HP_skill_get_unit_layout(uint16 skill_id, uint16 ski retVal___ = HPMHooks.source.skill.get_unit_layout(skill_id, skill_lv, src, x, y); } if (HPMHooks.count.HP_skill_get_unit_layout_post > 0) { - struct s_skill_unit_layout* (*postHookFunc) (struct s_skill_unit_layout* retVal___, uint16 skill_id, uint16 skill_lv, struct block_list *src, int x, int y); + struct s_skill_unit_layout * (*postHookFunc) (struct s_skill_unit_layout * retVal___, uint16 skill_id, uint16 skill_lv, struct block_list *src, int x, int y); for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_layout_post; hIndex++) { postHookFunc = HPMHooks.list.HP_skill_get_unit_layout_post[hIndex].func; retVal___ = postHookFunc(retVal___, skill_id, skill_lv, src, x, y); @@ -84283,11 +84283,11 @@ int HP_skill_destroy_trap(struct block_list *bl, va_list ap) { } return retVal___; } -struct skill_unit_group_tickset* HP_skill_unitgrouptickset_search(struct block_list *bl, struct skill_unit_group *group, int64 tick) { +struct skill_unit_group_tickset * HP_skill_unitgrouptickset_search(struct block_list *bl, struct skill_unit_group *group, int64 tick) { int hIndex = 0; - struct skill_unit_group_tickset* retVal___ = NULL; + struct skill_unit_group_tickset * retVal___ = NULL; if (HPMHooks.count.HP_skill_unitgrouptickset_search_pre > 0) { - struct skill_unit_group_tickset* (*preHookFunc) (struct block_list **bl, struct skill_unit_group **group, int64 *tick); + struct skill_unit_group_tickset * (*preHookFunc) (struct block_list **bl, struct skill_unit_group **group, int64 *tick); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitgrouptickset_search_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_skill_unitgrouptickset_search_pre[hIndex].func; @@ -84302,7 +84302,7 @@ struct skill_unit_group_tickset* HP_skill_unitgrouptickset_search(struct block_l retVal___ = HPMHooks.source.skill.unitgrouptickset_search(bl, group, tick); } if (HPMHooks.count.HP_skill_unitgrouptickset_search_post > 0) { - struct skill_unit_group_tickset* (*postHookFunc) (struct skill_unit_group_tickset* retVal___, struct block_list *bl, struct skill_unit_group *group, int64 tick); + struct skill_unit_group_tickset * (*postHookFunc) (struct skill_unit_group_tickset * retVal___, struct block_list *bl, struct skill_unit_group *group, int64 tick); for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitgrouptickset_search_post; hIndex++) { postHookFunc = HPMHooks.list.HP_skill_unitgrouptickset_search_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl, group, tick); @@ -88854,11 +88854,11 @@ uint32 HP_sockt_host2ip(const char *hostname) { } return retVal___; } -const char* HP_sockt_ip2str(uint32 ip, char *ip_str) { +const char * HP_sockt_ip2str(uint32 ip, char *ip_str) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sockt_ip2str_pre > 0) { - const char* (*preHookFunc) (uint32 *ip, char **ip_str); + const char * (*preHookFunc) (uint32 *ip, char **ip_str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sockt_ip2str_pre[hIndex].func; @@ -88873,7 +88873,7 @@ const char* HP_sockt_ip2str(uint32 ip, char *ip_str) { retVal___ = HPMHooks.source.sockt.ip2str(ip, ip_str); } if (HPMHooks.count.HP_sockt_ip2str_post > 0) { - const char* (*postHookFunc) (const char* retVal___, uint32 ip, char *ip_str); + const char * (*postHookFunc) (const char * retVal___, uint32 ip, char *ip_str); for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sockt_ip2str_post[hIndex].func; retVal___ = postHookFunc(retVal___, ip, ip_str); @@ -89585,11 +89585,11 @@ void HP_SQL_Free(struct Sql *self) { } return; } -struct Sql* HP_SQL_Malloc(void) { +struct Sql * HP_SQL_Malloc(void) { int hIndex = 0; - struct Sql* retVal___ = NULL; + struct Sql * retVal___ = NULL; if (HPMHooks.count.HP_SQL_Malloc_pre > 0) { - struct Sql* (*preHookFunc) (void); + struct Sql * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_SQL_Malloc_pre[hIndex].func; @@ -89604,7 +89604,7 @@ struct Sql* HP_SQL_Malloc(void) { retVal___ = HPMHooks.source.SQL.Malloc(); } if (HPMHooks.count.HP_SQL_Malloc_post > 0) { - struct Sql* (*postHookFunc) (struct Sql* retVal___); + struct Sql * (*postHookFunc) (struct Sql * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_SQL_Malloc_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -89612,11 +89612,11 @@ struct Sql* HP_SQL_Malloc(void) { } return retVal___; } -struct SqlStmt* HP_SQL_StmtMalloc(struct Sql *sql) { +struct SqlStmt * HP_SQL_StmtMalloc(struct Sql *sql) { int hIndex = 0; - struct SqlStmt* retVal___ = NULL; + struct SqlStmt * retVal___ = NULL; if (HPMHooks.count.HP_SQL_StmtMalloc_pre > 0) { - struct SqlStmt* (*preHookFunc) (struct Sql **sql); + struct SqlStmt * (*preHookFunc) (struct Sql **sql); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_pre[hIndex].func; @@ -89631,7 +89631,7 @@ struct SqlStmt* HP_SQL_StmtMalloc(struct Sql *sql) { retVal___ = HPMHooks.source.SQL.StmtMalloc(sql); } if (HPMHooks.count.HP_SQL_StmtMalloc_post > 0) { - struct SqlStmt* (*postHookFunc) (struct SqlStmt* retVal___, struct Sql *sql); + struct SqlStmt * (*postHookFunc) (struct SqlStmt * retVal___, struct Sql *sql); for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_post[hIndex].func; retVal___ = postHookFunc(retVal___, sql); @@ -90398,11 +90398,11 @@ int HP_status_fixed_revive(struct block_list *bl, unsigned int per_hp, unsigned } return retVal___; } -struct regen_data* HP_status_get_regen_data(struct block_list *bl) { +struct regen_data * HP_status_get_regen_data(struct block_list *bl) { int hIndex = 0; - struct regen_data* retVal___ = NULL; + struct regen_data * retVal___ = NULL; if (HPMHooks.count.HP_status_get_regen_data_pre > 0) { - struct regen_data* (*preHookFunc) (struct block_list **bl); + struct regen_data * (*preHookFunc) (struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_regen_data_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_get_regen_data_pre[hIndex].func; @@ -90417,7 +90417,7 @@ struct regen_data* HP_status_get_regen_data(struct block_list *bl) { retVal___ = HPMHooks.source.status.get_regen_data(bl); } if (HPMHooks.count.HP_status_get_regen_data_post > 0) { - struct regen_data* (*postHookFunc) (struct regen_data* retVal___, struct block_list *bl); + struct regen_data * (*postHookFunc) (struct regen_data * retVal___, struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_regen_data_post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_get_regen_data_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); @@ -90425,11 +90425,11 @@ struct regen_data* HP_status_get_regen_data(struct block_list *bl) { } return retVal___; } -struct status_data* HP_status_get_status_data(struct block_list *bl) { +struct status_data * HP_status_get_status_data(struct block_list *bl) { int hIndex = 0; - struct status_data* retVal___ = NULL; + struct status_data * retVal___ = NULL; if (HPMHooks.count.HP_status_get_status_data_pre > 0) { - struct status_data* (*preHookFunc) (struct block_list **bl); + struct status_data * (*preHookFunc) (struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_status_data_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_get_status_data_pre[hIndex].func; @@ -90444,7 +90444,7 @@ struct status_data* HP_status_get_status_data(struct block_list *bl) { retVal___ = HPMHooks.source.status.get_status_data(bl); } if (HPMHooks.count.HP_status_get_status_data_post > 0) { - struct status_data* (*postHookFunc) (struct status_data* retVal___, struct block_list *bl); + struct status_data * (*postHookFunc) (struct status_data * retVal___, struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_status_data_post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_get_status_data_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); @@ -90452,11 +90452,11 @@ struct status_data* HP_status_get_status_data(struct block_list *bl) { } return retVal___; } -struct status_data* HP_status_get_base_status(struct block_list *bl) { +struct status_data * HP_status_get_base_status(struct block_list *bl) { int hIndex = 0; - struct status_data* retVal___ = NULL; + struct status_data * retVal___ = NULL; if (HPMHooks.count.HP_status_get_base_status_pre > 0) { - struct status_data* (*preHookFunc) (struct block_list **bl); + struct status_data * (*preHookFunc) (struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_status_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_get_base_status_pre[hIndex].func; @@ -90471,7 +90471,7 @@ struct status_data* HP_status_get_base_status(struct block_list *bl) { retVal___ = HPMHooks.source.status.get_base_status(bl); } if (HPMHooks.count.HP_status_get_base_status_post > 0) { - struct status_data* (*postHookFunc) (struct status_data* retVal___, struct block_list *bl); + struct status_data * (*postHookFunc) (struct status_data * retVal___, struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_status_post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_get_base_status_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); @@ -90479,11 +90479,11 @@ struct status_data* HP_status_get_base_status(struct block_list *bl) { } return retVal___; } -const char* HP_status_get_name(const struct block_list *bl) { +const char * HP_status_get_name(const struct block_list *bl) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_status_get_name_pre > 0) { - const char* (*preHookFunc) (const struct block_list **bl); + const char * (*preHookFunc) (const struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_name_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_get_name_pre[hIndex].func; @@ -90498,7 +90498,7 @@ const char* HP_status_get_name(const struct block_list *bl) { retVal___ = HPMHooks.source.status.get_name(bl); } if (HPMHooks.count.HP_status_get_name_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const struct block_list *bl); + const char * (*postHookFunc) (const char * retVal___, const struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_name_post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_get_name_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); @@ -90776,11 +90776,11 @@ int HP_status_get_race2(const struct block_list *bl) { } return retVal___; } -struct view_data* HP_status_get_viewdata(struct block_list *bl) { +struct view_data * HP_status_get_viewdata(struct block_list *bl) { int hIndex = 0; - struct view_data* retVal___ = NULL; + struct view_data * retVal___ = NULL; if (HPMHooks.count.HP_status_get_viewdata_pre > 0) { - struct view_data* (*preHookFunc) (struct block_list **bl); + struct view_data * (*preHookFunc) (struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_viewdata_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_get_viewdata_pre[hIndex].func; @@ -90795,7 +90795,7 @@ struct view_data* HP_status_get_viewdata(struct block_list *bl) { retVal___ = HPMHooks.source.status.get_viewdata(bl); } if (HPMHooks.count.HP_status_get_viewdata_post > 0) { - struct view_data* (*postHookFunc) (struct view_data* retVal___, struct block_list *bl); + struct view_data * (*postHookFunc) (struct view_data * retVal___, struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_viewdata_post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_get_viewdata_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); @@ -90855,11 +90855,11 @@ void HP_status_change_init(struct block_list *bl) { } return; } -struct status_change* HP_status_get_sc(struct block_list *bl) { +struct status_change * HP_status_get_sc(struct block_list *bl) { int hIndex = 0; - struct status_change* retVal___ = NULL; + struct status_change * retVal___ = NULL; if (HPMHooks.count.HP_status_get_sc_pre > 0) { - struct status_change* (*preHookFunc) (struct block_list **bl); + struct status_change * (*preHookFunc) (struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_status_get_sc_pre[hIndex].func; @@ -90874,7 +90874,7 @@ struct status_change* HP_status_get_sc(struct block_list *bl) { retVal___ = HPMHooks.source.status.get_sc(bl); } if (HPMHooks.count.HP_status_get_sc_post > 0) { - struct status_change* (*postHookFunc) (struct status_change* retVal___, struct block_list *bl); + struct status_change * (*postHookFunc) (struct status_change * retVal___, struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_status_get_sc_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); @@ -94086,11 +94086,11 @@ int HP_storage_reconnect_sub(union DBKey key, struct DBData *data, va_list ap) { return retVal___; } /* stringbuf_interface */ -StringBuf* HP_StrBuf_Malloc(void) { +StringBuf * HP_StrBuf_Malloc(void) { int hIndex = 0; - StringBuf* retVal___ = NULL; + StringBuf * retVal___ = NULL; if (HPMHooks.count.HP_StrBuf_Malloc_pre > 0) { - StringBuf* (*preHookFunc) (void); + StringBuf * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_StrBuf_Malloc_pre[hIndex].func; @@ -94105,7 +94105,7 @@ StringBuf* HP_StrBuf_Malloc(void) { retVal___ = HPMHooks.source.StrBuf.Malloc(); } if (HPMHooks.count.HP_StrBuf_Malloc_post > 0) { - StringBuf* (*postHookFunc) (StringBuf* retVal___); + StringBuf * (*postHookFunc) (StringBuf * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_post; hIndex++) { postHookFunc = HPMHooks.list.HP_StrBuf_Malloc_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -94253,11 +94253,11 @@ int HP_StrBuf_Length(StringBuf *self) { } return retVal___; } -char* HP_StrBuf_Value(StringBuf *self) { +char * HP_StrBuf_Value(StringBuf *self) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_StrBuf_Value_pre > 0) { - char* (*preHookFunc) (StringBuf **self); + char * (*preHookFunc) (StringBuf **self); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_StrBuf_Value_pre[hIndex].func; @@ -94272,7 +94272,7 @@ char* HP_StrBuf_Value(StringBuf *self) { retVal___ = HPMHooks.source.StrBuf.Value(self); } if (HPMHooks.count.HP_StrBuf_Value_post > 0) { - char* (*postHookFunc) (char* retVal___, StringBuf *self); + char * (*postHookFunc) (char * retVal___, StringBuf *self); for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_post; hIndex++) { postHookFunc = HPMHooks.list.HP_StrBuf_Value_post[hIndex].func; retVal___ = postHookFunc(retVal___, self); @@ -94359,11 +94359,11 @@ void HP_StrBuf_Free(StringBuf *self) { return; } /* strlib_interface */ -char* HP_strlib_jstrescape(char *pt) { +char * HP_strlib_jstrescape(char *pt) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_jstrescape_pre > 0) { - char* (*preHookFunc) (char **pt); + char * (*preHookFunc) (char **pt); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_jstrescape_pre[hIndex].func; @@ -94378,7 +94378,7 @@ char* HP_strlib_jstrescape(char *pt) { retVal___ = HPMHooks.source.strlib.jstrescape(pt); } if (HPMHooks.count.HP_strlib_jstrescape_post > 0) { - char* (*postHookFunc) (char* retVal___, char *pt); + char * (*postHookFunc) (char * retVal___, char *pt); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_jstrescape_post[hIndex].func; retVal___ = postHookFunc(retVal___, pt); @@ -94386,11 +94386,11 @@ char* HP_strlib_jstrescape(char *pt) { } return retVal___; } -char* HP_strlib_jstrescapecpy(char *pt, const char *spt) { +char * HP_strlib_jstrescapecpy(char *pt, const char *spt) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_jstrescapecpy_pre > 0) { - char* (*preHookFunc) (char **pt, const char **spt); + char * (*preHookFunc) (char **pt, const char **spt); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_pre[hIndex].func; @@ -94405,7 +94405,7 @@ char* HP_strlib_jstrescapecpy(char *pt, const char *spt) { retVal___ = HPMHooks.source.strlib.jstrescapecpy(pt, spt); } if (HPMHooks.count.HP_strlib_jstrescapecpy_post > 0) { - char* (*postHookFunc) (char* retVal___, char *pt, const char *spt); + char * (*postHookFunc) (char * retVal___, char *pt, const char *spt); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_post[hIndex].func; retVal___ = postHookFunc(retVal___, pt, spt); @@ -94467,11 +94467,11 @@ int HP_strlib_remove_control_chars_(char *str) { } return retVal___; } -char* HP_strlib_trim_(char *str) { +char * HP_strlib_trim_(char *str) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_trim__pre > 0) { - char* (*preHookFunc) (char **str); + char * (*preHookFunc) (char **str); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_trim__pre[hIndex].func; @@ -94486,7 +94486,7 @@ char* HP_strlib_trim_(char *str) { retVal___ = HPMHooks.source.strlib.trim_(str); } if (HPMHooks.count.HP_strlib_trim__post > 0) { - char* (*postHookFunc) (char* retVal___, char *str); + char * (*postHookFunc) (char * retVal___, char *str); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_trim__post[hIndex].func; retVal___ = postHookFunc(retVal___, str); @@ -94494,11 +94494,11 @@ char* HP_strlib_trim_(char *str) { } return retVal___; } -char* HP_strlib_normalize_name_(char *str, const char *delims) { +char * HP_strlib_normalize_name_(char *str, const char *delims) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_normalize_name__pre > 0) { - char* (*preHookFunc) (char **str, const char **delims); + char * (*preHookFunc) (char **str, const char **delims); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_normalize_name__pre[hIndex].func; @@ -94513,7 +94513,7 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) { retVal___ = HPMHooks.source.strlib.normalize_name_(str, delims); } if (HPMHooks.count.HP_strlib_normalize_name__post > 0) { - char* (*postHookFunc) (char* retVal___, char *str, const char *delims); + char * (*postHookFunc) (char * retVal___, char *str, const char *delims); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_normalize_name__post[hIndex].func; retVal___ = postHookFunc(retVal___, str, delims); @@ -94521,11 +94521,11 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) { } return retVal___; } -const char* HP_strlib_stristr_(const char *haystack, const char *needle) { +const char * HP_strlib_stristr_(const char *haystack, const char *needle) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_stristr__pre > 0) { - const char* (*preHookFunc) (const char **haystack, const char **needle); + const char * (*preHookFunc) (const char **haystack, const char **needle); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_stristr__pre[hIndex].func; @@ -94540,7 +94540,7 @@ const char* HP_strlib_stristr_(const char *haystack, const char *needle) { retVal___ = HPMHooks.source.strlib.stristr_(haystack, needle); } if (HPMHooks.count.HP_strlib_stristr__post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *haystack, const char *needle); + const char * (*postHookFunc) (const char * retVal___, const char *haystack, const char *needle); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_stristr__post[hIndex].func; retVal___ = postHookFunc(retVal___, haystack, needle); @@ -94575,11 +94575,11 @@ size_t HP_strlib_strnlen_(const char *string, size_t maxlen) { } return retVal___; } -char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) { +char * HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_strtok_r__pre > 0) { - char* (*preHookFunc) (char **s1, const char **s2, char ***lasts); + char * (*preHookFunc) (char **s1, const char **s2, char ***lasts); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_strtok_r__pre[hIndex].func; @@ -94594,7 +94594,7 @@ char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) { retVal___ = HPMHooks.source.strlib.strtok_r_(s1, s2, lasts); } if (HPMHooks.count.HP_strlib_strtok_r__post > 0) { - char* (*postHookFunc) (char* retVal___, char *s1, const char *s2, char **lasts); + char * (*postHookFunc) (char * retVal___, char *s1, const char *s2, char **lasts); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_strtok_r__post[hIndex].func; retVal___ = postHookFunc(retVal___, s1, s2, lasts); @@ -94656,11 +94656,11 @@ int HP_strlib_config_switch_(const char *str) { } return retVal___; } -char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) { +char * HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) { int hIndex = 0; - char* retVal___ = NULL; + char * retVal___ = NULL; if (HPMHooks.count.HP_strlib_safestrncpy__pre > 0) { - char* (*preHookFunc) (char **dst, const char **src, size_t *n); + char * (*preHookFunc) (char **dst, const char **src, size_t *n); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__pre; hIndex++) { preHookFunc = HPMHooks.list.HP_strlib_safestrncpy__pre[hIndex].func; @@ -94675,7 +94675,7 @@ char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) { retVal___ = HPMHooks.source.strlib.safestrncpy_(dst, src, n); } if (HPMHooks.count.HP_strlib_safestrncpy__post > 0) { - char* (*postHookFunc) (char* retVal___, char *dst, const char *src, size_t n); + char * (*postHookFunc) (char * retVal___, char *dst, const char *src, size_t n); for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__post; hIndex++) { postHookFunc = HPMHooks.list.HP_strlib_safestrncpy__post[hIndex].func; retVal___ = postHookFunc(retVal___, dst, src, n); @@ -95138,11 +95138,11 @@ size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) { } return retVal___; } -const char* HP_sv_skip_escaped_c(const char *p) { +const char * HP_sv_skip_escaped_c(const char *p) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sv_skip_escaped_c_pre > 0) { - const char* (*preHookFunc) (const char **p); + const char * (*preHookFunc) (const char **p); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_pre[hIndex].func; @@ -95157,7 +95157,7 @@ const char* HP_sv_skip_escaped_c(const char *p) { retVal___ = HPMHooks.source.sv.skip_escaped_c(p); } if (HPMHooks.count.HP_sv_skip_escaped_c_post > 0) { - const char* (*postHookFunc) (const char* retVal___, const char *p); + const char * (*postHookFunc) (const char * retVal___, const char *p); for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_post[hIndex].func; retVal___ = postHookFunc(retVal___, p); @@ -95220,11 +95220,11 @@ long HP_sysinfo_getpagesize(void) { } return retVal___; } -const char* HP_sysinfo_platform(void) { +const char * HP_sysinfo_platform(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_platform_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_platform_pre[hIndex].func; @@ -95239,7 +95239,7 @@ const char* HP_sysinfo_platform(void) { retVal___ = HPMHooks.source.sysinfo.platform(); } if (HPMHooks.count.HP_sysinfo_platform_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_platform_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95247,11 +95247,11 @@ const char* HP_sysinfo_platform(void) { } return retVal___; } -const char* HP_sysinfo_osversion(void) { +const char * HP_sysinfo_osversion(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_osversion_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_osversion_pre[hIndex].func; @@ -95266,7 +95266,7 @@ const char* HP_sysinfo_osversion(void) { retVal___ = HPMHooks.source.sysinfo.osversion(); } if (HPMHooks.count.HP_sysinfo_osversion_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_osversion_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95274,11 +95274,11 @@ const char* HP_sysinfo_osversion(void) { } return retVal___; } -const char* HP_sysinfo_cpu(void) { +const char * HP_sysinfo_cpu(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_cpu_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_cpu_pre[hIndex].func; @@ -95293,7 +95293,7 @@ const char* HP_sysinfo_cpu(void) { retVal___ = HPMHooks.source.sysinfo.cpu(); } if (HPMHooks.count.HP_sysinfo_cpu_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_cpu_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95328,11 +95328,11 @@ int HP_sysinfo_cpucores(void) { } return retVal___; } -const char* HP_sysinfo_arch(void) { +const char * HP_sysinfo_arch(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_arch_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_arch_pre[hIndex].func; @@ -95347,7 +95347,7 @@ const char* HP_sysinfo_arch(void) { retVal___ = HPMHooks.source.sysinfo.arch(); } if (HPMHooks.count.HP_sysinfo_arch_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_arch_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95382,11 +95382,11 @@ bool HP_sysinfo_is64bit(void) { } return retVal___; } -const char* HP_sysinfo_compiler(void) { +const char * HP_sysinfo_compiler(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_compiler_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_compiler_pre[hIndex].func; @@ -95401,7 +95401,7 @@ const char* HP_sysinfo_compiler(void) { retVal___ = HPMHooks.source.sysinfo.compiler(); } if (HPMHooks.count.HP_sysinfo_compiler_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_compiler_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95409,11 +95409,11 @@ const char* HP_sysinfo_compiler(void) { } return retVal___; } -const char* HP_sysinfo_cflags(void) { +const char * HP_sysinfo_cflags(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_cflags_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_cflags_pre[hIndex].func; @@ -95428,7 +95428,7 @@ const char* HP_sysinfo_cflags(void) { retVal___ = HPMHooks.source.sysinfo.cflags(); } if (HPMHooks.count.HP_sysinfo_cflags_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_cflags_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95436,11 +95436,11 @@ const char* HP_sysinfo_cflags(void) { } return retVal___; } -const char* HP_sysinfo_time(void) { +const char * HP_sysinfo_time(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_time_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_time_pre[hIndex].func; @@ -95455,7 +95455,7 @@ const char* HP_sysinfo_time(void) { retVal___ = HPMHooks.source.sysinfo.time(); } if (HPMHooks.count.HP_sysinfo_time_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_time_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95463,11 +95463,11 @@ const char* HP_sysinfo_time(void) { } return retVal___; } -const char* HP_sysinfo_vcstype(void) { +const char * HP_sysinfo_vcstype(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_vcstype_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_vcstype_pre[hIndex].func; @@ -95482,7 +95482,7 @@ const char* HP_sysinfo_vcstype(void) { retVal___ = HPMHooks.source.sysinfo.vcstype(); } if (HPMHooks.count.HP_sysinfo_vcstype_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_vcstype_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95517,11 +95517,11 @@ int HP_sysinfo_vcstypeid(void) { } return retVal___; } -const char* HP_sysinfo_vcsrevision_src(void) { +const char * HP_sysinfo_vcsrevision_src(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_vcsrevision_src_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_pre[hIndex].func; @@ -95536,7 +95536,7 @@ const char* HP_sysinfo_vcsrevision_src(void) { retVal___ = HPMHooks.source.sysinfo.vcsrevision_src(); } if (HPMHooks.count.HP_sysinfo_vcsrevision_src_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95544,11 +95544,11 @@ const char* HP_sysinfo_vcsrevision_src(void) { } return retVal___; } -const char* HP_sysinfo_vcsrevision_scripts(void) { +const char * HP_sysinfo_vcsrevision_scripts(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_pre[hIndex].func; @@ -95563,7 +95563,7 @@ const char* HP_sysinfo_vcsrevision_scripts(void) { retVal___ = HPMHooks.source.sysinfo.vcsrevision_scripts(); } if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95678,11 +95678,11 @@ bool HP_sysinfo_is_superuser(void) { } return retVal___; } -const char* HP_sysinfo_zlib(void) { +const char * HP_sysinfo_zlib(void) { int hIndex = 0; - const char* retVal___ = NULL; + const char * retVal___ = NULL; if (HPMHooks.count.HP_sysinfo_zlib_pre > 0) { - const char* (*preHookFunc) (void); + const char * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_zlib_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_sysinfo_zlib_pre[hIndex].func; @@ -95697,7 +95697,7 @@ const char* HP_sysinfo_zlib(void) { retVal___ = HPMHooks.source.sysinfo.zlib(); } if (HPMHooks.count.HP_sysinfo_zlib_post > 0) { - const char* (*postHookFunc) (const char* retVal___); + const char * (*postHookFunc) (const char * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_zlib_post; hIndex++) { postHookFunc = HPMHooks.list.HP_sysinfo_zlib_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -95810,11 +95810,11 @@ void HP_thread_final(void) { } return; } -struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { +struct thread_handle * HP_thread_create(threadFunc entry_point, void *param) { int hIndex = 0; - struct thread_handle* retVal___ = NULL; + struct thread_handle * retVal___ = NULL; if (HPMHooks.count.HP_thread_create_pre > 0) { - struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param); + struct thread_handle * (*preHookFunc) (threadFunc *entry_point, void **param); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func; @@ -95829,7 +95829,7 @@ struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { retVal___ = HPMHooks.source.thread.create(entry_point, param); } if (HPMHooks.count.HP_thread_create_post > 0) { - struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param); + struct thread_handle * (*postHookFunc) (struct thread_handle * retVal___, threadFunc entry_point, void *param); for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++) { postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func; retVal___ = postHookFunc(retVal___, entry_point, param); @@ -95837,11 +95837,11 @@ struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) { } return retVal___; } -struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { +struct thread_handle * HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) { int hIndex = 0; - struct thread_handle* retVal___ = NULL; + struct thread_handle * retVal___ = NULL; if (HPMHooks.count.HP_thread_create_opt_pre > 0) { - struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); + struct thread_handle * (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func; @@ -95856,7 +95856,7 @@ struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio); } if (HPMHooks.count.HP_thread_create_opt_post > 0) { - struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); + struct thread_handle * (*postHookFunc) (struct thread_handle * retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio); for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++) { postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func; retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio); @@ -95890,11 +95890,11 @@ void HP_thread_destroy(struct thread_handle *handle) { } return; } -struct thread_handle* HP_thread_self(void) { +struct thread_handle * HP_thread_self(void) { int hIndex = 0; - struct thread_handle* retVal___ = NULL; + struct thread_handle * retVal___ = NULL; if (HPMHooks.count.HP_thread_self_pre > 0) { - struct thread_handle* (*preHookFunc) (void); + struct thread_handle * (*preHookFunc) (void); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func; @@ -95909,7 +95909,7 @@ struct thread_handle* HP_thread_self(void) { retVal___ = HPMHooks.source.thread.self(); } if (HPMHooks.count.HP_thread_self_post > 0) { - struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___); + struct thread_handle * (*postHookFunc) (struct thread_handle * retVal___); for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++) { postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func; retVal___ = postHookFunc(retVal___); @@ -96159,11 +96159,11 @@ int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int } return retVal___; } -const struct TimerData* HP_timer_get(int tid) { +const struct TimerData * HP_timer_get(int tid) { int hIndex = 0; - const struct TimerData* retVal___ = NULL; + const struct TimerData * retVal___ = NULL; if (HPMHooks.count.HP_timer_get_pre > 0) { - const struct TimerData* (*preHookFunc) (int *tid); + const struct TimerData * (*preHookFunc) (int *tid); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_timer_get_pre[hIndex].func; @@ -96178,7 +96178,7 @@ const struct TimerData* HP_timer_get(int tid) { retVal___ = HPMHooks.source.timer.get(tid); } if (HPMHooks.count.HP_timer_get_post > 0) { - const struct TimerData* (*postHookFunc) (const struct TimerData* retVal___, int tid); + const struct TimerData * (*postHookFunc) (const struct TimerData * retVal___, int tid); for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_post; hIndex++) { postHookFunc = HPMHooks.list.HP_timer_get_post[hIndex].func; retVal___ = postHookFunc(retVal___, tid); @@ -96772,11 +96772,11 @@ int HP_unit_final(void) { } return retVal___; } -struct unit_data* HP_unit_bl2ud(struct block_list *bl) { +struct unit_data * HP_unit_bl2ud(struct block_list *bl) { int hIndex = 0; - struct unit_data* retVal___ = NULL; + struct unit_data * retVal___ = NULL; if (HPMHooks.count.HP_unit_bl2ud_pre > 0) { - struct unit_data* (*preHookFunc) (struct block_list **bl); + struct unit_data * (*preHookFunc) (struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_unit_bl2ud_pre[hIndex].func; @@ -96791,7 +96791,7 @@ struct unit_data* HP_unit_bl2ud(struct block_list *bl) { retVal___ = HPMHooks.source.unit.bl2ud(bl); } if (HPMHooks.count.HP_unit_bl2ud_post > 0) { - struct unit_data* (*postHookFunc) (struct unit_data* retVal___, struct block_list *bl); + struct unit_data * (*postHookFunc) (struct unit_data * retVal___, struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud_post; hIndex++) { postHookFunc = HPMHooks.list.HP_unit_bl2ud_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); @@ -96799,11 +96799,11 @@ struct unit_data* HP_unit_bl2ud(struct block_list *bl) { } return retVal___; } -const struct unit_data* HP_unit_cbl2ud(const struct block_list *bl) { +const struct unit_data * HP_unit_cbl2ud(const struct block_list *bl) { int hIndex = 0; - const struct unit_data* retVal___ = NULL; + const struct unit_data * retVal___ = NULL; if (HPMHooks.count.HP_unit_cbl2ud_pre > 0) { - const struct unit_data* (*preHookFunc) (const struct block_list **bl); + const struct unit_data * (*preHookFunc) (const struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_cbl2ud_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_unit_cbl2ud_pre[hIndex].func; @@ -96818,7 +96818,7 @@ const struct unit_data* HP_unit_cbl2ud(const struct block_list *bl) { retVal___ = HPMHooks.source.unit.cbl2ud(bl); } if (HPMHooks.count.HP_unit_cbl2ud_post > 0) { - const struct unit_data* (*postHookFunc) (const struct unit_data* retVal___, const struct block_list *bl); + const struct unit_data * (*postHookFunc) (const struct unit_data * retVal___, const struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_cbl2ud_post; hIndex++) { postHookFunc = HPMHooks.list.HP_unit_cbl2ud_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); @@ -96826,11 +96826,11 @@ const struct unit_data* HP_unit_cbl2ud(const struct block_list *bl) { } return retVal___; } -struct unit_data* HP_unit_bl2ud2(struct block_list *bl) { +struct unit_data * HP_unit_bl2ud2(struct block_list *bl) { int hIndex = 0; - struct unit_data* retVal___ = NULL; + struct unit_data * retVal___ = NULL; if (HPMHooks.count.HP_unit_bl2ud2_pre > 0) { - struct unit_data* (*preHookFunc) (struct block_list **bl); + struct unit_data * (*preHookFunc) (struct block_list **bl); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud2_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_unit_bl2ud2_pre[hIndex].func; @@ -96845,7 +96845,7 @@ struct unit_data* HP_unit_bl2ud2(struct block_list *bl) { retVal___ = HPMHooks.source.unit.bl2ud2(bl); } if (HPMHooks.count.HP_unit_bl2ud2_post > 0) { - struct unit_data* (*postHookFunc) (struct unit_data* retVal___, struct block_list *bl); + struct unit_data * (*postHookFunc) (struct unit_data * retVal___, struct block_list *bl); for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud2_post; hIndex++) { postHookFunc = HPMHooks.list.HP_unit_bl2ud2_post[hIndex].func; retVal___ = postHookFunc(retVal___, bl); From 2ef1788fc70d82e401c9120e7fb7c3497642dd67 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 18:56:55 +0300 Subject: [PATCH 29/50] Add term parameters into script command soundeffect Also add script command soundeffectall2 with term parameter. --- doc/script_commands.txt | 3 +- src/map/atcommand.c | 2 +- src/map/clif.h | 6 ++-- src/map/script.c | 80 ++++++++++++++++++++++++++++++++++++----- 4 files changed, 78 insertions(+), 13 deletions(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index cf48af2dcae..baa32d7d9b5 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -8403,8 +8403,9 @@ without event labels. If specified name is not found, command does nothing. --------------------------------------- -*soundeffect("", ) +*soundeffect("", {, }) *soundeffectall("", {, ""}{, , , , }) +*soundeffectall2("", {, {, ""}}{, , , , }) These two commands will play a sound effect to either the invoking character only (soundeffect()) or multiple characters (soundeffectall()). diff --git a/src/map/atcommand.c b/src/map/atcommand.c index a292fd586b8..e02670e90de 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6542,7 +6542,7 @@ ACMD(sound) if(strstr(sound_file, ".wav") == NULL) strcat(sound_file, ".wav"); - clif->soundeffectall(&sd->bl, sound_file, SOUND_TYPE_PLAY, 0, AREA); + clif->soundeffectall(&sd->bl, sound_file, PLAY_SOUND_ONCE, 0, AREA); return true; } diff --git a/src/map/clif.h b/src/map/clif.h index c41a0f2e1a5..a1ee4ce1e46 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -863,9 +863,9 @@ enum play_npc_bgm { }; enum play_sound_act { - SOUND_TYPE_PLAY = 0, - SOUND_TYPE_REPEAT = 1, - SOUND_TYPE_STOP = 2, + PLAY_SOUND_ONCE = 0, + PLAY_SOUND_REPEAT = 1, + PLAY_SOUND_STOP = 2, }; /** diff --git a/src/map/script.c b/src/map/script.c index 6f3e7a36992..65a548f7acb 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -16724,11 +16724,14 @@ static BUILDIN(playbgmall2) static BUILDIN(soundeffect) { struct map_session_data *sd = script->rid2sd(st); - const char* name = script_getstr(st,2); - enum play_sound_act type = script_getnum(st,3); + const char* name = script_getstr(st, 2); + enum play_sound_act type = script_getnum(st, 3); + int term = 0; + if (script_hasdata(st, 4)) + term = script_getnum(st, 4); if (sd != NULL) { - clif->soundeffect(sd, &sd->bl, name, type, 0); + clif->soundeffect(sd, &sd->bl, name, type, term); } return true; } @@ -16737,13 +16740,14 @@ static int soundeffect_sub(struct block_list *bl, va_list ap) { struct map_session_data *sd = NULL; char *name = va_arg(ap, char *); - int type = va_arg(ap, int); + enum play_sound_act type = va_arg(ap, int); + int term = va_arg(ap, int); nullpo_ret(bl); Assert_ret(bl->type == BL_PC); sd = BL_UCAST(BL_PC, bl); - clif->soundeffect(sd, bl, name, type, 0); + clif->soundeffect(sd, bl, name, type, term); return true; } @@ -16775,7 +16779,7 @@ static BUILDIN(soundeffectall) return true; } - map->foreachinmap(script->soundeffect_sub, m, BL_PC, name, type); + map->foreachinmap(script->soundeffect_sub, m, BL_PC, name, type, 0); } else if(script_hasdata(st,8)) { // specified part of map const char *mapname = script_getstr(st,4); int x0 = script_getnum(st,5); @@ -16789,7 +16793,7 @@ static BUILDIN(soundeffectall) return true; } - map->foreachinarea(script->soundeffect_sub, m, x0, y0, x1, y1, BL_PC, name, type); + map->foreachinarea(script->soundeffect_sub, m, x0, y0, x1, y1, BL_PC, name, type, 0); } else { ShowError("buildin_soundeffectall: insufficient arguments for specific area broadcast.\n"); } @@ -16797,6 +16801,60 @@ static BUILDIN(soundeffectall) return true; } + +/*========================================== + * Play a sound effect (.wav) on multiple clients + * soundeffectall "",{, term{,""}}{,,,,}; + *------------------------------------------*/ +static BUILDIN(soundeffectall2) +{ + struct block_list *bl = st->rid != 0 ? map->id2bl(st->rid) : map->id2bl(st->oid); + if (bl == NULL) + return true; + + const char *name = script_getstr(st, 2); + enum play_sound_act type = script_getnum(st, 3); + int term = 0; + if (script_hasdata(st, 4)) + term = script_getnum(st, 4); + + //FIXME: enumerating map squares (map->foreach) is slower than enumerating the list of online players (map->foreachpc?) [ultramage] + + if (!script_hasdata(st, 5)) { // area around + clif->soundeffectall(bl, name, type, term, AREA); + } else { + if (!script_hasdata(st, 6)) { // entire map + const char *mapname = script_getstr(st, 5); + int m; + + if ((m = map->mapname2mapid(mapname)) == -1) { + ShowWarning("soundeffectall2: Attempted to play song '%s' (type %d) on non-existent map '%s'\n", name, (int)type, mapname); + return true; + } + + map->foreachinmap(script->soundeffect_sub, m, BL_PC, name, type, term); + } else if (script_hasdata(st, 9)) { // specified part of map + const char *mapname = script_getstr(st, 5); + int x0 = script_getnum(st, 6); + int y0 = script_getnum(st, 7); + int x1 = script_getnum(st, 8); + int y1 = script_getnum(st, 9); + int m; + + if ((m = map->mapname2mapid(mapname)) == -1) { + ShowWarning("soundeffectall2: Attempted to play song '%s' (type %d) on non-existent map '%s'\n", name, (int)type, mapname); + return true; + } + + map->foreachinarea(script->soundeffect_sub, m, x0, y0, x1, y1, BL_PC, name, type, term); + } else { + ShowError("buildin_soundeffectall2: insufficient arguments for specific area broadcast.\n"); + } + } + + return true; +} + /*========================================== * pet status recovery [Valaris] / Rewritten by [Skotlex] *------------------------------------------*/ @@ -28306,8 +28364,9 @@ static void script_parse_builtin(void) BUILDIN_DEF(playbgm,"s?"), BUILDIN_DEF(playbgmall,"s?????"), BUILDIN_DEF(playbgmall2,"si?????"), - BUILDIN_DEF(soundeffect,"si"), + BUILDIN_DEF(soundeffect,"si?"), BUILDIN_DEF(soundeffectall,"si?????"), // SoundEffectAll [Codemaster] + BUILDIN_DEF(soundeffectall2,"si??????"), // SoundEffectAll2 [Codemaster] BUILDIN_DEF(strmobinfo,"ii"), // display mob data [Valaris] BUILDIN_DEF(guardian,"siisi??"), // summon guardians BUILDIN_DEF(guardianinfo,"sii"), // display guardian data [Valaris] @@ -29602,6 +29661,11 @@ static void script_hardcoded_constants(void) script->set_constant("PLAY_BGM_ONCE", PLAY_BGM_ONCE, false, false); script->set_constant("PLAY_BGM_STOP", PLAY_BGM_STOP, false, false); + script->constdb_comment("Sound play type"); + script->set_constant("PLAY_SOUND_ONCE", PLAY_SOUND_ONCE, false, false); + script->set_constant("PLAY_SOUND_REPEAT", PLAY_SOUND_REPEAT, false, false); + script->set_constant("PLAY_SOUND_STOP", PLAY_SOUND_STOP, false, false); + script->constdb_comment("Renewal"); #ifdef RENEWAL script->set_constant("RENEWAL", 1, false, false); From 9d5ec14322854cb8c1604442f9293f023aa673c3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 19:13:25 +0300 Subject: [PATCH 30/50] Use constants for play type in soundeffect and soundeffectall --- npc/cities/splendide.txt | 8 +-- npc/other/hugel_bingo.txt | 2 +- npc/quests/bard_quest.txt | 10 ++-- npc/quests/dandelion_request.txt | 48 ++++++++-------- npc/quests/first_class/tu_acolyte.txt | 2 +- npc/quests/first_class/tu_archer.txt | 4 +- npc/quests/quests_13_1.txt | 4 +- npc/quests/quests_hugel.txt | 14 ++--- npc/quests/quests_juperos.txt | 60 ++++++++++---------- npc/quests/quests_lighthalzen.txt | 80 +++++++++++++-------------- npc/quests/quests_morocc.txt | 2 +- npc/quests/quests_moscovia.txt | 20 +++---- npc/quests/quests_niflheim.txt | 2 +- npc/quests/seals/brisingamen_seal.txt | 14 ++--- npc/quests/the_sign_quest.txt | 14 ++--- npc/re/cities/malangdo.txt | 8 +-- npc/re/instances/EclageInterior.txt | 2 +- npc/re/instances/OldGlastHeim.txt | 2 +- npc/re/quests/quests_dicastes.txt | 4 +- 19 files changed, 150 insertions(+), 150 deletions(-) diff --git a/npc/cities/splendide.txt b/npc/cities/splendide.txt index bf557e4d8da..f3c1f063f52 100644 --- a/npc/cities/splendide.txt +++ b/npc/cities/splendide.txt @@ -513,14 +513,14 @@ spl_in01,172,225,3 script Wandering Poet#ep13 1_M_BARD,{ mes "[Poet Nell]"; mes "Poet of Bragie!"; mes "You must have a keen ear."; - soundeffect "bragis_poem.wav",0; + soundeffect "bragis_poem.wav", PLAY_SOUND_ONCE; break; case 2: cutin "god_nelluad02",2; mes "[Poet Nell]"; mes "Chaos in Eternity..."; mes "This is a great piece but I wouldn't reccomend it while dining..."; - soundeffect "chaos_of_eternity.wav",0; + soundeffect "chaos_of_eternity.wav", PLAY_SOUND_ONCE; break; case 3: cutin "god_nelluad02",2; @@ -528,7 +528,7 @@ spl_in01,172,225,3 script Wandering Poet#ep13 1_M_BARD,{ mes "Sunset Assassin!"; mes "Do you like Assassins?"; mes "This song tells of a legendary Assassin Cross that lived in the desert."; - soundeffect "assassin_of_sunset.wav",0; + soundeffect "assassin_of_sunset.wav", PLAY_SOUND_ONCE; break; case 4: cutin "god_nelluad02",2; @@ -536,7 +536,7 @@ spl_in01,172,225,3 script Wandering Poet#ep13 1_M_BARD,{ mes "Ring of Nibelungen..."; mes "This song has quite an interesting story~"; next; - soundeffect "ring_of_nibelungen.wav",0; + soundeffect "ring_of_nibelungen.wav", PLAY_SOUND_ONCE; mes "^4d4dff There was a niver named Rhein that"; mes "that would shine as if made of gold."; mes "It's secret hidden from all since"; diff --git a/npc/other/hugel_bingo.txt b/npc/other/hugel_bingo.txt index 13bc064d06c..5c764180b85 100644 --- a/npc/other/hugel_bingo.txt +++ b/npc/other/hugel_bingo.txt @@ -669,7 +669,7 @@ OnInit: OnTouch: if ($@bingowinner$ != strcharinfo(PC_NAME)) end; specialeffect EF_SUI_EXPLOSION; - soundeffect "tming_success.wav",1; + soundeffect "tming_success.wav", PLAY_SOUND_REPEAT; if ($@bingoresult == 16) getitem 7515,50; else getitem 7515,1; initnpctimer; diff --git a/npc/quests/bard_quest.txt b/npc/quests/bard_quest.txt index 2a6afc48631..4e7703fa318 100644 --- a/npc/quests/bard_quest.txt +++ b/npc/quests/bard_quest.txt @@ -1144,11 +1144,11 @@ S_StorySong: .@random = rand(1,3); if (.@random == 1) - soundeffect "ring_of_nibelungen.wav",0; + soundeffect "ring_of_nibelungen.wav", PLAY_SOUND_ONCE; else if (.@random == 2) - soundeffect "dont_forget_me_not.wav",0; + soundeffect "dont_forget_me_not.wav", PLAY_SOUND_ONCE; else - soundeffect "in_to_the_abyss.wav",0; + soundeffect "in_to_the_abyss.wav", PLAY_SOUND_ONCE; } else { cutin "bard_eland04",2; @@ -1515,7 +1515,7 @@ morocc,134,111,3 script Bard#3 2_M_BARD_ORIENT,{ mes "Oh... Well, I have a chronic disease so I can't speak out loud. I, um, even cough up a little blood. But aside from that, I'm perfectly healthy."; next; mes "^3355FFA look of bitterness momentarily flashed across Kino Kitty's face. He then adjusted his guitar strings and began to play, humming a low tune.^000000"; - soundeffect "humming.wav",0; + soundeffect "humming.wav", PLAY_SOUND_ONCE; close; case 3: mes "[Kino Kitty]"; @@ -1657,7 +1657,7 @@ morocc,134,111,3 script Bard#3 2_M_BARD_ORIENT,{ mes "Oh... Well, I have a chronic disease so I can't speak out loud. I, um, even cough up a little blood. But aside from that, I'm perfectly healthy."; next; mes "^3355FFA look of bitterness momentarily flashed across Kino Kitty's face. He then adjusted his guitar strings and began to play, humming a low tune.^000000"; - soundeffect "humming.wav",0; + soundeffect "humming.wav", PLAY_SOUND_ONCE; close; case 3: mes "[Kino Kitty]"; diff --git a/npc/quests/dandelion_request.txt b/npc/quests/dandelion_request.txt index 96c58b50887..a06212ec236 100644 --- a/npc/quests/dandelion_request.txt +++ b/npc/quests/dandelion_request.txt @@ -7960,7 +7960,7 @@ OnTouch: mes "......"; mes "........."; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "...Isn't the moon"; @@ -7985,7 +7985,7 @@ OnTouch: mes "Valdes? Anybody?"; mes "What was that?"; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate1_talk2"; end; @@ -8006,7 +8006,7 @@ OnTouch: mes "........."; mes "............"; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "So, you telling me you"; @@ -8042,7 +8042,7 @@ OnTouch: mes "........."; mes "............"; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate1_talk3"; end; @@ -8063,7 +8063,7 @@ OnTouch: mes "........."; mes "............"; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "Hmpf."; @@ -8094,7 +8094,7 @@ OnTouch: mes "that's happened here"; mes "in Castle Morroc..."; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate1_talk4"; end; @@ -8115,7 +8115,7 @@ OnTouch: mes "........."; mes "............"; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "Sir, our investigation has"; @@ -8131,7 +8131,7 @@ OnTouch: mes "they be doing in there?!"; mes "Come on, let's go..."; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate1_talk5"; end; @@ -8152,7 +8152,7 @@ OnTouch: mes "........."; mes "............"; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "Wh-what's with"; @@ -8204,7 +8204,7 @@ OnTouch: mes "much longer. Where"; mes "the hell is Raiyan Moore?!"; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate1_talk6"; end; @@ -8225,7 +8225,7 @@ OnTouch: mes "........."; mes "............"; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "Jeez, what's going"; @@ -8258,7 +8258,7 @@ OnTouch: mes "right now! Please... Please"; mes "don't let me be too late!"; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate1_talk7"; end; @@ -8943,7 +8943,7 @@ OnTouch: mes "......"; mes "........."; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "...Isn't the moon"; @@ -8968,7 +8968,7 @@ OnTouch: mes "Valdes? Anybody?"; mes "What was that?"; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate2_talk2"; end; @@ -8989,7 +8989,7 @@ OnTouch: mes "........."; mes "............"; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "So, you telling me you"; @@ -9025,7 +9025,7 @@ OnTouch: mes "........."; mes "............"; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate2_talk3"; end; @@ -9046,7 +9046,7 @@ OnTouch: mes "........."; mes "............"; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "Hmpf."; @@ -9077,7 +9077,7 @@ OnTouch: mes "that's happened here"; mes "in Castle Morroc..."; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate2_talk4"; end; @@ -9098,7 +9098,7 @@ OnTouch: mes "........."; mes "............"; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "Sir, our investigation has"; @@ -9114,7 +9114,7 @@ OnTouch: mes "they be doing in there?!"; mes "Come on, let's go..."; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate2_talk5"; end; @@ -9135,7 +9135,7 @@ OnTouch: mes "........."; mes "............"; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "Wh-what's with"; @@ -9187,7 +9187,7 @@ OnTouch: mes "much longer. Where"; mes "the hell is Raiyan Moore?!"; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate2_talk6"; end; @@ -9208,7 +9208,7 @@ OnTouch: mes "........."; mes "............"; next; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "[?????]"; mes "Jeez, what's going"; @@ -9241,7 +9241,7 @@ OnTouch: mes "right now! Please... Please"; mes "don't let me be too late!"; close2; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_ALL; disablenpc "#maogate2_talk7"; end; diff --git a/npc/quests/first_class/tu_acolyte.txt b/npc/quests/first_class/tu_acolyte.txt index 42950c9c813..13ac2c59f32 100644 --- a/npc/quests/first_class/tu_acolyte.txt +++ b/npc/quests/first_class/tu_acolyte.txt @@ -1085,7 +1085,7 @@ prt_monk,226,257,6 script Ill Girl#tu 4_F_04,{ mes "................"; next; specialeffect EF_CURSEATTACK; - soundeffectall "_curse.wav",0; + soundeffectall "_curse.wav", PLAY_SOUND_ONCE; emotion e_omg; mes "["+strcharinfo(PC_NAME)+"]"; mes "This is....!"; diff --git a/npc/quests/first_class/tu_archer.txt b/npc/quests/first_class/tu_archer.txt index cd9ffcbcaa5..69ccb5bacbd 100644 --- a/npc/quests/first_class/tu_archer.txt +++ b/npc/quests/first_class/tu_archer.txt @@ -1743,7 +1743,7 @@ prontera,126,335,5 script Arthail 1_M_BARD,{ next; mes "[???]"; mes "..."; - soundeffectall "se_littlewaves02.wav",0; + soundeffectall "se_littlewaves02.wav", PLAY_SOUND_ONCE; next; mes "["+strcharinfo(PC_NAME)+"]"; mes "Huh?"; @@ -1753,7 +1753,7 @@ prontera,126,335,5 script Arthail 1_M_BARD,{ mes "[????]"; mes "AAAAAAAAAAAAAAAHHHHHHHHHHH!!!!!"; emotion e_omg; - soundeffectall "se_scream_w01.wav",0; + soundeffectall "se_scream_w01.wav", PLAY_SOUND_ONCE; next; mes "["+strcharinfo(PC_NAME)+"]"; mes "What the--?!"; diff --git a/npc/quests/quests_13_1.txt b/npc/quests/quests_13_1.txt index cc755f79621..f2e4f2e9fbd 100644 --- a/npc/quests/quests_13_1.txt +++ b/npc/quests/quests_13_1.txt @@ -13520,7 +13520,7 @@ OnEnable: end; OnTouch: - soundeffect "wander_man_move.wav",1; + soundeffect "wander_man_move.wav", PLAY_SOUND_REPEAT; sc_start SC_BLIND,600000,0; mes "As soon as you touched the crystal,"; mes "you feel your body being pulled into the space gap."; @@ -13550,7 +13550,7 @@ OnTouch: mes "Shut up! It's creepy that you all look alike. Bring it on! I'm not afraid of you!"; mes "I'm not going to let you run away again!"; next; - soundeffect "wander_man_move.wav",1; + soundeffect "wander_man_move.wav", PLAY_SOUND_REPEAT; sc_end SC_BLIND; mes "[" + strcharinfo(PC_NAME) + "]"; mes "... !!!!"; diff --git a/npc/quests/quests_hugel.txt b/npc/quests/quests_hugel.txt index 1fd6486d3be..cc9e8b07056 100644 --- a/npc/quests/quests_hugel.txt +++ b/npc/quests/quests_hugel.txt @@ -7557,9 +7557,9 @@ L_MilkCow: mes "to chime, and Booboo the"; mes "cow beings to express her^FFFFFF ^3355FF feelings in the center of Hugel.^000000"; delitem Center_Potion,3; - soundeffect ""+getarg(0)+"",0; + soundeffect "" + getarg(0) + "", PLAY_SOUND_ONCE; next; - soundeffect ""+getarg(0)+"",0; + soundeffect "" + getarg(0) + "", PLAY_SOUND_ONCE; mes "^3355FFNow it's time for you"; mes "to brush Booboo the cow."; mes "Depending on her mood,"; @@ -7568,7 +7568,7 @@ L_MilkCow: next; input(.@cowbrush); if (.@cowbrush != getarg(1)) { - soundeffect "taming_fail.wav",0; + soundeffect "taming_fail.wav", PLAY_SOUND_ONCE; mes "^3355FFAwwww..."; mes "Booboo the cow looks"; mes "so disappointed. She"; @@ -7577,12 +7577,12 @@ L_MilkCow: mes "from the rest of the world...^000000"; close; } - soundeffect "cow_06.wav",0; + soundeffect "cow_06.wav", PLAY_SOUND_ONCE; mes "^3355FFBooboo the cow"; mes "seems fairly content,"; mes "and is singing a serenade.^000000"; next; - soundeffect "cow_06.wav",0; + soundeffect "cow_06.wav", PLAY_SOUND_ONCE; mes "[Mrs. Booboo]"; switch(rand(1,6)) { case 1: @@ -7648,7 +7648,7 @@ L_MilkCow: next; input(.@cowanswer$); if (.@cowanswer$ == .@cowsong$) { - soundeffect "tming_success.wav",0; + soundeffect "tming_success.wav", PLAY_SOUND_ONCE; mes "^3355FFSuccess!"; mes "Booboo the cow"; mes "is quite happy, and"; @@ -7660,7 +7660,7 @@ L_MilkCow: setquest 12043; close; } - soundeffect "taming_fail.wav",0; + soundeffect "taming_fail.wav", PLAY_SOUND_ONCE; mes "^3355FFUh oh..."; mes "Booboo the cow is starting"; mes "to snort violently! She seems"; diff --git a/npc/quests/quests_juperos.txt b/npc/quests/quests_juperos.txt index c0921cb41d9..d762802d501 100644 --- a/npc/quests/quests_juperos.txt +++ b/npc/quests/quests_juperos.txt @@ -1734,7 +1734,7 @@ OnMyMobDead: else if (.MyMobs == 0) { mapannounce "juperos_02","Have you come to see me? Fine! Find me first!",bc_map,"0xFF0000"; specialeffect(EF_SCREEN_QUAKE, AREA, playerattached()); - soundeffectall "earth_quake.wav",0; + soundeffectall "earth_quake.wav", PLAY_SOUND_ONCE; disablenpc "3F Gate Switch#jupe"; donpcevent "Restricted Area#jupe::OnEnable"; } @@ -1941,7 +1941,7 @@ OnInit: OnEnable: enablenpc "Warp#1-1"; specialeffect EF_BIG_PORTAL; - soundeffectall "jupe_warp.wav",0; + soundeffectall "jupe_warp.wav", PLAY_SOUND_ONCE; initnpctimer; end; @@ -1985,8 +1985,8 @@ OnTimer1000: OnTimer3000: mapannounce "jupe_area1","I do not intend to stop you.",bc_map,"0xFF0000"; - soundeffectall "jupe_warning.wav",0,"jupe_area1"; - soundeffectall "jupe_warning.wav",0,"jupe_area1"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area1"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area1"; end; OnTimer5000: @@ -2000,8 +2000,8 @@ OnTimer7000: OnTimer8000: disablenpc "Red Alarm On#1-1"; - soundeffectall "jupe_warning.wav",0,"jupe_area1"; - soundeffectall "jupe_warning.wav",0,"jupe_area1"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area1"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area1"; stopnpctimer; end; } @@ -2068,8 +2068,8 @@ OnEnable: OnTimer2000: mapannounce "jupe_area1","How about now?",bc_map,"0xFF0000"; - soundeffectall "jupe_warning.wav",0,"jupe_area1"; - soundeffectall "jupe_warning.wav",0,"jupe_area1"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area1"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area1"; end; OnTimer4000: @@ -2078,8 +2078,8 @@ OnTimer4000: OnTimer7000: mapannounce "jupe_area1","Just how strong you are!",bc_map,"0xFF0000"; - soundeffectall "jupe_warning.wav",0,"jupe_area1"; - soundeffectall "jupe_warning.wav",0,"jupe_area1"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area1"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area1"; .MyMobs = 8; monster "jupe_area1",30,238,"Security Guard",1675,1,"Monster2#1-1::OnMyMobDead"; monster "jupe_area1",31,238,"Security Guard",1669,1,"Monster2#1-1::OnMyMobDead"; @@ -2233,7 +2233,7 @@ OnInit: OnEnable: enablenpc "Warp#1-2"; specialeffect EF_BIG_PORTAL; - soundeffectall "jupe_warp.wav",0; + soundeffectall "jupe_warp.wav", PLAY_SOUND_ONCE; initnpctimer; end; @@ -2518,7 +2518,7 @@ OnInit: OnEnable: enablenpc "Warp#1-3"; specialeffect EF_BIG_PORTAL; - soundeffectall "jupe_warp.wav",0; + soundeffectall "jupe_warp.wav", PLAY_SOUND_ONCE; initnpctimer; end; @@ -2805,7 +2805,7 @@ OnInit: OnEnable: enablenpc "Warp#1-4"; specialeffect EF_BIG_PORTAL; - soundeffectall "jupe_warp.wav",0; + soundeffectall "jupe_warp.wav", PLAY_SOUND_ONCE; initnpctimer; end; @@ -3009,7 +3009,7 @@ OnInit: OnEnable: enablenpc "LeverWarp#ufe"; specialeffect EF_BIG_PORTAL; - soundeffectall "jupe_warp.wav",0; + soundeffectall "jupe_warp.wav", PLAY_SOUND_ONCE; initnpctimer; end; @@ -3140,7 +3140,7 @@ OnInit: OnEnable: enablenpc "Warp#2-1"; specialeffect EF_BIG_PORTAL; - soundeffectall "jupe_warp.wav",0; + soundeffectall "jupe_warp.wav", PLAY_SOUND_ONCE; initnpctimer; end; @@ -3184,8 +3184,8 @@ OnTimer1000: OnTimer3000: mapannounce "jupe_area2","I do not intend to stop you.",bc_map,"0xFF0000"; - soundeffectall "jupe_warning.wav",0,"jupe_area2"; - soundeffectall "jupe_warning.wav",0,"jupe_area2"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area2"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area2"; end; OnTimer5000: @@ -3199,8 +3199,8 @@ OnTimer7000: OnTimer8000: disablenpc "Red Alarm On#2-1"; - soundeffectall "jupe_warning.wav",0,"jupe_area2"; - soundeffectall "jupe_warning.wav",0,"jupe_area2"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area2"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area2"; stopnpctimer; end; } @@ -3267,8 +3267,8 @@ OnEnable: OnTimer2000: mapannounce "jupe_area2","How about now?",bc_map,"0xFF0000"; - soundeffectall "jupe_warning.wav",0,"jupe_area2"; - soundeffectall "jupe_warning.wav",0,"jupe_area2"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area2"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area2"; end; OnTimer4000: @@ -3277,8 +3277,8 @@ OnTimer4000: OnTimer7000: mapannounce "jupe_area2","Just how strong you are!",bc_map,"0xFF0000"; - soundeffectall "jupe_warning.wav",0,"jupe_area2"; - soundeffectall "jupe_warning.wav",0,"jupe_area2"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area2"; + soundeffectall "jupe_warning.wav", PLAY_SOUND_ONCE, "jupe_area2"; .MyMobs = 8; monster "jupe_area2",126,236,"Security Guard",1675,1,"Monster2#2-1::OnMyMobDead"; monster "jupe_area2",127,236,"Security Guard",1669,1,"Monster2#2-1::OnMyMobDead"; @@ -3432,7 +3432,7 @@ OnInit: OnEnable: enablenpc "Warp#2-2"; specialeffect EF_BIG_PORTAL; - soundeffectall "jupe_warp.wav",0; + soundeffectall "jupe_warp.wav", PLAY_SOUND_ONCE; initnpctimer; end; @@ -3717,7 +3717,7 @@ OnInit: OnEnable: enablenpc "Warp#2-3"; specialeffect EF_BIG_PORTAL; - soundeffectall "jupe_warp.wav",0; + soundeffectall "jupe_warp.wav", PLAY_SOUND_ONCE; initnpctimer; end; @@ -4006,7 +4006,7 @@ OnInit: OnEnable: enablenpc "Warp#2-4"; specialeffect EF_BIG_PORTAL; - soundeffectall "jupe_warp.wav",0; + soundeffectall "jupe_warp.wav", PLAY_SOUND_ONCE; initnpctimer; end; @@ -4212,7 +4212,7 @@ OnInit: OnEnable: enablenpc "LeverWarp#ufe2"; specialeffect EF_BIG_PORTAL; - soundeffectall "jupe_warp.wav",0; + soundeffectall "jupe_warp.wav", PLAY_SOUND_ONCE; initnpctimer; end; @@ -4304,7 +4304,7 @@ jupe_ele_r,51,98,0 script Switch#ufe CLEAR_NPC,{ enablenpc "Switch On#ufe"; initnpctimer; specialeffect(EF_SCREEN_QUAKE, AREA, playerattached()); - soundeffectall "earth_quake.wav",0; + soundeffectall "earth_quake.wav", PLAY_SOUND_ONCE; close2; cutin "5-1",255; end; @@ -4471,7 +4471,7 @@ OnEnable: OnTimer5000: mapannounce "jupe_ele_r","Those of you who have defeated the hallucination, step forward.",bc_map,"0x66FF00"; - soundeffectall "earth_quake.wav",0; + soundeffectall "earth_quake.wav", PLAY_SOUND_ONCE; end; OnTimer8000: @@ -4870,7 +4870,7 @@ OnTimer12000: OnTimer22000: mapannounce "jupe_ele","It's not real anyway. All of it's safe, it can't hurt you...",bc_map,"0x66FF00"; - soundeffectall "earth_quake.wav",0; + soundeffectall "earth_quake.wav", PLAY_SOUND_ONCE; disablenpc "4F Enter#ufe"; end; diff --git a/npc/quests/quests_lighthalzen.txt b/npc/quests/quests_lighthalzen.txt index 62707ddfd20..0b05cd99b08 100644 --- a/npc/quests/quests_lighthalzen.txt +++ b/npc/quests/quests_lighthalzen.txt @@ -3374,19 +3374,19 @@ lhz_dun01,147,106,0 script #kiz01-1 FAKE_NPC,3,3,{ OnTouch: if (countitem(Armlet_Of_Prisoner) > 0 ) { if (lhz_curse == 0) { - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; lhz_curse = 1; setquest 2086; } else if (lhz_curse < 26) { @lhz_ghost = rand(1,5); sc_start SC_CURSE,1000,0; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; if (@lhz_ghost == 1) { mes "[??????]"; mes "..................."; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "[??????]"; mes "...elp....help..."; close; @@ -3395,7 +3395,7 @@ OnTouch: mes "[??????]"; mes "..................."; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "[??????]"; mes "I..."; mes "I despise the living."; @@ -3414,19 +3414,19 @@ lhz_dun02,244,229,0 script #kiz02-1 FAKE_NPC,3,3,{ OnTouch: if (countitem(Armlet_Of_Prisoner) > 0 ) { if (lhz_curse == 0) { - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; lhz_curse = 1; setquest 2086; } else if (lhz_curse < 26) { @lhz_ghost = rand(1,10); sc_start SC_CURSE,1000,0; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; if (@lhz_ghost == 1) { mes "[??????]"; mes "..................."; next; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; mes "[??????]"; mes "...elp....help..."; close; @@ -3435,7 +3435,7 @@ OnTouch: mes "[??????]"; mes "..................."; next; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; mes "[??????]"; mes "I..."; mes "I despise the living."; @@ -3454,19 +3454,19 @@ lhz_dun03,244,51,0 script #kiz03-1 FAKE_NPC,3,3,{ OnTouch: if (countitem(Armlet_Of_Prisoner) > 0 ) { if (lhz_curse == 0) { - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; lhz_curse = 1; setquest 2086; } else if (lhz_curse < 26) { @lhz_ghost = rand(1,10); sc_start SC_CURSE,1000,0; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; if (@lhz_ghost == 1) { mes "[??????]"; mes "..................."; next; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; mes "[??????]"; mes "...elp....help..."; close; @@ -3475,7 +3475,7 @@ OnTouch: mes "[??????]"; mes "..................."; next; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; mes "[??????]"; mes "I..."; mes "I despise the living."; @@ -3493,13 +3493,13 @@ lighthalzen,344,278,0 script #kiz03 FAKE_NPC,2,2,{ OnTouch: if (countitem(Armlet_Of_Prisoner) > 0 ) { if (lhz_curse == 0) { - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; sc_start SC_CURSE,1000,0; } else if ((lhz_curse > 0) && (lhz_curse < 26)) { mes "............"; next; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "............"; next; @@ -3545,12 +3545,12 @@ OnTouch: if (countitem(Armlet_Of_Prisoner) > 0 ) { if (lhz_curse == 0) { sc_start SC_CURSE,1000,0; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; } else if ((lhz_curse > 0) && (lhz_curse < 26)) { mes "............"; next; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "............"; next; @@ -3610,7 +3610,7 @@ OnTouch: mes "again! Where are all of"; mes "these voices coming from?"; close2; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; sc_end SC_BLIND; sc_start SC_CURSE,5000,0; if (!lhz_spi02) lhz_spi02 = 1; @@ -3628,7 +3628,7 @@ OnTouch: else if ((lhz_curse > 0) && (lhz_curse < 26)) { mes "............"; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "............"; next; @@ -3656,7 +3656,7 @@ OnTouch: mes "This is insane!"; mes "I must be hallucinating!"; close2; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; sc_end SC_BLIND; sc_start SC_CURSE,3000,0; if (!lhz_spi03) lhz_spi03 = 1; @@ -3674,7 +3674,7 @@ OnTouch: else if ((lhz_curse > 0) && (lhz_curse < 26)) { mes "............"; next; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "............"; next; @@ -3715,7 +3715,7 @@ OnTouch: mes "["+strcharinfo(PC_NAME)+"]"; mes "............"; close2; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; sc_end SC_BLIND; sc_start SC_CURSE,5000,0; if (!lhz_spi04) lhz_spi04 = 1; @@ -3733,7 +3733,7 @@ OnTouch: else if ((lhz_curse > 0) && (lhz_curse < 26)) { mes "............"; next; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "............"; next; @@ -3769,7 +3769,7 @@ OnTouch: next; mes "............"; close2; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; sc_end SC_BLIND; sc_start SC_CURSE,3000,0; if (lhz_curse == 6) lhz_curse = 7; @@ -3787,7 +3787,7 @@ OnTouch: else if ((lhz_curse > 0) && (lhz_curse < 26)) { mes "............"; next; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; mes "............"; next; @@ -3853,7 +3853,7 @@ OnTouch: next; mes "............"; close2; - soundeffect "tao_gunka_stand.wav",0; + soundeffect "tao_gunka_stand.wav", PLAY_SOUND_ONCE; sc_end SC_BLIND; sc_start SC_CURSE,3000,0; if (lhz_curse == 11) lhz_curse = 12; @@ -3869,7 +3869,7 @@ OnTouch: mes "............"; next; mes "............"; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; sc_start SC_CURSE,1000,0; close2; warp "lhz_que01",26,27; @@ -3914,13 +3914,13 @@ lhz_que01,21,31,5 script #li_Varmunt 4_M_SAGE_C,{ next; mes "............"; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "................."; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "..................."; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "....................."; next; mes "......................."; @@ -3946,13 +3946,13 @@ lhz_que01,21,31,5 script #li_Varmunt 4_M_SAGE_C,{ next; mes "............"; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "................."; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "...................."; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "......................"; next; mes "[??]"; @@ -4049,13 +4049,13 @@ lhz_que01,29,24,3 script #li_researcher 4_M_SAGE_A,{ next; mes "............"; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "................."; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "..................."; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "....................."; next; mes "......................."; @@ -4081,13 +4081,13 @@ lhz_que01,29,24,3 script #li_researcher 4_M_SAGE_A,{ next; mes "............"; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "................."; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "...................."; next; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; mes "......................"; next; mes "[??]"; @@ -4171,7 +4171,7 @@ OnTouch: mes "..."; mes "......"; mes "........."; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; sc_start SC_CURSE,1000,0; close2; warp "lhz_que01",98,59; @@ -4378,7 +4378,7 @@ lighthalzen,346,263,3 script Elder#lhz 4_F_EINOLD,{ mes "you been experiencing chills"; mes "down your spine, cold sweats,"; mes "maybe even hearing voices?"; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; sc_start SC_CURSE,5000,0; next; select("Yes! How do I get rid of them?"); diff --git a/npc/quests/quests_morocc.txt b/npc/quests/quests_morocc.txt index 8c0158fa021..5cf5481e432 100644 --- a/npc/quests/quests_morocc.txt +++ b/npc/quests/quests_morocc.txt @@ -3855,7 +3855,7 @@ OnTouch: next; mes "[Echoing Voice]"; mes "You are bound to your fate, no matter how hard you try to escape..."; - soundeffect "loli_ruri_stand.wav",0; + soundeffect "loli_ruri_stand.wav", PLAY_SOUND_ONCE; next; mes ".................."; mes ".................."; diff --git a/npc/quests/quests_moscovia.txt b/npc/quests/quests_moscovia.txt index d0afd0d1187..ff138ab5128 100644 --- a/npc/quests/quests_moscovia.txt +++ b/npc/quests/quests_moscovia.txt @@ -1277,7 +1277,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{ mes "dry land. If you don't go back"; mes "soon, some people may worry."; next; - soundeffect "mos_gusli1.wav",0; + soundeffect "mos_gusli1.wav", PLAY_SOUND_ONCE; mes "-The island starts to move slowly"; mes "when the old man plays an"; mes "unfamiliar instrument...-"; @@ -1379,7 +1379,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{ mes "That's all you need if only it"; mes "existed in this island..."; next; - soundeffect "mos_gusli1.wav",0; + soundeffect "mos_gusli1.wav", PLAY_SOUND_ONCE; mes "-The aged man closes his eyes and"; mes "starts to play his instrument, as"; mes "he falls in thought.-"; @@ -1548,7 +1548,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{ mes "At first, look at me how I play,"; mes "then you play it slowly."; next; - soundeffect "mos_gusli1.wav",0; + soundeffect "mos_gusli1.wav", PLAY_SOUND_ONCE; mes "[Aged Stranger]"; mes "Do not hurry,"; mes "keep your composure,"; @@ -1686,7 +1686,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{ mes "Good. I will go to the place"; mes "right way."; next; - soundeffect "mos_gusli1.wav",0; + soundeffect "mos_gusli1.wav", PLAY_SOUND_ONCE; mes "A old man started to play a instrument"; mes "closing his eyes."; mes "And then he didn't any answer so, looks like"; @@ -1699,7 +1699,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{ S_AS_1: if (rand(1,3) == 2) { - soundeffect "mos_gusli1.wav",0; + soundeffect "mos_gusli1.wav", PLAY_SOUND_ONCE; emotion e_no1; specialeffect(EF_EXIT, AREA, playerattached()); mes "[Aged Stranger]"; @@ -1816,7 +1816,7 @@ S_AS_2: mes "with this island. Only if you are a"; mes "friend... heheh."; next; - soundeffect "mos_gusli1.wav",0; + soundeffect "mos_gusli1.wav", PLAY_SOUND_ONCE; mes "-The old man starts to play"; mes "his instrument, with eyes closed."; mes "He is unresponsive..."; @@ -1828,7 +1828,7 @@ S_AS_2: } S_AS_3: - soundeffect "mos_gusli1.wav",0; + soundeffect "mos_gusli1.wav", PLAY_SOUND_ONCE; mes "-The old man starts to play"; mes "his instrument, with eyes closed."; mes "He is unresponsive..."; @@ -2188,7 +2188,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{ mes "You can play it!"; mes "Good, play it right away!"; next; - soundeffect "mos_gusli2.wav",0; + soundeffect "mos_gusli2.wav", PLAY_SOUND_ONCE; emotion e_ag,0,"Csar Alexsay III#npc"; emotion e_ag,0,"Prime Minister Dmitree#m"; mes "[Csar Alexsay III]"; @@ -2299,7 +2299,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{ mes "Oh! Oh!... You can play it!"; mes "Play it right away. I wonder about its sound."; next; - soundeffect "mos_gusli1.wav",0; + soundeffect "mos_gusli1.wav", PLAY_SOUND_ONCE; mes "-When the music of the Gusli is"; mes "played, all the people in the"; mes "Csar's Palace fall in with the tune.-"; @@ -2512,7 +2512,7 @@ OnTouch: next; if(select("Go to Whale Island.", "Stay put.") == 1) { if (getequipid(EQI_ACC_L) == GUSLI || getequipid(EQI_ACC_R) == GUSLI) { - soundeffect "mos_gusli2.wav",0; + soundeffect "mos_gusli2.wav", PLAY_SOUND_ONCE; mes "-Slowly, your hands are on the"; mes "Gusli, and the playing starts..."; mes "reminding you of the melody which"; diff --git a/npc/quests/quests_niflheim.txt b/npc/quests/quests_niflheim.txt index e0c8ba6d2b5..24ad2607834 100644 --- a/npc/quests/quests_niflheim.txt +++ b/npc/quests/quests_niflheim.txt @@ -268,7 +268,7 @@ OnTouch: mes "the final empty key space"; mes "to take a better look at it...^000000"; next; - soundeffect "complete.wav",0; + soundeffect "complete.wav", PLAY_SOUND_ONCE; next; if (nif_esc == 12) { MISC_QUEST |= 32; diff --git a/npc/quests/seals/brisingamen_seal.txt b/npc/quests/seals/brisingamen_seal.txt index 3eb81b7003f..03c23b06e33 100644 --- a/npc/quests/seals/brisingamen_seal.txt +++ b/npc/quests/seals/brisingamen_seal.txt @@ -66,7 +66,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "I must say this song"; mes "represents the"; mes "heart of a poet!"; - soundeffect "bragis_poem.wav",1; + soundeffect "bragis_poem.wav", PLAY_SOUND_REPEAT; close2; break; case 2: @@ -78,7 +78,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "what the title really"; mes "means. Is it the chaos"; mes "of hell or our own reality?"; - soundeffect "chaos_of_eternity.wav",1; + soundeffect "chaos_of_eternity.wav", PLAY_SOUND_REPEAT; close2; break; case 3: @@ -86,7 +86,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "[Nelliorde]"; mes "Assassin in the Sunset!"; mes "Yes, no one looks cooler than an Assassin, the bringer of death, standing alone in the sunset! Heh heh~"; - soundeffect "assassin_of_sunset.wav",1; + soundeffect "assassin_of_sunset.wav", PLAY_SOUND_REPEAT; close2; break; case 4: @@ -96,7 +96,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "Okay, are you ready to listen?"; mes "Hum hum hum...."; next; - soundeffect "ring_of_nibelungen.wav",1; + soundeffect "ring_of_nibelungen.wav", PLAY_SOUND_REPEAT; mes "^4D4DFFRheingold..."; mes "Hidden in the Rhein river."; mes "If made into a ring,"; @@ -801,7 +801,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "I must say this song"; mes "represents the"; mes "heart of a poet!"; - soundeffect "bragis_poem.wav",1; + soundeffect "bragis_poem.wav", PLAY_SOUND_REPEAT; Zeny -= 500; close2; } @@ -819,7 +819,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "You must like robust"; mes "and energetic music, eh?"; mes "As you wish~"; - soundeffect "chaos_of_eternity.wav",1; + soundeffect "chaos_of_eternity.wav", PLAY_SOUND_REPEAT; Zeny -= 500; close2; } @@ -839,7 +839,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "the setting sun fits"; mes "well with Assassins."; mes "Don't you agree?"; - soundeffect "assassin_of_sunset.wav",1; + soundeffect "assassin_of_sunset.wav", PLAY_SOUND_REPEAT; Zeny -= 500; close2; } diff --git a/npc/quests/the_sign_quest.txt b/npc/quests/the_sign_quest.txt index 0bcd4c78dc0..ce7c618e577 100644 --- a/npc/quests/the_sign_quest.txt +++ b/npc/quests/the_sign_quest.txt @@ -3107,7 +3107,7 @@ OnTouch: prt_maze02,25,161,0 script #music FAKE_NPC,7,7,{ OnTouch: - soundeffect "effect\\ ؽ.wav",1; + soundeffect "effect\\ ؽ.wav", PLAY_SOUND_REPEAT; end; } @@ -4481,7 +4481,7 @@ cmd_in02,88,51,4 script Strange Guy#sign 1_M_SIGNART,{ mes "I'll freakin' beat you to near"; mes "freakin' death! Bam bam bam!"; close2; - soundeffect "effect\\sign_noise.wav",1; + soundeffect "effect\\sign_noise.wav", PLAY_SOUND_REPEAT; Hp = 1; warp "comodo",122,100; end; @@ -5180,7 +5180,7 @@ OnReset: end; OnTouch: - soundeffect "effect\\sign_up.wav",1; + soundeffect "effect\\sign_up.wav", PLAY_SOUND_REPEAT; if (.s_up == 1) { donpcevent "Examiner#sd::OnUp"; donpcevent "s_dance#up::OnDisable"; @@ -5236,7 +5236,7 @@ OnReset: end; OnTouch: - soundeffect "effect\\sign_down.wav",1; + soundeffect "effect\\sign_down.wav", PLAY_SOUND_REPEAT; if (.s_down == 1) { donpcevent "Examiner#sd::OnUp"; donpcevent "s_dance#down::OnDisable"; @@ -5313,7 +5313,7 @@ OnReset: end; OnTouch: - soundeffect "effect\\sign_left.wav",1; + soundeffect "effect\\sign_left.wav", PLAY_SOUND_REPEAT; if (.s_left == 1) { donpcevent "Examiner#sd::OnUp"; donpcevent "s_dance#right::OnUp"; @@ -5381,7 +5381,7 @@ OnReset: end; OnTouch: - soundeffect "effect\\sign_right.wav",1; + soundeffect "effect\\sign_right.wav", PLAY_SOUND_REPEAT; if (.s_right == 1) { donpcevent "Examiner#sd::OnUp"; donpcevent "s_dance#right::OnDisable"; @@ -5455,7 +5455,7 @@ OnReset: end; OnTouch: - soundeffect "effect\\sign_center.wav",1; + soundeffect "effect\\sign_center.wav", PLAY_SOUND_REPEAT; if (.s_center == 1) { donpcevent "Examiner#sd::OnUp"; donpcevent "s_dance#cen::OnDisable"; diff --git a/npc/re/cities/malangdo.txt b/npc/re/cities/malangdo.txt index 0ad90e80c91..7f774dee6bb 100644 --- a/npc/re/cities/malangdo.txt +++ b/npc/re/cities/malangdo.txt @@ -363,16 +363,16 @@ malangdo,149,120,5 script Wanderer#mal 4_F_WANDERER,5,1,{ OnTouch: switch(rand(5)) { case 0: - soundeffect "ring_of_nibelungen.wav",0; + soundeffect "ring_of_nibelungen.wav", PLAY_SOUND_ONCE; break; case 1: - soundeffect "dont_forget_me_not.wav",0; + soundeffect "dont_forget_me_not.wav", PLAY_SOUND_ONCE; break; case 2: - soundeffect "humming.wav",0; + soundeffect "humming.wav", PLAY_SOUND_ONCE; break; case 3: - soundeffect "assassin_of_sunset.wav",0; + soundeffect "assassin_of_sunset.wav", PLAY_SOUND_ONCE; break; case 4: emotion e_ho; diff --git a/npc/re/instances/EclageInterior.txt b/npc/re/instances/EclageInterior.txt index 3a5cfd2381e..91c66406d2d 100644 --- a/npc/re/instances/EclageInterior.txt +++ b/npc/re/instances/EclageInterior.txt @@ -146,7 +146,7 @@ ecl_hub01,130,15,0 script It is closed shut. CLEAR_NPC,{ mes("No...way!!!"); specialeffect(EF_LORD, AREA, playerattached()); percentheal(-99, 0); - soundeffect("wander_man_move.wav", 1); + soundeffect("wander_man_move.wav", PLAY_SOUND_REPEAT); sc_start(SC_BLIND, 60000, 0); close2(); warp("1@ecl", 146, 95); diff --git a/npc/re/instances/OldGlastHeim.txt b/npc/re/instances/OldGlastHeim.txt index 4a0f5133f5d..5cc1889acc8 100644 --- a/npc/re/instances/OldGlastHeim.txt +++ b/npc/re/instances/OldGlastHeim.txt @@ -2029,7 +2029,7 @@ OnTimer80000: mes("[Hugin]"); mes("Varmundt's time is stopped by me. And your time will be distorted soon."); specialeffect(EF_BLIND, AREA, AREA, playerattached()); - soundeffect("_blind.wav", 0); + soundeffect("_blind.wav", PLAY_SOUND_ONCE); next(); mes("[Hugin]"); mes("Maybe this poor time traveler will try to stop Glast Heim's tragedy from happening."); diff --git a/npc/re/quests/quests_dicastes.txt b/npc/re/quests/quests_dicastes.txt index e0620b03285..46f73ae1d22 100644 --- a/npc/re/quests/quests_dicastes.txt +++ b/npc/re/quests/quests_dicastes.txt @@ -1332,7 +1332,7 @@ OnTouch: if (ep13_3_secret == 13) { mes "As soon as you enter the room, someone"; mes "pushes down your head to force you to bow."; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; next; mes "[Ringing Voice]"; @@ -1537,7 +1537,7 @@ dic_in01,300,280,5 script Minister Ahat#ep133_21 4_HUMAN_GERUTOO,{ else if (ep13_3_secret == 13) { mes "As soon as you try to approach Ahat, someone"; mes "pushes down your head to force you to bow."; - soundeffect "wander_man_move.wav",0; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,60000,0; next; mes "[Ringing Voice]"; From 6870427d84e7e964e049efdb16e8eef8d210bf0b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 20:45:07 +0300 Subject: [PATCH 31/50] Fix play repeat sound in packet PACKET_ZC_SOUND --- src/map/clif.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/map/clif.c b/src/map/clif.c index e404277757f..798fbe29fa9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9377,7 +9377,13 @@ static void clif_soundeffect(struct map_session_data *sd, struct block_list *bl, safestrncpy(p->name, name, NAME_LENGTH); p->act = type; p->term = term; - p->AID = bl->id; + if (type == PLAY_SOUND_REPEAT) { + // for repeat look like used wrong 3d sound position and player cant hear sound only once. [4144] + // Without AID sound played without any position in space. [4144] + p->AID = 0; + } else { + p->AID = bl->id; + } WFIFOSET(fd, sizeof(struct PACKET_ZC_SOUND)); } From 7a82e561975d37fd4acb0ee0e91e09b7f0356a48 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 20:45:54 +0300 Subject: [PATCH 32/50] Add soundeffect demo script --- npc/custom/sound.txt | 33 +++++++++++++++++++++++++++++++++ npc/scripts_custom.conf | 1 + 2 files changed, 34 insertions(+) create mode 100644 npc/custom/sound.txt diff --git a/npc/custom/sound.txt b/npc/custom/sound.txt new file mode 100644 index 00000000000..e1847a08167 --- /dev/null +++ b/npc/custom/sound.txt @@ -0,0 +1,33 @@ +//===== Hercules Script ====================================== +//= soundeffect play demo +//===== By: ================================================== +//= 4144 +//===== Current Version: ===================================== +//= 1.0 +//===== Description: ========================================= +//= soundeffect player demo in prontera. +//============================================================ + +prontera,162,286,4 script Sound demo#prt 4_M_KID1,{ + mes("soundeffect(\"loli_ruri_stand.wav\", PLAY_SOUND_ONCE)"); + soundeffect("loli_ruri_stand.wav", PLAY_SOUND_ONCE); + next(); + + mes("soundeffect(\"loli_ruri_stand.wav\", PLAY_SOUND_REPEAT, 1000)"); + soundeffect("loli_ruri_stand.wav", PLAY_SOUND_REPEAT, 1000); + next(); + + mes("soundeffect(\"complete.wav\", PLAY_SOUND_REPEAT, 4000)"); + soundeffect("complete.wav", PLAY_SOUND_REPEAT, 4000); + next(); + + mes("soundeffect(\"loli_ruri_stand.wav\", PLAY_SOUND_STOP)"); + soundeffect("loli_ruri_stand.wav", PLAY_SOUND_STOP); + next(); + + mes("soundeffect(\"complete.wav\", PLAY_SOUND_STOP)"); + soundeffect("complete.wav", PLAY_SOUND_STOP); + next(); + + close; +} diff --git a/npc/scripts_custom.conf b/npc/scripts_custom.conf index cc140771917..bd87eaebcce 100644 --- a/npc/scripts_custom.conf +++ b/npc/scripts_custom.conf @@ -56,6 +56,7 @@ //"npc/custom/dialogalign.txt", //"npc/custom/dialogpossize.txt", //"npc/custom/bgm.txt", +//"npc/custom/sound.txt", //================= Other Scripts ========================================= // -- MVP Arena From 9046a6e8c655747b948ad1487317215e79c08e02 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 21:01:50 +0300 Subject: [PATCH 33/50] Update positions for custom demo scripts --- npc/custom/bgm.txt | 2 +- npc/custom/dialogalign.txt | 2 +- npc/custom/dialogpossize.txt | 2 +- npc/custom/expandedbartershop.txt | 2 +- npc/custom/sound.txt | 2 +- npc/custom/zeroui.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/npc/custom/bgm.txt b/npc/custom/bgm.txt index e11a2546f07..2540a57b6c1 100644 --- a/npc/custom/bgm.txt +++ b/npc/custom/bgm.txt @@ -8,7 +8,7 @@ //= Bgm player demo in prontera. //============================================================ -prontera,162,286,4 script Bgm demo#prt 4_M_KID1,{ +prontera,161,284,4 script Bgm demo#prt 4_M_KID1,{ mes("Play track 30.mp3 once and return to normal music"); mes("playbgm \"30\", PLAY_BGM_ONCE"); playbgm("30", PLAY_BGM_ONCE); diff --git a/npc/custom/dialogalign.txt b/npc/custom/dialogalign.txt index 51432f69124..a123bb33835 100644 --- a/npc/custom/dialogalign.txt +++ b/npc/custom/dialogalign.txt @@ -8,7 +8,7 @@ //= Dialog align demo in prontera. //============================================================ -prontera,162,284,4 script Align demo#prt 4_M_KID1,{ +prontera,163,284,4 script Align demo#prt 4_M_KID1,{ setdialogalign(DIALOG_ALIGN_LEFT); mes("Align left"); next; diff --git a/npc/custom/dialogpossize.txt b/npc/custom/dialogpossize.txt index eaaba5e9864..16b2e62af5b 100644 --- a/npc/custom/dialogpossize.txt +++ b/npc/custom/dialogpossize.txt @@ -8,7 +8,7 @@ //= Dialog pos and size demo in prontera. //============================================================ -prontera,162,286,4 script Pos / Size demo#prt 4_M_KID1,{ +prontera,165,284,4 script Pos / Size demo#prt 4_M_KID1,{ mes("setdialogsize(400, 100)"); mes("setdialogpos(100, 100)"); mes("select next ..."); diff --git a/npc/custom/expandedbartershop.txt b/npc/custom/expandedbartershop.txt index 5ba988ad91e..6f9ab47fbb1 100644 --- a/npc/custom/expandedbartershop.txt +++ b/npc/custom/expandedbartershop.txt @@ -8,7 +8,7 @@ //= Expanded barter shop demo in prontera. //============================================================ -prontera,160,284,4 trader Expanded Barter Shop#prt 4_M_KID1,{ +prontera,167,284,4 trader Expanded Barter Shop#prt 4_M_KID1,{ end; OnInit: tradertype(NST_EXPANDED_BARTER); diff --git a/npc/custom/sound.txt b/npc/custom/sound.txt index e1847a08167..affd9721138 100644 --- a/npc/custom/sound.txt +++ b/npc/custom/sound.txt @@ -8,7 +8,7 @@ //= soundeffect player demo in prontera. //============================================================ -prontera,162,286,4 script Sound demo#prt 4_M_KID1,{ +prontera,169,284,4 script Sound demo#prt 4_M_KID1,{ mes("soundeffect(\"loli_ruri_stand.wav\", PLAY_SOUND_ONCE)"); soundeffect("loli_ruri_stand.wav", PLAY_SOUND_ONCE); next(); diff --git a/npc/custom/zeroui.txt b/npc/custom/zeroui.txt index 6fadf160bfa..10fad27cb38 100644 --- a/npc/custom/zeroui.txt +++ b/npc/custom/zeroui.txt @@ -8,7 +8,7 @@ //= Zero ui demo in prontera. //============================================================ -prontera,161,284,4 script Zero UI demo#prt 4_M_KID1,{ +prontera,171,284,4 script Zero UI demo#prt 4_M_KID1,{ cutin("h_iris01.bmp", 2); zmes1("Hello hercules with zero ui!"); next; From f0c2f095341e40c4f1bf6127f3a72688283e7f14 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 21:13:13 +0300 Subject: [PATCH 34/50] Update docs for soundeffect, soundeffectall, soundeffectall2 --- doc/script_commands.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index baa32d7d9b5..ead3a4b894c 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -8416,10 +8416,12 @@ If it does, it will be centered on that object. (an NPC sprite) Effect filename is the filename in a GRF. It must have the .wav extension. -It's not quite certain what the 'type' actually does, it is sent to the -client directly. It probably determines which directory to play the effect -from. It's certain that giving 0 for the number will play sound files from -'\data\wav\', but where the other numbers will read from is unclear. +Possible values for type: + PLAY_SOUND_ONCE - play sound file once (default) + PLAY_SOUND_REPEAT - play sound in repeat mode. Term parameter set delay before next sound play. + PLAY_SOUND_STOP - stop repeated sound. Not stop already playing sound but terminate future repeats. + +Term parameter make sense only for type PLAY_SOUND_REPEAT. The sound files themselves must be in the PCM format, and file names should also have a maximum length of 23 characters including the .wav From d28c1295061cded356a06eaf344b5e9be433f17a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 21:30:08 +0300 Subject: [PATCH 35/50] Add packet id for packet ZC_ACK_TOUSESKILL --- src/map/clif.c | 2 +- src/map/packets_struct.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/map/clif.c b/src/map/clif.c index 798fbe29fa9..413bda2f558 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5855,7 +5855,7 @@ static void clif_skill_fail(struct map_session_data *sd, uint16 skill_id, enum u WFIFOHEAD(fd, sizeof(struct PACKET_ZC_ACK_TOUSESKILL)); struct PACKET_ZC_ACK_TOUSESKILL *p = WFIFOP(fd, 0); - p->packetType = 0x110; + p->packetType = HEADER_ZC_ACK_TOUSESKILL; p->skillId = skill_id; p->btype = btype; p->itemId = item_id; diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 4c752a7b0c8..7110e8a7f75 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -2458,6 +2458,7 @@ struct PACKET_ZC_ACK_TOUSESKILL { uint8 flag; uint8 cause; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ACK_TOUSESKILL, 0x0110) #if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 struct PACKET_ZC_ADD_ITEM_TO_CART { From e73bc924842fec04d1667b32d45bd8a35b36a0aa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 21:56:07 +0300 Subject: [PATCH 36/50] Update packet version in github ci --- .github/workflows/clang13_test.yml | 2 +- .github/workflows/gcc_test.yml | 2 +- .github/workflows/gccsnapshot_test.yml | 2 +- .github/workflows/mariadb.yml | 2 +- .github/workflows/mysql.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/clang13_test.yml b/.github/workflows/clang13_test.yml index 01d66bd9fc7..f34ec1fd59f 100644 --- a/.github/workflows/clang13_test.yml +++ b/.github/workflows/clang13_test.yml @@ -19,7 +19,7 @@ jobs: RENEWAL: ["", "--disable-renewal"] CLIENT_TYPE: ["", "--enable-packetver-re", "--enable-packetver-zero"] SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] - PACKET_VERSION: ["--enable-packetver=20211118", "--enable-packetver=20130724"] + PACKET_VERSION: ["--enable-packetver=20220518", "--enable-packetver=20130724"] exclude: - PACKET_VERSION: "--enable-packetver=20130724" CLIENT_TYPE: "--enable-packetver-zero" diff --git a/.github/workflows/gcc_test.yml b/.github/workflows/gcc_test.yml index 7cfa7e531ef..9a3e9bfd50e 100644 --- a/.github/workflows/gcc_test.yml +++ b/.github/workflows/gcc_test.yml @@ -18,7 +18,7 @@ jobs: RENEWAL: ["", "--disable-renewal"] CLIENT_TYPE: ["", "--enable-packetver-re", "--enable-packetver-zero"] SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] - PACKET_VERSION: ["--enable-packetver=20211118", "--enable-packetver=20130724"] + PACKET_VERSION: ["--enable-packetver=20220518", "--enable-packetver=20130724"] exclude: - PACKET_VERSION: "--enable-packetver=20130724" CLIENT_TYPE: "--enable-packetver-zero" diff --git a/.github/workflows/gccsnapshot_test.yml b/.github/workflows/gccsnapshot_test.yml index a7879767e16..2d232b157ea 100644 --- a/.github/workflows/gccsnapshot_test.yml +++ b/.github/workflows/gccsnapshot_test.yml @@ -18,7 +18,7 @@ jobs: RENEWAL: ["", "--disable-renewal"] CLIENT_TYPE: ["", "--enable-packetver-re", "--enable-packetver-zero"] SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] - PACKET_VERSION: ["--enable-packetver=20211118", "--enable-packetver=20130724"] + PACKET_VERSION: ["--enable-packetver=20220518", "--enable-packetver=20130724"] exclude: - PACKET_VERSION: "--enable-packetver=20130724" CLIENT_TYPE: "--enable-packetver-zero" diff --git a/.github/workflows/mariadb.yml b/.github/workflows/mariadb.yml index 67c7506dff5..f3ae0232112 100644 --- a/.github/workflows/mariadb.yml +++ b/.github/workflows/mariadb.yml @@ -18,7 +18,7 @@ jobs: RENEWAL: [""] CLIENT_TYPE: [""] SANITIZER: ["--disable-manager", "--enable-sanitize=full"] - PACKET_VERSION: ["--enable-packetver=20211118"] + PACKET_VERSION: ["--enable-packetver=20220518"] MYSQL: ["10.2", "latest"] container: image: debian:unstable diff --git a/.github/workflows/mysql.yml b/.github/workflows/mysql.yml index 282a8fb3f2e..42a12ddb8b4 100644 --- a/.github/workflows/mysql.yml +++ b/.github/workflows/mysql.yml @@ -18,7 +18,7 @@ jobs: RENEWAL: [""] CLIENT_TYPE: [""] SANITIZER: ["--disable-manager", "--enable-sanitize=full"] - PACKET_VERSION: ["--enable-packetver=20211118"] + PACKET_VERSION: ["--enable-packetver=20220518"] MYSQL: ["5.6", "5.7", "latest"] container: image: debian:unstable From 2ddd8163ceb2467a252e763ed1f0add377d1874e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 22:43:44 +0300 Subject: [PATCH 37/50] Replace in most scripts PLAY_SOUND_REPEAT to PLAY_SOUND_ONCE Because before mode PLAY_SOUND_REPEAT was broken and worked as PLAY_SOUND_ONCE. --- npc/other/hugel_bingo.txt | 2 +- npc/quests/quests_13_1.txt | 4 ++-- npc/quests/seals/brisingamen_seal.txt | 14 +++++++------- npc/quests/the_sign_quest.txt | 14 +++++++------- npc/re/instances/EclageInterior.txt | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/npc/other/hugel_bingo.txt b/npc/other/hugel_bingo.txt index 5c764180b85..e2de2a76290 100644 --- a/npc/other/hugel_bingo.txt +++ b/npc/other/hugel_bingo.txt @@ -669,7 +669,7 @@ OnInit: OnTouch: if ($@bingowinner$ != strcharinfo(PC_NAME)) end; specialeffect EF_SUI_EXPLOSION; - soundeffect "tming_success.wav", PLAY_SOUND_REPEAT; + soundeffect "tming_success.wav", PLAY_SOUND_ONCE; if ($@bingoresult == 16) getitem 7515,50; else getitem 7515,1; initnpctimer; diff --git a/npc/quests/quests_13_1.txt b/npc/quests/quests_13_1.txt index f2e4f2e9fbd..ec98bd6ae74 100644 --- a/npc/quests/quests_13_1.txt +++ b/npc/quests/quests_13_1.txt @@ -13520,7 +13520,7 @@ OnEnable: end; OnTouch: - soundeffect "wander_man_move.wav", PLAY_SOUND_REPEAT; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_start SC_BLIND,600000,0; mes "As soon as you touched the crystal,"; mes "you feel your body being pulled into the space gap."; @@ -13550,7 +13550,7 @@ OnTouch: mes "Shut up! It's creepy that you all look alike. Bring it on! I'm not afraid of you!"; mes "I'm not going to let you run away again!"; next; - soundeffect "wander_man_move.wav", PLAY_SOUND_REPEAT; + soundeffect "wander_man_move.wav", PLAY_SOUND_ONCE; sc_end SC_BLIND; mes "[" + strcharinfo(PC_NAME) + "]"; mes "... !!!!"; diff --git a/npc/quests/seals/brisingamen_seal.txt b/npc/quests/seals/brisingamen_seal.txt index 03c23b06e33..df4093d82bc 100644 --- a/npc/quests/seals/brisingamen_seal.txt +++ b/npc/quests/seals/brisingamen_seal.txt @@ -66,7 +66,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "I must say this song"; mes "represents the"; mes "heart of a poet!"; - soundeffect "bragis_poem.wav", PLAY_SOUND_REPEAT; + soundeffect "bragis_poem.wav", PLAY_SOUND_ONCE; close2; break; case 2: @@ -78,7 +78,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "what the title really"; mes "means. Is it the chaos"; mes "of hell or our own reality?"; - soundeffect "chaos_of_eternity.wav", PLAY_SOUND_REPEAT; + soundeffect "chaos_of_eternity.wav", PLAY_SOUND_ONCE; close2; break; case 3: @@ -86,7 +86,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "[Nelliorde]"; mes "Assassin in the Sunset!"; mes "Yes, no one looks cooler than an Assassin, the bringer of death, standing alone in the sunset! Heh heh~"; - soundeffect "assassin_of_sunset.wav", PLAY_SOUND_REPEAT; + soundeffect "assassin_of_sunset.wav", PLAY_SOUND_ONCE; close2; break; case 4: @@ -96,7 +96,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "Okay, are you ready to listen?"; mes "Hum hum hum...."; next; - soundeffect "ring_of_nibelungen.wav", PLAY_SOUND_REPEAT; + soundeffect "ring_of_nibelungen.wav", PLAY_SOUND_ONCE; mes "^4D4DFFRheingold..."; mes "Hidden in the Rhein river."; mes "If made into a ring,"; @@ -801,7 +801,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "I must say this song"; mes "represents the"; mes "heart of a poet!"; - soundeffect "bragis_poem.wav", PLAY_SOUND_REPEAT; + soundeffect "bragis_poem.wav", PLAY_SOUND_ONCE; Zeny -= 500; close2; } @@ -819,7 +819,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "You must like robust"; mes "and energetic music, eh?"; mes "As you wish~"; - soundeffect "chaos_of_eternity.wav", PLAY_SOUND_REPEAT; + soundeffect "chaos_of_eternity.wav", PLAY_SOUND_ONCE; Zeny -= 500; close2; } @@ -839,7 +839,7 @@ prt_fild08,175,374,3 script Bard#brising 1_M_BARD,{ mes "the setting sun fits"; mes "well with Assassins."; mes "Don't you agree?"; - soundeffect "assassin_of_sunset.wav", PLAY_SOUND_REPEAT; + soundeffect "assassin_of_sunset.wav", PLAY_SOUND_ONCE; Zeny -= 500; close2; } diff --git a/npc/quests/the_sign_quest.txt b/npc/quests/the_sign_quest.txt index ce7c618e577..3d3851787b0 100644 --- a/npc/quests/the_sign_quest.txt +++ b/npc/quests/the_sign_quest.txt @@ -3107,7 +3107,7 @@ OnTouch: prt_maze02,25,161,0 script #music FAKE_NPC,7,7,{ OnTouch: - soundeffect "effect\\ ؽ.wav", PLAY_SOUND_REPEAT; + soundeffect "effect\\ ؽ.wav", PLAY_SOUND_ONCE; end; } @@ -4481,7 +4481,7 @@ cmd_in02,88,51,4 script Strange Guy#sign 1_M_SIGNART,{ mes "I'll freakin' beat you to near"; mes "freakin' death! Bam bam bam!"; close2; - soundeffect "effect\\sign_noise.wav", PLAY_SOUND_REPEAT; + soundeffect "effect\\sign_noise.wav", PLAY_SOUND_ONCE; Hp = 1; warp "comodo",122,100; end; @@ -5180,7 +5180,7 @@ OnReset: end; OnTouch: - soundeffect "effect\\sign_up.wav", PLAY_SOUND_REPEAT; + soundeffect "effect\\sign_up.wav", PLAY_SOUND_ONCE; if (.s_up == 1) { donpcevent "Examiner#sd::OnUp"; donpcevent "s_dance#up::OnDisable"; @@ -5236,7 +5236,7 @@ OnReset: end; OnTouch: - soundeffect "effect\\sign_down.wav", PLAY_SOUND_REPEAT; + soundeffect "effect\\sign_down.wav", PLAY_SOUND_ONCE; if (.s_down == 1) { donpcevent "Examiner#sd::OnUp"; donpcevent "s_dance#down::OnDisable"; @@ -5313,7 +5313,7 @@ OnReset: end; OnTouch: - soundeffect "effect\\sign_left.wav", PLAY_SOUND_REPEAT; + soundeffect "effect\\sign_left.wav", PLAY_SOUND_ONCE; if (.s_left == 1) { donpcevent "Examiner#sd::OnUp"; donpcevent "s_dance#right::OnUp"; @@ -5381,7 +5381,7 @@ OnReset: end; OnTouch: - soundeffect "effect\\sign_right.wav", PLAY_SOUND_REPEAT; + soundeffect "effect\\sign_right.wav", PLAY_SOUND_ONCE; if (.s_right == 1) { donpcevent "Examiner#sd::OnUp"; donpcevent "s_dance#right::OnDisable"; @@ -5455,7 +5455,7 @@ OnReset: end; OnTouch: - soundeffect "effect\\sign_center.wav", PLAY_SOUND_REPEAT; + soundeffect "effect\\sign_center.wav", PLAY_SOUND_ONCE; if (.s_center == 1) { donpcevent "Examiner#sd::OnUp"; donpcevent "s_dance#cen::OnDisable"; diff --git a/npc/re/instances/EclageInterior.txt b/npc/re/instances/EclageInterior.txt index 91c66406d2d..9f8040a3a1c 100644 --- a/npc/re/instances/EclageInterior.txt +++ b/npc/re/instances/EclageInterior.txt @@ -146,7 +146,7 @@ ecl_hub01,130,15,0 script It is closed shut. CLEAR_NPC,{ mes("No...way!!!"); specialeffect(EF_LORD, AREA, playerattached()); percentheal(-99, 0); - soundeffect("wander_man_move.wav", PLAY_SOUND_REPEAT); + soundeffect("wander_man_move.wav", PLAY_SOUND_ONCE); sc_start(SC_BLIND, 60000, 0); close2(); warp("1@ecl", 146, 95); From e8f840da58a23a0998a06659d1886078c492a236 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 22:45:13 +0300 Subject: [PATCH 38/50] Remove ifdef from setdialog functions --- src/map/script.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/map/script.c b/src/map/script.c index 65a548f7acb..fdabe047b45 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -27846,7 +27846,6 @@ static BUILDIN(opengradeui) static BUILDIN(setdialogsize) { -#if PACKETVER_MAIN_NUM >= 20220504 struct map_session_data *sd = script_rid2sd(st); if (sd == NULL) { @@ -27856,12 +27855,10 @@ static BUILDIN(setdialogsize) clif->set_npc_window_size(sd, script_getnum(st, 2), script_getnum(st, 3)); return true; -#endif } static BUILDIN(setdialogpos) { -#if PACKETVER_MAIN_NUM >= 20220504 struct map_session_data *sd = script_rid2sd(st); if (sd == NULL) { @@ -27871,12 +27868,10 @@ static BUILDIN(setdialogpos) clif->set_npc_window_pos(sd, script_getnum(st, 2), script_getnum(st, 3)); return true; -#endif } static BUILDIN(setdialogpospercent) { -#if PACKETVER_MAIN_NUM >= 20220504 struct map_session_data *sd = script_rid2sd(st); if (sd == NULL) { @@ -27886,7 +27881,6 @@ static BUILDIN(setdialogpospercent) clif->set_npc_window_pos_percent(sd, script_getnum(st, 2), script_getnum(st, 3)); return true; -#endif } /** From 4106b72df2d1c07d334f33595a78a1dfa6f86102 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 21 Apr 2022 21:01:34 +0300 Subject: [PATCH 39/50] Update libbacktrace --- 3rdparty/libbacktrace/Makefile.in | 2 +- 3rdparty/libbacktrace/alloc.c | 15 +- 3rdparty/libbacktrace/atomic.c | 2 +- 3rdparty/libbacktrace/backtrace.c | 4 +- 3rdparty/libbacktrace/backtrace.h | 10 +- 3rdparty/libbacktrace/btest.c | 17 +- 3rdparty/libbacktrace/dwarf.c | 2256 +++++++-- 3rdparty/libbacktrace/edtest.c | 5 +- 3rdparty/libbacktrace/edtest2.c | 2 +- 3rdparty/libbacktrace/elf.c | 326 +- 3rdparty/libbacktrace/fileline.c | 86 +- 3rdparty/libbacktrace/filenames.h | 3 + 3rdparty/libbacktrace/filetype.awk | 22 +- 3rdparty/libbacktrace/internal.h | 60 +- 3rdparty/libbacktrace/ltmain.sh | 7524 +++++++++------------------- 3rdparty/libbacktrace/macho.c | 2351 ++++----- 3rdparty/libbacktrace/mmap.c | 4 +- 3rdparty/libbacktrace/mmapio.c | 12 +- 3rdparty/libbacktrace/nounwind.c | 2 +- 3rdparty/libbacktrace/pecoff.c | 66 +- 3rdparty/libbacktrace/posix.c | 2 +- 3rdparty/libbacktrace/print.c | 4 +- 3rdparty/libbacktrace/read.c | 32 +- 3rdparty/libbacktrace/simple.c | 4 +- 3rdparty/libbacktrace/sort.c | 2 +- 3rdparty/libbacktrace/state.c | 2 +- 3rdparty/libbacktrace/stest.c | 2 +- 3rdparty/libbacktrace/testlib.c | 2 +- 3rdparty/libbacktrace/testlib.h | 2 +- 3rdparty/libbacktrace/ttest.c | 2 +- 3rdparty/libbacktrace/unknown.c | 2 +- 3rdparty/libbacktrace/xcoff.c | 500 +- 3rdparty/libbacktrace/ztest.c | 24 +- 33 files changed, 6066 insertions(+), 7283 deletions(-) diff --git a/3rdparty/libbacktrace/Makefile.in b/3rdparty/libbacktrace/Makefile.in index 1c112d83241..ef74104b594 100644 --- a/3rdparty/libbacktrace/Makefile.in +++ b/3rdparty/libbacktrace/Makefile.in @@ -72,4 +72,4 @@ Makefile: Makefile.in %.o: %.c $(LIBBACKTRACE_H) Makefile @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ @CPPFLAGS@ -Wno-pointer-arith -Wno-switch-enum -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ @CPPFLAGS@ -Wno-pointer-arith -Wno-switch-enum -Wno-shadow -c $(OUTPUT_OPTION) $< diff --git a/3rdparty/libbacktrace/alloc.c b/3rdparty/libbacktrace/alloc.c index 7070afbf2aa..75aa0728aac 100644 --- a/3rdparty/libbacktrace/alloc.c +++ b/3rdparty/libbacktrace/alloc.c @@ -1,5 +1,5 @@ /* alloc.c -- Memory allocation without mmap. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -145,12 +145,23 @@ backtrace_vector_release (struct backtrace_state *state ATTRIBUTE_UNUSED, backtrace_error_callback error_callback, void *data) { + vec->alc = 0; + + if (vec->size == 0) + { + /* As of C17, realloc with size 0 is marked as an obsolescent feature, use + free instead. */ + free (vec->base); + vec->base = NULL; + return 1; + } + vec->base = realloc (vec->base, vec->size); if (vec->base == NULL) { error_callback (data, "realloc", errno); return 0; } - vec->alc = 0; + return 1; } diff --git a/3rdparty/libbacktrace/atomic.c b/3rdparty/libbacktrace/atomic.c index 5ab1600664d..c5c88f9520b 100644 --- a/3rdparty/libbacktrace/atomic.c +++ b/3rdparty/libbacktrace/atomic.c @@ -1,5 +1,5 @@ /* atomic.c -- Support for atomic functions if not present. - Copyright (C) 2013-2018 Free Software Foundation, Inc. + Copyright (C) 2013-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without diff --git a/3rdparty/libbacktrace/backtrace.c b/3rdparty/libbacktrace/backtrace.c index f8e3dc59d45..5838dcb4c7a 100644 --- a/3rdparty/libbacktrace/backtrace.c +++ b/3rdparty/libbacktrace/backtrace.c @@ -1,5 +1,5 @@ /* backtrace.c -- Entry point for stack backtrace library. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -98,7 +98,7 @@ unwind (struct _Unwind_Context *context, void *vdata) /* Get a stack backtrace. */ -int +int __attribute__((noinline)) backtrace_full (struct backtrace_state *state, int skip, backtrace_full_callback callback, backtrace_error_callback error_callback, void *data) diff --git a/3rdparty/libbacktrace/backtrace.h b/3rdparty/libbacktrace/backtrace.h index 17b10197df2..777e1460be3 100644 --- a/3rdparty/libbacktrace/backtrace.h +++ b/3rdparty/libbacktrace/backtrace.h @@ -1,5 +1,5 @@ /* backtrace.h -- Public header file for stack backtrace library. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -75,7 +75,13 @@ typedef void (*backtrace_error_callback) (void *data, const char *msg, use appropriate atomic operations. If THREADED is zero the state may only be accessed by one thread at a time. This returns a state pointer on success, NULL on error. If an error occurs, this will - call the ERROR_CALLBACK routine. */ + call the ERROR_CALLBACK routine. + + Calling this function allocates resources that cannot be freed. + There is no backtrace_free_state function. The state is used to + cache information that is expensive to recompute. Programs are + expected to call this function at most once and to save the return + value for all later calls to backtrace functions. */ extern struct backtrace_state *backtrace_create_state ( const char *filename, int threaded, diff --git a/3rdparty/libbacktrace/btest.c b/3rdparty/libbacktrace/btest.c index 1348d54da50..ff2eb7123f9 100644 --- a/3rdparty/libbacktrace/btest.c +++ b/3rdparty/libbacktrace/btest.c @@ -1,5 +1,5 @@ /* btest.c -- Test for libbacktrace library - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -48,9 +48,9 @@ POSSIBILITY OF SUCH DAMAGE. */ /* Test the backtrace function with non-inlined functions. */ -static int test1 (void) __attribute__ ((noinline, unused)); -static int f2 (int) __attribute__ ((noinline)); -static int f3 (int, int) __attribute__ ((noinline)); +static int test1 (void) __attribute__ ((noinline, noclone, unused)); +static int f2 (int) __attribute__ ((noinline, noclone)); +static int f3 (int, int) __attribute__ ((noinline, noclone)); static int test1 (void) @@ -162,9 +162,9 @@ f13 (int f1line, int f2line) /* Test the backtrace_simple function with non-inlined functions. */ -static int test3 (void) __attribute__ ((noinline, unused)); -static int f22 (int) __attribute__ ((noinline)); -static int f23 (int, int) __attribute__ ((noinline)); +static int test3 (void) __attribute__ ((noinline, noclone, unused)); +static int f22 (int) __attribute__ ((noinline, noclone)); +static int f23 (int, int) __attribute__ ((noinline, noclone)); static int test3 (void) @@ -423,7 +423,8 @@ test5 (void) fprintf (stderr, "test5: NULL syminfo name\n"); symdata.failed = 1; } - else if (strcmp (symdata.name, "global") != 0) + else if (!(strncmp (symdata.name, "global", 6) == 0 + && (symdata.name[6] == '\0'|| symdata.name[6] == '.'))) { fprintf (stderr, "test5: unexpected syminfo name got %s expected %s\n", diff --git a/3rdparty/libbacktrace/dwarf.c b/3rdparty/libbacktrace/dwarf.c index c378b251758..8f9c1a41603 100644 --- a/3rdparty/libbacktrace/dwarf.c +++ b/3rdparty/libbacktrace/dwarf.c @@ -1,5 +1,5 @@ /* dwarf.c -- Get file/line information from DWARF for backtraces. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -37,6 +37,8 @@ POSSIBILITY OF SUCH DAMAGE. */ #include #include +#include "filenames.h" + #include "backtrace.h" #include "internal.h" @@ -50,11 +52,11 @@ enum dwarf_tag { }; enum dwarf_form { - DW_FORM_addr = 0x1, - DW_FORM_block2 = 0x3, - DW_FORM_block4 = 0x4, - DW_FORM_data2 = 0x5, - DW_FORM_data4 = 0x6, + DW_FORM_addr = 0x01, + DW_FORM_block2 = 0x03, + DW_FORM_block4 = 0x04, + DW_FORM_data2 = 0x05, + DW_FORM_data4 = 0x06, DW_FORM_data8 = 0x07, DW_FORM_string = 0x08, DW_FORM_block = 0x09, @@ -75,25 +77,248 @@ enum dwarf_form { DW_FORM_exprloc = 0x18, DW_FORM_flag_present = 0x19, DW_FORM_ref_sig8 = 0x20, + DW_FORM_strx = 0x1a, + DW_FORM_addrx = 0x1b, + DW_FORM_ref_sup4 = 0x1c, + DW_FORM_strp_sup = 0x1d, + DW_FORM_data16 = 0x1e, + DW_FORM_line_strp = 0x1f, + DW_FORM_implicit_const = 0x21, + DW_FORM_loclistx = 0x22, + DW_FORM_rnglistx = 0x23, + DW_FORM_ref_sup8 = 0x24, + DW_FORM_strx1 = 0x25, + DW_FORM_strx2 = 0x26, + DW_FORM_strx3 = 0x27, + DW_FORM_strx4 = 0x28, + DW_FORM_addrx1 = 0x29, + DW_FORM_addrx2 = 0x2a, + DW_FORM_addrx3 = 0x2b, + DW_FORM_addrx4 = 0x2c, DW_FORM_GNU_addr_index = 0x1f01, DW_FORM_GNU_str_index = 0x1f02, DW_FORM_GNU_ref_alt = 0x1f20, - DW_FORM_GNU_strp_alt = 0x1f21, + DW_FORM_GNU_strp_alt = 0x1f21 }; enum dwarf_attribute { - DW_AT_name = 0x3, + DW_AT_sibling = 0x01, + DW_AT_location = 0x02, + DW_AT_name = 0x03, + DW_AT_ordering = 0x09, + DW_AT_subscr_data = 0x0a, + DW_AT_byte_size = 0x0b, + DW_AT_bit_offset = 0x0c, + DW_AT_bit_size = 0x0d, + DW_AT_element_list = 0x0f, DW_AT_stmt_list = 0x10, DW_AT_low_pc = 0x11, DW_AT_high_pc = 0x12, + DW_AT_language = 0x13, + DW_AT_member = 0x14, + DW_AT_discr = 0x15, + DW_AT_discr_value = 0x16, + DW_AT_visibility = 0x17, + DW_AT_import = 0x18, + DW_AT_string_length = 0x19, + DW_AT_common_reference = 0x1a, DW_AT_comp_dir = 0x1b, + DW_AT_const_value = 0x1c, + DW_AT_containing_type = 0x1d, + DW_AT_default_value = 0x1e, + DW_AT_inline = 0x20, + DW_AT_is_optional = 0x21, + DW_AT_lower_bound = 0x22, + DW_AT_producer = 0x25, + DW_AT_prototyped = 0x27, + DW_AT_return_addr = 0x2a, + DW_AT_start_scope = 0x2c, + DW_AT_bit_stride = 0x2e, + DW_AT_upper_bound = 0x2f, DW_AT_abstract_origin = 0x31, + DW_AT_accessibility = 0x32, + DW_AT_address_class = 0x33, + DW_AT_artificial = 0x34, + DW_AT_base_types = 0x35, + DW_AT_calling_convention = 0x36, + DW_AT_count = 0x37, + DW_AT_data_member_location = 0x38, + DW_AT_decl_column = 0x39, + DW_AT_decl_file = 0x3a, + DW_AT_decl_line = 0x3b, + DW_AT_declaration = 0x3c, + DW_AT_discr_list = 0x3d, + DW_AT_encoding = 0x3e, + DW_AT_external = 0x3f, + DW_AT_frame_base = 0x40, + DW_AT_friend = 0x41, + DW_AT_identifier_case = 0x42, + DW_AT_macro_info = 0x43, + DW_AT_namelist_items = 0x44, + DW_AT_priority = 0x45, + DW_AT_segment = 0x46, DW_AT_specification = 0x47, + DW_AT_static_link = 0x48, + DW_AT_type = 0x49, + DW_AT_use_location = 0x4a, + DW_AT_variable_parameter = 0x4b, + DW_AT_virtuality = 0x4c, + DW_AT_vtable_elem_location = 0x4d, + DW_AT_allocated = 0x4e, + DW_AT_associated = 0x4f, + DW_AT_data_location = 0x50, + DW_AT_byte_stride = 0x51, + DW_AT_entry_pc = 0x52, + DW_AT_use_UTF8 = 0x53, + DW_AT_extension = 0x54, DW_AT_ranges = 0x55, + DW_AT_trampoline = 0x56, + DW_AT_call_column = 0x57, DW_AT_call_file = 0x58, DW_AT_call_line = 0x59, + DW_AT_description = 0x5a, + DW_AT_binary_scale = 0x5b, + DW_AT_decimal_scale = 0x5c, + DW_AT_small = 0x5d, + DW_AT_decimal_sign = 0x5e, + DW_AT_digit_count = 0x5f, + DW_AT_picture_string = 0x60, + DW_AT_mutable = 0x61, + DW_AT_threads_scaled = 0x62, + DW_AT_explicit = 0x63, + DW_AT_object_pointer = 0x64, + DW_AT_endianity = 0x65, + DW_AT_elemental = 0x66, + DW_AT_pure = 0x67, + DW_AT_recursive = 0x68, + DW_AT_signature = 0x69, + DW_AT_main_subprogram = 0x6a, + DW_AT_data_bit_offset = 0x6b, + DW_AT_const_expr = 0x6c, + DW_AT_enum_class = 0x6d, DW_AT_linkage_name = 0x6e, + DW_AT_string_length_bit_size = 0x6f, + DW_AT_string_length_byte_size = 0x70, + DW_AT_rank = 0x71, + DW_AT_str_offsets_base = 0x72, + DW_AT_addr_base = 0x73, + DW_AT_rnglists_base = 0x74, + DW_AT_dwo_name = 0x76, + DW_AT_reference = 0x77, + DW_AT_rvalue_reference = 0x78, + DW_AT_macros = 0x79, + DW_AT_call_all_calls = 0x7a, + DW_AT_call_all_source_calls = 0x7b, + DW_AT_call_all_tail_calls = 0x7c, + DW_AT_call_return_pc = 0x7d, + DW_AT_call_value = 0x7e, + DW_AT_call_origin = 0x7f, + DW_AT_call_parameter = 0x80, + DW_AT_call_pc = 0x81, + DW_AT_call_tail_call = 0x82, + DW_AT_call_target = 0x83, + DW_AT_call_target_clobbered = 0x84, + DW_AT_call_data_location = 0x85, + DW_AT_call_data_value = 0x86, + DW_AT_noreturn = 0x87, + DW_AT_alignment = 0x88, + DW_AT_export_symbols = 0x89, + DW_AT_deleted = 0x8a, + DW_AT_defaulted = 0x8b, + DW_AT_loclists_base = 0x8c, + DW_AT_lo_user = 0x2000, + DW_AT_hi_user = 0x3fff, + DW_AT_MIPS_fde = 0x2001, + DW_AT_MIPS_loop_begin = 0x2002, + DW_AT_MIPS_tail_loop_begin = 0x2003, + DW_AT_MIPS_epilog_begin = 0x2004, + DW_AT_MIPS_loop_unroll_factor = 0x2005, + DW_AT_MIPS_software_pipeline_depth = 0x2006, DW_AT_MIPS_linkage_name = 0x2007, + DW_AT_MIPS_stride = 0x2008, + DW_AT_MIPS_abstract_name = 0x2009, + DW_AT_MIPS_clone_origin = 0x200a, + DW_AT_MIPS_has_inlines = 0x200b, + DW_AT_HP_block_index = 0x2000, + DW_AT_HP_unmodifiable = 0x2001, + DW_AT_HP_prologue = 0x2005, + DW_AT_HP_epilogue = 0x2008, + DW_AT_HP_actuals_stmt_list = 0x2010, + DW_AT_HP_proc_per_section = 0x2011, + DW_AT_HP_raw_data_ptr = 0x2012, + DW_AT_HP_pass_by_reference = 0x2013, + DW_AT_HP_opt_level = 0x2014, + DW_AT_HP_prof_version_id = 0x2015, + DW_AT_HP_opt_flags = 0x2016, + DW_AT_HP_cold_region_low_pc = 0x2017, + DW_AT_HP_cold_region_high_pc = 0x2018, + DW_AT_HP_all_variables_modifiable = 0x2019, + DW_AT_HP_linkage_name = 0x201a, + DW_AT_HP_prof_flags = 0x201b, + DW_AT_HP_unit_name = 0x201f, + DW_AT_HP_unit_size = 0x2020, + DW_AT_HP_widened_byte_size = 0x2021, + DW_AT_HP_definition_points = 0x2022, + DW_AT_HP_default_location = 0x2023, + DW_AT_HP_is_result_param = 0x2029, + DW_AT_sf_names = 0x2101, + DW_AT_src_info = 0x2102, + DW_AT_mac_info = 0x2103, + DW_AT_src_coords = 0x2104, + DW_AT_body_begin = 0x2105, + DW_AT_body_end = 0x2106, + DW_AT_GNU_vector = 0x2107, + DW_AT_GNU_guarded_by = 0x2108, + DW_AT_GNU_pt_guarded_by = 0x2109, + DW_AT_GNU_guarded = 0x210a, + DW_AT_GNU_pt_guarded = 0x210b, + DW_AT_GNU_locks_excluded = 0x210c, + DW_AT_GNU_exclusive_locks_required = 0x210d, + DW_AT_GNU_shared_locks_required = 0x210e, + DW_AT_GNU_odr_signature = 0x210f, + DW_AT_GNU_template_name = 0x2110, + DW_AT_GNU_call_site_value = 0x2111, + DW_AT_GNU_call_site_data_value = 0x2112, + DW_AT_GNU_call_site_target = 0x2113, + DW_AT_GNU_call_site_target_clobbered = 0x2114, + DW_AT_GNU_tail_call = 0x2115, + DW_AT_GNU_all_tail_call_sites = 0x2116, + DW_AT_GNU_all_call_sites = 0x2117, + DW_AT_GNU_all_source_call_sites = 0x2118, + DW_AT_GNU_macros = 0x2119, + DW_AT_GNU_deleted = 0x211a, + DW_AT_GNU_dwo_name = 0x2130, + DW_AT_GNU_dwo_id = 0x2131, + DW_AT_GNU_ranges_base = 0x2132, + DW_AT_GNU_addr_base = 0x2133, + DW_AT_GNU_pubnames = 0x2134, + DW_AT_GNU_pubtypes = 0x2135, + DW_AT_GNU_discriminator = 0x2136, + DW_AT_GNU_locviews = 0x2137, + DW_AT_GNU_entry_view = 0x2138, + DW_AT_VMS_rtnbeg_pd_address = 0x2201, + DW_AT_use_GNAT_descriptive_type = 0x2301, + DW_AT_GNAT_descriptive_type = 0x2302, + DW_AT_GNU_numerator = 0x2303, + DW_AT_GNU_denominator = 0x2304, + DW_AT_GNU_bias = 0x2305, + DW_AT_upc_threads_scaled = 0x3210, + DW_AT_PGI_lbase = 0x3a00, + DW_AT_PGI_soffset = 0x3a01, + DW_AT_PGI_lstride = 0x3a02, + DW_AT_APPLE_optimized = 0x3fe1, + DW_AT_APPLE_flags = 0x3fe2, + DW_AT_APPLE_isa = 0x3fe3, + DW_AT_APPLE_block = 0x3fe4, + DW_AT_APPLE_major_runtime_vers = 0x3fe5, + DW_AT_APPLE_runtime_class = 0x3fe6, + DW_AT_APPLE_omit_frame_ptr = 0x3fe7, + DW_AT_APPLE_property_name = 0x3fe8, + DW_AT_APPLE_property_getter = 0x3fe9, + DW_AT_APPLE_property_setter = 0x3fea, + DW_AT_APPLE_property_attribute = 0x3feb, + DW_AT_APPLE_objc_complete_type = 0x3fec, + DW_AT_APPLE_property = 0x3fed }; enum dwarf_line_number_op { @@ -112,21 +337,44 @@ enum dwarf_line_number_op { DW_LNS_set_isa = 0xc, }; -enum dwarf_extedned_line_number_op { +enum dwarf_extended_line_number_op { DW_LNE_end_sequence = 0x1, DW_LNE_set_address = 0x2, DW_LNE_define_file = 0x3, DW_LNE_set_discriminator = 0x4, }; -#if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__) -# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\') -#define HAS_DRIVE_SPEC(f) ((f)[0] && (f)[1] == ':') -# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR(f[0]) || HAS_DRIVE_SPEC(f)) -#else -# define IS_DIR_SEPARATOR(c) ((c) == '/') -# define IS_ABSOLUTE_PATH(f) IS_DIR_SEPARATOR(f[0]) -#endif +enum dwarf_line_number_content_type { + DW_LNCT_path = 0x1, + DW_LNCT_directory_index = 0x2, + DW_LNCT_timestamp = 0x3, + DW_LNCT_size = 0x4, + DW_LNCT_MD5 = 0x5, + DW_LNCT_lo_user = 0x2000, + DW_LNCT_hi_user = 0x3fff +}; + +enum dwarf_range_list_entry { + DW_RLE_end_of_list = 0x00, + DW_RLE_base_addressx = 0x01, + DW_RLE_startx_endx = 0x02, + DW_RLE_startx_length = 0x03, + DW_RLE_offset_pair = 0x04, + DW_RLE_base_address = 0x05, + DW_RLE_start_end = 0x06, + DW_RLE_start_length = 0x07 +}; + +enum dwarf_unit_type { + DW_UT_compile = 0x01, + DW_UT_type = 0x02, + DW_UT_partial = 0x03, + DW_UT_skeleton = 0x04, + DW_UT_split_compile = 0x05, + DW_UT_split_type = 0x06, + DW_UT_lo_user = 0x80, + DW_UT_hi_user = 0xff +}; #if !defined(HAVE_DECL_STRNLEN) || !HAVE_DECL_STRNLEN @@ -177,6 +425,8 @@ struct attr enum dwarf_attribute name; /* The attribute form. */ enum dwarf_form form; + /* The attribute value, for DW_FORM_implicit_const. */ + int64_t val; }; /* A single DWARF abbreviation. */ @@ -214,22 +464,33 @@ struct abbrevs enum attr_val_encoding { + /* No attribute value. */ + ATTR_VAL_NONE, /* An address. */ ATTR_VAL_ADDRESS, + /* An index into the .debug_addr section, whose value is relative to + * the DW_AT_addr_base attribute of the compilation unit. */ + ATTR_VAL_ADDRESS_INDEX, /* A unsigned integer. */ ATTR_VAL_UINT, /* A sigd integer. */ ATTR_VAL_SINT, /* A string. */ ATTR_VAL_STRING, + /* An index into the .debug_str_offsets section. */ + ATTR_VAL_STRING_INDEX, /* An offset to other data in the containing unit. */ ATTR_VAL_REF_UNIT, - /* An offset to other data within the .dwarf_info section. */ + /* An offset to other data within the .debug_info section. */ ATTR_VAL_REF_INFO, + /* An offset to other data within the alt .debug_info section. */ + ATTR_VAL_REF_ALT_INFO, /* An offset to data in some other section. */ ATTR_VAL_REF_SECTION, /* A type signature. */ ATTR_VAL_REF_TYPE, + /* An index into the .debug_rnglists section. */ + ATTR_VAL_RNGLISTS_INDEX, /* A block of data (not represented). */ ATTR_VAL_BLOCK, /* An expression (not represented). */ @@ -244,7 +505,7 @@ struct attr_val enum attr_val_encoding encoding; union { - /* ATTR_VAL_ADDRESS, ATTR_VAL_UINT, ATTR_VAL_REF*. */ + /* ATTR_VAL_ADDRESS*, ATTR_VAL_UINT, ATTR_VAL_REF*. */ uint64_t uint; /* ATTR_VAL_SINT. */ int64_t sint; @@ -260,6 +521,8 @@ struct line_header { /* The version of the line number information. */ int version; + /* Address size. */ + int addrsize; /* The minimum instruction length. */ unsigned int min_insn_len; /* The maximum number of ops per instruction. */ @@ -282,6 +545,14 @@ struct line_header const char **filenames; }; +/* A format description from a line header. */ + +struct line_header_format +{ + int lnct; /* LNCT code. */ + enum dwarf_form form; /* Form of entry data. */ +}; + /* Map a single PC value to a file/line. We will keep a vector of these sorted by PC value. Each file/line will be correct from the PC up to the PC of the next entry if there is one. We allocate one @@ -364,6 +635,12 @@ struct unit /* The offset of UNIT_DATA from the start of the information for this compilation unit. */ size_t unit_data_offset; + /* Offset of the start of the compilation unit from the start of the + .debug_info section. */ + size_t low_offset; + /* Offset of the end of the compilation unit from the start of the + .debug_info section. */ + size_t high_offset; /* DWARF version. */ int version; /* Whether unit is DWARF64. */ @@ -372,6 +649,12 @@ struct unit int addrsize; /* Offset into line number information. */ off_t lineoff; + /* Offset of compilation unit in .debug_str_offsets. */ + uint64_t str_offsets_base; + /* Offset of compilation unit in .debug_addr. */ + uint64_t addr_base; + /* Offset of compilation unit in .debug_rnglists. */ + uint64_t rnglists_base; /* Primary source file. */ const char *filename; /* Compilation command working directory. */ @@ -422,30 +705,34 @@ struct unit_addrs_vector size_t count; }; +/* A growable vector of compilation unit pointer. */ + +struct unit_vector +{ + struct backtrace_vector vec; + size_t count; +}; + /* The information we need to map a PC to a file and line. */ struct dwarf_data { /* The data for the next file we know about. */ struct dwarf_data *next; + /* The data for .gnu_debugaltlink. */ + struct dwarf_data *altlink; /* The base address for this file. */ uintptr_t base_address; /* A sorted list of address ranges. */ struct unit_addrs *addrs; /* Number of address ranges in list. */ size_t addrs_count; - /* The unparsed .debug_info section. */ - const unsigned char *dwarf_info; - size_t dwarf_info_size; - /* The unparsed .debug_line section. */ - const unsigned char *dwarf_line; - size_t dwarf_line_size; - /* The unparsed .debug_ranges section. */ - const unsigned char *dwarf_ranges; - size_t dwarf_ranges_size; - /* The unparsed .debug_str section. */ - const unsigned char *dwarf_str; - size_t dwarf_str_size; + /* A sorted list of units. */ + struct unit **units; + /* Number of units in the list. */ + size_t units_count; + /* The unparsed DWARF debug data. */ + struct dwarf_sections dwarf_sections; /* Whether the data is big-endian or not. */ int is_bigendian; /* A vector used for function addresses. We keep this here so that @@ -496,6 +783,25 @@ advance (struct dwarf_buf *buf, size_t count) return 1; } +/* Read one zero-terminated string from BUF and advance past the string. */ + +static const char * +read_string (struct dwarf_buf *buf) +{ + const char *p = (const char *)buf->buf; + size_t len = strnlen (p, buf->left); + + /* - If len == left, we ran out of buffer before finding the zero terminator. + Generate an error by advancing len + 1. + - If len < left, advance by len + 1 to skip past the zero terminator. */ + size_t count = len + 1; + + if (!advance (buf, count)) + return NULL; + + return p; +} + /* Read one byte from BUF and advance 1 byte. */ static unsigned char @@ -535,6 +841,23 @@ read_uint16 (struct dwarf_buf *buf) return ((uint16_t) p[1] << 8) | (uint16_t) p[0]; } +/* Read a 24 bit value from BUF and advance 3 bytes. */ + +static uint32_t +read_uint24 (struct dwarf_buf *buf) +{ + const unsigned char *p = buf->buf; + + if (!advance (buf, 3)) + return 0; + if (buf->is_bigendian) + return (((uint32_t) p[0] << 16) | ((uint32_t) p[1] << 8) + | (uint32_t) p[2]); + else + return (((uint32_t) p[2] << 16) | ((uint32_t) p[1] << 8) + | (uint32_t) p[0]); +} + /* Read a uint32 from BUF and advance 4 bytes. */ static uint32_t @@ -717,6 +1040,25 @@ leb128_len (const unsigned char *p) return ret; } +/* Read initial_length from BUF and advance the appropriate number of bytes. */ + +static uint64_t +read_initial_length (struct dwarf_buf *buf, int *is_dwarf64) +{ + uint64_t len; + + len = read_uint32 (buf); + if (len == 0xffffffff) + { + len = read_uint64 (buf); + *is_dwarf64 = 1; + } + else + *is_dwarf64 = 0; + + return len; +} + /* Free an abbreviations structure. */ static void @@ -742,10 +1084,10 @@ free_abbrevs (struct backtrace_state *state, struct abbrevs *abbrevs, forms, because we don't care about them. */ static int -read_attribute (enum dwarf_form form, struct dwarf_buf *buf, - int is_dwarf64, int version, int addrsize, - const unsigned char *dwarf_str, size_t dwarf_str_size, - struct attr_val *val) +read_attribute (enum dwarf_form form, uint64_t implicit_val, + struct dwarf_buf *buf, int is_dwarf64, int version, + int addrsize, const struct dwarf_sections *dwarf_sections, + struct dwarf_data *altlink, struct attr_val *val) { /* Avoid warnings about val.u.FIELD may be used uninitialized if this function is inlined. The warnings aren't valid but can @@ -777,10 +1119,13 @@ read_attribute (enum dwarf_form form, struct dwarf_buf *buf, val->encoding = ATTR_VAL_UINT; val->u.uint = read_uint64 (buf); return 1; + case DW_FORM_data16: + val->encoding = ATTR_VAL_BLOCK; + return advance (buf, 16); case DW_FORM_string: val->encoding = ATTR_VAL_STRING; - val->u.string = (const char *) buf->buf; - return advance (buf, strnlen ((const char *) buf->buf, buf->left) + 1); + val->u.string = read_string (buf); + return val->u.string == NULL ? 0 : 1; case DW_FORM_block: val->encoding = ATTR_VAL_BLOCK; return advance (buf, read_uleb128 (buf)); @@ -804,13 +1149,29 @@ read_attribute (enum dwarf_form form, struct dwarf_buf *buf, uint64_t offset; offset = read_offset (buf, is_dwarf64); - if (offset >= dwarf_str_size) + if (offset >= dwarf_sections->size[DEBUG_STR]) { dwarf_buf_error (buf, "DW_FORM_strp out of range"); return 0; } val->encoding = ATTR_VAL_STRING; - val->u.string = (const char *) dwarf_str + offset; + val->u.string = + (const char *) dwarf_sections->data[DEBUG_STR] + offset; + return 1; + } + case DW_FORM_line_strp: + { + uint64_t offset; + + offset = read_offset (buf, is_dwarf64); + if (offset >= dwarf_sections->size[DEBUG_LINE_STR]) + { + dwarf_buf_error (buf, "DW_FORM_line_strp out of range"); + return 0; + } + val->encoding = ATTR_VAL_STRING; + val->u.string = + (const char *) dwarf_sections->data[DEBUG_LINE_STR] + offset; return 1; } case DW_FORM_udata: @@ -846,11 +1207,17 @@ read_attribute (enum dwarf_form form, struct dwarf_buf *buf, return 1; case DW_FORM_indirect: { - uint64_t form1; + uint64_t form; - form1 = read_uleb128 (buf); - return read_attribute ((enum dwarf_form) form1, buf, is_dwarf64, - version, addrsize, dwarf_str, dwarf_str_size, + form = read_uleb128 (buf); + if (form == DW_FORM_implicit_const) + { + dwarf_buf_error (buf, + "DW_FORM_indirect to DW_FORM_implicit_const"); + return 0; + } + return read_attribute ((enum dwarf_form) form, 0, buf, is_dwarf64, + version, addrsize, dwarf_sections, altlink, val); } case DW_FORM_sec_offset: @@ -868,6 +1235,88 @@ read_attribute (enum dwarf_form form, struct dwarf_buf *buf, val->encoding = ATTR_VAL_REF_TYPE; val->u.uint = read_uint64 (buf); return 1; + case DW_FORM_strx: case DW_FORM_strx1: case DW_FORM_strx2: + case DW_FORM_strx3: case DW_FORM_strx4: + { + uint64_t offset; + + switch (form) + { + case DW_FORM_strx: + offset = read_uleb128 (buf); + break; + case DW_FORM_strx1: + offset = read_byte (buf); + break; + case DW_FORM_strx2: + offset = read_uint16 (buf); + break; + case DW_FORM_strx3: + offset = read_uint24 (buf); + break; + case DW_FORM_strx4: + offset = read_uint32 (buf); + break; + default: + /* This case can't happen. */ + return 0; + } + val->encoding = ATTR_VAL_STRING_INDEX; + val->u.uint = offset; + return 1; + } + case DW_FORM_addrx: case DW_FORM_addrx1: case DW_FORM_addrx2: + case DW_FORM_addrx3: case DW_FORM_addrx4: + { + uint64_t offset; + + switch (form) + { + case DW_FORM_addrx: + offset = read_uleb128 (buf); + break; + case DW_FORM_addrx1: + offset = read_byte (buf); + break; + case DW_FORM_addrx2: + offset = read_uint16 (buf); + break; + case DW_FORM_addrx3: + offset = read_uint24 (buf); + break; + case DW_FORM_addrx4: + offset = read_uint32 (buf); + break; + default: + /* This case can't happen. */ + return 0; + } + val->encoding = ATTR_VAL_ADDRESS_INDEX; + val->u.uint = offset; + return 1; + } + case DW_FORM_ref_sup4: + val->encoding = ATTR_VAL_REF_SECTION; + val->u.uint = read_uint32 (buf); + return 1; + case DW_FORM_ref_sup8: + val->encoding = ATTR_VAL_REF_SECTION; + val->u.uint = read_uint64 (buf); + return 1; + case DW_FORM_implicit_const: + val->encoding = ATTR_VAL_UINT; + val->u.uint = implicit_val; + return 1; + case DW_FORM_loclistx: + /* We don't distinguish this from DW_FORM_sec_offset. It + * shouldn't matter since we don't care about loclists. */ + val->encoding = ATTR_VAL_REF_SECTION; + val->u.uint = read_uleb128 (buf); + return 1; + case DW_FORM_rnglistx: + val->encoding = ATTR_VAL_RNGLISTS_INDEX; + val->u.uint = read_uleb128 (buf); + return 1; case DW_FORM_GNU_addr_index: val->encoding = ATTR_VAL_REF_SECTION; val->u.uint = read_uleb128 (buf); @@ -877,19 +1326,157 @@ read_attribute (enum dwarf_form form, struct dwarf_buf *buf, val->u.uint = read_uleb128 (buf); return 1; case DW_FORM_GNU_ref_alt: - val->encoding = ATTR_VAL_REF_SECTION; - val->u.uint = read_offset (buf, is_dwarf64); - return 1; - case DW_FORM_GNU_strp_alt: - val->encoding = ATTR_VAL_REF_SECTION; val->u.uint = read_offset (buf, is_dwarf64); + if (altlink == NULL) + { + val->encoding = ATTR_VAL_NONE; + return 1; + } + val->encoding = ATTR_VAL_REF_ALT_INFO; return 1; + case DW_FORM_strp_sup: case DW_FORM_GNU_strp_alt: + { + uint64_t offset; + + offset = read_offset (buf, is_dwarf64); + if (altlink == NULL) + { + val->encoding = ATTR_VAL_NONE; + return 1; + } + if (offset >= altlink->dwarf_sections.size[DEBUG_STR]) + { + dwarf_buf_error (buf, "DW_FORM_strp_sup out of range"); + return 0; + } + val->encoding = ATTR_VAL_STRING; + val->u.string = + (const char *) altlink->dwarf_sections.data[DEBUG_STR] + offset; + return 1; + } default: dwarf_buf_error (buf, "unrecognized DWARF form"); return 0; } } +/* If we can determine the value of a string attribute, set *STRING to + point to the string. Return 1 on success, 0 on error. If we don't + know the value, we consider that a success, and we don't change + *STRING. An error is only reported for some sort of out of range + offset. */ + +static int +resolve_string (const struct dwarf_sections *dwarf_sections, int is_dwarf64, + int is_bigendian, uint64_t str_offsets_base, + const struct attr_val *val, + backtrace_error_callback error_callback, void *data, + const char **string) +{ + switch (val->encoding) + { + case ATTR_VAL_STRING: + *string = val->u.string; + return 1; + + case ATTR_VAL_STRING_INDEX: + { + uint64_t offset; + struct dwarf_buf offset_buf; + + offset = val->u.uint * (is_dwarf64 ? 8 : 4) + str_offsets_base; + if (offset + (is_dwarf64 ? 8 : 4) + >= dwarf_sections->size[DEBUG_STR_OFFSETS]) + { + error_callback (data, "DW_FORM_strx value out of range", 0); + return 0; + } + + offset_buf.name = ".debug_str_offsets"; + offset_buf.start = dwarf_sections->data[DEBUG_STR_OFFSETS]; + offset_buf.buf = dwarf_sections->data[DEBUG_STR_OFFSETS] + offset; + offset_buf.left = dwarf_sections->size[DEBUG_STR_OFFSETS] - offset; + offset_buf.is_bigendian = is_bigendian; + offset_buf.error_callback = error_callback; + offset_buf.data = data; + offset_buf.reported_underflow = 0; + + offset = read_offset (&offset_buf, is_dwarf64); + if (offset >= dwarf_sections->size[DEBUG_STR]) + { + dwarf_buf_error (&offset_buf, "DW_FORM_strx offset out of range"); + return 0; + } + *string = (const char *) dwarf_sections->data[DEBUG_STR] + offset; + return 1; + } + + default: + return 1; + } +} + +/* Set *ADDRESS to the real address for a ATTR_VAL_ADDRESS_INDEX. + Return 1 on success, 0 on error. */ + +static int +resolve_addr_index (const struct dwarf_sections *dwarf_sections, + uint64_t addr_base, int addrsize, int is_bigendian, + uint64_t addr_index, + backtrace_error_callback error_callback, void *data, + uint64_t *address) +{ + uint64_t offset; + struct dwarf_buf addr_buf; + + offset = addr_index * addrsize + addr_base; + if (offset + addrsize >= dwarf_sections->size[DEBUG_ADDR]) + { + error_callback (data, "DW_FORM_addrx value out of range", 0); + return 0; + } + + addr_buf.name = ".debug_addr"; + addr_buf.start = dwarf_sections->data[DEBUG_ADDR]; + addr_buf.buf = dwarf_sections->data[DEBUG_ADDR] + offset; + addr_buf.left = dwarf_sections->size[DEBUG_ADDR] - offset; + addr_buf.is_bigendian = is_bigendian; + addr_buf.error_callback = error_callback; + addr_buf.data = data; + addr_buf.reported_underflow = 0; + + *address = read_address (&addr_buf, addrsize); + return 1; +} + +/* Compare a unit offset against a unit for bsearch. */ + +static int +units_search (const void *vkey, const void *ventry) +{ + const size_t *key = (const size_t *) vkey; + const struct unit *entry = *((const struct unit *const *) ventry); + size_t offset; + + offset = *key; + if (offset < entry->low_offset) + return -1; + else if (offset >= entry->high_offset) + return 1; + else + return 0; +} + +/* Find a unit in PU containing OFFSET. */ + +static struct unit * +find_unit (struct unit **pu, size_t units_count, size_t offset) +{ + struct unit **u; + u = bsearch (&offset, pu, units_count, sizeof (struct unit *), units_search); + return u == NULL ? NULL : *u; +} + /* Compare function_addrs for qsort. When ranges are nested, make the smallest one sort last. */ @@ -930,31 +1517,28 @@ function_addrs_search (const void *vkey, const void *ventry) return 0; } -/* Add a new compilation unit address range to a vector. Returns 1 on - success, 0 on failure. */ +/* Add a new compilation unit address range to a vector. This is + called via add_ranges. Returns 1 on success, 0 on failure. */ static int -add_unit_addr (struct backtrace_state *state, uintptr_t base_address, - struct unit_addrs addrs, +add_unit_addr (struct backtrace_state *state, void *rdata, + uint64_t lowpc, uint64_t highpc, backtrace_error_callback error_callback, void *data, - struct unit_addrs_vector *vec) + void *pvec) { + struct unit *u = (struct unit *) rdata; + struct unit_addrs_vector *vec = (struct unit_addrs_vector *) pvec; struct unit_addrs *p; - /* Add in the base address of the module here, so that we can look - up the PC directly. */ - addrs.low += base_address; - addrs.high += base_address; - /* Try to merge with the last entry. */ if (vec->count > 0) { p = (struct unit_addrs *) vec->vec.base + (vec->count - 1); - if ((addrs.low == p->high || addrs.low == p->high + 1) - && addrs.u == p->u) + if ((lowpc == p->high || lowpc == p->high + 1) + && u == p->u) { - if (addrs.high > p->high) - p->high = addrs.high; + if (highpc > p->high) + p->high = highpc; return 1; } } @@ -965,24 +1549,13 @@ add_unit_addr (struct backtrace_state *state, uintptr_t base_address, if (p == NULL) return 0; - *p = addrs; - ++vec->count; - return 1; -} - -/* Free a unit address vector. */ + p->low = lowpc; + p->high = highpc; + p->u = u; -static void -free_unit_addrs_vector (struct backtrace_state *state, - struct unit_addrs_vector *vec, - backtrace_error_callback error_callback, void *data) -{ - struct unit_addrs *addrs; - size_t i; + ++vec->count; - addrs = (struct unit_addrs *) vec->vec.base; - for (i = 0; i < vec->count; ++i) - free_abbrevs (state, &addrs[i].u->abbrevs, error_callback, data); + return 1; } /* Compare unit_addrs for qsort. When ranges are nested, make the @@ -1141,7 +1714,13 @@ read_abbrevs (struct backtrace_state *state, uint64_t abbrev_offset, read_byte (&count_buf); // Skip attributes. while (read_uleb128 (&count_buf) != 0) - read_uleb128 (&count_buf); + { + uint64_t form; + + form = read_uleb128 (&count_buf); + if ((enum dwarf_form) form == DW_FORM_implicit_const) + read_sleb128 (&count_buf); + } // Skip form of last attribute. read_uleb128 (&count_buf); } @@ -1152,13 +1731,13 @@ read_abbrevs (struct backtrace_state *state, uint64_t abbrev_offset, if (num_abbrevs == 0) return 1; - abbrevs->num_abbrevs = num_abbrevs; abbrevs->abbrevs = ((struct abbrev *) backtrace_alloc (state, num_abbrevs * sizeof (struct abbrev), error_callback, data)); if (abbrevs->abbrevs == NULL) return 0; + abbrevs->num_abbrevs = num_abbrevs; memset (abbrevs->abbrevs, 0, num_abbrevs * sizeof (struct abbrev)); num_abbrevs = 0; @@ -1184,8 +1763,12 @@ read_abbrevs (struct backtrace_state *state, uint64_t abbrev_offset, num_attrs = 0; while (read_uleb128 (&count_buf) != 0) { + uint64_t form; + ++num_attrs; - read_uleb128 (&count_buf); + form = read_uleb128 (&count_buf); + if ((enum dwarf_form) form == DW_FORM_implicit_const) + read_sleb128 (&count_buf); } if (num_attrs == 0) @@ -1213,6 +1796,10 @@ read_abbrevs (struct backtrace_state *state, uint64_t abbrev_offset, break; attrs[num_attrs].name = (enum dwarf_attribute) name; attrs[num_attrs].form = (enum dwarf_form) form; + if ((enum dwarf_form) form == DW_FORM_implicit_const) + attrs[num_attrs].val = read_sleb128 (&abbrev_buf); + else + attrs[num_attrs].val = 0; ++num_attrs; } } @@ -1262,29 +1849,165 @@ lookup_abbrev (struct abbrevs *abbrevs, uint64_t code, return (const struct abbrev *) p; } -/* Add non-contiguous address ranges for a compilation unit. Returns - 1 on success, 0 on failure. */ +/* This struct is used to gather address range information while + reading attributes. We use this while building a mapping from + address ranges to compilation units and then again while mapping + from address ranges to function entries. Normally either + lowpc/highpc is set or ranges is set. */ + +struct pcrange { + uint64_t lowpc; /* The low PC value. */ + int have_lowpc; /* Whether a low PC value was found. */ + int lowpc_is_addr_index; /* Whether lowpc is in .debug_addr. */ + uint64_t highpc; /* The high PC value. */ + int have_highpc; /* Whether a high PC value was found. */ + int highpc_is_relative; /* Whether highpc is relative to lowpc. */ + int highpc_is_addr_index; /* Whether highpc is in .debug_addr. */ + uint64_t ranges; /* Offset in ranges section. */ + int have_ranges; /* Whether ranges is valid. */ + int ranges_is_index; /* Whether ranges is DW_FORM_rnglistx. */ +}; + +/* Update PCRANGE from an attribute value. */ + +static void +update_pcrange (const struct attr* attr, const struct attr_val* val, + struct pcrange *pcrange) +{ + switch (attr->name) + { + case DW_AT_low_pc: + if (val->encoding == ATTR_VAL_ADDRESS) + { + pcrange->lowpc = val->u.uint; + pcrange->have_lowpc = 1; + } + else if (val->encoding == ATTR_VAL_ADDRESS_INDEX) + { + pcrange->lowpc = val->u.uint; + pcrange->have_lowpc = 1; + pcrange->lowpc_is_addr_index = 1; + } + break; + + case DW_AT_high_pc: + if (val->encoding == ATTR_VAL_ADDRESS) + { + pcrange->highpc = val->u.uint; + pcrange->have_highpc = 1; + } + else if (val->encoding == ATTR_VAL_UINT) + { + pcrange->highpc = val->u.uint; + pcrange->have_highpc = 1; + pcrange->highpc_is_relative = 1; + } + else if (val->encoding == ATTR_VAL_ADDRESS_INDEX) + { + pcrange->highpc = val->u.uint; + pcrange->have_highpc = 1; + pcrange->highpc_is_addr_index = 1; + } + break; + + case DW_AT_ranges: + if (val->encoding == ATTR_VAL_UINT + || val->encoding == ATTR_VAL_REF_SECTION) + { + pcrange->ranges = val->u.uint; + pcrange->have_ranges = 1; + } + else if (val->encoding == ATTR_VAL_RNGLISTS_INDEX) + { + pcrange->ranges = val->u.uint; + pcrange->have_ranges = 1; + pcrange->ranges_is_index = 1; + } + break; + + default: + break; + } +} + +/* Call ADD_RANGE for a low/high PC pair. Returns 1 on success, 0 on + error. */ static int -add_unit_ranges (struct backtrace_state *state, uintptr_t base_address, - struct unit *u, uint64_t ranges, uint64_t base, - int is_bigendian, const unsigned char *dwarf_ranges, - size_t dwarf_ranges_size, - backtrace_error_callback error_callback, void *data, - struct unit_addrs_vector *addrs) +add_low_high_range (struct backtrace_state *state, + const struct dwarf_sections *dwarf_sections, + uintptr_t base_address, int is_bigendian, + struct unit *u, const struct pcrange *pcrange, + int (*add_range) (struct backtrace_state *state, + void *rdata, uint64_t lowpc, + uint64_t highpc, + backtrace_error_callback error_callback, + void *data, void *vec), + void *rdata, + backtrace_error_callback error_callback, void *data, + void *vec) +{ + uint64_t lowpc; + uint64_t highpc; + + lowpc = pcrange->lowpc; + if (pcrange->lowpc_is_addr_index) + { + if (!resolve_addr_index (dwarf_sections, u->addr_base, u->addrsize, + is_bigendian, lowpc, error_callback, data, + &lowpc)) + return 0; + } + + highpc = pcrange->highpc; + if (pcrange->highpc_is_addr_index) + { + if (!resolve_addr_index (dwarf_sections, u->addr_base, u->addrsize, + is_bigendian, highpc, error_callback, data, + &highpc)) + return 0; + } + if (pcrange->highpc_is_relative) + highpc += lowpc; + + /* Add in the base address of the module when recording PC values, + so that we can look up the PC directly. */ + lowpc += base_address; + highpc += base_address; + + return add_range (state, rdata, lowpc, highpc, error_callback, data, vec); +} + +/* Call ADD_RANGE for each range read from .debug_ranges, as used in + DWARF versions 2 through 4. */ + +static int +add_ranges_from_ranges ( + struct backtrace_state *state, + const struct dwarf_sections *dwarf_sections, + uintptr_t base_address, int is_bigendian, + struct unit *u, uint64_t base, + const struct pcrange *pcrange, + int (*add_range) (struct backtrace_state *state, void *rdata, + uint64_t lowpc, uint64_t highpc, + backtrace_error_callback error_callback, void *data, + void *vec), + void *rdata, + backtrace_error_callback error_callback, void *data, + void *vec) { struct dwarf_buf ranges_buf; - if (ranges >= dwarf_ranges_size) + if (pcrange->ranges >= dwarf_sections->size[DEBUG_RANGES]) { error_callback (data, "ranges offset out of range", 0); return 0; } ranges_buf.name = ".debug_ranges"; - ranges_buf.start = dwarf_ranges; - ranges_buf.buf = dwarf_ranges + ranges; - ranges_buf.left = dwarf_ranges_size - ranges; + ranges_buf.start = dwarf_sections->data[DEBUG_RANGES]; + ranges_buf.buf = dwarf_sections->data[DEBUG_RANGES] + pcrange->ranges; + ranges_buf.left = dwarf_sections->size[DEBUG_RANGES] - pcrange->ranges; ranges_buf.is_bigendian = is_bigendian; ranges_buf.error_callback = error_callback; ranges_buf.data = data; @@ -1308,13 +2031,10 @@ add_unit_ranges (struct backtrace_state *state, uintptr_t base_address, base = high; else { - struct unit_addrs a; - - a.low = low + base; - a.high = high + base; - a.u = u; - if (!add_unit_addr (state, base_address, a, error_callback, data, - addrs)) + if (!add_range (state, rdata, + low + base + base_address, + high + base + base_address, + error_callback, data, vec)) return 0; } } @@ -1325,31 +2045,242 @@ add_unit_ranges (struct backtrace_state *state, uintptr_t base_address, return 1; } -/* Find the address range covered by a compilation unit, reading from - UNIT_BUF and adding values to U. Returns 1 if all data could be - read, 0 if there is some error. */ +/* Call ADD_RANGE for each range read from .debug_rnglists, as used in + DWARF version 5. */ static int -find_address_ranges (struct backtrace_state *state, uintptr_t base_address, - struct dwarf_buf *unit_buf, - const unsigned char *dwarf_str, size_t dwarf_str_size, - const unsigned char *dwarf_ranges, - size_t dwarf_ranges_size, - int is_bigendian, backtrace_error_callback error_callback, - void *data, struct unit *u, - struct unit_addrs_vector *addrs) +add_ranges_from_rnglists ( + struct backtrace_state *state, + const struct dwarf_sections *dwarf_sections, + uintptr_t base_address, int is_bigendian, + struct unit *u, uint64_t base, + const struct pcrange *pcrange, + int (*add_range) (struct backtrace_state *state, void *rdata, + uint64_t lowpc, uint64_t highpc, + backtrace_error_callback error_callback, void *data, + void *vec), + void *rdata, + backtrace_error_callback error_callback, void *data, + void *vec) { - while (unit_buf->left > 0) + uint64_t offset; + struct dwarf_buf rnglists_buf; + + if (!pcrange->ranges_is_index) + offset = pcrange->ranges; + else + offset = u->rnglists_base + pcrange->ranges * (u->is_dwarf64 ? 8 : 4); + if (offset >= dwarf_sections->size[DEBUG_RNGLISTS]) { - uint64_t code; + error_callback (data, "rnglists offset out of range", 0); + return 0; + } + + rnglists_buf.name = ".debug_rnglists"; + rnglists_buf.start = dwarf_sections->data[DEBUG_RNGLISTS]; + rnglists_buf.buf = dwarf_sections->data[DEBUG_RNGLISTS] + offset; + rnglists_buf.left = dwarf_sections->size[DEBUG_RNGLISTS] - offset; + rnglists_buf.is_bigendian = is_bigendian; + rnglists_buf.error_callback = error_callback; + rnglists_buf.data = data; + rnglists_buf.reported_underflow = 0; + + if (pcrange->ranges_is_index) + { + offset = read_offset (&rnglists_buf, u->is_dwarf64); + offset += u->rnglists_base; + if (offset >= dwarf_sections->size[DEBUG_RNGLISTS]) + { + error_callback (data, "rnglists index offset out of range", 0); + return 0; + } + rnglists_buf.buf = dwarf_sections->data[DEBUG_RNGLISTS] + offset; + rnglists_buf.left = dwarf_sections->size[DEBUG_RNGLISTS] - offset; + } + + while (1) + { + unsigned char rle; + + rle = read_byte (&rnglists_buf); + if (rle == DW_RLE_end_of_list) + break; + switch (rle) + { + case DW_RLE_base_addressx: + { + uint64_t index; + + index = read_uleb128 (&rnglists_buf); + if (!resolve_addr_index (dwarf_sections, u->addr_base, + u->addrsize, is_bigendian, index, + error_callback, data, &base)) + return 0; + } + break; + + case DW_RLE_startx_endx: + { + uint64_t index; + uint64_t low; + uint64_t high; + + index = read_uleb128 (&rnglists_buf); + if (!resolve_addr_index (dwarf_sections, u->addr_base, + u->addrsize, is_bigendian, index, + error_callback, data, &low)) + return 0; + index = read_uleb128 (&rnglists_buf); + if (!resolve_addr_index (dwarf_sections, u->addr_base, + u->addrsize, is_bigendian, index, + error_callback, data, &high)) + return 0; + if (!add_range (state, rdata, low + base_address, + high + base_address, error_callback, data, + vec)) + return 0; + } + break; + + case DW_RLE_startx_length: + { + uint64_t index; + uint64_t low; + uint64_t length; + + index = read_uleb128 (&rnglists_buf); + if (!resolve_addr_index (dwarf_sections, u->addr_base, + u->addrsize, is_bigendian, index, + error_callback, data, &low)) + return 0; + length = read_uleb128 (&rnglists_buf); + low += base_address; + if (!add_range (state, rdata, low, low + length, + error_callback, data, vec)) + return 0; + } + break; + + case DW_RLE_offset_pair: + { + uint64_t low; + uint64_t high; + + low = read_uleb128 (&rnglists_buf); + high = read_uleb128 (&rnglists_buf); + if (!add_range (state, rdata, low + base + base_address, + high + base + base_address, + error_callback, data, vec)) + return 0; + } + break; + + case DW_RLE_base_address: + base = read_address (&rnglists_buf, u->addrsize); + break; + + case DW_RLE_start_end: + { + uint64_t low; + uint64_t high; + + low = read_address (&rnglists_buf, u->addrsize); + high = read_address (&rnglists_buf, u->addrsize); + if (!add_range (state, rdata, low + base_address, + high + base_address, error_callback, data, + vec)) + return 0; + } + break; + + case DW_RLE_start_length: + { + uint64_t low; + uint64_t length; + + low = read_address (&rnglists_buf, u->addrsize); + length = read_uleb128 (&rnglists_buf); + low += base_address; + if (!add_range (state, rdata, low, low + length, + error_callback, data, vec)) + return 0; + } + break; + + default: + dwarf_buf_error (&rnglists_buf, "unrecognized DW_RLE value"); + return 0; + } + } + + if (rnglists_buf.reported_underflow) + return 0; + + return 1; +} + +/* Call ADD_RANGE for each lowpc/highpc pair in PCRANGE. RDATA is + passed to ADD_RANGE, and is either a struct unit * or a struct + function *. VEC is the vector we are adding ranges to, and is + either a struct unit_addrs_vector * or a struct function_vector *. + Returns 1 on success, 0 on error. */ + +static int +add_ranges (struct backtrace_state *state, + const struct dwarf_sections *dwarf_sections, + uintptr_t base_address, int is_bigendian, + struct unit *u, uint64_t base, const struct pcrange *pcrange, + int (*add_range) (struct backtrace_state *state, void *rdata, + uint64_t lowpc, uint64_t highpc, + backtrace_error_callback error_callback, + void *data, void *vec), + void *rdata, + backtrace_error_callback error_callback, void *data, + void *vec) +{ + if (pcrange->have_lowpc && pcrange->have_highpc) + return add_low_high_range (state, dwarf_sections, base_address, + is_bigendian, u, pcrange, add_range, rdata, + error_callback, data, vec); + + if (!pcrange->have_ranges) + { + /* Did not find any address ranges to add. */ + return 1; + } + + if (u->version < 5) + return add_ranges_from_ranges (state, dwarf_sections, base_address, + is_bigendian, u, base, pcrange, add_range, + rdata, error_callback, data, vec); + else + return add_ranges_from_rnglists (state, dwarf_sections, base_address, + is_bigendian, u, base, pcrange, add_range, + rdata, error_callback, data, vec); +} + +/* Find the address range covered by a compilation unit, reading from + UNIT_BUF and adding values to U. Returns 1 if all data could be + read, 0 if there is some error. */ + +static int +find_address_ranges (struct backtrace_state *state, uintptr_t base_address, + struct dwarf_buf *unit_buf, + const struct dwarf_sections *dwarf_sections, + int is_bigendian, struct dwarf_data *altlink, + backtrace_error_callback error_callback, void *data, + struct unit *u, struct unit_addrs_vector *addrs, + enum dwarf_tag *unit_tag) +{ + while (unit_buf->left > 0) + { + uint64_t code; const struct abbrev *abbrev; - uint64_t lowpc; - int have_lowpc; - uint64_t highpc; - int have_highpc; - int highpc_is_relative; - uint64_t ranges; - int have_ranges; + struct pcrange pcrange; + struct attr_val name_val; + int have_name_val; + struct attr_val comp_dir_val; + int have_comp_dir_val; size_t i; code = read_uleb128 (unit_buf); @@ -1360,72 +2291,68 @@ find_address_ranges (struct backtrace_state *state, uintptr_t base_address, if (abbrev == NULL) return 0; - lowpc = 0; - have_lowpc = 0; - highpc = 0; - have_highpc = 0; - highpc_is_relative = 0; - ranges = 0; - have_ranges = 0; + if (unit_tag != NULL) + *unit_tag = abbrev->tag; + + memset (&pcrange, 0, sizeof pcrange); + memset (&name_val, 0, sizeof name_val); + have_name_val = 0; + memset (&comp_dir_val, 0, sizeof comp_dir_val); + have_comp_dir_val = 0; for (i = 0; i < abbrev->num_attrs; ++i) { struct attr_val val; - if (!read_attribute (abbrev->attrs[i].form, unit_buf, - u->is_dwarf64, u->version, u->addrsize, - dwarf_str, dwarf_str_size, &val)) + if (!read_attribute (abbrev->attrs[i].form, abbrev->attrs[i].val, + unit_buf, u->is_dwarf64, u->version, + u->addrsize, dwarf_sections, altlink, &val)) return 0; switch (abbrev->attrs[i].name) { - case DW_AT_low_pc: - if (val.encoding == ATTR_VAL_ADDRESS) - { - lowpc = val.u.uint; - have_lowpc = 1; - } + case DW_AT_low_pc: case DW_AT_high_pc: case DW_AT_ranges: + update_pcrange (&abbrev->attrs[i], &val, &pcrange); break; - case DW_AT_high_pc: - if (val.encoding == ATTR_VAL_ADDRESS) - { - highpc = val.u.uint; - have_highpc = 1; - } - else if (val.encoding == ATTR_VAL_UINT) + case DW_AT_stmt_list: + if (abbrev->tag == DW_TAG_compile_unit + && (val.encoding == ATTR_VAL_UINT + || val.encoding == ATTR_VAL_REF_SECTION)) + u->lineoff = val.u.uint; + break; + + case DW_AT_name: + if (abbrev->tag == DW_TAG_compile_unit) { - highpc = val.u.uint; - have_highpc = 1; - highpc_is_relative = 1; + name_val = val; + have_name_val = 1; } break; - case DW_AT_ranges: - if (val.encoding == ATTR_VAL_UINT - || val.encoding == ATTR_VAL_REF_SECTION) + case DW_AT_comp_dir: + if (abbrev->tag == DW_TAG_compile_unit) { - ranges = val.u.uint; - have_ranges = 1; + comp_dir_val = val; + have_comp_dir_val = 1; } break; - case DW_AT_stmt_list: + case DW_AT_str_offsets_base: if (abbrev->tag == DW_TAG_compile_unit - && (val.encoding == ATTR_VAL_UINT - || val.encoding == ATTR_VAL_REF_SECTION)) - u->lineoff = val.u.uint; + && val.encoding == ATTR_VAL_REF_SECTION) + u->str_offsets_base = val.u.uint; break; - case DW_AT_name: + case DW_AT_addr_base: if (abbrev->tag == DW_TAG_compile_unit - && val.encoding == ATTR_VAL_STRING) - u->filename = val.u.string; + && val.encoding == ATTR_VAL_REF_SECTION) + u->addr_base = val.u.uint; break; - case DW_AT_comp_dir: + case DW_AT_rnglists_base: if (abbrev->tag == DW_TAG_compile_unit - && val.encoding == ATTR_VAL_STRING) - u->comp_dir = val.u.string; + && val.encoding == ATTR_VAL_REF_SECTION) + u->rnglists_base = val.u.uint; break; default: @@ -1433,46 +2360,45 @@ find_address_ranges (struct backtrace_state *state, uintptr_t base_address, } } + // Resolve strings after we're sure that we have seen + // DW_AT_str_offsets_base. + if (have_name_val) + { + if (!resolve_string (dwarf_sections, u->is_dwarf64, is_bigendian, + u->str_offsets_base, &name_val, + error_callback, data, &u->filename)) + return 0; + } + if (have_comp_dir_val) + { + if (!resolve_string (dwarf_sections, u->is_dwarf64, is_bigendian, + u->str_offsets_base, &comp_dir_val, + error_callback, data, &u->comp_dir)) + return 0; + } + if (abbrev->tag == DW_TAG_compile_unit || abbrev->tag == DW_TAG_subprogram) { - if (have_ranges) - { - if (!add_unit_ranges (state, base_address, u, ranges, lowpc, - is_bigendian, dwarf_ranges, - dwarf_ranges_size, error_callback, - data, addrs)) - return 0; - } - else if (have_lowpc && have_highpc) - { - struct unit_addrs a; - - if (highpc_is_relative) - highpc += lowpc; - a.low = lowpc; - a.high = highpc; - a.u = u; - - if (!add_unit_addr (state, base_address, a, error_callback, data, - addrs)) - return 0; - } + if (!add_ranges (state, dwarf_sections, base_address, + is_bigendian, u, pcrange.lowpc, &pcrange, + add_unit_addr, (void *) u, error_callback, data, + (void *) addrs)) + return 0; /* If we found the PC range in the DW_TAG_compile_unit, we can stop now. */ if (abbrev->tag == DW_TAG_compile_unit - && (have_ranges || (have_lowpc && have_highpc))) + && (pcrange.have_ranges + || (pcrange.have_lowpc && pcrange.have_highpc))) return 1; } if (abbrev->has_children) { if (!find_address_ranges (state, base_address, unit_buf, - dwarf_str, dwarf_str_size, - dwarf_ranges, dwarf_ranges_size, - is_bigendian, error_callback, data, - u, addrs)) + dwarf_sections, is_bigendian, altlink, + error_callback, data, u, addrs, NULL)) return 0; } } @@ -1486,33 +2412,40 @@ find_address_ranges (struct backtrace_state *state, uintptr_t base_address, static int build_address_map (struct backtrace_state *state, uintptr_t base_address, - const unsigned char *dwarf_info, size_t dwarf_info_size, - const unsigned char *dwarf_abbrev, size_t dwarf_abbrev_size, - const unsigned char *dwarf_ranges, size_t dwarf_ranges_size, - const unsigned char *dwarf_str, size_t dwarf_str_size, - int is_bigendian, backtrace_error_callback error_callback, - void *data, struct unit_addrs_vector *addrs) + const struct dwarf_sections *dwarf_sections, + int is_bigendian, struct dwarf_data *altlink, + backtrace_error_callback error_callback, void *data, + struct unit_addrs_vector *addrs, + struct unit_vector *unit_vec) { struct dwarf_buf info; - struct abbrevs abbrevs; + struct backtrace_vector units; + size_t units_count; + size_t i; + struct unit **pu; + size_t unit_offset = 0; memset (&addrs->vec, 0, sizeof addrs->vec); + memset (&unit_vec->vec, 0, sizeof unit_vec->vec); addrs->count = 0; + unit_vec->count = 0; /* Read through the .debug_info section. FIXME: Should we use the .debug_aranges section? gdb and addr2line don't use it, but I'm not sure why. */ info.name = ".debug_info"; - info.start = dwarf_info; - info.buf = dwarf_info; - info.left = dwarf_info_size; + info.start = dwarf_sections->data[DEBUG_INFO]; + info.buf = info.start; + info.left = dwarf_sections->size[DEBUG_INFO]; info.is_bigendian = is_bigendian; info.error_callback = error_callback; info.data = data; info.reported_underflow = 0; - memset (&abbrevs, 0, sizeof abbrevs); + memset (&units, 0, sizeof units); + units_count = 0; + while (info.left > 0) { const unsigned char *unit_data_start; @@ -1520,23 +2453,18 @@ build_address_map (struct backtrace_state *state, uintptr_t base_address, int is_dwarf64; struct dwarf_buf unit_buf; int version; + int unit_type; uint64_t abbrev_offset; int addrsize; struct unit *u; + enum dwarf_tag unit_tag; if (info.reported_underflow) goto fail; unit_data_start = info.buf; - is_dwarf64 = 0; - len = read_uint32 (&info); - if (len == 0xffffffff) - { - len = read_uint64 (&info); - is_dwarf64 = 1; - } - + len = read_initial_length (&info, &is_dwarf64); unit_buf = info; unit_buf.left = len; @@ -1544,23 +2472,70 @@ build_address_map (struct backtrace_state *state, uintptr_t base_address, goto fail; version = read_uint16 (&unit_buf); - if (version < 2 || version > 4) + if (version < 2 || version > 5) { dwarf_buf_error (&unit_buf, "unrecognized DWARF version"); goto fail; } - abbrev_offset = read_offset (&unit_buf, is_dwarf64); - if (!read_abbrevs (state, abbrev_offset, dwarf_abbrev, dwarf_abbrev_size, - is_bigendian, error_callback, data, &abbrevs)) - goto fail; + if (version < 5) + unit_type = 0; + else + { + unit_type = read_byte (&unit_buf); + if (unit_type == DW_UT_type || unit_type == DW_UT_split_type) + { + /* This unit doesn't have anything we need. */ + continue; + } + } - addrsize = read_byte (&unit_buf); + pu = ((struct unit **) + backtrace_vector_grow (state, sizeof (struct unit *), + error_callback, data, &units)); + if (pu == NULL) + goto fail; u = ((struct unit *) backtrace_alloc (state, sizeof *u, error_callback, data)); if (u == NULL) goto fail; + + *pu = u; + ++units_count; + + if (version < 5) + addrsize = 0; /* Set below. */ + else + addrsize = read_byte (&unit_buf); + + memset (&u->abbrevs, 0, sizeof u->abbrevs); + abbrev_offset = read_offset (&unit_buf, is_dwarf64); + if (!read_abbrevs (state, abbrev_offset, + dwarf_sections->data[DEBUG_ABBREV], + dwarf_sections->size[DEBUG_ABBREV], + is_bigendian, error_callback, data, &u->abbrevs)) + goto fail; + + if (version < 5) + addrsize = read_byte (&unit_buf); + + switch (unit_type) + { + case 0: + break; + case DW_UT_compile: case DW_UT_partial: + break; + case DW_UT_skeleton: case DW_UT_split_compile: + read_uint64 (&unit_buf); /* dwo_id */ + break; + default: + break; + } + + u->low_offset = unit_offset; + unit_offset += len + (is_dwarf64 ? 12 : 4); + u->high_offset = unit_offset; u->unit_data = unit_buf.buf; u->unit_data_len = unit_buf.left; u->unit_data_offset = unit_buf.buf - unit_data_start; @@ -1571,8 +2546,6 @@ build_address_map (struct backtrace_state *state, uintptr_t base_address, u->comp_dir = NULL; u->abs_filename = NULL; u->lineoff = 0; - u->abbrevs = abbrevs; - memset (&abbrevs, 0, sizeof abbrevs); /* The actual line number mappings will be read as needed. */ u->lines = NULL; @@ -1580,32 +2553,37 @@ build_address_map (struct backtrace_state *state, uintptr_t base_address, u->function_addrs = NULL; u->function_addrs_count = 0; - if (!find_address_ranges (state, base_address, &unit_buf, - dwarf_str, dwarf_str_size, - dwarf_ranges, dwarf_ranges_size, - is_bigendian, error_callback, data, - u, addrs)) - { - free_abbrevs (state, &u->abbrevs, error_callback, data); - backtrace_free (state, u, sizeof *u, error_callback, data); - goto fail; - } + if (!find_address_ranges (state, base_address, &unit_buf, dwarf_sections, + is_bigendian, altlink, error_callback, data, + u, addrs, &unit_tag)) + goto fail; if (unit_buf.reported_underflow) - { - free_abbrevs (state, &u->abbrevs, error_callback, data); - backtrace_free (state, u, sizeof *u, error_callback, data); - goto fail; - } + goto fail; } if (info.reported_underflow) goto fail; + unit_vec->vec = units; + unit_vec->count = units_count; return 1; fail: - free_abbrevs (state, &abbrevs, error_callback, data); - free_unit_addrs_vector (state, addrs, error_callback, data); + if (units_count > 0) + { + pu = (struct unit **) units.base; + for (i = 0; i < units_count; i++) + { + free_abbrevs (state, &pu[i]->abbrevs, error_callback, data); + backtrace_free (state, pu[i], sizeof **pu, error_callback, data); + } + backtrace_vector_free (state, &units, error_callback, data); + } + if (addrs->count > 0) + { + backtrace_vector_free (state, &addrs->vec, error_callback, data); + addrs->count = 0; + } return 0; } @@ -1641,7 +2619,7 @@ add_line (struct backtrace_state *state, struct dwarf_data *ddata, ln->filename = filename; ln->lineno = lineno; - ln->idx = (int)vec->count; + ln->idx = vec->count; ++vec->count; @@ -1662,55 +2640,21 @@ free_line_header (struct backtrace_state *state, struct line_header *hdr, error_callback, data); } -/* Read the line header. Return 1 on success, 0 on failure. */ +/* Read the directories and file names for a line header for version + 2, setting fields in HDR. Return 1 on success, 0 on failure. */ static int -read_line_header (struct backtrace_state *state, struct unit *u, - int is_dwarf64, struct dwarf_buf *line_buf, - struct line_header *hdr) +read_v2_paths (struct backtrace_state *state, struct unit *u, + struct dwarf_buf *hdr_buf, struct line_header *hdr) { - uint64_t hdrlen; - struct dwarf_buf hdr_buf; const unsigned char *p; const unsigned char *pend; size_t i; - hdr->version = read_uint16 (line_buf); - if (hdr->version < 2 || hdr->version > 4) - { - dwarf_buf_error (line_buf, "unsupported line number version"); - return 0; - } - - hdrlen = read_offset (line_buf, is_dwarf64); - - hdr_buf = *line_buf; - hdr_buf.left = hdrlen; - - if (!advance (line_buf, hdrlen)) - return 0; - - hdr->min_insn_len = read_byte (&hdr_buf); - if (hdr->version < 4) - hdr->max_ops_per_insn = 1; - else - hdr->max_ops_per_insn = read_byte (&hdr_buf); - - /* We don't care about default_is_stmt. */ - read_byte (&hdr_buf); - - hdr->line_base = read_sbyte (&hdr_buf); - hdr->line_range = read_byte (&hdr_buf); - - hdr->opcode_base = read_byte (&hdr_buf); - hdr->opcode_lengths = hdr_buf.buf; - if (!advance (&hdr_buf, hdr->opcode_base - 1)) - return 0; - /* Count the number of directory entries. */ hdr->dirs_count = 0; - p = hdr_buf.buf; - pend = p + hdr_buf.left; + p = hdr_buf->buf; + pend = p + hdr_buf->left; while (p < pend && *p != '\0') { p += strnlen((const char *) p, pend - p) + 1; @@ -1723,30 +2667,30 @@ read_line_header (struct backtrace_state *state, struct unit *u, hdr->dirs = ((const char **) backtrace_alloc (state, hdr->dirs_count * sizeof (const char *), - line_buf->error_callback, line_buf->data)); + hdr_buf->error_callback, + hdr_buf->data)); if (hdr->dirs == NULL) return 0; } i = 0; - while (*hdr_buf.buf != '\0') + while (*hdr_buf->buf != '\0') { - if (hdr_buf.reported_underflow) + if (hdr_buf->reported_underflow) return 0; - hdr->dirs[i] = (const char *) hdr_buf.buf; - ++i; - if (!advance (&hdr_buf, - strnlen ((const char *) hdr_buf.buf, hdr_buf.left) + 1)) + hdr->dirs[i] = read_string (hdr_buf); + if (hdr->dirs[i] == NULL) return 0; + ++i; } - if (!advance (&hdr_buf, 1)) + if (!advance (hdr_buf, 1)) return 0; /* Count the number of file entries. */ hdr->filenames_count = 0; - p = hdr_buf.buf; - pend = p + hdr_buf.left; + p = hdr_buf->buf; + pend = p + hdr_buf->left; while (p < pend && *p != '\0') { p += strnlen ((const char *) p, pend - p) + 1; @@ -1759,24 +2703,23 @@ read_line_header (struct backtrace_state *state, struct unit *u, hdr->filenames = ((const char **) backtrace_alloc (state, hdr->filenames_count * sizeof (char *), - line_buf->error_callback, - line_buf->data)); + hdr_buf->error_callback, + hdr_buf->data)); if (hdr->filenames == NULL) return 0; i = 0; - while (*hdr_buf.buf != '\0') + while (*hdr_buf->buf != '\0') { const char *filename; uint64_t dir_index; - if (hdr_buf.reported_underflow) + if (hdr_buf->reported_underflow) return 0; - filename = (const char *) hdr_buf.buf; - if (!advance (&hdr_buf, - strnlen ((const char *) hdr_buf.buf, hdr_buf.left) + 1)) + filename = read_string (hdr_buf); + if (filename == NULL) return 0; - dir_index = read_uleb128 (&hdr_buf); + dir_index = read_uleb128 (hdr_buf); if (IS_ABSOLUTE_PATH (filename) || (dir_index == 0 && u->comp_dir == NULL)) hdr->filenames[i] = filename; @@ -1793,16 +2736,16 @@ read_line_header (struct backtrace_state *state, struct unit *u, dir = hdr->dirs[dir_index - 1]; else { - dwarf_buf_error (line_buf, + dwarf_buf_error (hdr_buf, ("invalid directory index in " "line number program header")); return 0; } dir_len = strlen (dir); filename_len = strlen (filename); - s = ((char *) - backtrace_alloc (state, dir_len + filename_len + 2, - line_buf->error_callback, line_buf->data)); + s = ((char *) backtrace_alloc (state, dir_len + filename_len + 2, + hdr_buf->error_callback, + hdr_buf->data)); if (s == NULL) return 0; memcpy (s, dir, dir_len); @@ -1815,12 +2758,258 @@ read_line_header (struct backtrace_state *state, struct unit *u, } /* Ignore the modification time and size. */ - read_uleb128 (&hdr_buf); - read_uleb128 (&hdr_buf); + read_uleb128 (hdr_buf); + read_uleb128 (hdr_buf); ++i; } + return 1; +} + +/* Read a single version 5 LNCT entry for a directory or file name in a + line header. Sets *STRING to the resulting name, ignoring other + data. Return 1 on success, 0 on failure. */ + +static int +read_lnct (struct backtrace_state *state, struct dwarf_data *ddata, + struct unit *u, struct dwarf_buf *hdr_buf, + const struct line_header *hdr, size_t formats_count, + const struct line_header_format *formats, const char **string) +{ + size_t i; + const char *dir; + const char *path; + + dir = NULL; + path = NULL; + for (i = 0; i < formats_count; i++) + { + struct attr_val val; + + if (!read_attribute (formats[i].form, 0, hdr_buf, u->is_dwarf64, + u->version, hdr->addrsize, &ddata->dwarf_sections, + ddata->altlink, &val)) + return 0; + switch (formats[i].lnct) + { + case DW_LNCT_path: + if (!resolve_string (&ddata->dwarf_sections, u->is_dwarf64, + ddata->is_bigendian, u->str_offsets_base, + &val, hdr_buf->error_callback, hdr_buf->data, + &path)) + return 0; + break; + case DW_LNCT_directory_index: + if (val.encoding == ATTR_VAL_UINT) + { + if (val.u.uint >= hdr->dirs_count) + { + dwarf_buf_error (hdr_buf, + ("invalid directory index in " + "line number program header")); + return 0; + } + dir = hdr->dirs[val.u.uint]; + } + break; + default: + /* We don't care about timestamps or sizes or hashes. */ + break; + } + } + + if (path == NULL) + { + dwarf_buf_error (hdr_buf, + "missing file name in line number program header"); + return 0; + } + + if (dir == NULL) + *string = path; + else + { + size_t dir_len; + size_t path_len; + char *s; + + dir_len = strlen (dir); + path_len = strlen (path); + s = (char *) backtrace_alloc (state, dir_len + path_len + 2, + hdr_buf->error_callback, hdr_buf->data); + if (s == NULL) + return 0; + memcpy (s, dir, dir_len); + /* FIXME: If we are on a DOS-based file system, and the + directory or the path name use backslashes, then we should + use a backslash here. */ + s[dir_len] = '/'; + memcpy (s + dir_len + 1, path, path_len + 1); + *string = s; + } + + return 1; +} + +/* Read a set of DWARF 5 line header format entries, setting *PCOUNT + and *PPATHS. Return 1 on success, 0 on failure. */ + +static int +read_line_header_format_entries (struct backtrace_state *state, + struct dwarf_data *ddata, + struct unit *u, + struct dwarf_buf *hdr_buf, + struct line_header *hdr, + size_t *pcount, + const char ***ppaths) +{ + size_t formats_count; + struct line_header_format *formats; + size_t paths_count; + const char **paths; + size_t i; + int ret; + + formats_count = read_byte (hdr_buf); + if (formats_count == 0) + formats = NULL; + else + { + formats = ((struct line_header_format *) + backtrace_alloc (state, + (formats_count + * sizeof (struct line_header_format)), + hdr_buf->error_callback, + hdr_buf->data)); + if (formats == NULL) + return 0; + + for (i = 0; i < formats_count; i++) + { + formats[i].lnct = (int) read_uleb128(hdr_buf); + formats[i].form = (enum dwarf_form) read_uleb128 (hdr_buf); + } + } + + paths_count = read_uleb128 (hdr_buf); + if (paths_count == 0) + { + *pcount = 0; + *ppaths = NULL; + ret = 1; + goto exit; + } + + paths = ((const char **) + backtrace_alloc (state, paths_count * sizeof (const char *), + hdr_buf->error_callback, hdr_buf->data)); + if (paths == NULL) + { + ret = 0; + goto exit; + } + for (i = 0; i < paths_count; i++) + { + if (!read_lnct (state, ddata, u, hdr_buf, hdr, formats_count, + formats, &paths[i])) + { + backtrace_free (state, paths, + paths_count * sizeof (const char *), + hdr_buf->error_callback, hdr_buf->data); + ret = 0; + goto exit; + } + } + + *pcount = paths_count; + *ppaths = paths; + + ret = 1; + + exit: + if (formats != NULL) + backtrace_free (state, formats, + formats_count * sizeof (struct line_header_format), + hdr_buf->error_callback, hdr_buf->data); + + return ret; +} + +/* Read the line header. Return 1 on success, 0 on failure. */ + +static int +read_line_header (struct backtrace_state *state, struct dwarf_data *ddata, + struct unit *u, int is_dwarf64, struct dwarf_buf *line_buf, + struct line_header *hdr) +{ + uint64_t hdrlen; + struct dwarf_buf hdr_buf; + + hdr->version = read_uint16 (line_buf); + if (hdr->version < 2 || hdr->version > 5) + { + dwarf_buf_error (line_buf, "unsupported line number version"); + return 0; + } + + if (hdr->version < 5) + hdr->addrsize = u->addrsize; + else + { + hdr->addrsize = read_byte (line_buf); + /* We could support a non-zero segment_selector_size but I doubt + we'll ever see it. */ + if (read_byte (line_buf) != 0) + { + dwarf_buf_error (line_buf, + "non-zero segment_selector_size not supported"); + return 0; + } + } + + hdrlen = read_offset (line_buf, is_dwarf64); + + hdr_buf = *line_buf; + hdr_buf.left = hdrlen; + + if (!advance (line_buf, hdrlen)) + return 0; + + hdr->min_insn_len = read_byte (&hdr_buf); + if (hdr->version < 4) + hdr->max_ops_per_insn = 1; + else + hdr->max_ops_per_insn = read_byte (&hdr_buf); + + /* We don't care about default_is_stmt. */ + read_byte (&hdr_buf); + + hdr->line_base = read_sbyte (&hdr_buf); + hdr->line_range = read_byte (&hdr_buf); + + hdr->opcode_base = read_byte (&hdr_buf); + hdr->opcode_lengths = hdr_buf.buf; + if (!advance (&hdr_buf, hdr->opcode_base - 1)) + return 0; + + if (hdr->version < 5) + { + if (!read_v2_paths (state, u, &hdr_buf, hdr)) + return 0; + } + else + { + if (!read_line_header_format_entries (state, ddata, u, &hdr_buf, hdr, + &hdr->dirs_count, + &hdr->dirs)) + return 0; + if (!read_line_header_format_entries (state, ddata, u, &hdr_buf, hdr, + &hdr->filenames_count, + &hdr->filenames)) + return 0; + } + if (hdr_buf.reported_underflow) return 0; @@ -1886,17 +3075,17 @@ read_line_program (struct backtrace_state *state, struct dwarf_data *ddata, lineno = 1; break; case DW_LNE_set_address: - address = read_address (line_buf, u->addrsize); + address = read_address (line_buf, hdr->addrsize); break; case DW_LNE_define_file: { const char *f; unsigned int dir_index; - f = (const char *) line_buf->buf; - if (!advance (line_buf, strnlen (f, line_buf->left) + 1)) + f = read_string (line_buf); + if (f == NULL) return 0; - dir_index = (unsigned int)read_uleb128 (line_buf); + dir_index = read_uleb128 (line_buf); /* Ignore that time and length. */ read_uleb128 (line_buf); read_uleb128 (line_buf); @@ -1909,7 +3098,7 @@ read_line_program (struct backtrace_state *state, struct dwarf_data *ddata, size_t f_len; char *p; - if (dir_index == 0) + if (dir_index == 0 && hdr->version < 5) dir = u->comp_dir; else if (dir_index - 1 < hdr->dirs_count) dir = hdr->dirs[dir_index - 1]; @@ -2055,31 +3244,25 @@ read_line_info (struct backtrace_state *state, struct dwarf_data *ddata, memset (hdr, 0, sizeof *hdr); if (u->lineoff != (off_t) (size_t) u->lineoff - || (size_t) u->lineoff >= ddata->dwarf_line_size) + || (size_t) u->lineoff >= ddata->dwarf_sections.size[DEBUG_LINE]) { error_callback (data, "unit line offset out of range", 0); goto fail; } line_buf.name = ".debug_line"; - line_buf.start = ddata->dwarf_line; - line_buf.buf = ddata->dwarf_line + u->lineoff; - line_buf.left = ddata->dwarf_line_size - u->lineoff; + line_buf.start = ddata->dwarf_sections.data[DEBUG_LINE]; + line_buf.buf = ddata->dwarf_sections.data[DEBUG_LINE] + u->lineoff; + line_buf.left = ddata->dwarf_sections.size[DEBUG_LINE] - u->lineoff; line_buf.is_bigendian = ddata->is_bigendian; line_buf.error_callback = error_callback; line_buf.data = data; line_buf.reported_underflow = 0; - is_dwarf64 = 0; - len = read_uint32 (&line_buf); - if (len == 0xffffffff) - { - len = read_uint64 (&line_buf); - is_dwarf64 = 1; - } + len = read_initial_length (&line_buf, &is_dwarf64); line_buf.left = len; - if (!read_line_header (state, u, is_dwarf64, &line_buf, hdr)) + if (!read_line_header (state, ddata, u, is_dwarf64, &line_buf, hdr)) goto fail; if (!read_line_program (state, ddata, u, hdr, &line_buf, &vec)) @@ -2119,15 +3302,69 @@ read_line_info (struct backtrace_state *state, struct dwarf_data *ddata, return 1; fail: - vec.vec.alc += vec.vec.size; - vec.vec.size = 0; - backtrace_vector_release (state, &vec.vec, error_callback, data); + backtrace_vector_free (state, &vec.vec, error_callback, data); free_line_header (state, hdr, error_callback, data); *lines = (struct line *) (uintptr_t) -1; *lines_count = 0; return 0; } +static const char *read_referenced_name (struct dwarf_data *, struct unit *, + uint64_t, backtrace_error_callback, + void *); + +/* Read the name of a function from a DIE referenced by ATTR with VAL. */ + +static const char * +read_referenced_name_from_attr (struct dwarf_data *ddata, struct unit *u, + struct attr *attr, struct attr_val *val, + backtrace_error_callback error_callback, + void *data) +{ + switch (attr->name) + { + case DW_AT_abstract_origin: + case DW_AT_specification: + break; + default: + return NULL; + } + + if (attr->form == DW_FORM_ref_sig8) + return NULL; + + if (val->encoding == ATTR_VAL_REF_INFO) + { + struct unit *unit + = find_unit (ddata->units, ddata->units_count, + val->u.uint); + if (unit == NULL) + return NULL; + + uint64_t offset = val->u.uint - unit->low_offset; + return read_referenced_name (ddata, unit, offset, error_callback, data); + } + + if (val->encoding == ATTR_VAL_UINT + || val->encoding == ATTR_VAL_REF_UNIT) + return read_referenced_name (ddata, u, val->u.uint, error_callback, data); + + if (val->encoding == ATTR_VAL_REF_ALT_INFO) + { + struct unit *alt_unit + = find_unit (ddata->altlink->units, ddata->altlink->units_count, + val->u.uint); + if (alt_unit == NULL) + return NULL; + + uint64_t offset = val->u.uint - alt_unit->low_offset; + return read_referenced_name (ddata->altlink, alt_unit, offset, + error_callback, data); + } + + return NULL; +} + /* Read the name of a function from a DIE referenced by a DW_AT_abstract_origin or DW_AT_specification tag. OFFSET is within the same compilation unit. */ @@ -2159,7 +3396,7 @@ read_referenced_name (struct dwarf_data *ddata, struct unit *u, offset -= u->unit_data_offset; unit_buf.name = ".debug_info"; - unit_buf.start = ddata->dwarf_info; + unit_buf.start = ddata->dwarf_sections.data[DEBUG_INFO]; unit_buf.buf = u->unit_data + offset; unit_buf.left = u->unit_data_len - offset; unit_buf.is_bigendian = ddata->is_bigendian; @@ -2183,45 +3420,52 @@ read_referenced_name (struct dwarf_data *ddata, struct unit *u, { struct attr_val val; - if (!read_attribute (abbrev->attrs[i].form, &unit_buf, - u->is_dwarf64, u->version, u->addrsize, - ddata->dwarf_str, ddata->dwarf_str_size, - &val)) + if (!read_attribute (abbrev->attrs[i].form, abbrev->attrs[i].val, + &unit_buf, u->is_dwarf64, u->version, u->addrsize, + &ddata->dwarf_sections, ddata->altlink, &val)) return NULL; switch (abbrev->attrs[i].name) { case DW_AT_name: - /* We prefer the linkage name if get one. */ - if (val.encoding == ATTR_VAL_STRING) - ret = val.u.string; + /* Third name preference: don't override. A name we found in some + other way, will normally be more useful -- e.g., this name is + normally not mangled. */ + if (ret != NULL) + break; + if (!resolve_string (&ddata->dwarf_sections, u->is_dwarf64, + ddata->is_bigendian, u->str_offsets_base, + &val, error_callback, data, &ret)) + return NULL; break; case DW_AT_linkage_name: case DW_AT_MIPS_linkage_name: - if (val.encoding == ATTR_VAL_STRING) - return val.u.string; + /* First name preference: override all. */ + { + const char *s; + + s = NULL; + if (!resolve_string (&ddata->dwarf_sections, u->is_dwarf64, + ddata->is_bigendian, u->str_offsets_base, + &val, error_callback, data, &s)) + return NULL; + if (s != NULL) + return s; + } break; case DW_AT_specification: - if (abbrev->attrs[i].form == DW_FORM_ref_addr - || abbrev->attrs[i].form == DW_FORM_ref_sig8) - { - /* This refers to a specification defined in some other - compilation unit. We can handle this case if we - must, but it's harder. */ - break; - } - if (val.encoding == ATTR_VAL_UINT - || val.encoding == ATTR_VAL_REF_UNIT) - { - const char *name; + /* Second name preference: override DW_AT_name, don't override + DW_AT_linkage_name. */ + { + const char *name; - name = read_referenced_name (ddata, u, val.u.uint, - error_callback, data); - if (name != NULL) - ret = name; - } + name = read_referenced_name_from_attr (ddata, u, &abbrev->attrs[i], + &val, error_callback, data); + if (name != NULL) + ret = name; + } break; default: @@ -2232,25 +3476,22 @@ read_referenced_name (struct dwarf_data *ddata, struct unit *u, return ret; } -/* Add a single range to U that maps to function. Returns 1 on - success, 0 on error. */ +/* Add a range to a unit that maps to a function. This is called via + add_ranges. Returns 1 on success, 0 on error. */ static int -add_function_range (struct backtrace_state *state, struct dwarf_data *ddata, - struct function *function, uint64_t lowpc, uint64_t highpc, - backtrace_error_callback error_callback, - void *data, struct function_vector *vec) +add_function_range (struct backtrace_state *state, void *rdata, + uint64_t lowpc, uint64_t highpc, + backtrace_error_callback error_callback, void *data, + void *pvec) { + struct function *function = (struct function *) rdata; + struct function_vector *vec = (struct function_vector *) pvec; struct function_addrs *p; - /* Add in the base address here, so that we can look up the PC - directly. */ - lowpc += ddata->base_address; - highpc += ddata->base_address; - if (vec->count > 0) { - p = (struct function_addrs *) vec->vec.base + vec->count - 1; + p = (struct function_addrs *) vec->vec.base + (vec->count - 1); if ((lowpc == p->high || lowpc == p->high + 1) && function == p->function) { @@ -2269,63 +3510,8 @@ add_function_range (struct backtrace_state *state, struct dwarf_data *ddata, p->low = lowpc; p->high = highpc; p->function = function; - ++vec->count; - return 1; -} - -/* Add PC ranges to U that map to FUNCTION. Returns 1 on success, 0 - on error. */ - -static int -add_function_ranges (struct backtrace_state *state, struct dwarf_data *ddata, - struct unit *u, struct function *function, - uint64_t ranges, uint64_t base, - backtrace_error_callback error_callback, void *data, - struct function_vector *vec) -{ - struct dwarf_buf ranges_buf; - - if (ranges >= ddata->dwarf_ranges_size) - { - error_callback (data, "function ranges offset out of range", 0); - return 0; - } - - ranges_buf.name = ".debug_ranges"; - ranges_buf.start = ddata->dwarf_ranges; - ranges_buf.buf = ddata->dwarf_ranges + ranges; - ranges_buf.left = ddata->dwarf_ranges_size - ranges; - ranges_buf.is_bigendian = ddata->is_bigendian; - ranges_buf.error_callback = error_callback; - ranges_buf.data = data; - ranges_buf.reported_underflow = 0; - while (1) - { - uint64_t low; - uint64_t high; - - if (ranges_buf.reported_underflow) - return 0; - - low = read_address (&ranges_buf, u->addrsize); - high = read_address (&ranges_buf, u->addrsize); - - if (low == 0 && high == 0) - break; - - if (is_highest_address (low, u->addrsize)) - base = high; - else - { - if (!add_function_range (state, ddata, function, low + base, - high + base, error_callback, data, vec)) - return 0; - } - } - - if (ranges_buf.reported_underflow) - return 0; + ++vec->count; return 1; } @@ -2349,13 +3535,8 @@ read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata, struct function *function; struct function_vector *vec; size_t i; - uint64_t lowpc; - int have_lowpc; - uint64_t highpc; - int have_highpc; - int highpc_is_relative; - uint64_t ranges; - int have_ranges; + struct pcrange pcrange; + int have_linkage_name; code = read_uleb128 (unit_buf); if (code == 0) @@ -2385,29 +3566,34 @@ read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata, memset (function, 0, sizeof *function); } - lowpc = 0; - have_lowpc = 0; - highpc = 0; - have_highpc = 0; - highpc_is_relative = 0; - ranges = 0; - have_ranges = 0; + memset (&pcrange, 0, sizeof pcrange); + have_linkage_name = 0; for (i = 0; i < abbrev->num_attrs; ++i) { struct attr_val val; - if (!read_attribute (abbrev->attrs[i].form, unit_buf, - u->is_dwarf64, u->version, u->addrsize, - ddata->dwarf_str, ddata->dwarf_str_size, - &val)) + if (!read_attribute (abbrev->attrs[i].form, abbrev->attrs[i].val, + unit_buf, u->is_dwarf64, u->version, + u->addrsize, &ddata->dwarf_sections, + ddata->altlink, &val)) return 0; /* The compile unit sets the base address for any address ranges in the function entries. */ if (abbrev->tag == DW_TAG_compile_unit - && abbrev->attrs[i].name == DW_AT_low_pc - && val.encoding == ATTR_VAL_ADDRESS) - base = val.u.uint; + && abbrev->attrs[i].name == DW_AT_low_pc) + { + if (val.encoding == ATTR_VAL_ADDRESS) + base = val.u.uint; + else if (val.encoding == ATTR_VAL_ADDRESS_INDEX) + { + if (!resolve_addr_index (&ddata->dwarf_sections, + u->addr_base, u->addrsize, + ddata->is_bigendian, val.u.uint, + error_callback, data, &base)) + return 0; + } + } if (is_function) { @@ -2435,78 +3621,60 @@ read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata, case DW_AT_call_line: if (val.encoding == ATTR_VAL_UINT) - function->caller_lineno = (int)val.u.uint; + function->caller_lineno = val.u.uint; break; case DW_AT_abstract_origin: case DW_AT_specification: - if (abbrev->attrs[i].form == DW_FORM_ref_addr - || abbrev->attrs[i].form == DW_FORM_ref_sig8) - { - /* This refers to an abstract origin defined in - some other compilation unit. We can handle - this case if we must, but it's harder. */ - break; - } - if (val.encoding == ATTR_VAL_UINT - || val.encoding == ATTR_VAL_REF_UNIT) - { - const char *name; - - name = read_referenced_name (ddata, u, val.u.uint, - error_callback, data); - if (name != NULL) - function->name = name; - } + /* Second name preference: override DW_AT_name, don't override + DW_AT_linkage_name. */ + if (have_linkage_name) + break; + { + const char *name; + + name + = read_referenced_name_from_attr (ddata, u, + &abbrev->attrs[i], &val, + error_callback, data); + if (name != NULL) + function->name = name; + } break; case DW_AT_name: - if (val.encoding == ATTR_VAL_STRING) - { - /* Don't override a name we found in some other - way, as it will normally be more - useful--e.g., this name is normally not - mangled. */ - if (function->name == NULL) - function->name = val.u.string; - } + /* Third name preference: don't override. */ + if (function->name != NULL) + break; + if (!resolve_string (&ddata->dwarf_sections, u->is_dwarf64, + ddata->is_bigendian, + u->str_offsets_base, &val, + error_callback, data, &function->name)) + return 0; break; case DW_AT_linkage_name: case DW_AT_MIPS_linkage_name: - if (val.encoding == ATTR_VAL_STRING) - function->name = val.u.string; - break; - - case DW_AT_low_pc: - if (val.encoding == ATTR_VAL_ADDRESS) - { - lowpc = val.u.uint; - have_lowpc = 1; - } - break; + /* First name preference: override all. */ + { + const char *s; - case DW_AT_high_pc: - if (val.encoding == ATTR_VAL_ADDRESS) - { - highpc = val.u.uint; - have_highpc = 1; - } - else if (val.encoding == ATTR_VAL_UINT) - { - highpc = val.u.uint; - have_highpc = 1; - highpc_is_relative = 1; - } + s = NULL; + if (!resolve_string (&ddata->dwarf_sections, u->is_dwarf64, + ddata->is_bigendian, + u->str_offsets_base, &val, + error_callback, data, &s)) + return 0; + if (s != NULL) + { + function->name = s; + have_linkage_name = 1; + } + } break; - case DW_AT_ranges: - if (val.encoding == ATTR_VAL_UINT - || val.encoding == ATTR_VAL_REF_SECTION) - { - ranges = val.u.uint; - have_ranges = 1; - } + case DW_AT_low_pc: case DW_AT_high_pc: case DW_AT_ranges: + update_pcrange (&abbrev->attrs[i], &val, &pcrange); break; default: @@ -2526,18 +3694,14 @@ read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata, if (is_function) { - if (have_ranges) - { - if (!add_function_ranges (state, ddata, u, function, ranges, - base, error_callback, data, vec)) - return 0; - } - else if (have_lowpc && have_highpc) + if (pcrange.have_ranges + || (pcrange.have_lowpc && pcrange.have_highpc)) { - if (highpc_is_relative) - highpc += lowpc; - if (!add_function_range (state, ddata, function, lowpc, highpc, - error_callback, data, vec)) + if (!add_ranges (state, &ddata->dwarf_sections, + ddata->base_address, ddata->is_bigendian, + u, base, &pcrange, add_function_range, + (void *) function, error_callback, data, + (void *) vec)) return 0; } else @@ -2621,7 +3785,7 @@ read_function_info (struct backtrace_state *state, struct dwarf_data *ddata, } unit_buf.name = ".debug_info"; - unit_buf.start = ddata->dwarf_info; + unit_buf.start = ddata->dwarf_sections.data[DEBUG_INFO]; unit_buf.buf = u->unit_data; unit_buf.left = u->unit_data_len; unit_buf.is_bigendian = ddata->is_bigendian; @@ -2744,8 +3908,10 @@ dwarf_lookup_pc (struct backtrace_state *state, struct dwarf_data *ddata, *found = 1; /* Find an address range that includes PC. */ - entry = bsearch (&pc, ddata->addrs, ddata->addrs_count, - sizeof (struct unit_addrs), unit_addrs_search); + entry = (ddata->addrs_count == 0 + ? NULL + : bsearch (&pc, ddata->addrs, ddata->addrs_count, + sizeof (struct unit_addrs), unit_addrs_search)); if (entry == NULL) { @@ -2873,11 +4039,11 @@ dwarf_lookup_pc (struct backtrace_state *state, struct dwarf_data *ddata, if (entry->u->abs_filename == NULL) { - const char *filename1; + const char *filename; - filename1 = entry->u->filename; - if (filename1 != NULL - && !IS_ABSOLUTE_PATH (filename1) + filename = entry->u->filename; + if (filename != NULL + && !IS_ABSOLUTE_PATH (filename) && entry->u->comp_dir != NULL) { size_t filename_len; @@ -2885,7 +4051,7 @@ dwarf_lookup_pc (struct backtrace_state *state, struct dwarf_data *ddata, size_t dir_len; char *s; - filename_len = strlen (filename1); + filename_len = strlen (filename); dir = entry->u->comp_dir; dir_len = strlen (dir); s = (char *) backtrace_alloc (state, dir_len + filename_len + 2, @@ -2898,10 +4064,10 @@ dwarf_lookup_pc (struct backtrace_state *state, struct dwarf_data *ddata, memcpy (s, dir, dir_len); /* FIXME: Should use backslash if DOS file system. */ s[dir_len] = '/'; - memcpy (s + dir_len + 1, filename1, filename_len + 1); - filename1 = s; + memcpy (s + dir_len + 1, filename, filename_len + 1); + filename = s; } - entry->u->abs_filename = filename1; + entry->u->abs_filename = filename; } return callback (data, pc, entry->u->abs_filename, 0, NULL); @@ -2998,37 +4164,36 @@ dwarf_fileline (struct backtrace_state *state, uintptr_t pc, static struct dwarf_data * build_dwarf_data (struct backtrace_state *state, uintptr_t base_address, - const unsigned char *dwarf_info, - size_t dwarf_info_size, - const unsigned char *dwarf_line, - size_t dwarf_line_size, - const unsigned char *dwarf_abbrev, - size_t dwarf_abbrev_size, - const unsigned char *dwarf_ranges, - size_t dwarf_ranges_size, - const unsigned char *dwarf_str, - size_t dwarf_str_size, + const struct dwarf_sections *dwarf_sections, int is_bigendian, + struct dwarf_data *altlink, backtrace_error_callback error_callback, void *data) { struct unit_addrs_vector addrs_vec; struct unit_addrs *addrs; size_t addrs_count; + struct unit_vector units_vec; + struct unit **units; + size_t units_count; struct dwarf_data *fdata; - if (!build_address_map (state, base_address, dwarf_info, dwarf_info_size, - dwarf_abbrev, dwarf_abbrev_size, dwarf_ranges, - dwarf_ranges_size, dwarf_str, dwarf_str_size, - is_bigendian, error_callback, data, &addrs_vec)) + if (!build_address_map (state, base_address, dwarf_sections, is_bigendian, + altlink, error_callback, data, &addrs_vec, + &units_vec)) return NULL; if (!backtrace_vector_release (state, &addrs_vec.vec, error_callback, data)) return NULL; + if (!backtrace_vector_release (state, &units_vec.vec, error_callback, data)) + return NULL; addrs = (struct unit_addrs *) addrs_vec.vec.base; + units = (struct unit **) units_vec.vec.base; addrs_count = addrs_vec.count; + units_count = units_vec.count; backtrace_qsort (addrs, addrs_count, sizeof (struct unit_addrs), unit_addrs_compare); + /* No qsort for units required, already sorted. */ fdata = ((struct dwarf_data *) backtrace_alloc (state, sizeof (struct dwarf_data), @@ -3037,17 +4202,13 @@ build_dwarf_data (struct backtrace_state *state, return NULL; fdata->next = NULL; + fdata->altlink = altlink; fdata->base_address = base_address; fdata->addrs = addrs; fdata->addrs_count = addrs_count; - fdata->dwarf_info = dwarf_info; - fdata->dwarf_info_size = dwarf_info_size; - fdata->dwarf_line = dwarf_line; - fdata->dwarf_line_size = dwarf_line_size; - fdata->dwarf_ranges = dwarf_ranges; - fdata->dwarf_ranges_size = dwarf_ranges_size; - fdata->dwarf_str = dwarf_str; - fdata->dwarf_str_size = dwarf_str_size; + fdata->units = units; + fdata->units_count = units_count; + fdata->dwarf_sections = *dwarf_sections; fdata->is_bigendian = is_bigendian; memset (&fdata->fvec, 0, sizeof fdata->fvec); @@ -3061,30 +4222,23 @@ build_dwarf_data (struct backtrace_state *state, int backtrace_dwarf_add (struct backtrace_state *state, uintptr_t base_address, - const unsigned char *dwarf_info, - size_t dwarf_info_size, - const unsigned char *dwarf_line, - size_t dwarf_line_size, - const unsigned char *dwarf_abbrev, - size_t dwarf_abbrev_size, - const unsigned char *dwarf_ranges, - size_t dwarf_ranges_size, - const unsigned char *dwarf_str, - size_t dwarf_str_size, + const struct dwarf_sections *dwarf_sections, int is_bigendian, + struct dwarf_data *fileline_altlink, backtrace_error_callback error_callback, - void *data, fileline *fileline_fn) + void *data, fileline *fileline_fn, + struct dwarf_data **fileline_entry) { struct dwarf_data *fdata; - fdata = build_dwarf_data (state, base_address, dwarf_info, dwarf_info_size, - dwarf_line, dwarf_line_size, dwarf_abbrev, - dwarf_abbrev_size, dwarf_ranges, dwarf_ranges_size, - dwarf_str, dwarf_str_size, is_bigendian, - error_callback, data); + fdata = build_dwarf_data (state, base_address, dwarf_sections, is_bigendian, + fileline_altlink, error_callback, data); if (fdata == NULL) return 0; + if (fileline_entry != NULL) + *fileline_entry = fdata; + if (!state->threaded) { struct dwarf_data **pp; diff --git a/3rdparty/libbacktrace/edtest.c b/3rdparty/libbacktrace/edtest.c index 3a2cac411e6..d0b28a29db3 100644 --- a/3rdparty/libbacktrace/edtest.c +++ b/3rdparty/libbacktrace/edtest.c @@ -1,5 +1,5 @@ /* edtest.c -- Test for libbacktrace storage allocation stress handling - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2020 Free Software Foundation, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -43,8 +43,7 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "testlib.h" -static int test1 (void) __attribute__ ((noinline, unused)); -static int test1 (void) __attribute__ ((noinline, unused)); +static int test1 (void) __attribute__ ((noinline, noclone, unused)); extern int f2 (int); extern int f3 (int, int); diff --git a/3rdparty/libbacktrace/edtest2.c b/3rdparty/libbacktrace/edtest2.c index e0c0470be9b..48c26cc629e 100644 --- a/3rdparty/libbacktrace/edtest2.c +++ b/3rdparty/libbacktrace/edtest2.c @@ -1,5 +1,5 @@ /* edtest2.c -- Test for libbacktrace storage allocation stress handling (p2) - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2020 Free Software Foundation, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/3rdparty/libbacktrace/elf.c b/3rdparty/libbacktrace/elf.c index 51e27b9331f..1216af86fd9 100644 --- a/3rdparty/libbacktrace/elf.c +++ b/3rdparty/libbacktrace/elf.c @@ -1,5 +1,5 @@ /* elf.c -- Get debug data from an ELF file for backtraces. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -337,41 +337,19 @@ typedef struct #define ELFCOMPRESS_ZLIB 1 -/* An index of ELF sections we care about. */ +/* Names of sections, indexed by enum dwarf_section in internal.h. */ -enum debug_section -{ - DEBUG_INFO, - DEBUG_LINE, - DEBUG_ABBREV, - DEBUG_RANGES, - DEBUG_STR, - - /* The old style compressed sections. This list must correspond to - the list of normal debug sections. */ - ZDEBUG_INFO, - ZDEBUG_LINE, - ZDEBUG_ABBREV, - ZDEBUG_RANGES, - ZDEBUG_STR, - - DEBUG_MAX -}; - -/* Names of sections, indexed by enum elf_section. */ - -static const char * const debug_section_names[DEBUG_MAX] = +static const char * const dwarf_section_names[DEBUG_MAX] = { ".debug_info", ".debug_line", ".debug_abbrev", ".debug_ranges", ".debug_str", - ".zdebug_info", - ".zdebug_line", - ".zdebug_abbrev", - ".zdebug_ranges", - ".zdebug_str" + ".debug_addr", + ".debug_str_offsets", + ".debug_line_str", + ".debug_rnglists" }; /* Information we gather for the sections we care about. */ @@ -809,6 +787,8 @@ elf_readlink (struct backtrace_state *state, const char *filename, } } +#define SYSTEM_BUILD_ID_DIR "/usr/lib/debug/.build-id/" + /* Open a separate debug info file, using the build ID to find it. Returns an open file descriptor, or -1. @@ -821,7 +801,7 @@ elf_open_debugfile_by_buildid (struct backtrace_state *state, backtrace_error_callback error_callback, void *data) { - const char * const prefix = "/usr/lib/debug/.build-id/"; + const char * const prefix = SYSTEM_BUILD_ID_DIR; const size_t prefix_len = strlen (prefix); const char * const suffix = ".debug"; const size_t suffix_len = strlen (suffix); @@ -2638,7 +2618,8 @@ static int elf_add (struct backtrace_state *state, const char *filename, int descriptor, uintptr_t base_address, backtrace_error_callback error_callback, void *data, fileline *fileline_fn, int *found_sym, int *found_dwarf, - int exe, int debuginfo) + struct dwarf_data **fileline_entry, int exe, int debuginfo, + const char *with_buildid_data, uint32_t with_buildid_size) { struct backtrace_view ehdr_view; b_elf_ehdr ehdr; @@ -2658,6 +2639,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, unsigned int dynsym_shndx; unsigned int i; struct debug_section_info sections[DEBUG_MAX]; + struct debug_section_info zsections[DEBUG_MAX]; struct backtrace_view symtab_view; int symtab_view_valid; struct backtrace_view strtab_view; @@ -2670,13 +2652,22 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, int debuglink_view_valid; const char *debuglink_name; uint32_t debuglink_crc; + struct backtrace_view debugaltlink_view; + int debugaltlink_view_valid; + const char *debugaltlink_name; + const char *debugaltlink_buildid_data; + uint32_t debugaltlink_buildid_size; off_t min_offset; off_t max_offset; + off_t debug_size; struct backtrace_view debug_view; int debug_view_valid; unsigned int using_debug_view; uint16_t *zdebug_table; + struct backtrace_view split_debug_view[DEBUG_MAX]; + unsigned char split_debug_view_valid[DEBUG_MAX]; struct elf_ppc64_opd_data opd_data, *opd; + struct dwarf_sections dwarf_sections; if (!debuginfo) { @@ -2694,7 +2685,12 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, debuglink_view_valid = 0; debuglink_name = NULL; debuglink_crc = 0; + debugaltlink_view_valid = 0; + debugaltlink_name = NULL; + debugaltlink_buildid_data = NULL; + debugaltlink_buildid_size = 0; debug_view_valid = 0; + memset (&split_debug_view_valid[0], 0, sizeof split_debug_view_valid); opd = NULL; if (!backtrace_get_view (state, descriptor, 0, sizeof ehdr, error_callback, @@ -2761,7 +2757,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, shdr = (const b_elf_shdr *) shdr_view.data; if (shnum == 0) - shnum = (unsigned int)shdr->sh_size; + shnum = shdr->sh_size; if (shstrndx == SHN_XINDEX) { @@ -2803,7 +2799,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, shstr_size = shstrhdr->sh_size; shstr_off = shstrhdr->sh_offset; - if (!backtrace_get_view (state, descriptor, shstr_off, shstr_size, + if (!backtrace_get_view (state, descriptor, shstr_off, shstrhdr->sh_size, error_callback, data, &names_view)) goto fail; names_view_valid = 1; @@ -2813,6 +2809,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, dynsym_shndx = 0; memset (sections, 0, sizeof sections); + memset (zsections, 0, sizeof zsections); /* Look for the symbol table. */ for (i = 1; i < shnum; ++i) @@ -2840,7 +2837,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, for (j = 0; j < (int) DEBUG_MAX; ++j) { - if (strcmp (name, debug_section_names[j]) == 0) + if (strcmp (name, dwarf_section_names[j]) == 0) { sections[j].offset = shdr->sh_offset; sections[j].size = shdr->sh_size; @@ -2849,10 +2846,23 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, } } + if (name[0] == '.' && name[1] == 'z') + { + for (j = 0; j < (int) DEBUG_MAX; ++j) + { + if (strcmp (name + 2, dwarf_section_names[j] + 1) == 0) + { + zsections[j].offset = shdr->sh_offset; + zsections[j].size = shdr->sh_size; + break; + } + } + } + /* Read the build ID if present. This could check for any SHT_NOTE section with the right note name and type, but gdb looks for a specific section name. */ - if (!debuginfo + if ((!debuginfo || with_buildid_data != NULL) && !buildid_view_valid && strcmp (name, ".note.gnu.build-id") == 0) { @@ -2868,11 +2878,20 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, if (note->type == NT_GNU_BUILD_ID && note->namesz == 4 && strncmp (note->name, "GNU", 4) == 0 - && shdr->sh_size < 12 + ((note->namesz + 3) & ~ 3) + note->descsz) + && shdr->sh_size <= 12 + ((note->namesz + 3) & ~ 3) + note->descsz) { buildid_data = ¬e->name[0] + ((note->namesz + 3) & ~ 3); buildid_size = note->descsz; } + + if (with_buildid_size != 0) + { + if (buildid_size != with_buildid_size) + goto fail; + + if (memcmp (buildid_data, with_buildid_data, buildid_size) != 0) + goto fail; + } } /* Read the debuglink file if present. */ @@ -2899,6 +2918,32 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, } } + if (!debugaltlink_view_valid + && strcmp (name, ".gnu_debugaltlink") == 0) + { + const char *debugaltlink_data; + size_t debugaltlink_name_len; + + if (!backtrace_get_view (state, descriptor, shdr->sh_offset, + shdr->sh_size, error_callback, data, + &debugaltlink_view)) + goto fail; + + debugaltlink_view_valid = 1; + debugaltlink_data = (const char *) debugaltlink_view.data; + debugaltlink_name = debugaltlink_data; + debugaltlink_name_len = strnlen (debugaltlink_data, shdr->sh_size); + if (debugaltlink_name_len < shdr->sh_size) + { + /* Include terminating zero. */ + debugaltlink_name_len += 1; + + debugaltlink_buildid_data + = debugaltlink_data + debugaltlink_name_len; + debugaltlink_buildid_size = shdr->sh_size - debugaltlink_name_len; + } + } + /* Read the .opd section on PowerPC64 ELFv1. */ if (ehdr.e_machine == EM_PPC64 && (ehdr.e_flags & EF_PPC64_ABI) < 2 @@ -2966,6 +3011,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, string table permanently. */ backtrace_release_view (state, &symtab_view, error_callback, data); symtab_view_valid = 0; + strtab_view_valid = 0; *found_sym = 1; @@ -2993,8 +3039,12 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, if (debuglink_view_valid) backtrace_release_view (state, &debuglink_view, error_callback, data); - ret = elf_add (state, NULL, d, base_address, error_callback, data, - fileline_fn, found_sym, found_dwarf, 0, 1); + if (debugaltlink_view_valid) + backtrace_release_view (state, &debugaltlink_view, error_callback, + data); + ret = elf_add (state, "", d, base_address, error_callback, data, + fileline_fn, found_sym, found_dwarf, NULL, 0, 1, NULL, + 0); if (ret < 0) backtrace_close (d, error_callback, data); else @@ -3028,8 +3078,12 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, backtrace_release_view (state, &debuglink_view, error_callback, data); - ret = elf_add (state, NULL, d, base_address, error_callback, data, - fileline_fn, found_sym, found_dwarf, 0, 1); + if (debugaltlink_view_valid) + backtrace_release_view (state, &debugaltlink_view, error_callback, + data); + ret = elf_add (state, "", d, base_address, error_callback, data, + fileline_fn, found_sym, found_dwarf, NULL, 0, 1, NULL, + 0); if (ret < 0) backtrace_close (d, error_callback, data); else @@ -3044,22 +3098,67 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, debuglink_view_valid = 0; } + struct dwarf_data *fileline_altlink = NULL; + if (debugaltlink_name != NULL) + { + int d; + + d = elf_open_debugfile_by_debuglink (state, filename, debugaltlink_name, + 0, error_callback, data); + if (d >= 0) + { + int ret; + + ret = elf_add (state, filename, d, base_address, error_callback, data, + fileline_fn, found_sym, found_dwarf, &fileline_altlink, + 0, 1, debugaltlink_buildid_data, + debugaltlink_buildid_size); + backtrace_release_view (state, &debugaltlink_view, error_callback, + data); + debugaltlink_view_valid = 0; + if (ret < 0) + { + backtrace_close (d, error_callback, data); + return ret; + } + } + } + + if (debugaltlink_view_valid) + { + backtrace_release_view (state, &debugaltlink_view, error_callback, data); + debugaltlink_view_valid = 0; + } + /* Read all the debug sections in a single view, since they are - probably adjacent in the file. We never release this view. */ + probably adjacent in the file. If any of sections are + uncompressed, we never release this view. */ min_offset = 0; max_offset = 0; + debug_size = 0; for (i = 0; i < (int) DEBUG_MAX; ++i) { off_t end; - if (sections[i].size == 0) - continue; - if (min_offset == 0 || sections[i].offset < min_offset) - min_offset = sections[i].offset; - end = sections[i].offset + sections[i].size; - if (end > max_offset) - max_offset = end; + if (sections[i].size != 0) + { + if (min_offset == 0 || sections[i].offset < min_offset) + min_offset = sections[i].offset; + end = sections[i].offset + sections[i].size; + if (end > max_offset) + max_offset = end; + debug_size += sections[i].size; + } + if (zsections[i].size != 0) + { + if (min_offset == 0 || zsections[i].offset < min_offset) + min_offset = zsections[i].offset; + end = zsections[i].offset + zsections[i].size; + if (end > max_offset) + max_offset = end; + debug_size += zsections[i].size; + } } if (min_offset == 0 || max_offset == 0) { @@ -3068,11 +3167,45 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, return 1; } - if (!backtrace_get_view (state, descriptor, min_offset, - max_offset - min_offset, - error_callback, data, &debug_view)) - goto fail; - debug_view_valid = 1; + /* If the total debug section size is large, assume that there are + gaps between the sections, and read them individually. */ + + if (max_offset - min_offset < 0x20000000 + || max_offset - min_offset < debug_size + 0x10000) + { + if (!backtrace_get_view (state, descriptor, min_offset, + max_offset - min_offset, + error_callback, data, &debug_view)) + goto fail; + debug_view_valid = 1; + } + else + { + memset (&split_debug_view[0], 0, sizeof split_debug_view); + for (i = 0; i < (int) DEBUG_MAX; ++i) + { + struct debug_section_info *dsec; + + if (sections[i].size != 0) + dsec = §ions[i]; + else if (zsections[i].size != 0) + dsec = &zsections[i]; + else + continue; + + if (!backtrace_get_view (state, descriptor, dsec->offset, dsec->size, + error_callback, data, &split_debug_view[i])) + goto fail; + split_debug_view_valid[i] = 1; + + if (sections[i].size != 0) + sections[i].data = ((const unsigned char *) + split_debug_view[i].data); + else + zsections[i].data = ((const unsigned char *) + split_debug_view[i].data); + } + } /* We've read all we need from the executable. */ if (!backtrace_close (descriptor, error_callback, data)) @@ -3080,28 +3213,33 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, descriptor = -1; using_debug_view = 0; - for (i = 0; i < (int) DEBUG_MAX; ++i) + if (debug_view_valid) { - if (sections[i].size == 0) - sections[i].data = NULL; - else + for (i = 0; i < (int) DEBUG_MAX; ++i) { - sections[i].data = ((const unsigned char *) debug_view.data - + (sections[i].offset - min_offset)); - if (i < ZDEBUG_INFO) - ++using_debug_view; + if (sections[i].size == 0) + sections[i].data = NULL; + else + { + sections[i].data = ((const unsigned char *) debug_view.data + + (sections[i].offset - min_offset)); + ++using_debug_view; + } + + if (zsections[i].size == 0) + zsections[i].data = NULL; + else + zsections[i].data = ((const unsigned char *) debug_view.data + + (zsections[i].offset - min_offset)); } } /* Uncompress the old format (--compress-debug-sections=zlib-gnu). */ zdebug_table = NULL; - for (i = 0; i < ZDEBUG_INFO; ++i) + for (i = 0; i < (int) DEBUG_MAX; ++i) { - struct debug_section_info *pz; - - pz = §ions[i + ZDEBUG_INFO - DEBUG_INFO]; - if (sections[i].size == 0 && pz->size > 0) + if (sections[i].size == 0 && zsections[i].size > 0) { unsigned char *uncompressed_data; size_t uncompressed_size; @@ -3117,19 +3255,27 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, uncompressed_data = NULL; uncompressed_size = 0; - if (!elf_uncompress_zdebug (state, pz->data, pz->size, zdebug_table, + if (!elf_uncompress_zdebug (state, zsections[i].data, + zsections[i].size, zdebug_table, error_callback, data, &uncompressed_data, &uncompressed_size)) goto fail; sections[i].data = uncompressed_data; sections[i].size = uncompressed_size; sections[i].compressed = 0; + + if (split_debug_view_valid[i]) + { + backtrace_release_view (state, &split_debug_view[i], + error_callback, data); + split_debug_view_valid[i] = 0; + } } } /* Uncompress the official ELF format (--compress-debug-sections=zlib-gabi). */ - for (i = 0; i < ZDEBUG_INFO; ++i) + for (i = 0; i < (int) DEBUG_MAX; ++i) { unsigned char *uncompressed_data; size_t uncompressed_size; @@ -3156,7 +3302,14 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, sections[i].size = uncompressed_size; sections[i].compressed = 0; - --using_debug_view; + if (debug_view_valid) + --using_debug_view; + else if (split_debug_view_valid[i]) + { + backtrace_release_view (state, &split_debug_view[i], + error_callback, data); + split_debug_view_valid[i] = 0; + } } if (zdebug_table != NULL) @@ -3169,19 +3322,17 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, debug_view_valid = 0; } - if (!backtrace_dwarf_add (state, base_address, - sections[DEBUG_INFO].data, - sections[DEBUG_INFO].size, - sections[DEBUG_LINE].data, - sections[DEBUG_LINE].size, - sections[DEBUG_ABBREV].data, - sections[DEBUG_ABBREV].size, - sections[DEBUG_RANGES].data, - sections[DEBUG_RANGES].size, - sections[DEBUG_STR].data, - sections[DEBUG_STR].size, + for (i = 0; i < (int) DEBUG_MAX; ++i) + { + dwarf_sections.data[i] = sections[i].data; + dwarf_sections.size[i] = sections[i].size; + } + + if (!backtrace_dwarf_add (state, base_address, &dwarf_sections, ehdr.e_ident[EI_DATA] == ELFDATA2MSB, - error_callback, data, fileline_fn)) + fileline_altlink, + error_callback, data, fileline_fn, + fileline_entry)) goto fail; *found_dwarf = 1; @@ -3199,10 +3350,18 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, backtrace_release_view (state, &strtab_view, error_callback, data); if (debuglink_view_valid) backtrace_release_view (state, &debuglink_view, error_callback, data); + if (debugaltlink_view_valid) + backtrace_release_view (state, &debugaltlink_view, error_callback, data); if (buildid_view_valid) backtrace_release_view (state, &buildid_view, error_callback, data); if (debug_view_valid) backtrace_release_view (state, &debug_view, error_callback, data); + for (i = 0; i < (int) DEBUG_MAX; ++i) + { + if (split_debug_view_valid[i]) + backtrace_release_view (state, &split_debug_view[i], + error_callback, data); + } if (opd) backtrace_release_view (state, &opd->view, error_callback, data); if (descriptor != -1) @@ -3269,7 +3428,7 @@ phdr_callback (struct dl_phdr_info *info, size_t size ATTRIBUTE_UNUSED, if (elf_add (pd->state, filename, descriptor, info->dlpi_addr, pd->error_callback, pd->data, &elf_fileline_fn, pd->found_sym, - &found_dwarf, 0, 0)) + &found_dwarf, NULL, 0, 0, NULL, 0)) { if (found_dwarf) { @@ -3297,7 +3456,8 @@ backtrace_initialize (struct backtrace_state *state, const char *filename, struct phdr_data pd; ret = elf_add (state, filename, descriptor, 0, error_callback, data, - &elf_fileline_fn, &found_sym, &found_dwarf, 1, 0); + &elf_fileline_fn, &found_sym, &found_dwarf, NULL, 1, 0, NULL, + 0); if (!ret) return 0; diff --git a/3rdparty/libbacktrace/fileline.c b/3rdparty/libbacktrace/fileline.c index e5673068379..cc1011e8b5d 100644 --- a/3rdparty/libbacktrace/fileline.c +++ b/3rdparty/libbacktrace/fileline.c @@ -1,5 +1,5 @@ /* fileline.c -- Get file and line number information in a backtrace. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -39,6 +39,10 @@ POSSIBILITY OF SUCH DAMAGE. */ #include #include +#if defined (HAVE_KERN_PROC_ARGS) || defined (HAVE_KERN_PROC) +#include +#endif + #include "backtrace.h" #include "internal.h" @@ -46,6 +50,78 @@ POSSIBILITY OF SUCH DAMAGE. */ #define getexecname() NULL #endif +#if !defined (HAVE_KERN_PROC_ARGS) && !defined (HAVE_KERN_PROC) + +#define sysctl_exec_name1(state, error_callback, data) NULL +#define sysctl_exec_name2(state, error_callback, data) NULL + +#else /* defined (HAVE_KERN_PROC_ARGS) || |defined (HAVE_KERN_PROC) */ + +static char * +sysctl_exec_name (struct backtrace_state *state, + int mib0, int mib1, int mib2, int mib3, + backtrace_error_callback error_callback, void *data) +{ + int mib[4]; + size_t len; + char *name; + size_t rlen; + + mib[0] = mib0; + mib[1] = mib1; + mib[2] = mib2; + mib[3] = mib3; + + if (sysctl (mib, 4, NULL, &len, NULL, 0) < 0) + return NULL; + name = (char *) backtrace_alloc (state, len, error_callback, data); + if (name == NULL) + return NULL; + rlen = len; + if (sysctl (mib, 4, name, &rlen, NULL, 0) < 0) + { + backtrace_free (state, name, len, error_callback, data); + return NULL; + } + return name; +} + +#ifdef HAVE_KERN_PROC_ARGS + +static char * +sysctl_exec_name1 (struct backtrace_state *state, + backtrace_error_callback error_callback, void *data) +{ + /* This variant is used on NetBSD. */ + return sysctl_exec_name (state, CTL_KERN, KERN_PROC_ARGS, -1, + KERN_PROC_PATHNAME, error_callback, data); +} + +#else + +#define sysctl_exec_name1(state, error_callback, data) NULL + +#endif + +#ifdef HAVE_KERN_PROC + +static char * +sysctl_exec_name2 (struct backtrace_state *state, + backtrace_error_callback error_callback, void *data) +{ + /* This variant is used on FreeBSD. */ + return sysctl_exec_name (state, CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1, + error_callback, data); +} + +#else + +#define sysctl_exec_name2(state, error_callback, data) NULL + +#endif + +#endif /* defined (HAVE_KERN_PROC_ARGS) || |defined (HAVE_KERN_PROC) */ + /* Initialize the fileline information from the executable. Returns 1 on success, 0 on failure. */ @@ -83,7 +159,7 @@ fileline_initialize (struct backtrace_state *state, descriptor = -1; called_error_callback = 0; - for (pass = 0; pass < 5; ++pass) + for (pass = 0; pass < 7; ++pass) { int does_not_exist; @@ -106,6 +182,12 @@ fileline_initialize (struct backtrace_state *state, (long) getpid ()); filename = buf; break; + case 5: + filename = sysctl_exec_name1 (state, error_callback, data); + break; + case 6: + filename = sysctl_exec_name2 (state, error_callback, data); + break; default: abort (); } diff --git a/3rdparty/libbacktrace/filenames.h b/3rdparty/libbacktrace/filenames.h index 2dcd6643a21..aa7bd7adff5 100644 --- a/3rdparty/libbacktrace/filenames.h +++ b/3rdparty/libbacktrace/filenames.h @@ -44,6 +44,9 @@ POSSIBILITY OF SUCH DAMAGE. */ #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__) # define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\') +# define HAS_DRIVE_SPEC(f) ((f)[0] != '\0' && (f)[1] == ':') +# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || HAS_DRIVE_SPEC(f)) #else # define IS_DIR_SEPARATOR(c) ((c) == '/') +# define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0])) #endif diff --git a/3rdparty/libbacktrace/filetype.awk b/3rdparty/libbacktrace/filetype.awk index a5f6c8cc180..14d91581f7e 100644 --- a/3rdparty/libbacktrace/filetype.awk +++ b/3rdparty/libbacktrace/filetype.awk @@ -1,11 +1,13 @@ # An awk script to determine the type of a file. -/\177ELF\001/ { if (NR == 1) { print "elf32"; exit } } -/\177ELF\002/ { if (NR == 1) { print "elf64"; exit } } -/\114\001/ { if (NR == 1) { print "pecoff"; exit } } -/\144\206/ { if (NR == 1) { print "pecoff"; exit } } -/\xFE\xED\xFA\xCE/ { if (NR == 1) { print "macho32"; exit } } -/\xCE\xFA\xED\xFE/ { if (NR == 1) { print "macho32"; exit } } -/\xFE\xED\xFA\xCF/ { if (NR == 1) { print "macho64"; exit } } -/\xCF\xFA\xED\xFE/ { if (NR == 1) { print "macho64"; exit } } -/\xCA\xFE\xBA\xBE/ { if (NR == 1) { print "macho-fat"; exit } } -/\xBE\xBA\xFE\xCA/ { if (NR == 1) { print "macho-fat"; exit } } +/\177ELF\001/ { if (NR == 1) { print "elf32"; exit } } +/\177ELF\002/ { if (NR == 1) { print "elf64"; exit } } +/\114\001/ { if (NR == 1) { print "pecoff"; exit } } +/\144\206/ { if (NR == 1) { print "pecoff"; exit } } +/\001\337/ { if (NR == 1) { print "xcoff32"; exit } } +/\001\367/ { if (NR == 1) { print "xcoff64"; exit } } +/\376\355\372\316/ { if (NR == 1) { print "macho"; exit } } +/\316\372\355\376/ { if (NR == 1) { print "macho"; exit } } +/\376\355\372\317/ { if (NR == 1) { print "macho"; exit } } +/\317\372\355\376/ { if (NR == 1) { print "macho"; exit } } +/\312\376\272\276/ { if (NR == 1) { print "macho"; exit } } +/\276\272\376\312/ { if (NR == 1) { print "macho"; exit } } diff --git a/3rdparty/libbacktrace/internal.h b/3rdparty/libbacktrace/internal.h index bff8ed470e4..be99bb0c84c 100644 --- a/3rdparty/libbacktrace/internal.h +++ b/3rdparty/libbacktrace/internal.h @@ -1,5 +1,5 @@ /* internal.h -- Internal header file for stack backtrace library. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -179,7 +179,7 @@ struct backtrace_view /* Create a view of SIZE bytes from DESCRIPTOR at OFFSET. Store the result in *VIEW. Returns 1 on success, 0 on error. */ extern int backtrace_get_view (struct backtrace_state *state, int descriptor, - off_t offset, size_t size, + off_t offset, uint64_t size, backtrace_error_callback error_callback, void *data, struct backtrace_view *view); @@ -257,6 +257,18 @@ extern int backtrace_vector_release (struct backtrace_state *state, backtrace_error_callback error_callback, void *data); +/* Free the space managed by VEC. This will reset VEC. */ + +static inline void +backtrace_vector_free (struct backtrace_state *state, + struct backtrace_vector *vec, + backtrace_error_callback error_callback, void *data) +{ + vec->alc += vec->size; + vec->size = 0; + backtrace_vector_release (state, vec, error_callback, data); +} + /* Read initial debug data from a descriptor, and set the fileline_data, syminfo_fn, and syminfo_data fields of STATE. Return the fileln_fn field in *FILELN_FN--this is done this way so @@ -274,23 +286,45 @@ extern int backtrace_initialize (struct backtrace_state *state, void *data, fileline *fileline_fn); +/* An enum for the DWARF sections we care about. */ + +enum dwarf_section +{ + DEBUG_INFO, + DEBUG_LINE, + DEBUG_ABBREV, + DEBUG_RANGES, + DEBUG_STR, + DEBUG_ADDR, + DEBUG_STR_OFFSETS, + DEBUG_LINE_STR, + DEBUG_RNGLISTS, + + DEBUG_MAX +}; + +/* Data for the DWARF sections we care about. */ + +struct dwarf_sections +{ + const unsigned char *data[DEBUG_MAX]; + size_t size[DEBUG_MAX]; +}; + +/* DWARF data read from a file, used for .gnu_debugaltlink. */ + +struct dwarf_data; + /* Add file/line information for a DWARF module. */ extern int backtrace_dwarf_add (struct backtrace_state *state, uintptr_t base_address, - const unsigned char* dwarf_info, - size_t dwarf_info_size, - const unsigned char *dwarf_line, - size_t dwarf_line_size, - const unsigned char *dwarf_abbrev, - size_t dwarf_abbrev_size, - const unsigned char *dwarf_ranges, - size_t dwarf_range_size, - const unsigned char *dwarf_str, - size_t dwarf_str_size, + const struct dwarf_sections *dwarf_sections, int is_bigendian, + struct dwarf_data *fileline_altlink, backtrace_error_callback error_callback, - void *data, fileline *fileline_fn); + void *data, fileline *fileline_fn, + struct dwarf_data **fileline_entry); /* A test-only hook for elf_uncompress_zdebug. */ diff --git a/3rdparty/libbacktrace/ltmain.sh b/3rdparty/libbacktrace/ltmain.sh index a736cf99425..b710c06b5d8 100644 --- a/3rdparty/libbacktrace/ltmain.sh +++ b/3rdparty/libbacktrace/ltmain.sh @@ -1,12 +1,10 @@ -#! /bin/sh -## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +# Generated from ltmain.m4sh. -# libtool (GNU libtool) 2.4.6 -# Provide generalized library-building support services. +# libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -26,2112 +24,755 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -PROGRAM=libtool -PACKAGE=libtool -VERSION="2.4.6 Debian-2.4.6-2" -package_revision=2.4.6 - - -## ------ ## -## Usage. ## -## ------ ## - -# Run './libtool --help' for help with using this script from the -# command line. - - -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# After configure completes, it has a better idea of some of the -# shell tools we need than the defaults used by the functions shared -# with bootstrap, so set those here where they can still be over- -# ridden by the user, but otherwise take precedence. - -: ${AUTOCONF="autoconf"} -: ${AUTOMAKE="automake"} - - -## -------------------------- ## -## Source external libraries. ## -## -------------------------- ## - -# Much of our low-level functionality needs to be sourced from external -# libraries, which are installed to $pkgauxdir. - -# Set a version string for this script. -scriptversion=2015-01-20.17; # UTC - -# General shell script boiler plate, and helper functions. -# Written by Gary V. Vaughan, 2004 - -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# Please report bugs or propose patches to gary@gnu.org. - - -## ------ ## -## Usage. ## -## ------ ## - -# Evaluate this file near the top of your script to gain access to -# the functions and variables defined here: +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. # -# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --no-finish let install mode avoid finish commands +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message # -# If you need to override any of the default environment variable -# settings, do that before evaluating this file. - - -## -------------------- ## -## Shell normalisation. ## -## -------------------- ## +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool 1.3134 2009-11-29) 2.2.7a +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . -# Some shells need a little help to be as Bourne compatible as possible. -# Before doing anything else, make sure all that help has been provided! +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.2.7a +TIMESTAMP=" 1.3134 2009-11-29" +package_revision=1.3134 -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac -fi - -# NLS nuisances: We save the old values in case they are required later. -_G_user_locale= -_G_safe_locale= -for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test set = \"\${$_G_var+set}\"; then - save_$_G_var=\$$_G_var - $_G_var=C - export $_G_var - _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" - _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" - fi" -done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Make sure IFS has a sensible default -sp=' ' -nl=' -' -IFS="$sp $nl" - -# There are apparently some retarded systems that use ';' as a PATH separator! -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh - - -## ------------------------- ## -## Locate command utilities. ## -## ------------------------- ## - - -# func_executable_p FILE -# ---------------------- -# Check that FILE is an executable regular file. -func_executable_p () -{ - test -f "$1" && test -x "$1" -} - - -# func_path_progs PROGS_LIST CHECK_FUNC [PATH] -# -------------------------------------------- -# Search for either a program that responds to --version with output -# containing "GNU", or else returned by CHECK_FUNC otherwise, by -# trying all the directories in PATH with each of the elements of -# PROGS_LIST. -# -# CHECK_FUNC should accept the path to a candidate program, and -# set $func_check_prog_result if it truncates its output less than -# $_G_path_prog_max characters. -func_path_progs () +# A function that is used when there is no print builtin or printf. +func_fallback_echo () { - _G_progs_list=$1 - _G_check_func=$2 - _G_PATH=${3-"$PATH"} - - _G_path_prog_max=0 - _G_path_prog_found=false - _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} - for _G_dir in $_G_PATH; do - IFS=$_G_save_IFS - test -z "$_G_dir" && _G_dir=. - for _G_prog_name in $_G_progs_list; do - for _exeext in '' .EXE; do - _G_path_prog=$_G_dir/$_G_prog_name$_exeext - func_executable_p "$_G_path_prog" || continue - case `"$_G_path_prog" --version 2>&1` in - *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; - *) $_G_check_func $_G_path_prog - func_path_progs_result=$func_check_prog_result - ;; - esac - $_G_path_prog_found && break 3 - done - done - done - IFS=$_G_save_IFS - test -z "$func_path_progs_result" && { - echo "no acceptable sed could be found in \$PATH" >&2 - exit 1 - } + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' } +# NLS nuisances: We save the old values to restore during execute mode. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done -# We want to be able to use the functions in this file before configure -# has figured out where the best binaries are kept, which means we have -# to search for them ourselves - except when the results are already set -# where we skip the searches. - -# Unless the user overrides by setting SED, search the path for either GNU -# sed, or the sed that truncates its output the least. -test -z "$SED" && { - _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for _G_i in 1 2 3 4 5 6 7; do - _G_sed_script=$_G_sed_script$nl$_G_sed_script - done - echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed - _G_sed_script= - - func_check_prog_sed () - { - _G_path_prog=$1 +$lt_unset CDPATH - _G_count=0 - printf 0123456789 >conftest.in - while : - do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo '' >> conftest.nl - "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break - diff conftest.out conftest.nl >/dev/null 2>&1 || break - _G_count=`expr $_G_count + 1` - if test "$_G_count" -gt "$_G_path_prog_max"; then - # Best one so far, save it but keep looking for a better one - func_check_prog_result=$_G_path_prog - _G_path_prog_max=$_G_count - fi - # 10*(2^10) chars as input seems more than enough - test 10 -lt "$_G_count" && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out - } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin - rm -f conftest.sed - SED=$func_path_progs_result -} -# Unless the user overrides by setting GREP, search the path for either GNU -# grep, or the grep that truncates its output the least. -test -z "$GREP" && { - func_check_prog_grep () - { - _G_path_prog=$1 - _G_count=0 - _G_path_prog_max=0 - printf 0123456789 >conftest.in - while : - do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo 'GREP' >> conftest.nl - "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break - diff conftest.out conftest.nl >/dev/null 2>&1 || break - _G_count=`expr $_G_count + 1` - if test "$_G_count" -gt "$_G_path_prog_max"; then - # Best one so far, save it but keep looking for a better one - func_check_prog_result=$_G_path_prog - _G_path_prog_max=$_G_count - fi - # 10*(2^10) chars as input seems more than enough - test 10 -lt "$_G_count" && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out - } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin - GREP=$func_path_progs_result -} +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## -# All uppercase variable names are used for environment variables. These -# variables can be overridden by the user before calling a script that -# uses them if a suitable command of that name is not already available -# in the command search PATH. : ${CP="cp -f"} -: ${ECHO="printf %s\n"} -: ${EGREP="$GREP -E"} -: ${FGREP="$GREP -F"} +: ${ECHO=$as_echo} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} +: ${SED="/mount/endor/wildenhu/local-x86_64/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. -## -------------------- ## -## Useful sed snippets. ## -## -------------------- ## - -sed_dirname='s|/[^/]*$||' -sed_basename='s|^.*/||' +exit_status=$EXIT_SUCCESS -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" -# Same as above, but do not quote variable references. -sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' - -# Sed substitution that converts a w32 file name or path -# that contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-'\' parameter expansions in output of sed_double_quote_subst that -# were '\'-ed in input to the same. If an odd number of '\' preceded a -# '$' in input to sed_double_quote_subst, that '$' was protected from -# expansion. Since each input '\' is now two '\'s, look for any number -# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. -_G_bs='\\' -_G_bs2='\\\\' -_G_bs4='\\\\\\\\' -_G_dollar='\$' -sed_double_backslash="\ - s/$_G_bs4/&\\ -/g - s/^$_G_bs2$_G_dollar/$_G_bs&/ - s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g - s/\n//g" +dirname="s,/[^/]*$,," +basename="s,^.*/,," +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} -## ----------------- ## -## Global variables. ## -## ----------------- ## +# Generated shell functions inserted here. -# Except for the global variables explicitly listed below, the following -# functions in the '^func_' namespace, and the '^require_' namespace -# variables initialised in the 'Resource management' section, sourcing -# this file will not pollute your global namespace with anything -# else. There's no portable way to scope variables in Bourne shell -# though, so actually running these functions will sometimes place -# results into a variable named after the function, and often use -# temporary variables in the '^_G_' namespace. If you are careful to -# avoid using those namespaces casually in your sourcing script, things -# should continue to work as you expect. And, of course, you can freely -# overwrite any of the functions or variables defined here before -# calling anything to customize them. +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} -# Allow overriding, eg assuming that you follow the convention of -# putting '$debug_cmd' at the start of all your functions, you can get -# bash to show function call trace with: -# -# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name -debug_cmd=${debug_cmd-":"} -exit_cmd=: +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done -# By convention, finish your script with: -# -# exit $exit_status -# -# so that you can set exit_status to non-zero if you want to indicate -# something went wrong during execution without actually bailing out at -# the point of failure. -exit_status=$EXIT_SUCCESS + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath=$0 + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} -# The name of this program. -progname=`$ECHO "$progpath" |$SED "$sed_basename"` +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result -# Make sure we have an absolute progpath for reexecution: +# Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) - progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` - progpath=$progdir/$progname + progpath="$progdir/$progname" ;; *) - _G_IFS=$IFS - IFS=${PATH_SEPARATOR-:} + save_IFS="$IFS" + IFS=: for progdir in $PATH; do - IFS=$_G_IFS + IFS="$save_IFS" test -x "$progdir/$progname" && break done - IFS=$_G_IFS + IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` - progpath=$progdir/$progname + progpath="$progdir/$progname" ;; esac +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' -## ----------------- ## -## Standard options. ## -## ----------------- ## - -# The following options affect the operation of the functions defined -# below, and should be set appropriately depending on run-time para- -# meters passed on the command line. +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" +# Standard options: opt_dry_run=false +opt_help=false opt_quiet=false opt_verbose=false +opt_warning=: -# Categories 'all' and 'none' are always available. Append any others -# you will pass as the first argument to func_warning from your own -# code. -warning_categories= - -# By default, display warnings according to 'opt_warning_types'. Set -# 'warning_func' to ':' to elide all warnings, or func_fatal_error to -# treat the next displayed warning as a fatal error. -warning_func=func_warn_and_continue - -# Set to 'all' to display all warnings, 'none' to suppress all -# warnings, or a space delimited list of some subset of -# 'warning_categories' to display only the listed warnings. -opt_warning_types=all - - -## -------------------- ## -## Resource management. ## -## -------------------- ## - -# This section contains definitions for functions that each ensure a -# particular resource (a file, or a non-empty configuration variable for -# example) is available, and if appropriate to extract default values -# from pertinent package files. Call them using their associated -# 'require_*' variable to ensure that they are executed, at most, once. -# -# It's entirely deliberate that calling these functions can set -# variables that don't obey the namespace limitations obeyed by the rest -# of this file, in order that that they be as useful as possible to -# callers. - - -# require_term_colors -# ------------------- -# Allow display of bold text on terminals that support it. -require_term_colors=func_require_term_colors -func_require_term_colors () +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () { - $debug_cmd - - test -t 1 && { - # COLORTERM and USE_ANSI_COLORS environment variables take - # precedence, because most terminfo databases neglect to describe - # whether color sequences are supported. - test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} - - if test 1 = "$USE_ANSI_COLORS"; then - # Standard ANSI escape sequences - tc_reset='' - tc_bold=''; tc_standout='' - tc_red=''; tc_green='' - tc_blue=''; tc_cyan='' - else - # Otherwise trust the terminfo database after all. - test -n "`tput sgr0 2>/dev/null`" && { - tc_reset=`tput sgr0` - test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` - tc_standout=$tc_bold - test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` - test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` - test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` - test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` - test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` - } - fi - } - - require_term_colors=: + $ECHO "$progname${mode+: }$mode: $*" } - -## ----------------- ## -## Function library. ## -## ----------------- ## - -# This section contains a variety of useful functions to call in your -# scripts. Take note of the portable wrappers for features provided by -# some modern shells, which will fall back to slower equivalents on -# less featureful shells. - - -# func_append VAR VALUE -# --------------------- -# Append VALUE onto the existing contents of VAR. - - # We should try to minimise forks, especially on Windows where they are - # unreasonably slow, so skip the feature probes when bash or zsh are - # being used: - if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then - : ${_G_HAVE_ARITH_OP="yes"} - : ${_G_HAVE_XSI_OPS="yes"} - # The += operator was introduced in bash 3.1 - case $BASH_VERSION in - [12].* | 3.0 | 3.0*) ;; - *) - : ${_G_HAVE_PLUSEQ_OP="yes"} - ;; - esac - fi - - # _G_HAVE_PLUSEQ_OP - # Can be empty, in which case the shell is probed, "yes" if += is - # useable or anything else if it does not work. - test -z "$_G_HAVE_PLUSEQ_OP" \ - && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ - && _G_HAVE_PLUSEQ_OP=yes - -if test yes = "$_G_HAVE_PLUSEQ_OP" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_append () - { - $debug_cmd - - eval "$1+=\$2" - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_append () - { - $debug_cmd - - eval "$1=\$$1\$2" - } -fi - - -# func_append_quoted VAR VALUE -# ---------------------------- -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -if test yes = "$_G_HAVE_PLUSEQ_OP"; then - eval 'func_append_quoted () - { - $debug_cmd - - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" - }' -else - func_append_quoted () - { - $debug_cmd - - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" - } -fi - - -# func_append_uniq VAR VALUE -# -------------------------- -# Append unique VALUE onto the existing contents of VAR, assuming -# entries are delimited by the first character of VALUE. For example: -# -# func_append_uniq options " --another-option option-argument" -# -# will only append to $options if " --another-option option-argument " -# is not already present somewhere in $options already (note spaces at -# each end implied by leading space in second argument). -func_append_uniq () +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () { - $debug_cmd - - eval _G_current_value='`$ECHO $'$1'`' - _G_delim=`expr "$2" : '\(.\)'` + $opt_verbose && func_echo ${1+"$@"} - case $_G_delim$_G_current_value$_G_delim in - *"$2$_G_delim"*) ;; - *) func_append "$@" ;; - esac + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : } +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} -# func_arith TERM... -# ------------------ -# Set func_arith_result to the result of evaluating TERMs. - test -z "$_G_HAVE_ARITH_OP" \ - && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ - && _G_HAVE_ARITH_OP=yes - -if test yes = "$_G_HAVE_ARITH_OP"; then - eval 'func_arith () - { - $debug_cmd - - func_arith_result=$(( $* )) - }' -else - func_arith () - { - $debug_cmd +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 +} - func_arith_result=`expr "$@"` - } -fi - - -# func_basename FILE -# ------------------ -# Set func_basename_result to FILE with everything up to and including -# the last / stripped. -if test yes = "$_G_HAVE_XSI_OPS"; then - # If this shell supports suffix pattern removal, then use it to avoid - # forking. Hide the definitions single quotes in case the shell chokes - # on unsupported syntax... - _b='func_basename_result=${1##*/}' - _d='case $1 in - */*) func_dirname_result=${1%/*}$2 ;; - * ) func_dirname_result=$3 ;; - esac' - -else - # ...otherwise fall back to using sed. - _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' - _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` - if test "X$func_dirname_result" = "X$1"; then - func_dirname_result=$3 - else - func_append func_dirname_result "$2" - fi' -fi - -eval 'func_basename () -{ - $debug_cmd - - '"$_b"' -}' - - -# func_dirname FILE APPEND NONDIR_REPLACEMENT -# ------------------------------------------- -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -eval 'func_dirname () -{ - $debug_cmd - - '"$_d"' -}' - - -# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT -# -------------------------------------------------------- -# Perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# For efficiency, we do not delegate to the functions above but instead -# duplicate the functionality here. -eval 'func_dirname_and_basename () -{ - $debug_cmd - - '"$_b"' - '"$_d"' -}' - - -# func_echo ARG... -# ---------------- -# Echo program name prefixed message. -func_echo () -{ - $debug_cmd - - _G_message=$* - - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $ECHO "$progname: $_G_line" - done - IFS=$func_echo_IFS -} - - -# func_echo_all ARG... -# -------------------- -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - - -# func_echo_infix_1 INFIX ARG... -# ------------------------------ -# Echo program name, followed by INFIX on the first line, with any -# additional lines not showing INFIX. -func_echo_infix_1 () -{ - $debug_cmd - - $require_term_colors - - _G_infix=$1; shift - _G_indent=$_G_infix - _G_prefix="$progname: $_G_infix: " - _G_message=$* - - # Strip color escape sequences before counting printable length - for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" - do - test -n "$_G_tc" && { - _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` - _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` - } - done - _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes - - func_echo_infix_1_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_infix_1_IFS - $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 - _G_prefix=$_G_indent - done - IFS=$func_echo_infix_1_IFS -} - - -# func_error ARG... -# ----------------- -# Echo program name prefixed message to standard error. -func_error () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 -} - - -# func_fatal_error ARG... -# ----------------------- -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - $debug_cmd - - func_error "$*" - exit $EXIT_FAILURE -} - - -# func_grep EXPRESSION FILENAME -# ----------------------------- -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $debug_cmd - - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_len STRING -# --------------- -# Set func_len_result to the length of STRING. STRING may not -# start with a hyphen. - test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_len () - { - $debug_cmd - - func_len_result=${#1} - }' -else - func_len () - { - $debug_cmd - - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` - } -fi - - -# func_mkdir_p DIRECTORY-PATH -# --------------------------- -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - $debug_cmd - - _G_directory_path=$1 - _G_dir_list= - - if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then - - # Protect directory names starting with '-' - case $_G_directory_path in - -*) _G_directory_path=./$_G_directory_path ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$_G_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - _G_dir_list=$_G_directory_path:$_G_dir_list - - # If the last portion added has no slash in it, the list is done - case $_G_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` - done - _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` - - func_mkdir_p_IFS=$IFS; IFS=: - for _G_dir in $_G_dir_list; do - IFS=$func_mkdir_p_IFS - # mkdir can fail with a 'File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$_G_dir" 2>/dev/null || : - done - IFS=$func_mkdir_p_IFS - - # Bail out if we (or some other process) failed to create a directory. - test -d "$_G_directory_path" || \ - func_fatal_error "Failed to create '$1'" - fi -} - - -# func_mktempdir [BASENAME] -# ------------------------- -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, BASENAME is the basename for that directory. -func_mktempdir () -{ - $debug_cmd - - _G_template=${TMPDIR-/tmp}/${1-$progname} - - if test : = "$opt_dry_run"; then - # Return a directory name, but don't create it in dry-run mode - _G_tmpdir=$_G_template-$$ - else - - # If mktemp works, use that first and foremost - _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` - - if test ! -d "$_G_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - _G_tmpdir=$_G_template-${RANDOM-0}$$ - - func_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$_G_tmpdir" - umask $func_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$_G_tmpdir" || \ - func_fatal_error "cannot create temporary directory '$_G_tmpdir'" - fi - - $ECHO "$_G_tmpdir" -} - - -# func_normal_abspath PATH -# ------------------------ -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -func_normal_abspath () -{ - $debug_cmd - - # These SED scripts presuppose an absolute path with a trailing slash. - _G_pathcar='s|^/\([^/]*\).*$|\1|' - _G_pathcdr='s|^/[^/]*||' - _G_removedotparts=':dotsl - s|/\./|/|g - t dotsl - s|/\.$|/|' - _G_collapseslashes='s|/\{1,\}|/|g' - _G_finalslash='s|/*$|/|' - - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` - while :; do - # Processed it all yet? - if test / = "$func_normal_abspath_tpath"; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result"; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - - -# func_notquiet ARG... -# -------------------- -# Echo program name prefixed message only when not in quiet mode. -func_notquiet () -{ - $debug_cmd - - $opt_quiet || func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - - -# func_relative_path SRCDIR DSTDIR -# -------------------------------- -# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. -func_relative_path () -{ - $debug_cmd - - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=$func_dirname_result - if test -z "$func_relative_path_tlibdir"; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test -n "$func_stripname_result"; then - func_append func_relative_path_result "/$func_stripname_result" - fi - - # Normalisation. If bindir is libdir, return '.' else relative path. - if test -n "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - fi - - test -n "$func_relative_path_result" || func_relative_path_result=. - - : -} - - -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () -{ - $debug_cmd - - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" - fi - - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" - ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; - esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift - done -} - - -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd - - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; - esac - - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" - ;; - esac - - func_quote_for_expand_result=$_G_arg -} - - -# func_stripname PREFIX SUFFIX NAME -# --------------------------------- -# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_stripname () - { - $debug_cmd - - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary variable first. - func_stripname_result=$3 - func_stripname_result=${func_stripname_result#"$1"} - func_stripname_result=${func_stripname_result%"$2"} - }' -else - func_stripname () - { - $debug_cmd - - case $2 in - .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; - *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; - esac - } -fi - - -# func_show_eval CMD [FAIL_EXP] -# ----------------------------- -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" - - $opt_dry_run || { - eval "$_G_cmd" - _G_status=$? - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_show_eval_locale CMD [FAIL_EXP] -# ------------------------------------ -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - $opt_dry_run || { - eval "$_G_user_locale - $_G_cmd" - _G_status=$? - eval "$_G_safe_locale" - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_tr_sh -# ---------- -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - $debug_cmd - - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_verbose ARG... -# ------------------- -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $debug_cmd - - $opt_verbose && func_echo "$*" - - : -} - - -# func_warn_and_continue ARG... -# ----------------------------- +# func_warning arg... # Echo program name prefixed warning message to standard error. -func_warn_and_continue () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 -} - - -# func_warning CATEGORY ARG... -# ---------------------------- -# Echo program name prefixed warning message to standard error. Warning -# messages can be filtered according to CATEGORY, where this function -# elides messages where CATEGORY is not listed in the global variable -# 'opt_warning_types'. func_warning () { - $debug_cmd - - # CATEGORY must be in the warning_categories list! - case " $warning_categories " in - *" $1 "*) ;; - *) func_internal_error "invalid warning category '$1'" ;; - esac - - _G_category=$1 - shift - - case " $opt_warning_types " in - *" $_G_category "*) $warning_func ${1+"$@"} ;; - esac -} - - -# func_sort_ver VER1 VER2 -# ----------------------- -# 'sort -V' is not generally available. -# Note this deviates from the version comparison in automake -# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a -# but this should suffice as we won't be specifying old -# version formats or redundant trailing .0 in bootstrap.conf. -# If we did want full compatibility then we should probably -# use m4_version_compare from autoconf. -func_sort_ver () -{ - $debug_cmd - - printf '%s\n%s\n' "$1" "$2" \ - | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n -} - -# func_lt_ver PREV CURR -# --------------------- -# Return true if PREV and CURR are in the correct order according to -# func_sort_ver, otherwise false. Use it like this: -# -# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." -func_lt_ver () -{ - $debug_cmd - - test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` -} - - -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: -#! /bin/sh - -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - -# A portable, pluggable option parser for Bourne shell. -# Written by Gary V. Vaughan, 2010 - -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. - - -## ------ ## -## Usage. ## -## ------ ## - -# This file is a library for parsing options in your shell scripts along -# with assorted other useful supporting features that you can make use -# of too. -# -# For the simplest scripts you might need only: -# -# #!/bin/sh -# . relative/path/to/funclib.sh -# . relative/path/to/options-parser -# scriptversion=1.0 -# func_options ${1+"$@"} -# eval set dummy "$func_options_result"; shift -# ...rest of your script... -# -# In order for the '--version' option to work, you will need to have a -# suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. -# -# For '-h' and '--help' to work, you will also need a one line -# description of your script's purpose in a comment directly above the -# '# Written by ' line, like the one at the top of this file. -# -# The default options also support '--debug', which will turn on shell -# execution tracing (see the comment above debug_cmd below for another -# use), and '--verbose' and the func_verbose function to allow your script -# to display verbose messages only when your user has specified -# '--verbose'. -# -# After sourcing this file, you can plug processing for additional -# options by amending the variables from the 'Configuration' section -# below, and following the instructions in the 'Option parsing' -# section further down. - -## -------------- ## -## Configuration. ## -## -------------- ## - -# You should override these variables in your script after sourcing this -# file so that they reflect the customisations you have added to the -# option parser. - -# The usage line for option parsing errors and the start of '-h' and -# '--help' output messages. You can embed shell variables for delayed -# expansion at the time the message is displayed, but you will need to -# quote other shell meta-characters carefully to prevent them being -# expanded when the contents are evaled. -usage='$progpath [OPTION]...' - -# Short help message in response to '-h' and '--help'. Add to this or -# override it after sourcing this library to reflect the full set of -# options your script accepts. -usage_message="\ - --debug enable verbose shell tracing - -W, --warnings=CATEGORY - report the warnings falling in CATEGORY [all] - -v, --verbose verbosely report processing - --version print version information and exit - -h, --help print short or long help message and exit -" - -# Additional text appended to 'usage_message' in response to '--help'. -long_help_message=" -Warning categories include: - 'all' show all warnings - 'none' turn off all the warnings - 'error' warnings are treated as fatal errors" - -# Help message printed before fatal option parsing errors. -fatal_help="Try '\$progname --help' for more information." - - - -## ------------------------- ## -## Hook function management. ## -## ------------------------- ## - -# This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. - -# func_hookable FUNC_NAME -# ----------------------- -# Declare that FUNC_NAME will run hooks added with -# 'func_add_hook FUNC_NAME ...'. -func_hookable () -{ - $debug_cmd - - func_append hookable_fns " $1" -} - - -# func_add_hook FUNC_NAME HOOK_FUNC -# --------------------------------- -# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must -# first have been declared "hookable" by a call to 'func_hookable'. -func_add_hook () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not accept hook functions." ;; - esac - - eval func_append ${1}_hooks '" $2"' -} - - -# func_remove_hook FUNC_NAME HOOK_FUNC -# ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. -func_remove_hook () -{ - $debug_cmd - - eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' -} - - -# func_run_hooks FUNC_NAME [ARG]... -# --------------------------------- -# Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more -# than a whitespace-delimited list of legal shell function names, and -# no effort is wasted trying to catch shell meta-characters or preserve -# whitespace. -func_run_hooks () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; - esac - - eval _G_hook_fns=\$$1_hooks; shift - - for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift - done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result -} - - - -## --------------- ## -## Option parsing. ## -## --------------- ## - -# In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: -# -# my_options_prep () -# { -# $debug_cmd -# -# # Extend the existing usage message. -# usage_message=$usage_message' -# -s, --silent don'\''t print informational messages -# ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result -# } -# func_add_hook func_options_prep my_options_prep -# -# -# my_silent_option () -# { -# $debug_cmd -# -# # Note that for efficiency, we parse as many options as we can -# # recognise in a loop before passing the remainder back to the -# # caller on the first unrecognised argument we encounter. -# while test $# -gt 0; do -# opt=$1; shift -# case $opt in -# --silent|-s) opt_silent=: ;; -# # Separate non-argument short options: -# -s*) func_split_short_opt "$_G_opt" -# set dummy "$func_split_short_opt_name" \ -# "-$func_split_short_opt_arg" ${1+"$@"} -# shift -# ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; -# esac -# done -# -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result -# } -# func_add_hook func_parse_options my_silent_option -# -# -# my_option_validation () -# { -# $debug_cmd -# -# $opt_silent && $opt_verbose && func_fatal_help "\ -# '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result -# } -# func_add_hook func_validate_options my_option_validation -# -# You'll alse need to manually amend $usage_message to reflect the extra -# options you parse. It's preferable to append if you can, so that -# multiple option parsing hooks can be added safely. - - -# func_options [ARG]... -# --------------------- -# All the functions called inside func_options are hookable. See the -# individual implementations for details. -func_hookable func_options -func_options () -{ - $debug_cmd + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} - - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} - - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + # bash bug again: + : } - -# func_options_prep [ARG]... -# -------------------------- -# All initialisations required before starting the option parse loop. -# Note that when calling hook functions, we pass through the list of -# positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. -func_hookable func_options_prep -func_options_prep () +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () { - $debug_cmd + func_error ${1+"$@"} + exit $EXIT_FAILURE +} - # Option defaults: - opt_verbose=false - opt_warning_types= +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default - func_run_hooks func_options_prep ${1+"$@"} - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 } -# func_parse_options [ARG]... -# --------------------------- -# The main option parsing loop. -func_hookable func_parse_options -func_parse_options () +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () { - $debug_cmd + my_directory_path="$1" + my_dir_list= - func_parse_options_result= + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - # this just eases exit handling - while test $# -gt 0; do - # Defer to hook functions for initial option parsing, so they - # get priority in the event of reusing an option name. - func_run_hooks func_parse_options ${1+"$@"} + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" - # Break out of the loop if we already parsed every option. - test $# -gt 0 || break + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac - _G_opt=$1 - shift - case $_G_opt in - --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" - $debug_cmd - ;; - - --no-warnings|--no-warning|--no-warn) - set dummy --warnings none ${1+"$@"} - shift - ;; + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break - case " $warning_categories $1" in - *" $1 "*) - # trailing space prevents matching last $1 above - func_append_uniq opt_warning_types " $1" - ;; - *all) - opt_warning_types=$warning_categories - ;; - *none) - opt_warning_types=none - warning_func=: - ;; - *error) - opt_warning_types=$warning_categories - warning_func=func_fatal_error - ;; - *) - func_fatal_error \ - "unsupported warning category: '$1'" - ;; - esac - shift - ;; - - --verbose|-v) opt_verbose=: ;; - --version) func_version ;; - -\?|-h) func_usage ;; - --help) func_help ;; - - # Separate optargs to long options (plugins may need this): - --*=*) func_split_equals "$_G_opt" - set dummy "$func_split_equals_lhs" \ - "$func_split_equals_rhs" ${1+"$@"} - shift - ;; - - # Separate optargs to short options: - -W*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-v*|-x*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; - esac - done + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi } -# func_validate_options [ARG]... -# ------------------------------ -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -func_hookable func_validate_options -func_validate_options () +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () { - $debug_cmd - - # Display all warnings if -W was not given. - test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - - func_run_hooks func_validate_options ${1+"$@"} - - # Bail if the options were screwed! - $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result -} - + my_template="${TMPDIR-/tmp}/${1-$progname}" + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else -## ----------------- ## -## Helper functions. ## -## ----------------- ## + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` -# This section contains the helper functions used by the rest of the -# hookable option parser framework in ascii-betical order. + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi -# func_fatal_help ARG... -# ---------------------- -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - $debug_cmd + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi - eval \$ECHO \""Usage: $usage"\" - eval \$ECHO \""$fatal_help"\" - func_error ${1+"$@"} - exit $EXIT_FAILURE + $ECHO "$my_tmpdir" } -# func_help -# --------- -# Echo long help message to standard output and exit. -func_help () +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () { - $debug_cmd + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac - func_usage_message - $ECHO "$long_help_message" - exit 0 + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac } -# func_missing_arg ARGNAME -# ------------------------ -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () { - $debug_cmd - - func_error "Missing argument for '$1'." - exit_cmd=exit -} - - -# func_split_equals STRING -# ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. -test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_equals () - { - $debug_cmd + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac - func_split_equals_lhs=${1%%=*} - func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_equals () - { - $debug_cmd + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac - func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` - func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ - || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` - } -fi #func_split_equals + func_quote_for_expand_result="$my_arg" +} -# func_split_short_opt SHORTOPT -# ----------------------------- -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_short_opt () - { - $debug_cmd +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"} - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_short_opt () - { - $debug_cmd + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` - func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` - } -fi #func_split_short_opt + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} -# func_usage -# ---------- -# Echo short help message to standard output and exit. -func_usage () +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () { - $debug_cmd + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } - func_usage_message - $ECHO "Run '$progname --help |${PAGER-more}' for full usage" - exit 0 + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi } -# func_usage_message -# ------------------ -# Echo short help message to standard output. -func_usage_message () -{ - $debug_cmd - eval \$ECHO \""Usage: $usage"\" - echo - $SED -n 's|^# || - /^Written by/{ - x;p;x - } - h - /^Written by/q' < "$progpath" - echo - eval \$ECHO \""$usage_message"\" -} # func_version -# ------------ # Echo version message to standard output and exit. func_version () { - $debug_cmd - - printf '%s\n' "$progname $scriptversion" - $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p - } - /^# Written by / { - s|^# || - p - } - /^warranty; /q' < "$progpath" + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# // + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/^# *-h/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" exit $? } - -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: - -# Set a version string. -scriptversion='(GNU libtool) 2.4.6' - - -# func_echo ARG... -# ---------------- -# Libtool also displays the current mode in messages, so override -# funclib.sh func_echo with this custom definition. -func_echo () +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () { - $debug_cmd - - _G_message=$* - - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" - done - IFS=$func_echo_IFS + $SED -n '/^# Usage:/,/# Report bugs to/ { + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + }' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi } - -# func_warning ARG... -# ------------------- -# Libtool warnings are not categorized, so override funclib.sh -# func_warning with this simpler definition. -func_warning () +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () { - $debug_cmd - - $warning_func ${1+"$@"} + func_error "missing argument for $1" + exit_cmd=exit } +exit_cmd=: -## ---------------- ## -## Options parsing. ## -## ---------------- ## - -# Hook in the functions to make sure our own options are parsed during -# the option parsing loop. - -usage='$progpath [OPTION]... [MODE-ARG]...' - -# Short help message in response to '-h'. -usage_message="Options: - --config show all configuration variables - --debug enable verbose shell tracing - -n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --mode=MODE use operation mode MODE - --no-warnings equivalent to '-Wnone' - --preserve-dup-deps don't remove duplicate dependency libraries - --quiet, --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - -v, --verbose print more informational messages than default - --version print version information - -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] - -h, --help, --help-all print short, long, or detailed help message -" -# Additional text appended to 'usage_message' in response to '--help'. -func_help () -{ - $debug_cmd - - func_usage_message - $ECHO "$long_help_message - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. When passed as first option, -'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. -Try '$progname --help --mode=MODE' for a more detailed description of MODE. - -When reporting a bug, please describe a test case to reproduce it and -include the following information: - - host-triplet: $host - shell: $SHELL - compiler: $LTCC - compiler flags: $LTCFLAGS - linker: $LD (gnu? $with_gnu_ld) - version: $progname $scriptversion Debian-2.4.6-2 - automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` - autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` - -Report bugs to . -GNU libtool home page: . -General help using GNU software: ." - exit 0 -} -# func_lo2o OBJECT-NAME -# --------------------- -# Transform OBJECT-NAME from a '.lo' suffix to the platform specific -# object suffix. -lo2o=s/\\.lo\$/.$objext/ -o2lo=s/\\.$objext\$/.lo/ -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_lo2o () - { - case $1 in - *.lo) func_lo2o_result=${1%.lo}.$objext ;; - * ) func_lo2o_result=$1 ;; - esac - }' +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" - # func_xform LIBOBJ-OR-SOURCE - # --------------------------- - # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) - # suffix to a '.lo' libtool-object suffix. - eval 'func_xform () - { - func_xform_result=${1%.*}.lo - }' -else - # ...otherwise fall back to using sed. - func_lo2o () - { - func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` - } +# Global variables. +# $mode is unset +nonopt= +execute_dlfiles= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 - func_xform () - { - func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` - } -fi +opt_dry_run=false +opt_finish=: +opt_duplicate_deps=false +opt_silent=false +opt_debug=: +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= -# func_fatal_configuration ARG... -# ------------------------------- +# func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ - "See the $PACKAGE documentation for more information." \ - "Fatal configuration error." + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." } # func_config -# ----------- # Display the configuration for all the tags in this script. func_config () { @@ -2149,19 +790,17 @@ func_config () exit $? } - # func_features -# ------------- # Display the features supported by this script. func_features () { echo "host: $host" - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi - if test yes = "$build_old_libs"; then + if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" @@ -2170,350 +809,273 @@ func_features () exit $? } - -# func_enable_tag TAGNAME -# ----------------------- +# func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { - # Global variable: - tagname=$1 + # Global variable: + tagname="$1" - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf=/$re_begincf/,/$re_endcf/p + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - - -# func_check_version_match -# ------------------------ -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF + func_error "ignoring unknown tag $tagname" fi - - exit $EXIT_MISMATCH - fi -} - - -# libtool_options_prep [ARG]... -# ----------------------------- -# Preparation for options parsed by libtool. -libtool_options_prep () -{ - $debug_mode - - # Option defaults: - opt_config=false - opt_dlopen= - opt_dry_run=false - opt_help=false - opt_mode= - opt_preserve_dup_deps=false - opt_quiet=false - - nonopt= - preserve_args= - - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac - - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + esac } -func_add_hook func_options_prep libtool_options_prep - -# libtool_parse_options [ARG]... -# --------------------------------- -# Provide handling for libtool specific options. -libtool_parse_options () +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. { - $debug_cmd - - # Perform our own loop to consume as many options as possible in - # each iteration. - while test $# -gt 0; do - _G_opt=$1 - shift - case $_G_opt in - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - - --config) func_config ;; - - --dlopen|-dlopen) - opt_dlopen="${opt_dlopen+$opt_dlopen -}$1" - shift - ;; - - --preserve-dup-deps) - opt_preserve_dup_deps=: ;; - - --features) func_features ;; - - --finish) set dummy --mode finish ${1+"$@"}; shift ;; - - --help) opt_help=: ;; - - --help-all) opt_help=': help-all' ;; - - --mode) test $# = 0 && func_missing_arg $_G_opt && break - opt_mode=$1 - case $1 in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $_G_opt" - exit_cmd=exit - break - ;; - esac - shift - ;; - - --no-silent|--no-quiet) - opt_quiet=false - func_append preserve_args " $_G_opt" - ;; - - --no-warnings|--no-warning|--no-warn) - opt_warning=false - func_append preserve_args " $_G_opt" - ;; - - --no-verbose) - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --silent|--quiet) - opt_quiet=: - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --tag) test $# = 0 && func_missing_arg $_G_opt && break - opt_tag=$1 - func_append preserve_args " $_G_opt $1" - func_enable_tag "$1" - shift - ;; - - --verbose|-v) opt_quiet=false - opt_verbose=: - func_append preserve_args " $_G_opt" - ;; - - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; - esac - done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result -} -func_add_hook func_parse_options libtool_parse_options - - - -# libtool_validate_options [ARG]... -# --------------------------------- -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -libtool_validate_options () -{ - # save first non-option argument - if test 0 -lt $#; then - nonopt=$1 - shift - fi + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac - # preserve --debug - test : = "$debug_cmd" || func_append preserve_args " --debug" + # Parse non-mode specific arguments: + while test "$#" -gt 0; do + opt="$1" + shift - case $host in - # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 - # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; + case $opt in + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" + func_echo "enabling shell trace mode" + opt_debug='set -x' + $opt_debug + ;; + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" + shift + ;; + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + --no-finish) opt_finish=false ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 in + # Valid mode arguments: + clean) ;; + compile) ;; + execute) ;; + finish) ;; + install) ;; + link) ;; + relink) ;; + uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" + shift + ;; + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" + opt_silent=: + opt_verbose=false + ;; + + --no-quiet|--no-silent) + preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + opt_verbose=: + ;; + + --no-verbose) preserve_args="$preserve_args $opt" + opt_verbose=false + ;; + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here + shift + ;; + + # Separate optargs to long options: + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + shift + ;; + + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --help-all) opt_help=': help-all' ;; + --version) func_version ;; + + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; esac + done - $opt_help || { - # Sanity checks first: - func_check_version_match - test yes != "$build_libtool_libs" \ - && test yes != "$build_old_libs" \ - && func_fatal_configuration "not configured to build any kind of library" + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* ) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + ;; + esac - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test execute != "$opt_mode"; then - func_error "unrecognized option '-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi - # Change the help message to a mode-specific one. - generic_help=$help - help="Try '$progname --help --mode=$opt_mode' for more information." - } - - # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + exit $EXIT_MISMATCH + fi } -func_add_hook func_validate_options libtool_validate_options - - -# Process options as early as possible so that --help and --version -# can return quickly. -func_options ${1+"$@"} -eval set dummy "$func_options_result"; shift - ## ----------- ## ## Main. ## ## ----------- ## -magic='%%%MAGIC variable%%%' -magic_exe='%%%MAGIC EXE variable%%%' +$opt_help || { + # Sanity checks first: + func_check_version_match -# Global variables. -extracted_archives= -extracted_serial=0 + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= + test -z "$mode" && func_fatal_error "error: you must specify a MODE." -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} + # Darwin sucks + eval "std_shrext=\"$shrext_cmds\"" -# func_generated_by_libtool -# True iff stdin has been generated by Libtool. This function is only -# a basic sanity check; it will hardly flush out determined imposters. -func_generated_by_libtool_p () -{ - $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$mode' for more information." } + # func_lalib_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. +# True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. +# True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be -# fatal anyway. Works if 'file' does not exist. +# fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no @@ -2521,13 +1083,13 @@ func_lalib_unsafe_p () for lalib_p_l in 1 2 3 4 do read lalib_p_line - case $lalib_p_line in + case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi - test yes = "$lalib_p" + test "$lalib_p" = yes } # func_ltwrapper_script_p file @@ -2536,8 +1098,7 @@ func_lalib_unsafe_p () # determined imposters. func_ltwrapper_script_p () { - test -f "$1" && - $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p + func_lalib_p "$1" } # func_ltwrapper_executable_p file @@ -2560,9 +1121,12 @@ func_ltwrapper_executable_p () # temporary ltwrapper_script. func_ltwrapper_scriptname () { - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper + func_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi } # func_ltwrapper_p file @@ -2581,13 +1145,11 @@ func_ltwrapper_p () # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { - $debug_cmd - + $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do - IFS=$sp$nl - eval cmd=\"$cmd\" IFS=$save_ifs + eval "cmd=\"$cmd\"" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs @@ -2599,11 +1161,10 @@ func_execute_cmds () # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing -# 'FILE.' does not work on cygwin managed mounts. +# `FILE.' does not work on cygwin managed mounts. func_source () { - $debug_cmd - + $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; @@ -2611,37 +1172,6 @@ func_source () } -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case $lt_sysroot:$1 in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result='='$func_stripname_result - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. @@ -2650,12 +1180,12 @@ func_replace_sysroot () # arg is usually of the form 'gcc ...' func_infer_tag () { - $debug_cmd - + $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do - func_append_quoted CC_quoted "$arg" + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` @@ -2670,11 +1200,12 @@ func_infer_tag () for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. - eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` @@ -2695,7 +1226,7 @@ func_infer_tag () # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with '--tag'" + func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi @@ -2711,15 +1242,15 @@ func_infer_tag () # but don't create it if we're doing a dry run. func_write_libtool_object () { - write_libobj=$1 - if test yes = "$build_libtool_libs"; then - write_lobj=\'$2\' + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' else write_lobj=none fi - if test yes = "$build_old_libs"; then - write_oldobj=\'$3\' + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' else write_oldobj=none fi @@ -2727,7 +1258,7 @@ func_write_libtool_object () $opt_dry_run || { cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $debug_cmd - - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result= - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result"; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $debug_cmd - - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $debug_cmd - - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $debug_cmd - - if test -z "$2" && test -n "$1"; then - func_error "Could not determine host file name corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result=$1 - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $debug_cmd - - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " '$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result=$3 - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $debug_cmd - - case $4 in - $1 ) func_to_host_path_result=$3$func_to_host_path_result - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via '$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $debug_cmd - - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $debug_cmd - - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result=$1 -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result=$func_convert_core_msys_to_w32_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result=$func_convert_core_file_wine_to_w32_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result=$func_cygpath_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result=$func_cygpath_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via '$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $debug_cmd - - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd=func_convert_path_$func_stripname_result - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $debug_cmd - - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result=$1 -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_msys_to_w32_result - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_path_wine_to_w32_result - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result=$func_cygpath_result - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result=$func_cygpath_result - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_dll_def_p FILE -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with _LT_DLL_DEF_P in libtool.m4 -func_dll_def_p () -{ - $debug_cmd - - func_dll_def_p_tmp=`$SED -n \ - -e 's/^[ ]*//' \ - -e '/^\(;.*\)*$/d' \ - -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ - -e q \ - "$1"` - test DEF = "$func_dll_def_p_tmp" -} - - # func_mode_compile arg... func_mode_compile () { - $debug_cmd - + $opt_debug # Get the compilation command and the source file. base_compile= - srcfile=$nonopt # always keep a non-empty value in "srcfile" + srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal @@ -3281,12 +1293,12 @@ func_mode_compile () case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile - lastarg=$arg + lastarg="$arg" arg_mode=normal ;; target ) - libobj=$arg + libobj="$arg" arg_mode=normal continue ;; @@ -3296,18 +1308,18 @@ func_mode_compile () case $arg in -o) test -n "$libobj" && \ - func_fatal_error "you cannot specify '-o' more than once" + func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) - func_append pie_flag " $arg" + pie_flag="$pie_flag $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" + later="$later $arg" continue ;; @@ -3325,17 +1337,18 @@ func_mode_compile () func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= - save_ifs=$IFS; IFS=, + save_ifs="$IFS"; IFS=',' for arg in $args; do - IFS=$save_ifs - func_append_quoted lastarg "$arg" + IFS="$save_ifs" + func_quote_for_eval "$arg" + lastarg="$lastarg $func_quote_for_eval_result" done - IFS=$save_ifs + IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. - func_append base_compile " $lastarg" + base_compile="$base_compile $lastarg" continue ;; @@ -3343,15 +1356,16 @@ func_mode_compile () # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # - lastarg=$srcfile - srcfile=$arg + lastarg="$srcfile" + srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" + func_quote_for_eval "$lastarg" + base_compile="$base_compile $func_quote_for_eval_result" done # for arg case $arg_mode in @@ -3359,13 +1373,13 @@ func_mode_compile () func_fatal_error "you must specify an argument for -Xcompile" ;; target) - func_fatal_error "you must specify a target with '-o'" + func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" - libobj=$func_basename_result + libobj="$func_basename_result" } ;; esac @@ -3376,7 +1390,7 @@ func_mode_compile () *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -3385,7 +1399,7 @@ func_mode_compile () case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) - func_fatal_error "cannot determine name of library object from '$libobj'" + func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac @@ -3394,8 +1408,8 @@ func_mode_compile () for arg in $later; do case $arg in -shared) - test yes = "$build_libtool_libs" \ - || func_fatal_configuration "cannot build a shared library" + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; @@ -3421,17 +1435,17 @@ func_mode_compile () func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name '$libobj' may not contain shell special characters." + && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" - objname=$func_basename_result - xdir=$func_dirname_result - lobj=$xdir$objdir/$objname + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. - if test yes = "$build_old_libs"; then + if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" @@ -3443,16 +1457,16 @@ func_mode_compile () pic_mode=default ;; esac - if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c - if test no = "$compiler_c_o"; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext - lockfile=$output_obj.lock + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" else output_obj= need_locks=no @@ -3461,12 +1475,12 @@ func_mode_compile () # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file - if test yes = "$need_locks"; then + if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done - elif test warn = "$need_locks"; then + elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: @@ -3474,7 +1488,7 @@ func_mode_compile () This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you +your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -3482,25 +1496,26 @@ compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi - func_append removelist " $output_obj" + removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" + removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result + if test -n "$fix_srcfile_path"; then + eval "srcfile=\"$fix_srcfile_path\"" + fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile - if test no != "$pic_mode"; then + if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code @@ -3511,13 +1526,13 @@ compiler." if test -z "$output_obj"; then # Place PIC objects in $objdir - func_append command " -o $lobj" + command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - if test warn = "$need_locks" && + if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -3528,7 +1543,7 @@ $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you +your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -3544,29 +1559,29 @@ compiler." fi # Allow error messages only from the first compilation. - if test yes = "$suppress_opt"; then + if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. - if test yes = "$build_old_libs"; then - if test yes != "$pic_mode"; then + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi - if test yes = "$compiler_c_o"; then - func_append command " -o $obj" + if test "$compiler_c_o" = yes; then + command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" + command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - if test warn = "$need_locks" && + if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -3577,7 +1592,7 @@ $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you +your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -3597,7 +1612,7 @@ compiler." func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked - if test no != "$need_locks"; then + if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi @@ -3607,13 +1622,13 @@ compiler." } $opt_help || { - test compile = "$opt_mode" && func_mode_compile ${1+"$@"} + test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. - case $opt_mode in + case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. @@ -3627,7 +1642,7 @@ func_mode_help () Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated @@ -3644,18 +1659,18 @@ This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a '.o' file suitable for static linking - -static only build a '.o' file suitable for static linking + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler -COMPILE-COMMAND is a command to be used in creating a 'standard' object file +COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix '.c' with the -library object suffix, '.lo'." +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." ;; execute) @@ -3668,7 +1683,7 @@ This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path -This mode sets the library path environment variable according to '-dlopen' +This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated @@ -3687,7 +1702,7 @@ Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use -the '--dry-run' option if you just want to see what would be executed." +the \`--dry-run' option if you just want to see what would be executed." ;; install) @@ -3697,7 +1712,7 @@ the '--dry-run' option if you just want to see what would be executed." Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be -either the 'install' or 'cp' program. +either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: @@ -3723,7 +1738,7 @@ The following components of LINK-COMMAND are treated specially: -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) - -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE @@ -3737,8 +1752,7 @@ The following components of LINK-COMMAND are treated specially: -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE use a list of object files found in FILE to specify objects - -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information @@ -3758,20 +1772,20 @@ The following components of LINK-COMMAND are treated specially: -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) -All other options (arguments beginning with '-') are ignored. +All other options (arguments beginning with \`-') are ignored. -Every other argument is treated as a filename. Files ending in '.la' are +Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. -If the OUTPUT-FILE ends in '.la', then a libtool library is created, -only library objects ('.lo' files) may be specified, and '-rpath' is +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. -If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created -using 'ar' and 'ranlib', or on Windows using 'lib'. +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. -If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; @@ -3782,7 +1796,7 @@ is created, otherwise an executable program is created." Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. @@ -3790,33 +1804,33 @@ Otherwise, only FILE itself is deleted using RM." ;; *) - func_fatal_help "invalid operation mode '$opt_mode'" + func_fatal_help "invalid operation mode \`$mode'" ;; esac echo - $ECHO "Try '$progname --help' for more information about other modes." + $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then - if test : = "$opt_help"; then + if test "$opt_help" = :; then func_mode_help else { func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do + for mode in compile link execute install finish uninstall clean; do func_mode_help done - } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do + for mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | - $SED '1d + sed '1d /^When reporting/,/^Report/{ H d @@ -3833,27 +1847,23 @@ fi # func_mode_execute arg... func_mode_execute () { - $debug_cmd - + $opt_debug # The first argument is the command name. - cmd=$nonopt + cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. - for file in $opt_dlopen; do + for file in $execute_dlfiles; do test -f "$file" \ - || func_fatal_help "'$file' is not a file" + || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$lib' is not a valid libtool archive" + || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= @@ -3864,18 +1874,18 @@ func_mode_execute () if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ - func_warning "'$file' was not linked with '-export-dynamic'" + func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." - dir=$func_dirname_result + dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" + dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; @@ -3883,30 +1893,30 @@ func_mode_execute () *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." - dir=$func_dirname_result + dir="$func_dirname_result" ;; *) - func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir=$absdir + test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" + if eval test -z \"\$$shlibpath_var\"; then + eval $shlibpath_var=\$dir else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + eval $shlibpath_var=\$dir:\$$shlibpath_var fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. - libtool_execute_magic=$magic + libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= @@ -3919,28 +1929,21 @@ func_mode_execute () if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. - file=$progdir/$program + file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. - file=$progdir/$program + file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" done - if $opt_dry_run; then - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - else + if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" @@ -3957,64 +1960,34 @@ func_mode_execute () done # Now prepare to actually exec the command. - exec_cmd=\$cmd$args + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS fi } -test execute = "$opt_mode" && func_mode_execute ${1+"$@"} +test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { - $debug_cmd - - libs= - libdirs= + $opt_debug + libdirs="$nonopt" admincmds= - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "'$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument '$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and '=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -4024,77 +1997,73 @@ func_mode_finish () if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " + $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. - $opt_quiet && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the '-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the '$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the '$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" + $opt_silent && exit $EXIT_SUCCESS - $ECHO " - use the '$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" - fi - echo + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval "flag=\"$hardcode_libdir_flag_spec\"" - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" + $ECHO " - use the \`$flag' linker flag" fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS } -test finish = "$opt_mode" && func_mode_finish ${1+"$@"} +test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { - $debug_cmd - + $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). - if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac - then + case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -4108,7 +2077,7 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + install_prog="$install_prog$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4121,20 +2090,20 @@ func_mode_install () opts= prev= install_type= - isdir=false + isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then - func_append files " $dest" + files="$files $dest" dest=$arg continue fi case $arg in - -d) isdir=: ;; + -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg @@ -4152,7 +2121,7 @@ func_mode_install () *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then - if test X-m = "X$prev" && test -n "$install_override_mode"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi @@ -4166,23 +2135,23 @@ func_mode_install () # Aesthetically quote the argument. func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + install_prog="$install_prog $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + install_shared_prog="$install_shared_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ - func_fatal_help "the '$prev' option requires an argument" + func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" fi fi @@ -4199,19 +2168,19 @@ func_mode_install () dest=$func_stripname_result # Check to see that the destination is a directory. - test -d "$dest" && isdir=: - if $isdir; then - destdir=$dest + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." - destdir=$func_dirname_result - destname=$func_basename_result + destdir="$func_dirname_result" + destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ - func_fatal_help "'$dest' is not a directory" + func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -4220,7 +2189,7 @@ func_mode_install () case $file in *.lo) ;; *) - func_fatal_help "'$destdir' must be an absolute directory name" + func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done @@ -4229,7 +2198,7 @@ func_mode_install () # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic=$magic + libtool_install_magic="$magic" staticlibs= future_libdirs= @@ -4240,16 +2209,13 @@ func_mode_install () case $file in *.$libext) # Do the static libraries later. - func_append staticlibs " $file" + staticlibs="$staticlibs $file" ;; *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$file' is not a valid libtool archive" + || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= @@ -4260,19 +2226,19 @@ func_mode_install () if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; + *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; + *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" - dir=$func_dirname_result - func_append dir "$objdir" + dir="$func_dirname_result" + dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. @@ -4285,7 +2251,7 @@ func_mode_install () # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. @@ -4294,36 +2260,29 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi - func_warning "relinking '$file'" + func_warning "relinking \`$file'" func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then - realname=$1 + realname="$1" shift - srcname=$realname - test -n "$relink_command" && srcname=${realname}T + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' - tstripme=$stripme + tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) - tstripme= - ;; - esac - ;; - os2*) - case $realname in - *_dll.a) - tstripme= + tstripme="" ;; esac ;; @@ -4334,7 +2293,7 @@ func_mode_install () if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. - # Try 'ln -sf' first, because the 'ln' binary might depend on + # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname @@ -4345,18 +2304,18 @@ func_mode_install () fi # Do each command in the postinstall commands. - lib=$destdir/$realname + lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" - name=$func_basename_result - instname=$dir/${name}i + name="$func_basename_result" + instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) @@ -4364,11 +2323,11 @@ func_mode_install () # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile=$destdir/$destname + destfile="$destdir/$destname" else func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile + destfile="$func_basename_result" + destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. @@ -4378,11 +2337,11 @@ func_mode_install () staticdest=$func_lo2o_result ;; *.$objext) - staticdest=$destfile + staticdest="$destfile" destfile= ;; *) - func_fatal_help "cannot copy a libtool object to '$destfile'" + func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac @@ -4391,7 +2350,7 @@ func_mode_install () func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. - if test yes = "$build_old_libs"; then + if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result @@ -4403,23 +2362,23 @@ func_mode_install () *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile=$destdir/$destname + destfile="$destdir/$destname" else func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile + destfile="$func_basename_result" + destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install - stripped_ext= + stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result - stripped_ext=.exe + stripped_ext=".exe" fi ;; esac @@ -4447,19 +2406,19 @@ func_mode_install () # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script '$wrapper'" + func_fatal_error "invalid libtool wrapper script \`$wrapper'" - finalize=: + finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi - libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "'$lib' has not been installed in '$libdir'" - finalize=false + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no fi done @@ -4467,29 +2426,29 @@ func_mode_install () func_source "$wrapper" outputname= - if test no = "$fast_install" && test -n "$relink_command"; then + if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { - if $finalize; then + if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" - file=$func_basename_result - outputname=$tmpdir/$file + file="$func_basename_result" + outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - $opt_quiet || { + $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else - func_error "error: relink '$file' with the above command before installing it" + func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi - file=$outputname + file="$outputname" else - func_warning "cannot relink '$file'" + func_warning "cannot relink \`$file'" fi } else @@ -4526,17 +2485,15 @@ func_mode_install () for file in $staticlibs; do func_basename "$file" - name=$func_basename_result + name="$func_basename_result" # Set up the ranlib parameters. - oldlib=$destdir/$name - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result + oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -4544,18 +2501,18 @@ func_mode_install () done test -n "$future_libdirs" && \ - func_warning "remember to run '$progname --finish$future_libdirs'" + func_warning "remember to run \`$progname --finish$future_libdirs'" - if test -n "$current_libdirs"; then + if test -n "$current_libdirs" && $opt_finish; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } -test install = "$opt_mode" && func_mode_install ${1+"$@"} +test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -4563,17 +2520,16 @@ test install = "$opt_mode" && func_mode_install ${1+"$@"} # a dlpreopen symbol table. func_generate_dlsyms () { - $debug_cmd - - my_outputname=$1 - my_originator=$2 - my_pic_p=${3-false} - my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms=${my_outputname}S.c + my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi @@ -4584,7 +2540,7 @@ func_generate_dlsyms () "") ;; *.c) # Discover the nlist of each of the dlfiles. - nlist=$output_objdir/$my_outputname.nm + nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" @@ -4592,83 +2548,68 @@ func_generate_dlsyms () func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif -#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - /* External symbol declarations for the compiler. */\ " - if test yes = "$dlself"; then - func_verbose "generating symbol list for '$output'" + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from '$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' + $EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then - export_symbols=$output_objdir/$outputname.exp + export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols - eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + ${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' < "$nlist" > "$export_symbols" case $host in *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + echo EXPORTS > "$output_objdir/$outputname.def" + cat "$export_symbols" >> "$output_objdir/$outputname.def" ;; esac } else $opt_dry_run || { - eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' + ${SED} -e 's/\([].[*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/' < "$export_symbols" > "$output_objdir/$outputname.exp" + $GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" case $host in *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + echo EXPORTS > "$output_objdir/$outputname.def" + cat "$nlist" >> "$output_objdir/$outputname.def" ;; esac } @@ -4676,55 +2617,13 @@ extern \"C\" { fi for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from '$dlprefile'" + func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" - name=$func_basename_result - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename= - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname"; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename=$func_basename_result - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename"; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac + name="$func_basename_result" + $opt_dry_run || { + $ECHO ": $name " >> "$nlist" + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } done $opt_dry_run || { @@ -4755,11 +2654,6 @@ extern \"C\" { echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - func_show_eval '$RM "${nlist}I"' - if test -n "$global_symbol_to_import"; then - eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' - fi - echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ @@ -4767,31 +2661,29 @@ typedef struct { const char *name; void *address; } lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[];\ " - - if test -s "$nlist"I; then + case $host in + *cygwin* | *mingw* | *cegcc* ) echo >> "$output_objdir/$my_dlsyms" "\ -static void lt_syminit(void) -{ - LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; - for (; symbol->name; ++symbol) - {" - $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ - } -}" - fi +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ -LT_DLSYM_CONST lt_dlsymlist +extern $lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +$lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = -{ {\"$my_originator\", (void *) 0}," - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ - {\"@INIT@\", (void *) <_syminit}," - fi +{\ + { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) @@ -4828,12 +2720,14 @@ static const void *lt_preloaded_setup() { # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) - $my_pic_p && pic_flag_for_symtable=" $pic_flag" + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi ;; esac ;; @@ -4842,7 +2736,7 @@ static const void *lt_preloaded_setup() { for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; + *) symtab_cflags="$symtab_cflags $arg" ;; esac done @@ -4850,10 +2744,10 @@ static const void *lt_preloaded_setup() { func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. - symfileobj=$output_objdir/${my_outputname}S.$objext + symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then @@ -4871,7 +2765,7 @@ static const void *lt_preloaded_setup() { esac ;; *) - func_fatal_error "unknown suffix for '$my_dlsyms'" + func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else @@ -4885,32 +2779,6 @@ static const void *lt_preloaded_setup() { fi } -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - # func_win32_libid arg # return the library type of file 'arg' # @@ -4920,41 +2788,25 @@ func_cygming_ms_implib_p () # Despite the name, also deal with 64 bit binaries. func_win32_libid () { - $debug_cmd - - win32_libid_type=unknown + $opt_debug + win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - case $nm_interface in - "MS dumpbin") - if func_cygming_ms_implib_p "$1" || - func_cygming_gnu_implib_p "$1" - then - win32_nmres=import - else - win32_nmres= - fi - ;; - *) - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' + if $OBJDUMP -f "$1" | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + win32_nmres=`$NM -f posix -A "$1" | + $SED -n -e ' 1,100{ / I /{ - s|.*|import| + s,.*,import, p q } }'` - ;; - esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; @@ -4975,120 +2827,15 @@ func_win32_libid () $ECHO "$win32_libid_type" } -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $debug_cmd - - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $debug_cmd - - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive that possess that section. Heuristic: eliminate - # all those that have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $debug_cmd - - if func_cygming_gnu_implib_p "$1"; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1"; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result= - fi -} # func_extract_an_archive dir oldlib func_extract_an_archive () { - $debug_cmd - - f_ex_an_ar_dir=$1; shift - f_ex_an_ar_oldlib=$1 - if test yes = "$lock_old_archive_extraction"; then + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" @@ -5097,7 +2844,7 @@ func_extract_an_archive () fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' - if test yes = "$lock_old_archive_extraction"; then + if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then @@ -5111,23 +2858,22 @@ func_extract_an_archive () # func_extract_archives gentop oldlib ... func_extract_archives () { - $debug_cmd - - my_gentop=$1; shift + $opt_debug + my_gentop="$1"; shift my_oldlibs=${1+"$@"} - my_oldobjs= - my_xlib= - my_xabs= - my_xdir= + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" - my_xlib=$func_basename_result + my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in @@ -5139,7 +2885,7 @@ func_extract_archives () esac done extracted_archives="$extracted_archives $my_xlib_u" - my_xdir=$my_gentop/$my_xlib_u + my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" @@ -5152,23 +2898,22 @@ func_extract_archives () cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` - func_basename "$darwin_archive" - darwin_base_archive=$func_basename_result + darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches; do - func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" - $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" - cd "unfat-$$/$darwin_base_archive-$darwin_arch" - func_extract_an_archive "`pwd`" "$darwin_base_archive" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" - $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do @@ -5190,7 +2935,7 @@ func_extract_archives () my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done - func_extract_archives_result=$my_oldobjs + func_extract_archives_result="$my_oldobjs" } @@ -5205,7 +2950,7 @@ func_extract_archives () # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script -# will assume that the directory where it is stored is +# will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () @@ -5216,7 +2961,7 @@ func_emit_wrapper () #! $SHELL # $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. @@ -5269,113 +3014,7 @@ func_fallback_echo () _LTECHO_EOF' } ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case \" \$* \" in - *\\ --lt-*) - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done ;; - esac - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} + fi\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` @@ -5418,13 +3057,13 @@ func_exec_program () test -n \"\$absdir\" && thisdir=\"\$absdir\" " - if test yes = "$fast_install"; then + if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" @@ -5439,9 +3078,9 @@ func_exec_program () # relink executable if necessary if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : + if relink_command_output=\`eval \"\$relink_command\" 2>&1\`; then : else - \$ECHO \"\$relink_command_output\" >&2 + $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi @@ -5463,20 +3102,8 @@ func_exec_program () if test -f \"\$progdir/\$program\"; then" - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - # Export our shlibpath_var if we have one. - if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" @@ -5489,14 +3116,39 @@ func_exec_program () " fi + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 fi else # The program doesn't exist. - \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 @@ -5506,6 +3158,166 @@ fi\ } +# func_to_host_path arg +# +# Convert paths to host format when used with build tools. +# Intended for use with "native" mingw (where libtool itself +# is running under the msys shell), or in the following cross- +# build environments: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# where wine is equipped with the `winepath' executable. +# In the native mingw case, the (msys) shell automatically +# converts paths for any non-msys applications it launches, +# but that facility isn't available from inside the cwrapper. +# Similar accommodations are necessary for $host mingw and +# $build cygwin. Calling this function does no harm for other +# $host/$build combinations not listed above. +# +# ARG is the path (on $build) that should be converted to +# the proper representation for $host. The result is stored +# in $func_to_host_path_result. +func_to_host_path () +{ + func_to_host_path_result="$1" + if test -n "$1"; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + case $build in + *mingw* ) # actually, msys + # awkward: cmd appends spaces to result + func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_result=`cygpath -w "$1" | + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then + func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" | + $SED -e "$lt_sed_naive_backslashify"` + else + # Allow warning below. + func_to_host_path_result= + fi + ;; + esac + if test -z "$func_to_host_path_result" ; then + func_error "Could not determine host path corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi + ;; + esac + fi +} +# end: func_to_host_path + +# func_to_host_pathlist arg +# +# Convert pathlists to host format when used with build tools. +# See func_to_host_path(), above. This function supports the +# following $build/$host combinations (but does no harm for +# combinations not listed here): +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# +# Path separators are also converted from $build format to +# $host format. If ARG begins or ends with a path separator +# character, it is preserved (but converted to $host format) +# on output. +# +# ARG is a pathlist (on $build) that should be converted to +# the proper representation on $host. The result is stored +# in $func_to_host_pathlist_result. +func_to_host_pathlist () +{ + func_to_host_pathlist_result="$1" + if test -n "$1"; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_pathlist_tmp1=$func_stripname_result + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + func_to_host_pathlist_result=` + ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # unfortunately, winepath doesn't convert pathlists + func_to_host_pathlist_result="" + func_to_host_pathlist_oldIFS=$IFS + IFS=: + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do + IFS=$func_to_host_pathlist_oldIFS + if test -n "$func_to_host_pathlist_f" ; then + func_to_host_path "$func_to_host_pathlist_f" + if test -n "$func_to_host_path_result" ; then + if test -z "$func_to_host_pathlist_result" ; then + func_to_host_pathlist_result="$func_to_host_path_result" + else + func_append func_to_host_pathlist_result ";$func_to_host_path_result" + fi + fi + fi + done + IFS=$func_to_host_pathlist_oldIFS + ;; + esac + if test -z "$func_to_host_pathlist_result"; then + func_error "Could not determine the host path(s) corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This may break if $1 contains DOS-style drive + # specifications. The fix is not to complicate the expression + # below, but for the user to provide a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works properly. + lt_replace_pathsep_nix_to_dos="s|:|;|g" + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_replace_pathsep_nix_to_dos"` + fi + # Now, add the leading and trailing path separators back + case "$1" in + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" + ;; + esac + case "$1" in + *: ) func_append func_to_host_pathlist_result ";" + ;; + esac + ;; + esac + fi +} +# end: func_to_host_pathlist + # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because @@ -5515,13 +3327,17 @@ func_emit_cwrapperexe_src () cat < #include -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - /* declarations of non-ANSI functions */ -#if defined __MINGW32__ +#if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif -#elif defined __CYGWIN__ +#elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif -/* #elif defined other_platform || defined ... */ +/* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ -#if defined _MSC_VER +#if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC -#elif defined __MINGW32__ +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv -#elif defined __CYGWIN__ +#elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" -/* #elif defined other platforms ... */ +/* #elif defined (other platforms) ... */ #endif -#if defined PATH_MAX +#if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX -#elif defined MAXPATHLEN +#elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 @@ -5607,8 +3425,8 @@ int setenv (const char *, const char *, int); # define PATH_SEPARATOR ':' #endif -#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ - defined __OS2__ +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 @@ -5641,16 +3459,25 @@ int setenv (const char *, const char *, int); #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ - if (stale) { free (stale); stale = 0; } \ + if (stale) { free ((void *) stale); stale = 0; } \ } while (0) +#undef LTWRAPPER_DEBUGPRINTF #if defined LT_DEBUGWRAPPER -static int lt_debug = 1; +# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args +static void +ltwrapper_debugprintf (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); +} #else -static int lt_debug = 0; +# define LTWRAPPER_DEBUGPRINTF(args) #endif -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ +const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); @@ -5660,10 +3487,7 @@ char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); +void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); @@ -5673,19 +3497,14 @@ void lt_dump_script (FILE *f); EOF cat <"))); for (i = 0; i < newargc; i++) { - lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", - i, nonnull (newargz[i])); + LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF @@ -5902,13 +3702,11 @@ EOF cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ newargz = prepare_spawn (newargz); - rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); + rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ - lt_debugprintf (__FILE__, __LINE__, - "(main) failed to launch target \"%s\": %s\n", - lt_argv_zero, nonnull (strerror (errno))); + LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; @@ -5930,7 +3728,7 @@ xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) - lt_fatal (__FILE__, __LINE__, "memory exhausted"); + lt_fatal ("Memory exhausted"); return p; } @@ -5947,7 +3745,7 @@ base_name (const char *name) { const char *base; -#if defined HAVE_DOS_BASED_FILE_SYSTEM +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; @@ -5964,8 +3762,8 @@ check_executable (const char *path) { struct stat st; - lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", - nonempty (path)); + LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; @@ -5982,8 +3780,8 @@ make_executable (const char *path) int rval = 0; struct stat st; - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); + LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; @@ -6006,17 +3804,17 @@ find_executable (const char *wrapper) const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; - size_t tmp_len; + int tmp_len; char *concat_name; - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); + LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", + wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ -#if defined HAVE_DOS_BASED_FILE_SYSTEM +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); @@ -6034,7 +3832,7 @@ find_executable (const char *wrapper) return concat_name; XFREE (concat_name); } -#if defined HAVE_DOS_BASED_FILE_SYSTEM +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif @@ -6057,14 +3855,13 @@ find_executable (const char *wrapper) for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; - p_len = (size_t) (q - p); + p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); + lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); @@ -6089,8 +3886,7 @@ find_executable (const char *wrapper) } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); + lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); @@ -6116,9 +3912,8 @@ chase_symlinks (const char *pathspec) int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); + LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", + tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) @@ -6140,9 +3935,8 @@ chase_symlinks (const char *pathspec) } else { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); + char *errstr = strerror (errno); + lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); @@ -6155,8 +3949,7 @@ chase_symlinks (const char *pathspec) tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); + lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif @@ -6176,31 +3969,17 @@ strendzap (char *str, const char *pat) if (patlen <= len) { str += len - patlen; - if (STREQ (str, pat)) + if (strcmp (str, pat) == 0) *str = '\0'; } return str; } -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, +lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); @@ -6209,39 +3988,27 @@ lt_error_core (int exit_status, const char *file, } void -lt_fatal (const char *file, int line, const char *message, ...) +lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - void lt_setenv (const char *name, const char *value) { - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); + LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", + (name ? name : ""), + (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else - size_t len = strlen (name) + 1 + strlen (value) + 1; + int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) @@ -6258,8 +4025,8 @@ lt_extend_str (const char *orig_value, const char *add, int to_end) char *new_value; if (orig_value && *orig_value) { - size_t orig_value_len = strlen (orig_value); - size_t add_len = strlen (add); + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { @@ -6282,18 +4049,18 @@ lt_extend_str (const char *orig_value, const char *add, int to_end) void lt_update_exe_path (const char *name, const char *value) { - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); + LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ - size_t len = strlen (new_value); - while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { - new_value[--len] = '\0'; + new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); @@ -6303,9 +4070,9 @@ lt_update_exe_path (const char *name, const char *value) void lt_update_lib_path (const char *name, const char *value) { - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); + LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); if (name && *name && value && *value) { @@ -6441,15 +4208,9 @@ void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | - $SED -n -e ' -s/^\(.\{79\}\)\(..*\)/\1\ -\2/ -h -s/\([\\"]\)/\\\1/g -s/$/\\n/ -s/\([^\n]*\).*/ fputs ("\1", f);/p -g -D' + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + cat <<"EOF" } EOF @@ -6460,47 +4221,27 @@ EOF # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { - $debug_cmd - - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + $opt_debug + case `eval "$file_magic_cmd \"\$1\" 2>/dev/null" | $SED -e 10q` in *import*) : ;; *) false ;; esac } -# func_suncc_cstd_abi -# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! -# Several compiler flags select an ABI that is incompatible with the -# Cstd library. Avoid specifying it if any are in CXXFLAGS. -func_suncc_cstd_abi () -{ - $debug_cmd - - case " $compile_command " in - *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) - suncc_use_cstd_abi=no - ;; - *) - suncc_use_cstd_abi=yes - ;; - esac -} - # func_mode_link arg... func_mode_link () { - $debug_cmd - + $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out - # what system we are compiling for in order to pass an extra + # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll that has undefined symbols, in which case not + # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. @@ -6544,11 +4285,10 @@ func_mode_link () module=no no_install=no objs= - os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no - preload=false + preload=no prev= prevarg= release= @@ -6560,7 +4300,7 @@ func_mode_link () vinfo= vinfo_number=no weak_libs= - single_module=$wl-single_module + single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. @@ -6568,15 +4308,15 @@ func_mode_link () do case $arg in -shared) - test yes != "$build_libtool_libs" \ - && func_fatal_configuration "cannot build a shared library" + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) - if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then @@ -6609,7 +4349,7 @@ func_mode_link () # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do - arg=$1 + arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result @@ -6626,21 +4366,21 @@ func_mode_link () case $prev in bindir) - bindir=$arg + bindir="$arg" prev= continue ;; dlfiles|dlprefiles) - $preload || { + if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" - preload=: - } + preload=yes + fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) - if test no = "$dlself"; then + if test "$dlself" = no; then dlself=needless export_dynamic=yes fi @@ -6648,9 +4388,9 @@ func_mode_link () continue ;; self) - if test dlprefiles = "$prev"; then + if test "$prev" = dlprefiles; then dlself=yes - elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless @@ -6660,10 +4400,10 @@ func_mode_link () continue ;; *) - if test dlfiles = "$prev"; then - func_append dlfiles " $arg" + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" else - func_append dlprefiles " $arg" + dlprefiles="$dlprefiles $arg" fi prev= continue @@ -6671,14 +4411,14 @@ func_mode_link () esac ;; expsyms) - export_symbols=$arg + export_symbols="$arg" test -f "$arg" \ - || func_fatal_error "symbol file '$arg' does not exist" + || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) - export_symbols_regex=$arg + export_symbols_regex="$arg" prev= continue ;; @@ -6687,7 +4427,7 @@ func_mode_link () *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; @@ -6696,13 +4436,7 @@ func_mode_link () continue ;; inst_prefix) - inst_prefix_dir=$arg - prev= - continue - ;; - mllvm) - # Clang does not use LLVM to link, so we can simply discard any - # '-mllvm $arg' options when doing the link step. + inst_prefix_dir="$arg" prev= continue ;; @@ -6712,7 +4446,7 @@ func_mode_link () moreargs= for fil in `cat "$save_arg"` do -# func_append moreargs " $fil" +# moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. @@ -6726,22 +4460,22 @@ func_mode_link () if test -z "$pic_object" || test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" - if test none != "$pic_object"; then + if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object + pic_object="$xdir$pic_object" - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then - func_append dlfiles " $pic_object" + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" prev= continue else @@ -6751,31 +4485,31 @@ func_mode_link () fi # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then + if test "$prev" = dlprefiles; then # Preload the old-style object. - func_append dlprefiles " $pic_object" + dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" - arg=$pic_object + arg="$pic_object" fi # Non-PIC object. - if test none != "$non_pic_object"; then + if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object + non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object + non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else @@ -6783,7 +4517,7 @@ func_mode_link () if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -6791,29 +4525,24 @@ func_mode_link () func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "'$arg' is not a valid libtool object" + func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else - func_fatal_error "link input file '$arg' does not exist" + func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; - os2dllname) - os2dllname=$arg - prev= - continue - ;; precious_regex) - precious_files_regex=$arg + precious_files_regex="$arg" prev= continue ;; release) - release=-$arg + release="-$arg" prev= continue ;; @@ -6825,48 +4554,48 @@ func_mode_link () func_fatal_error "only absolute run-paths are allowed" ;; esac - if test rpath = "$prev"; then + if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; - *) func_append rpath " $arg" ;; + *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; - *) func_append xrpath " $arg" ;; + *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) - shrext_cmds=$arg + shrext_cmds="$arg" prev= continue ;; weak) - func_append weak_libs " $arg" + weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) - func_append compiler_flags " $qarg" + compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" @@ -6880,7 +4609,7 @@ func_mode_link () esac fi # test -n "$prev" - prevarg=$arg + prevarg="$arg" case $arg in -all-static) @@ -6894,7 +4623,7 @@ func_mode_link () -allow-undefined) # FIXME: remove this flag sometime in the future. - func_fatal_error "'-allow-undefined' must not be used because it is the default" + func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) @@ -6926,7 +4655,7 @@ func_mode_link () if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi - if test X-export-symbols = "X$arg"; then + if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex @@ -6957,37 +4686,30 @@ func_mode_link () ;; -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then + func_stripname '-L' '' "$arg" + dir=$func_stripname_result + if test -z "$dir"; then if test "$#" -gt 0; then - func_fatal_error "require no space between '-L' and '$1'" + func_fatal_error "require no space between \`-L' and \`$1'" else - func_fatal_error "need path for '-L' option" + func_fatal_error "need path for \`-L' option" fi fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of '$dir'" - dir=$absdir + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" ;; esac case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; + *" -L$dir "*) ;; *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" ;; esac case $host in @@ -6996,12 +4718,12 @@ func_mode_link () case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; + *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; + *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac @@ -7009,7 +4731,7 @@ func_mode_link () ;; -l*) - if test X-lc = "X$arg" || test X-lm = "X$arg"; then + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) @@ -7017,40 +4739,38 @@ func_mode_link () ;; *-*-os2*) # These systems don't actually have a C library (as such) - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" + deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work - test X-lc = "X$arg" && continue + test "X$arg" = "X-lc" && continue + ;; + *-*-linux*) + test "X$arg" = "X-lc" && continue ;; esac - elif test X-lc_r = "X$arg"; then + elif test "X$arg" = "X-lc_r"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi - func_append deplibs " $arg" - continue - ;; - - -mllvm) - prev=mllvm + deplibs="$deplibs $arg" continue ;; @@ -7062,28 +4782,27 @@ func_mode_link () # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" + -model|-arch|-isysroot) + compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - func_append compiler_flags " $arg" + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) - single_module=$wl-multi_module + single_module="${wl}-multi_module" continue ;; @@ -7097,8 +4816,8 @@ func_mode_link () *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. - func_warning "'-no-install' is ignored for $host" - func_warning "assuming '-no-fast-install' instead" + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; @@ -7116,11 +4835,6 @@ func_mode_link () continue ;; - -os2dllname) - prev=os2dllname - continue - ;; - -o) prev=output ;; -precious-files-regex) @@ -7149,17 +4863,13 @@ func_mode_link () # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; - *) func_append xrpath " $dir" ;; + *) xrpath="$xrpath $dir" ;; esac continue ;; @@ -7208,14 +4918,14 @@ func_mode_link () func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= - save_ifs=$IFS; IFS=, + save_ifs="$IFS"; IFS=',' for flag in $args; do - IFS=$save_ifs + IFS="$save_ifs" func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + arg="$arg $func_quote_for_eval_result" + compiler_flags="$compiler_flags $func_quote_for_eval_result" done - IFS=$save_ifs + IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -7224,15 +4934,15 @@ func_mode_link () func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= - save_ifs=$IFS; IFS=, + save_ifs="$IFS"; IFS=',' for flag in $args; do - IFS=$save_ifs + IFS="$save_ifs" func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$linker_flags $func_quote_for_eval_result" done - IFS=$save_ifs + IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -7255,66 +4965,39 @@ func_mode_link () # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" ;; - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # -fstack-protector* stack protector flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - # -specs=* GCC specs files - # -stdlib=* select c++ std lib with clang - # -fsanitize=* Clang/GCC memory and address sanitizer + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*) + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" - func_append compiler_flags " $arg" + compiler_flags="$compiler_flags $arg" continue ;; - -Z*) - if test os2 = "`expr $host : '.*\(os2\)'`"; then - # OS/2 uses -Zxxx to specify OS/2-specific options - compiler_flags="$compiler_flags $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case $arg in - -Zlinker | -Zstack) - prev=xcompiler - ;; - esac - continue - else - # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - fi - ;; - # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. - func_append objs " $arg" + objs="$objs $arg" ;; *.lo) @@ -7330,22 +5013,22 @@ func_mode_link () if test -z "$pic_object" || test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" - test none = "$pic_object" || { + if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object + pic_object="$xdir$pic_object" - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then - func_append dlfiles " $pic_object" + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" prev= continue else @@ -7355,31 +5038,31 @@ func_mode_link () fi # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then + if test "$prev" = dlprefiles; then # Preload the old-style object. - func_append dlprefiles " $pic_object" + dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" - arg=$pic_object - } + arg="$pic_object" + fi # Non-PIC object. - if test none != "$non_pic_object"; then + if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object + non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object + non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else @@ -7387,7 +5070,7 @@ func_mode_link () if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir=$func_dirname_result + xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -7395,32 +5078,31 @@ func_mode_link () func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "'$arg' is not a valid libtool object" + func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. - func_resolve_sysroot "$arg" - if test dlfiles = "$prev"; then + if test "$prev" = dlfiles; then # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" + dlfiles="$dlfiles $arg" prev= - elif test dlprefiles = "$prev"; then + elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" + dlprefiles="$dlprefiles $arg" prev= else - func_append deplibs " $func_resolve_sysroot_result" + deplibs="$deplibs $arg" fi continue ;; @@ -7430,7 +5112,7 @@ func_mode_link () # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + arg="$func_quote_for_eval_result" ;; esac # arg @@ -7442,10 +5124,10 @@ func_mode_link () done # argument parsing loop test -n "$prev" && \ - func_fatal_help "the '$prevarg' option requires an argument" + func_fatal_help "the \`$prevarg' option requires an argument" - if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval "arg=\"$export_dynamic_flag_spec\"" func_append compile_command " $arg" func_append finalize_command " $arg" fi @@ -7453,25 +5135,20 @@ func_mode_link () oldlibs= # calculate the name of the file, without its directory func_basename "$output" - outputname=$func_basename_result - libobjs_save=$libobjs + outputname="$func_basename_result" + libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - # Definition is injected by LT_CONFIG during libtool generation. - func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + eval "sys_lib_search_path=\"$sys_lib_search_path_spec\"" + eval "sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"" func_dirname "$output" "/" "" - output_objdir=$func_dirname_result$objdir - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result + output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" @@ -7492,15 +5169,15 @@ func_mode_link () # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_preserve_dup_deps; then + if $opt_duplicate_deps ; then case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi - func_append libs " $deplib" + libs="$libs $deplib" done - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps @@ -7510,9 +5187,9 @@ func_mode_link () if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac - func_append pre_post_deps " $pre_post_dep" + pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= @@ -7532,7 +5209,7 @@ func_mode_link () case $file in *.la) ;; *) - func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done @@ -7540,7 +5217,7 @@ func_mode_link () prog) compile_deplibs= finalize_deplibs= - alldeplibs=false + alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" @@ -7552,39 +5229,35 @@ func_mode_link () for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... - if test lib,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done - deplibs=$tmp_deplibs + deplibs="$tmp_deplibs" fi - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass"; then - libs=$deplibs + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" deplibs= fi - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then case $pass in - dlopen) libs=$dlfiles ;; - dlpreopen) libs=$dlprefiles ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi - if test lib,dlpreopen = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= - func_resolve_sysroot "$lib" case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; + *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library @@ -7594,46 +5267,45 @@ func_mode_link () deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; + *) deplibs="$deplibs $deplib" ;; esac done done - libs=$dlprefiles + libs="$dlprefiles" fi - if test dlopen = "$pass"; then + if test "$pass" = dlopen; then # Collect dlpreopened libraries - save_deplibs=$deplibs + save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= - found=false + found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test prog,link = "$linkmode,$pass"; then + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - func_append compiler_flags " $deplib" - if test lib = "$linkmode"; then + compiler_flags="$compiler_flags $deplib" + if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) - if test lib != "$linkmode" && test prog != "$linkmode"; then - func_warning "'-l' is ignored for archives/objects" + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" @@ -7641,22 +5313,31 @@ func_mode_link () for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library - lib=$searchdir/lib$name$search_ext + lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then - if test .la = "$search_ext"; then - found=: + if test "$search_ext" = ".la"; then + found=yes else - found=false + found=no fi break 2 fi done done - if $found; then - # deplib is a libtool library + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then @@ -7664,19 +5345,19 @@ func_mode_link () old_library= func_source "$lib" for l in $old_library $library_names; do - ll=$l + ll="$l" done - if test "X$ll" = "X$old_library"; then # only static version available - found=false + if test "X$ll" = "X$old_library" ; then # only static version available + found=no func_dirname "$lib" "" "." - ladir=$func_dirname_result + ladir="$func_dirname_result" lib=$ladir/$old_library - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi @@ -7685,28 +5366,18 @@ func_mode_link () *) ;; esac fi - else - # deplib doesn't seem to be a libtool library - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" - fi - continue fi ;; # -l *.ltframework) - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - if test lib = "$linkmode"; then + if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi @@ -7716,53 +5387,47 @@ func_mode_link () case $linkmode in lib) deplibs="$deplib $deplibs" - test conv = "$pass" && continue + test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" + newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) - if test conv = "$pass"; then + if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi - if test scan = "$pass"; then + if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" + newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) - func_warning "'-L' is ignored for archives/objects" + func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) - if test link = "$pass"; then + if test "$pass" = link; then func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result + dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; - *) func_append xrpath " $dir" ;; + *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; + *.la) lib="$deplib" ;; *.$libext) - if test conv = "$pass"; then + if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi @@ -7773,26 +5438,21 @@ func_mode_link () case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) - valid_a_lib=false + valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=: + valid_a_lib=yes fi ;; pass_all) - valid_a_lib=: + valid_a_lib=yes ;; esac - if $valid_a_lib; then - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - else + if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" @@ -7800,13 +5460,18 @@ func_mode_link () echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) - if test link != "$pass"; then + if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -7817,36 +5482,38 @@ func_mode_link () esac # linkmode ;; # *.$libext *.lo | *.$objext) - if test conv = "$pass"; then + if test "$pass" = conv; then deplibs="$deplib $deplibs" - elif test prog = "$linkmode"; then - if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. - func_append newdlprefiles " $deplib" + newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - func_append newdlfiles " $deplib" + newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) - alldeplibs=: + alldeplibs=yes continue ;; esac # case $deplib - $found || test -f "$lib" \ - || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ - || func_fatal_error "'$lib' is not a valid libtool archive" + || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." - ladir=$func_dirname_result + ladir="$func_dirname_result" dlname= dlopen= @@ -7871,174 +5538,142 @@ func_mode_link () for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass" || - { test prog != "$linkmode" && test lib != "$linkmode"; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi - if test conv = "$pass"; then + if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for '$lib'" + func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done - elif test prog != "$linkmode" && test lib != "$linkmode"; then - func_fatal_error "'$lib' is not a convenience library" + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done continue fi # $pass = conv # Get the name of the library we link against. linklib= - if test -n "$old_library" && - { test yes = "$prefer_static_libs" || - test built,no = "$prefer_static_libs,$installed"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib=$l - done - fi + for l in $old_library $library_names; do + linklib="$l" + done if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for '$lib'" + func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. - if test dlopen = "$pass"; then - test -z "$libdir" \ - && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi if test -z "$dlname" || - test yes != "$dlopen_support" || - test no = "$build_libtool_libs" - then + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" + dlprefiles="$dlprefiles $lib $dependency_libs" else - func_append newdlfiles " $lib" + newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" - abs_ladir=$ladir + abs_ladir="$ladir" fi ;; esac func_basename "$lib" - laname=$func_basename_result + laname="$func_basename_result" # Find the relevant object directory and library name. - if test yes = "$installed"; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library '$lib' was moved." - dir=$ladir - absdir=$abs_ladir - libdir=$abs_ladir + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" else - dir=$lt_sysroot$libdir - absdir=$lt_sysroot$libdir + dir="$libdir" + absdir="$libdir" fi - test yes = "$hardcode_automatic" && avoidtemprpath=yes + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir=$ladir - absdir=$abs_ladir + dir="$ladir" + absdir="$abs_ladir" # Remove this search path later - func_append notinst_path " $abs_ladir" + notinst_path="$notinst_path $abs_ladir" else - dir=$ladir/$objdir - absdir=$abs_ladir/$objdir + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" # Remove this search path later - func_append notinst_path " $abs_ladir" + notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. - if test dlpreopen = "$pass"; then - if test -z "$libdir" && test prog = "$linkmode"; then - func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" fi - case $host in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" - elif test prog,link = "$linkmode,$pass"; then + elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else @@ -8048,53 +5683,52 @@ func_mode_link () fi - if test prog = "$linkmode" && test link != "$pass"; then - func_append newlib_search_path " $ladir" + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" - linkalldeplibs=false - if test no != "$link_all_deplibs" || test -z "$library_names" || - test no = "$build_libtool_libs"; then - linkalldeplibs=: + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" + newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? - if $linkalldeplibs; then + if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_preserve_dup_deps; then + if $opt_duplicate_deps ; then case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi - func_append tmp_libs " $deplib" + tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... - if test prog,link = "$linkmode,$pass"; then + if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && - { { test no = "$prefer_static_libs" || - test built,yes = "$prefer_static_libs,$installed"; } || + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. - case $temp_rpath: in + case "$temp_rpath:" in *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; + *) temp_rpath="$temp_rpath$absdir:" ;; esac fi @@ -8106,7 +5740,7 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; + *) compile_rpath="$compile_rpath $absdir" esac ;; esac @@ -8115,15 +5749,15 @@ func_mode_link () *) case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... - if $alldeplibs && - { test pass_all = "$deplibs_check_method" || - { test yes = "$build_libtool_libs" && + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue @@ -8132,20 +5766,20 @@ func_mode_link () link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs - if test built = "$use_static_libs" && test yes = "$installed"; then + if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && - { test no = "$use_static_libs" || test -z "$old_library"; }; then + { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in - *cygwin* | *mingw* | *cegcc* | *os2*) + *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" + notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) - if test no = "$installed"; then - func_append notinst_deplibs " $lib" + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; @@ -8154,24 +5788,24 @@ func_mode_link () # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule= + dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule=$dlpremoduletest + dlopenmodule="$dlpremoduletest" break fi done - if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi - if test lib = "$linkmode" && - test yes = "$hardcode_into_libs"; then + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. @@ -8180,7 +5814,7 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; + *) compile_rpath="$compile_rpath $absdir" esac ;; esac @@ -8189,7 +5823,7 @@ func_mode_link () *) case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac @@ -8199,43 +5833,43 @@ func_mode_link () # figure out the soname set dummy $library_names shift - realname=$1 + realname="$1" shift - libname=`eval "\\$ECHO \"$libname_spec\""` + eval "libname=\"$libname_spec\"" # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then - soname=$dlname + soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw* | *cegcc* | *os2*) + *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result - versuffix=-$major + versuffix="-$major" ;; esac - eval soname=\"$soname_spec\" + eval "soname=\"$soname_spec\"" else - soname=$realname + soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use - soroot=$soname + soroot="$soname" func_basename "$soroot" - soname=$func_basename_result + soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else - func_verbose "extracting exported symbol list from '$soname'" + func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for '$soname'" + func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library @@ -8243,70 +5877,70 @@ func_mode_link () linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test prog = "$linkmode" || test relink != "$opt_mode"; then + if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) - if test no = "$hardcode_direct"; then - add=$dir/$linklib + if test "$hardcode_direct" = no; then + add="$dir/$linklib" case $host in - *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; - *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir=-L$dir ;; + *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) - # if the lib is a (non-dlopened) module then we cannot + # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null; then + $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library"; then + if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else - add=$dir/$old_library + add="$dir/$old_library" fi elif test -n "$old_library"; then - add=$dir/$old_library + add="$dir/$old_library" fi fi esac - elif test no = "$hardcode_minus_L"; then + elif test "$hardcode_minus_L" = no; then case $host in - *-*-sunos*) add_shlibpath=$dir ;; + *-*-sunos*) add_shlibpath="$dir" ;; esac - add_dir=-L$dir - add=-l$name - elif test no = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" else lib_linked=no fi ;; relink) - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$dir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$absdir + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" + add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" else lib_linked=no fi @@ -8314,72 +5948,72 @@ func_mode_link () *) lib_linked=no ;; esac - if test yes != "$lib_linked"; then + if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" - if test yes != "$hardcode_direct" && - test yes != "$hardcode_minus_L" && - test yes = "$hardcode_shlibpath_var"; then + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi - if test prog = "$linkmode" || test relink = "$opt_mode"; then + if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$libdir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$libdir - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac - add=-l$name - elif test yes = "$hardcode_automatic"; then + add="-l$name" + elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib"; then - add=$inst_prefix_dir$libdir/$linklib + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" else - add=$libdir/$linklib + add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir=-L$libdir + add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" + add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi - add=-l$name + add="-l$name" fi - if test prog = "$linkmode"; then + if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else @@ -8387,43 +6021,43 @@ func_mode_link () test -n "$add" && deplibs="$add $deplibs" fi fi - elif test prog = "$linkmode"; then + elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. - if test unsupported != "$hardcode_direct"; then - test -n "$old_library" && linklib=$old_library + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi - elif test yes = "$build_libtool_libs"; then + elif test "$build_libtool_libs" = yes; then # Not a shared library - if test pass_all != "$deplibs_check_method"; then + if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo - $ECHO "*** Warning: This system cannot link to static lib archive $lib." + $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." - if test yes = "$module"; then + if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi - if test no = "$build_old_libs"; then + if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else @@ -8436,11 +6070,11 @@ func_mode_link () fi fi # link shared/static library? - if test lib = "$linkmode"; then + if test "$linkmode" = lib; then if test -n "$dependency_libs" && - { test yes != "$hardcode_into_libs" || - test yes = "$build_old_libs" || - test yes = "$link_static"; }; then + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do @@ -8449,54 +6083,46 @@ func_mode_link () temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; + *) xrpath="$xrpath $temp_xrpath";; esac;; - *) func_append temp_deplibs " $libdir";; + *) temp_deplibs="$temp_deplibs $libdir";; esac done - dependency_libs=$temp_deplibs + dependency_libs="$temp_deplibs" fi - func_append newlib_search_path " $absdir" + newlib_search_path="$newlib_search_path $absdir" # Link against this library - test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps; then + if $opt_duplicate_deps ; then case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi - func_append tmp_libs " $func_resolve_sysroot_result" + tmp_libs="$tmp_libs $deplib" done - if test no != "$link_all_deplibs"; then + if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in - -L*) path=$deplib ;; + -L*) path="$deplib" ;; *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." - dir=$func_dirname_result + dir="$func_dirname_result" # We need an absolute path. case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of '$dir'" - absdir=$dir + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" fi ;; esac @@ -8504,35 +6130,35 @@ func_mode_link () case $host in *-*-darwin*) depdepl= - eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names"; then - for tmp in $deplibrary_names; do + deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do depdepl=$tmp done - if test -f "$absdir/$objdir/$depdepl"; then - depdepl=$absdir/$objdir/$depdepl - darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then - darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" - func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) - path=-L$absdir/$objdir + path="-L$absdir/$objdir" ;; esac else - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" + func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ - func_warning "'$deplib' seems to be moved" + func_warning "\`$deplib' seems to be moved" - path=-L$absdir + path="-L$absdir" fi ;; esac @@ -8544,42 +6170,42 @@ func_mode_link () fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs - if test link = "$pass"; then - if test prog = "$linkmode"; then + if test "$pass" = link; then + if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi - dependency_libs=$newdependency_libs - if test dlpreopen = "$pass"; then + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi - if test dlopen != "$pass"; then - test conv = "$pass" || { + if test "$pass" != dlopen; then + if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; + *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= - } + fi - if test prog,link = "$linkmode,$pass"; then - vars="compile_deplibs finalize_deplibs" + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" else - vars=deplibs + vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" + eval tmp_libs=\$$var new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so @@ -8624,119 +6250,88 @@ func_mode_link () -L*) case " $tmp_libs " in *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; + *) tmp_libs="$tmp_libs $deplib" ;; esac ;; - *) func_append tmp_libs " $deplib" ;; + *) tmp_libs="$tmp_libs $deplib" ;; esac done - eval $var=\"$tmp_libs\" + eval $var=\$tmp_libs done # for var fi - - # Add Sun CC postdeps if required: - test CXX = "$tagname" && { - case $host_os in - linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C++ 5.9 - func_suncc_cstd_abi - - if test no != "$suncc_use_cstd_abi"; then - func_append postdeps ' -library=Cstd -library=Crun' - fi - ;; - esac - ;; - - solaris*) - func_cc_basename "$CC" - case $func_cc_basename_result in - CC* | sunCC*) - func_suncc_cstd_abi - - if test no != "$suncc_use_cstd_abi"; then - func_append postdeps ' -library=Cstd -library=Crun' - fi - ;; - esac - ;; - esac - } - # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= - for i in $dependency_libs; do + for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) - i= + i="" ;; esac - if test -n "$i"; then - func_append tmp_libs " $i" + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass - if test prog = "$linkmode"; then - dlfiles=$newdlfiles + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" fi - if test prog = "$linkmode" || test lib = "$linkmode"; then - dlprefiles=$newdlprefiles + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for archives" + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for archives" ;; + func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ - func_warning "'-rpath' is ignored for archives" + func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ - func_warning "'-R' is ignored for archives" + func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for archives" + func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ - func_warning "'-release' is ignored for archives" + func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ - func_warning "'-export-symbols' is ignored for archives" + func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no - oldlibs=$output - func_append objs "$old_deplibs" + oldlibs="$output" + objs="$objs$old_deplibs" ;; lib) - # Make sure we only generate libraries of the form 'libNAME.la'. + # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" + eval "shared_ext=\"$shrext_cmds\"" + eval "libname=\"$libname_spec\"" ;; *) - test no = "$module" \ - && func_fatal_help "libtool library '$output' must begin with 'lib'" + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" - if test no != "$need_lib_prefix"; then + if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" + eval "shared_ext=\"$shrext_cmds\"" + eval "libname=\"$libname_spec\"" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result @@ -8745,31 +6340,31 @@ func_mode_link () esac if test -n "$objs"; then - if test pass_all != "$deplibs_check_method"; then - func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" + libobjs="$libobjs $objs" fi fi - test no = "$dlself" \ - || func_warning "'-dlopen self' is ignored for libtool libraries" + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift - test 1 -lt "$#" \ - && func_warning "ignoring multiple '-rpath's for a libtool library" + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" - install_libdir=$1 + install_libdir="$1" oldlibs= if test -z "$rpath"; then - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. - # Some compilers have problems with a '.al' extension so + # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" @@ -8778,20 +6373,20 @@ func_mode_link () fi test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for convenience libraries" + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ - func_warning "'-release' is ignored for convenience libraries" + func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. - save_ifs=$IFS; IFS=: + save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift - IFS=$save_ifs + IFS="$save_ifs" test -n "$7" && \ - func_fatal_help "too many parameters to '-version-info'" + func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts @@ -8799,45 +6394,41 @@ func_mode_link () case $vinfo_number in yes) - number_major=$1 - number_minor=$2 - number_revision=$3 + number_major="$1" + number_minor="$2" + number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix - # that has an extra 1 added just for fun + # which has an extra 1 added just for fun # case $version_type in - # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result - age=$number_minor - revision=$number_revision + age="$number_minor" + revision="$number_revision" ;; - freebsd-aout|qnx|sunos) - current=$number_major - revision=$number_minor - age=0 + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result - age=$number_minor - revision=$number_minor + age="$number_minor" + revision="$number_minor" lt_irix_increment=no ;; - *) - func_fatal_configuration "$modename: unknown library version type '$version_type'" - ;; esac ;; no) - current=$1 - revision=$2 - age=$3 + current="$1" + revision="$2" + age="$3" ;; esac @@ -8845,30 +6436,30 @@ func_mode_link () case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "CURRENT '$current' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "REVISION '$revision' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "AGE '$age' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then - func_error "AGE '$age' is greater than the current interface number '$current'" - func_fatal_error "'$vinfo' is not valid version information" + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. @@ -8883,36 +6474,26 @@ func_mode_link () # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result - versuffix=$major.$age.$revision + versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result - xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - # On Darwin other compilers - case $CC in - nagfor*) - verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" - ;; - *) - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - esac ;; freebsd-aout) - major=.$current - versuffix=.$current.$revision + major=".$current" + versuffix=".$current.$revision"; ;; freebsd-elf) - func_arith $current - $age - major=.$func_arith_result - versuffix=$major.$age.$revision + major=".$current" + versuffix=".$current" ;; irix | nonstopux) - if test no = "$lt_irix_increment"; then + if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 @@ -8923,74 +6504,69 @@ func_mode_link () nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac - verstring=$verstring_prefix$major.$revision + verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision - while test 0 -ne "$loop"; do + while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring=$verstring_prefix$major.$iface:$verstring + verstring="$verstring_prefix$major.$iface:$verstring" done - # Before this point, $major must not contain '.'. + # Before this point, $major must not contain `.'. major=.$major - versuffix=$major.$revision + versuffix="$major.$revision" ;; - linux) # correct to gnu/linux during the next big refactor + linux) func_arith $current - $age major=.$func_arith_result - versuffix=$major.$age.$revision + versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result - versuffix=.$current.$age.$revision - verstring=$current.$age.$revision + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age - while test 0 -ne "$loop"; do + while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring=$verstring:$iface.0 + verstring="$verstring:${iface}.0" done # Make executables depend on our current version. - func_append verstring ":$current.0" + verstring="$verstring:${current}.0" ;; qnx) - major=.$current - versuffix=.$current - ;; - - sco) - major=.$current - versuffix=.$current + major=".$current" + versuffix=".$current" ;; sunos) - major=.$current - versuffix=.$current.$revision + major=".$current" + versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 file systems. + # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result - versuffix=-$major + versuffix="-$major" ;; *) - func_fatal_configuration "unknown library version type '$version_type'" + func_fatal_configuration "unknown library version type \`$version_type'" ;; esac @@ -9004,45 +6580,42 @@ func_mode_link () verstring= ;; *) - verstring=0.0 + verstring="0.0" ;; esac - if test no = "$need_version"; then + if test "$need_version" = no; then versuffix= else - versuffix=.0.0 + versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided - if test yes,no = "$avoid_version,$need_version"; then + if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= - verstring= + verstring="" fi # Check to see if the archive will have undefined symbols. - if test yes = "$allow_undefined"; then - if test unsupported = "$allow_undefined_flag"; then - if test yes = "$build_old_libs"; then - func_warning "undefined symbols not allowed in $host shared libraries; building static only" - build_libtool_libs=no - else - func_fatal_error "can't build $host shared library unless -no-undefined is specified" - fi + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes fi else # Don't allow undefined symbols. - allow_undefined_flag=$no_undefined_flag + allow_undefined_flag="$no_undefined_flag" fi fi - func_generate_dlsyms "$libname" "$libname" : - func_append libobjs " $symfileobj" - test " " = "$libobjs" && libobjs= + func_generate_dlsyms "$libname" "$libname" "yes" + libobjs="$libobjs $symfileobj" + test "X$libobjs" = "X " && libobjs= - if test relink != "$opt_mode"; then + if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -9051,14 +6624,14 @@ func_mode_link () case $p in *.$objext | *.gcno) ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) - if test -n "$precious_files_regex"; then + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi - func_append removelist " $p" + removelist="$removelist $p" ;; *) ;; esac @@ -9068,11 +6641,11 @@ func_mode_link () fi # Now set the variables for building old libraries. - if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then - func_append oldlibs " $output_objdir/$libname.$libext" + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. @@ -9086,39 +6659,38 @@ func_mode_link () # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" + temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; esac done - if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles=$dlfiles + old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; + *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files - old_dlprefiles=$dlprefiles + old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; + *) dlprefiles="$dlprefiles $lib" ;; esac done - if test yes = "$build_libtool_libs"; then + if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) @@ -9126,7 +6698,7 @@ func_mode_link () ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" + deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. @@ -9142,8 +6714,8 @@ func_mode_link () ;; *) # Add libc to deplibs on all other systems if necessary. - if test yes = "$build_libtool_need_lc"; then - func_append deplibs " -lc" + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" fi ;; esac @@ -9158,9 +6730,9 @@ func_mode_link () # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? - release= - versuffix= - major= + release="" + versuffix="" + major="" newdeplibs= droppeddeps=no case $deplibs_check_method in @@ -9189,21 +6761,21 @@ EOF -l*) func_stripname -l '' "$i" name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - func_append newdeplibs " $i" - i= + newdeplibs="$newdeplibs $i" + i="" ;; esac fi - if test -n "$i"; then - libname=`eval "\\$ECHO \"$libname_spec\""` - deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` + if test -n "$i" ; then + eval "libname=\"$libname_spec\"" + eval "deplib_matches=\"$library_names_spec\"" set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then - func_append newdeplibs " $i" + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" else droppeddeps=yes echo @@ -9217,7 +6789,7 @@ EOF fi ;; *) - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" ;; esac done @@ -9232,21 +6804,21 @@ EOF $opt_dry_run || $RM conftest if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - func_append newdeplibs " $i" - i= + newdeplibs="$newdeplibs $i" + i="" ;; esac fi - if test -n "$i"; then - libname=`eval "\\$ECHO \"$libname_spec\""` - deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` + if test -n "$i" ; then + eval "libname=\"$libname_spec\"" + eval "deplib_matches=\"$library_names_spec\"" set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then - func_append newdeplibs " $i" + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" else droppeddeps=yes echo @@ -9268,7 +6840,7 @@ EOF fi ;; *) - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" ;; esac done @@ -9282,30 +6854,18 @@ EOF -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib= + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" ;; esac fi - if test -n "$a_deplib"; then - libname=`eval "\\$ECHO \"$libname_spec\""` - if test -n "$file_magic_glob"; then - libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` - else - libnameglob=$libname - fi - test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` + if test -n "$a_deplib" ; then + eval "libname=\"$libname_spec\"" for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test yes = "$want_nocaseglob"; then - shopt -s nocaseglob - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | @@ -9317,25 +6877,25 @@ EOF # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? - potlib=$potent_lib + potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; - *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + if eval "$file_magic_cmd \"\$potlib\"" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib= + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" break 2 fi done done fi - if test -n "$a_deplib"; then + if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -9343,7 +6903,7 @@ EOF echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then + if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -9353,7 +6913,7 @@ EOF ;; *) # Add a -L argument. - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. @@ -9366,30 +6926,30 @@ EOF -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib= + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" ;; esac fi - if test -n "$a_deplib"; then - libname=`eval "\\$ECHO \"$libname_spec\""` + if test -n "$a_deplib" ; then + eval "libname=\"$libname_spec\"" for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do - potlib=$potent_lib # see symlink-check above in file_magic test + potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib= + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" break 2 fi done done fi - if test -n "$a_deplib"; then + if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -9397,7 +6957,7 @@ EOF echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then + if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -9407,24 +6967,24 @@ EOF ;; *) # Add a -L argument. - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) - newdeplibs= + newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - for i in $predeps $postdeps; do + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo - if test none = "$deplibs_check_method"; then + if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." @@ -9448,8 +7008,8 @@ EOF ;; esac - if test yes = "$droppeddeps"; then - if test yes = "$module"; then + if test "$droppeddeps" = yes; then + if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" @@ -9458,12 +7018,12 @@ EOF if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else @@ -9474,14 +7034,14 @@ EOF echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." - if test no = "$allow_undefined"; then + if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else @@ -9511,7 +7071,7 @@ EOF *) case " $deplibs " in *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; + new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac @@ -9521,13 +7081,13 @@ EOF -L*) case " $new_libs " in *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac done - deplibs=$new_libs + deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= @@ -9535,91 +7095,90 @@ EOF dlname= # Test again, we may have decided not to build it any more - if test yes = "$build_libtool_libs"; then - # Remove $wl instances when linking with ld. - # FIXME: should test the right _cmds variable. - case $archive_cmds in - *\$LD\ *) wl= ;; - esac - if test yes = "$hardcode_into_libs"; then + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= - rpath=$finalize_rpath - test relink = "$opt_mode" || rpath=$compile_rpath$rpath + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir + hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" + eval "flag=\"$hardcode_libdir_flag_spec\"" + dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; + *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval "dep_rpath=\"$hardcode_libdir_flag_spec_ld\"" + else + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do - func_append rpath "$dir:" + rpath="$rpath$dir:" done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + eval $runpath_var=\$rpath\$$runpath_var + export $runpath_var fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi - shlibpath=$finalize_shlibpath - test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + eval $shlibpath_var=\$shlibpath\$$shlibpath_var + export $shlibpath_var fi # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" + eval "shared_ext=\"$shrext_cmds\"" + eval "library_names=\"$library_names_spec\"" set dummy $library_names shift - realname=$1 + realname="$1" shift if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" + eval "soname=\"$soname_spec\"" else - soname=$realname + soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi - lib=$output_objdir/$realname + lib="$output_objdir/$realname" linknames= for link do - func_append linknames " $link" + linknames="$linknames $link" done # Use standard objects if they are pic @@ -9629,8 +7188,8 @@ EOF delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols=$output_objdir/$libname.uexp - func_append delfiles " $export_symbols" + export_symbols="$output_objdir/$libname.uexp" + delfiles="$delfiles $export_symbols" fi orig_export_symbols= @@ -9638,68 +7197,36 @@ EOF cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile - func_dll_def_p "$export_symbols" || { + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. - orig_export_symbols=$export_symbols + orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes - } + fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then - if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds - save_ifs=$IFS; IFS='~' - for cmd1 in $cmds; do - IFS=$save_ifs - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test yes = "$try_normal_branch" \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=$output_objdir/$output_la.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval "cmd=\"$cmd\"" + func_len " $cmd" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. @@ -9710,8 +7237,8 @@ EOF break fi done - IFS=$save_ifs - if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi @@ -9719,21 +7246,21 @@ EOF fi if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols" fi - if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine + # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -9743,15 +7270,15 @@ EOF case " $convenience " in *" $test_deplib "*) ;; *) - func_append tmp_deplibs " $test_deplib" + tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done - deplibs=$tmp_deplibs + deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && - test yes = "$compiler_needs_object" && + test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. @@ -9759,48 +7286,48 @@ EOF fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + eval "libobjs=\"\$libobjs $whole_archive_flag_spec\"" test "X$libobjs" = "X " && libobjs= else - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" + libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi - if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval "flag=\"$thread_safe_flag_spec\"" + linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking - if test relink = "$opt_mode"; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + if test "$mode" = relink; then + $opt_dry_run || (cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U) || exit $? fi # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then + if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" + eval "test_cmds=\"$module_expsym_cmds\"" cmds=$module_expsym_cmds else - eval test_cmds=\"$module_cmds\" + eval "test_cmds=\"$module_cmds\"" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" + eval "test_cmds=\"$archive_expsym_cmds\"" cmds=$archive_expsym_cmds else - eval test_cmds=\"$archive_cmds\" + eval "test_cmds=\"$archive_cmds\"" cmds=$archive_cmds fi fi - if test : != "$skipped_export" && + if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then @@ -9833,43 +7360,38 @@ EOF last_robj= k=1 - if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then - output=$output_objdir/$output_la.lnkscript + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output + $ECHO "$obj" >> $output done echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then - output=$output_objdir/$output_la.lnk + delfiles="$delfiles $output" + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= - if test yes = "$compiler_needs_object"; then + if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output + $ECHO "$obj" >> $output done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-$k.$objext - eval test_cmds=\"$reload_cmds\" + output=$output_objdir/$output_la-${k}.$objext + eval "test_cmds=\"$reload_cmds\"" func_len " $test_cmds" len0=$func_len_result len=$len0 @@ -9880,26 +7402,26 @@ EOF func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result - if test -z "$objlist" || + if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. - if test 1 -eq "$k"; then + if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" + eval "concat_cmds=\"$reload_cmds\"" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + eval "concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"" fi - last_robj=$output_objdir/$output_la-$k.$objext + last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result - output=$output_objdir/$output_la-$k.$objext + output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result @@ -9911,37 +7433,37 @@ EOF # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds$reload_cmds\" + eval "concat_cmds=\"\${concat_cmds}$reload_cmds\"" if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + eval "concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"" fi - func_append delfiles " $output" + delfiles="$delfiles $output" else output= fi - ${skipped_export-false} && { - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + eval "concat_cmds=\"\$concat_cmds$export_symbols_cmds\"" if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + eval "concat_cmds=\"\$concat_cmds~\$RM $last_robj\"" fi - } + fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. - save_ifs=$IFS; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do - IFS=$save_ifs - $opt_quiet || { + IFS="$save_ifs" + $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -9949,7 +7471,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then + if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -9958,7 +7480,7 @@ EOF exit $lt_exit } done - IFS=$save_ifs + IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' @@ -9966,41 +7488,41 @@ EOF fi fi - ${skipped_export-false} && { + if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols" fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine + # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi - } + fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + eval "libobjs=\"\$libobjs $whole_archive_flag_spec\"" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then + if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else @@ -10017,25 +7539,24 @@ EOF if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" + eval "cmds=\"\$cmds~\$RM $delfiles\"" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" + libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi - save_ifs=$IFS; IFS='~' + save_ifs="$IFS"; IFS='~' for cmd in $cmds; do - IFS=$sp$nl - eval cmd=\"$cmd\" - IFS=$save_ifs - $opt_quiet || { + IFS="$save_ifs" + eval "cmd=\"$cmd\"" + $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -10043,7 +7564,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then + if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -10052,11 +7573,11 @@ EOF exit $lt_exit } done - IFS=$save_ifs + IFS="$save_ifs" # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + if test "$mode" = relink; then + $opt_dry_run || (cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname) || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then @@ -10075,39 +7596,39 @@ EOF done # If -module or -export-dynamic was specified, set the dlname. - if test yes = "$module" || test yes = "$export_dynamic"; then + if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. - dlname=$soname + dlname="$soname" fi fi ;; obj) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for objects" + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for objects" ;; + func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ - func_warning "'-rpath' is ignored for objects" + func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ - func_warning "'-R' is ignored for objects" + func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for objects" + func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ - func_warning "'-release' is ignored for objects" + func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object '$output' from non-libtool objects" + func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" @@ -10115,7 +7636,7 @@ EOF ;; *) libobj= - obj=$output + obj="$output" ;; esac @@ -10128,33 +7649,28 @@ EOF # the extraction. reload_conv_objs= gentop= - # if reload_cmds runs $LD directly, get rid of -Wl from - # whole_archive_flag_spec and hope we can get by with turning comma - # into space. - case $reload_cmds in - *\$LD[\ \$]*) wl= ;; - esac + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags + eval "tmp_whole_archive_flags=\"$whole_archive_flag_spec\"" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else - gentop=$output_objdir/${obj}x - func_append generated " $gentop" + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi - # If we're not building shared, we need to use non_pic_objs - test yes = "$build_libtool_libs" || libobjs=$non_pic_objects - # Create the old-style object. - reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - output=$obj + output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. @@ -10166,7 +7682,7 @@ EOF exit $EXIT_SUCCESS fi - test yes = "$build_libtool_libs" || { + if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi @@ -10174,14 +7690,14 @@ EOF # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + # $opt_dry_run || echo timestamp > $libobj || exit $? exit $EXIT_SUCCESS - } + fi - if test -n "$pic_flag" || test default != "$pic_mode"; then + if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" - output=$libobj + output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi @@ -10198,14 +7714,16 @@ EOF output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for programs" + func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ - func_warning "'-release' is ignored for programs" + func_warning "\`-release' is ignored for programs" - $preload \ - && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ - && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) @@ -10219,11 +7737,11 @@ EOF *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). - if test CXX = "$tagname"; then + if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - func_append compile_command " $wl-bind_at_load" - func_append finalize_command " $wl-bind_at_load" + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi @@ -10243,7 +7761,7 @@ EOF *) case " $compile_deplibs " in *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; + new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac @@ -10253,17 +7771,17 @@ EOF -L*) case " $new_libs " in *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac done - compile_deplibs=$new_libs + compile_deplibs="$new_libs" - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. @@ -10271,7 +7789,7 @@ EOF # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi @@ -10283,39 +7801,39 @@ EOF if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir + hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" + eval "flag=\"$hardcode_libdir_flag_spec\"" + rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; + *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; + *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; + *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac @@ -10323,10 +7841,10 @@ EOF # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval rpath=\" $hardcode_libdir_flag_spec\" + libdir="$hardcode_libdirs" + eval "rpath=\" $hardcode_libdir_flag_spec\"" fi - compile_rpath=$rpath + compile_rpath="$rpath" rpath= hardcode_libdirs= @@ -10334,86 +7852,82 @@ EOF if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir + hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" + eval "flag=\"$hardcode_libdir_flag_spec\"" + rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval rpath=\" $hardcode_libdir_flag_spec\" + libdir="$hardcode_libdirs" + eval "rpath=\" $hardcode_libdir_flag_spec\"" fi - finalize_rpath=$rpath + finalize_rpath="$rpath" - if test -n "$libobjs" && test yes = "$build_old_libs"; then + if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi - func_generate_dlsyms "$outputname" "@PROGRAM@" false + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi - wrappers_required=: + wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=false + wrappers_required=no ;; *cygwin* | *mingw* ) - test yes = "$build_libtool_libs" || wrappers_required=false + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi ;; *) - if test no = "$need_relink" || test yes != "$build_libtool_libs"; then - wrappers_required=false + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no fi ;; esac - $wrappers_required || { + if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command=$compile_command$compile_rpath + link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.$objext"; then - func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status - } + fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" @@ -10429,7 +7943,7 @@ EOF # We should set the runpath_var. rpath= for dir in $perm_rpath; do - func_append rpath "$dir:" + rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -10437,53 +7951,45 @@ EOF # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" + rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi - if test yes = "$no_install"; then + if test "$no_install" = yes; then # We don't need to create a wrapper script. - link_command=$compile_var$compile_command$compile_rpath + link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - exit $EXIT_SUCCESS fi - case $hardcode_action,$fast_install in - relink,*) - # Fast installation is not supported - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" - func_warning "this platform does not like uninstalled shared libraries" - func_warning "'$output' will be relinked during installation" - ;; - *,yes) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - ;; - *,no) - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - ;; - *,needless) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command= - ;; - esac + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` @@ -10493,12 +7999,6 @@ EOF func_show_eval "$link_command" 'exit $?' - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - # Now create the wrapper script. func_verbose "creating $output" @@ -10540,8 +8040,8 @@ EOF func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result - cwrappersource=$output_path/$objdir/lt-$output_name.c - cwrapper=$output_path/$output_name.exe + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 @@ -10562,7 +8062,7 @@ EOF trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host"; then + if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result @@ -10585,45 +8085,43 @@ EOF # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do - case $build_libtool_libs in - convenience) - oldobjs="$libobjs_save $symfileobj" - addlibs=$convenience - build_libtool_libs=no - ;; - module) - oldobjs=$libobjs_save - addlibs=$old_convenience + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" build_libtool_libs=no - ;; - *) + else oldobjs="$old_deplibs $non_pic_objects" - $preload && test -f "$symfileobj" \ - && func_append oldobjs " $symfileobj" - addlibs=$old_convenience - ;; - esac + if test "$preload" = yes && test -f "$symfileobj"; then + oldobjs="$oldobjs $symfileobj" + fi + fi + addlibs="$old_convenience" + fi if test -n "$addlibs"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" + oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" + oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have @@ -10640,8 +8138,8 @@ EOF : else echo "copying selected object files to avoid basename conflicts..." - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= @@ -10649,7 +8147,7 @@ EOF for obj in $save_oldobjs do func_basename "$obj" - objbase=$func_basename_result + objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) @@ -10665,30 +8163,18 @@ EOF esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" ;; - *) func_append oldobjs " $obj" ;; + *) oldobjs="$oldobjs $obj" ;; esac done fi - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - eval cmds=\"$old_archive_cmds\" + eval "cmds=\"$old_archive_cmds\"" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." @@ -10703,7 +8189,7 @@ EOF do last_oldobj=$obj done - eval test_cmds=\"$old_archive_cmds\" + eval "test_cmds=\"$old_archive_cmds\"" func_len " $test_cmds" len0=$func_len_result len=$len0 @@ -10718,21 +8204,21 @@ EOF else # the above command should be used before it gets too long oldobjs=$objlist - if test "$obj" = "$last_oldobj"; then + if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + eval "concat_cmds=\"\${concat_cmds}$old_archive_cmds\"" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist - if test -z "$oldobjs"; then - eval cmds=\"\$concat_cmds\" + if test "X$oldobjs" = "X" ; then + eval "cmds=\"\$concat_cmds\"" else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + eval "cmds=\"\$concat_cmds~\$old_archive_cmds\"" fi fi fi @@ -10746,7 +8232,7 @@ EOF case $output in *.la) old_library= - test yes = "$build_old_libs" && old_library=$libname.$libext + test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior @@ -10761,63 +8247,52 @@ EOF fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test yes = "$hardcode_automatic"; then + if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do - if test yes = "$installed"; then + if test "$installed" = yes; then if test -z "$install_libdir"; then break fi - output=$output_objdir/${outputname}i + output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" - name=$func_basename_result - func_resolve_sysroot "$deplib" - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + name="$func_basename_result" + libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" + func_fatal_error "\`$deplib' is not a valid libtool archive" + newdependency_libs="$newdependency_libs $libdir/$name" ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; esac done - dependency_libs=$newdependency_libs + dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name="$func_basename_result" + libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlfiles="$newdlfiles $libdir/$name" ;; - *) func_append newdlfiles " $lib" ;; + *) newdlfiles="$newdlfiles $lib" ;; esac done - dlfiles=$newdlfiles + dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in @@ -10827,34 +8302,34 @@ EOF # didn't already link the preopened objects directly into # the library: func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name="$func_basename_result" + libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done - dlprefiles=$newdlprefiles + dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - func_append newdlfiles " $abs" + newdlfiles="$newdlfiles $abs" done - dlfiles=$newdlfiles + dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - func_append newdlprefiles " $abs" + newdlprefiles="$newdlprefiles $abs" done - dlprefiles=$newdlprefiles + dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin @@ -10870,9 +8345,10 @@ EOF case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. - if test -n "$bindir"; then + if test "x$bindir" != x ; + then func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result/$dlname + tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname @@ -10881,7 +8357,7 @@ EOF esac $ECHO > $output "\ # $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. @@ -10895,7 +8371,7 @@ library_names='$library_names' # The name of the static archive. old_library='$old_library' -# Linker flags that cannot go in dependency_libs. +# Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. @@ -10921,7 +8397,7 @@ dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" - if test no,yes = "$installed,$need_relink"; then + if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi @@ -10936,31 +8412,29 @@ relink_command=\"$relink_command\"" exit $EXIT_SUCCESS } -if test link = "$opt_mode" || test relink = "$opt_mode"; then - func_mode_link ${1+"$@"} -fi +{ test "$mode" = link || test "$mode" = relink; } && + func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { - $debug_cmd - - RM=$nonopt + $opt_debug + RM="$nonopt" files= - rmforce=false + rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic=$magic + libtool_install_magic="$magic" for arg do case $arg in - -f) func_append RM " $arg"; rmforce=: ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; + -f) RM="$RM $arg"; rmforce=yes ;; + -*) RM="$RM $arg" ;; + *) files="$files $arg" ;; esac done @@ -10969,23 +8443,24 @@ func_mode_uninstall () rmdirs= + origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." - dir=$func_dirname_result - if test . = "$dir"; then - odir=$objdir + dir="$func_dirname_result" + if test "X$dir" = X.; then + objdir="$origobjdir" else - odir=$dir/$objdir + objdir="$dir/$origobjdir" fi func_basename "$file" - name=$func_basename_result - test uninstall = "$opt_mode" && odir=$dir + name="$func_basename_result" + test "$mode" = uninstall && objdir="$dir" - # Remember odir for removal later, being careful to avoid duplicates - if test clean = "$opt_mode"; then + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; esac fi @@ -10997,11 +8472,11 @@ func_mode_uninstall () elif test -d "$file"; then exit_status=1 continue - elif $rmforce; then + elif test "$rmforce" = yes; then continue fi - rmfiles=$file + rmfiles="$file" case $name in *.la) @@ -11011,27 +8486,28 @@ func_mode_uninstall () # Delete the libtool libraries and symlinks. for n in $library_names; do - func_append rmfiles " $odir/$n" + rmfiles="$rmfiles $objdir/$n" done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - case $opt_mode in + case "$mode" in clean) - case " $library_names " in + case " $library_names " in + # " " in the beginning catches empty $dlname *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; @@ -11047,19 +8523,21 @@ func_mode_uninstall () func_source $dir/$name # Add PIC object to the list of files to remove. - if test -n "$pic_object" && test none != "$pic_object"; then - func_append rmfiles " $dir/$pic_object" + if test -n "$pic_object" && + test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && test none != "$non_pic_object"; then - func_append rmfiles " $dir/$non_pic_object" + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) - if test clean = "$opt_mode"; then + if test "$mode" = clean ; then noexename=$name case $file in *.exe) @@ -11069,7 +8547,7 @@ func_mode_uninstall () noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe - func_append rmfiles " $file" + rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. @@ -11078,7 +8556,7 @@ func_mode_uninstall () func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" + rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename @@ -11086,12 +8564,12 @@ func_mode_uninstall () # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.$objext" - if test yes = "$fast_install" && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" fi - if test "X$noexename" != "X$name"; then - func_append rmfiles " $odir/lt-$noexename.c" + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi @@ -11099,8 +8577,9 @@ func_mode_uninstall () esac func_show_eval "$RM $rmfiles" 'exit_status=1' done + objdir="$origobjdir" - # Try to remove the $objdir's in the directories where we deleted files + # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" @@ -11110,17 +8589,16 @@ func_mode_uninstall () exit $exit_status } -if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then - func_mode_uninstall ${1+"$@"} -fi +{ test "$mode" = uninstall || test "$mode" = clean; } && + func_mode_uninstall ${1+"$@"} -test -z "$opt_mode" && { - help=$generic_help +test -z "$mode" && { + help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode '$opt_mode'" + func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" @@ -11131,7 +8609,7 @@ exit $exit_status # The TAGs below are defined such that we never get into a situation -# where we disable both kinds of libraries. Given conflicting +# in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support @@ -11154,3 +8632,5 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # mode:shell-script # sh-indentation:2 # End: +# vi:sw=2 + diff --git a/3rdparty/libbacktrace/macho.c b/3rdparty/libbacktrace/macho.c index 01cdaf2403a..718512afc71 100644 --- a/3rdparty/libbacktrace/macho.c +++ b/3rdparty/libbacktrace/macho.c @@ -1,9 +1,6 @@ -/* macho.c -- Get debug data from an Mach-O file for backtraces. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - Written by John Colanduoni. - - Pending upstream pull request: - https://github.com/ianlancetaylor/libbacktrace/pull/2 +/* elf.c -- Get debug data from a Mach-O file for backtraces. + Copyright (C) 2020 Free Software Foundation, Inc. + Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -35,1398 +32,1276 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" -/* We can't use autotools to detect the pointer width of our program because - we may be building a fat Mach-O file containing both 32-bit and 64-bit - variants. However Mach-O runs a limited set of platforms so detection - via preprocessor is not difficult. */ - -#if defined(__MACH__) -#if defined(__LP64__) -#define BACKTRACE_BITS 64 -#else -#define BACKTRACE_BITS 32 -#endif -#else -#error Attempting to build Mach-O support on incorrect platform -#endif - -#if defined(__x86_64__) -#define NATIVE_CPU_TYPE CPU_TYPE_X86_64 -#elif defined(__i386__) -#define NATIVE_CPU_TYPE CPU_TYPE_X86 -#elif defined(__aarch64__) -#define NATIVE_CPU_TYPE CPU_TYPE_ARM64 -#elif defined(__arm__) -#define NATIVE_CPU_TYPE CPU_TYPE_ARM -#else -#error Could not detect native Mach-O cpu_type_t -#endif - #include -#include -#include -#include -#include -#include -#include -#include #include #include +#include + +#ifdef HAVE_MACH_O_DYLD_H +#include +#endif #include "backtrace.h" #include "internal.h" -// Pragma macro only enabled on gcc >= 8 -#if defined(__GNUC__) && (GCC_VERSION >= 8000) -#define PRAGMA_GCC8(str) _Pragma(#str) -#else // ! defined(__GNUC__) && (GCC_VERSION >= 8000) -#define PRAGMA_GCC8(str) -#endif // ! defined(__GNUC__) && (GCC_VERSION >= 8000) +/* Mach-O file header for a 32-bit executable. */ -struct macho_commands_view +struct macho_header_32 { - struct backtrace_view view; - uint32_t commands_count; - uint32_t commands_total_size; - int bytes_swapped; - size_t base_offset; + uint32_t magic; /* Magic number (MACH_O_MAGIC_32) */ + uint32_t cputype; /* CPU type */ + uint32_t cpusubtype; /* CPU subtype */ + uint32_t filetype; /* Type of file (object, executable) */ + uint32_t ncmds; /* Number of load commands */ + uint32_t sizeofcmds; /* Total size of load commands */ + uint32_t flags; /* Flags for special features */ }; -enum debug_section +/* Mach-O file header for a 64-bit executable. */ + +struct macho_header_64 { - DEBUG_INFO, - DEBUG_LINE, - DEBUG_ABBREV, - DEBUG_RANGES, - DEBUG_STR, - DEBUG_MAX + uint32_t magic; /* Magic number (MACH_O_MAGIC_64) */ + uint32_t cputype; /* CPU type */ + uint32_t cpusubtype; /* CPU subtype */ + uint32_t filetype; /* Type of file (object, executable) */ + uint32_t ncmds; /* Number of load commands */ + uint32_t sizeofcmds; /* Total size of load commands */ + uint32_t flags; /* Flags for special features */ + uint32_t reserved; /* Reserved */ }; -static const char *const debug_section_names[DEBUG_MAX] = - { - "__debug_info", - "__debug_line", - "__debug_abbrev", - "__debug_ranges", - "__debug_str" - }; - -struct found_dwarf_section +/* Mach-O file header for a fat executable. */ + +struct macho_header_fat { - uint32_t file_offset; - uintptr_t file_size; - const unsigned char *data; + uint32_t magic; /* Magic number (MACH_O_MH_MAGIC_FAT) */ + uint32_t nfat_arch; /* Number of components */ }; -/* Mach-O symbols don't have a length. As a result we have to infer it - by sorting the symbol addresses for each image and recording the - memory range attributed to each image. */ +/* Values for the header magic field. */ + +#define MACH_O_MH_MAGIC_32 0xfeedface +#define MACH_O_MH_MAGIC_64 0xfeedfacf +#define MACH_O_MH_MAGIC_FAT 0xcafebabe +#define MACH_O_MH_CIGAM_FAT 0xbebafeca + +/* Value for the header filetype field. */ + +#define MACH_O_MH_EXECUTE 0x02 +#define MACH_O_MH_DYLIB 0x06 +#define MACH_O_MH_DSYM 0x0a + +/* A component of a fat file. A fat file starts with a + macho_header_fat followed by nfat_arch instances of this + struct. */ + +struct macho_fat_arch +{ + uint32_t cputype; /* CPU type */ + uint32_t cpusubtype; /* CPU subtype */ + uint32_t offset; /* File offset of this entry */ + uint32_t size; /* Size of this entry */ + uint32_t align; /* Alignment of this entry */ +}; + +/* Values for the fat_arch cputype field (and the header cputype + field). */ + +#define MACH_O_CPU_ARCH_ABI64 0x01000000 + +#define MACH_O_CPU_TYPE_X86 7 +#define MACH_O_CPU_TYPE_ARM 12 + +#define MACH_O_CPU_TYPE_X86_64 (MACH_O_CPU_TYPE_X86 | MACH_O_CPU_ARCH_ABI64) +#define MACH_O_CPU_TYPE_ARM64 (MACH_O_CPU_TYPE_ARM | MACH_O_CPU_ARCH_ABI64) + +/* The header of a load command. */ + +struct macho_load_command +{ + uint32_t cmd; /* The type of load command */ + uint32_t cmdsize; /* Size in bytes of the entire command */ +}; + +/* Values for the load_command cmd field. */ + +#define MACH_O_LC_SEGMENT 0x01 +#define MACH_O_LC_SYMTAB 0x02 +#define MACH_O_LC_SEGMENT_64 0x19 +#define MACH_O_LC_UUID 0x1b + +/* The length of a section of segment name. */ + +#define MACH_O_NAMELEN (16) + +/* LC_SEGMENT load command. */ + +struct macho_segment_command +{ + uint32_t cmd; /* The type of load command (LC_SEGMENT) */ + uint32_t cmdsize; /* Size in bytes of the entire command */ + char segname[MACH_O_NAMELEN]; /* Segment name */ + uint32_t vmaddr; /* Virtual memory address */ + uint32_t vmsize; /* Virtual memory size */ + uint32_t fileoff; /* Offset of data to be mapped */ + uint32_t filesize; /* Size of data in file */ + uint32_t maxprot; /* Maximum permitted virtual protection */ + uint32_t initprot; /* Initial virtual memory protection */ + uint32_t nsects; /* Number of sections in this segment */ + uint32_t flags; /* Flags */ +}; + +/* LC_SEGMENT_64 load command. */ + +struct macho_segment_64_command +{ + uint32_t cmd; /* The type of load command (LC_SEGMENT) */ + uint32_t cmdsize; /* Size in bytes of the entire command */ + char segname[MACH_O_NAMELEN]; /* Segment name */ + uint64_t vmaddr; /* Virtual memory address */ + uint64_t vmsize; /* Virtual memory size */ + uint64_t fileoff; /* Offset of data to be mapped */ + uint64_t filesize; /* Size of data in file */ + uint32_t maxprot; /* Maximum permitted virtual protection */ + uint32_t initprot; /* Initial virtual memory protection */ + uint32_t nsects; /* Number of sections in this segment */ + uint32_t flags; /* Flags */ +}; + +/* LC_SYMTAB load command. */ + +struct macho_symtab_command +{ + uint32_t cmd; /* The type of load command (LC_SEGMENT) */ + uint32_t cmdsize; /* Size in bytes of the entire command */ + uint32_t symoff; /* File offset of symbol table */ + uint32_t nsyms; /* Number of symbols */ + uint32_t stroff; /* File offset of string table */ + uint32_t strsize; /* String table size */ +}; + +/* The length of a Mach-O uuid. */ + +#define MACH_O_UUID_LEN (16) + +/* LC_UUID load command. */ + +struct macho_uuid_command +{ + uint32_t cmd; /* Type of load command (LC_UUID) */ + uint32_t cmdsize; /* Size in bytes of command */ + unsigned char uuid[MACH_O_UUID_LEN]; /* UUID */ +}; + +/* 32-bit section header within a LC_SEGMENT segment. */ + +struct macho_section +{ + char sectname[MACH_O_NAMELEN]; /* Section name */ + char segment[MACH_O_NAMELEN]; /* Segment of this section */ + uint32_t addr; /* Address in memory */ + uint32_t size; /* Section size */ + uint32_t offset; /* File offset */ + uint32_t align; /* Log2 of section alignment */ + uint32_t reloff; /* File offset of relocations */ + uint32_t nreloc; /* Number of relocs for this section */ + uint32_t flags; /* Flags */ + uint32_t reserved1; + uint32_t reserved2; +}; + +/* 64-bit section header within a LC_SEGMENT_64 segment. */ + +struct macho_section_64 +{ + char sectname[MACH_O_NAMELEN]; /* Section name */ + char segment[MACH_O_NAMELEN]; /* Segment of this section */ + uint64_t addr; /* Address in memory */ + uint64_t size; /* Section size */ + uint32_t offset; /* File offset */ + uint32_t align; /* Log2 of section alignment */ + uint32_t reloff; /* File offset of section relocations */ + uint32_t nreloc; /* Number of relocs for this section */ + uint32_t flags; /* Flags */ + uint32_t reserved1; + uint32_t reserved2; + uint32_t reserved3; +}; + +/* 32-bit symbol data. */ + +struct macho_nlist +{ + uint32_t n_strx; /* Index of name in string table */ + uint8_t n_type; /* Type flag */ + uint8_t n_sect; /* Section number */ + uint16_t n_desc; /* Stabs description field */ + uint32_t n_value; /* Value */ +}; + +/* 64-bit symbol data. */ + +struct macho_nlist_64 +{ + uint32_t n_strx; /* Index of name in string table */ + uint8_t n_type; /* Type flag */ + uint8_t n_sect; /* Section number */ + uint16_t n_desc; /* Stabs description field */ + uint64_t n_value; /* Value */ +}; + +/* Value found in nlist n_type field. */ + +#define MACH_O_N_EXT 0x01 /* Extern symbol */ +#define MACH_O_N_ABS 0x02 /* Absolute symbol */ +#define MACH_O_N_SECT 0x0e /* Defined in section */ + +#define MACH_O_N_TYPE 0x0e /* Mask for type bits */ +#define MACH_O_N_STAB 0xe0 /* Stabs debugging symbol */ + +/* Information we keep for a Mach-O symbol. */ + struct macho_symbol { - uintptr_t addr; - size_t size; - const char *name; + const char *name; /* Symbol name */ + uintptr_t address; /* Symbol address */ }; +/* Information to pass to macho_syminfo. */ + struct macho_syminfo_data { - struct macho_syminfo_data *next; - struct macho_symbol *symbols; - size_t symbol_count; - uintptr_t min_addr; - uintptr_t max_addr; + struct macho_syminfo_data *next; /* Next module */ + struct macho_symbol *symbols; /* Symbols sorted by address */ + size_t count; /* Number of symbols */ }; -uint16_t -macho_file_to_host_u16 (int file_bytes_swapped, uint16_t input) +/* Names of sections, indexed by enum dwarf_section in internal.h. */ + +static const char * const dwarf_section_names[DEBUG_MAX] = { - if (file_bytes_swapped) - return (input >> 8) | (input << 8); - else - return input; + "__debug_info", + "__debug_line", + "__debug_abbrev", + "__debug_ranges", + "__debug_str", + "", /* DEBUG_ADDR */ + "__debug_str_offs", + "", /* DEBUG_LINE_STR */ + "__debug_rnglists" +}; + +/* Forward declaration. */ + +static int macho_add (struct backtrace_state *, const char *, int, off_t, + const unsigned char *, uintptr_t, int, + backtrace_error_callback, void *, fileline *, int *); + +/* A dummy callback function used when we can't find any debug info. */ + +static int +macho_nodebug (struct backtrace_state *state ATTRIBUTE_UNUSED, + uintptr_t pc ATTRIBUTE_UNUSED, + backtrace_full_callback callback ATTRIBUTE_UNUSED, + backtrace_error_callback error_callback, void *data) +{ + error_callback (data, "no debug info in Mach-O executable", -1); + return 0; } -uint32_t -macho_file_to_host_u32 (int file_bytes_swapped, uint32_t input) +/* A dummy callback function used when we can't find a symbol + table. */ + +static void +macho_nosyms (struct backtrace_state *state ATTRIBUTE_UNUSED, + uintptr_t addr ATTRIBUTE_UNUSED, + backtrace_syminfo_callback callback ATTRIBUTE_UNUSED, + backtrace_error_callback error_callback, void *data) { - if (file_bytes_swapped) - { - return ((input >> 24) & 0x000000FF) - | ((input >> 8) & 0x0000FF00) - | ((input << 8) & 0x00FF0000) - | ((input << 24) & 0xFF000000); - } - else - { - return input; - } + error_callback (data, "no symbol table in Mach-O executable", -1); } -uint64_t -macho_file_to_host_u64 (int file_bytes_swapped, uint64_t input) +/* Add a single DWARF section to DWARF_SECTIONS, if we need the + section. Returns 1 on success, 0 on failure. */ + +static int +macho_add_dwarf_section (struct backtrace_state *state, int descriptor, + const char *sectname, uint32_t offset, uint64_t size, + backtrace_error_callback error_callback, void *data, + struct dwarf_sections *dwarf_sections) { - if (file_bytes_swapped) - { - return macho_file_to_host_u32 (file_bytes_swapped, - (uint32_t) (input >> 32)) - | (((uint64_t) macho_file_to_host_u32 (file_bytes_swapped, - (uint32_t) input)) << 32); - } - else + int i; + + for (i = 0; i < (int) DEBUG_MAX; ++i) { - return input; + if (dwarf_section_names[i][0] != '\0' + && strncmp (sectname, dwarf_section_names[i], MACH_O_NAMELEN) == 0) + { + struct backtrace_view section_view; + + /* FIXME: Perhaps it would be better to try to use a single + view to read all the DWARF data, as we try to do for + ELF. */ + + if (!backtrace_get_view (state, descriptor, offset, size, + error_callback, data, §ion_view)) + return 0; + dwarf_sections->data[i] = (const unsigned char *) section_view.data; + dwarf_sections->size[i] = size; + break; + } } + return 1; } -#if BACKTRACE_BITS == 64 -#define macho_file_to_host_usize macho_file_to_host_u64 -typedef struct mach_header_64 mach_header_native_t; -#define LC_SEGMENT_NATIVE LC_SEGMENT_64 -typedef struct segment_command_64 segment_command_native_t; -typedef struct nlist_64 nlist_native_t; -typedef struct section_64 section_native_t; -#else /* BACKTRACE_BITS == 32 */ -#define macho_file_to_host_usize macho_file_to_host_u32 -typedef struct mach_header mach_header_native_t; -#define LC_SEGMENT_NATIVE LC_SEGMENT -typedef struct segment_command segment_command_native_t; -typedef struct nlist nlist_native_t; -typedef struct section section_native_t; -#endif +/* Collect DWARF sections from a DWARF segment. Returns 1 on success, + 0 on failure. */ -// Gets a view into a Mach-O image, taking any slice offset into account -int -macho_get_view (struct backtrace_state *state, int descriptor, - off_t offset, size_t size, - backtrace_error_callback error_callback, - void *data, struct macho_commands_view *commands_view, - struct backtrace_view *view) +static int +macho_add_dwarf_segment (struct backtrace_state *state, int descriptor, + off_t offset, unsigned int cmd, const char *psecs, + size_t sizesecs, unsigned int nsects, + backtrace_error_callback error_callback, void *data, + struct dwarf_sections *dwarf_sections) { - return backtrace_get_view (state, descriptor, - commands_view->base_offset + offset, size, - error_callback, data, view); -} + size_t sec_header_size; + size_t secoffset; + unsigned int i; -int -macho_get_commands (struct backtrace_state *state, int descriptor, - backtrace_error_callback error_callback, - void *data, struct macho_commands_view *commands_view, - int *incompatible) -{ - int ret = 0; - int is_fat = 0; - struct backtrace_view file_header_view; - int file_header_view_valid = 0; - struct backtrace_view fat_archs_view; - int fat_archs_view_valid = 0; - const mach_header_native_t *file_header; - uint64_t commands_offset; - - *incompatible = 0; - - if (!backtrace_get_view (state, descriptor, 0, sizeof (mach_header_native_t), - error_callback, data, &file_header_view)) - goto end; - file_header_view_valid = 1; - - switch (*(const uint32_t *) file_header_view.data) + switch (cmd) { - case MH_MAGIC: - if (BACKTRACE_BITS == 32) - commands_view->bytes_swapped = 0; - else - { - *incompatible = 1; - goto end; - } - break; - case MH_CIGAM: - if (BACKTRACE_BITS == 32) - commands_view->bytes_swapped = 1; - else - { - *incompatible = 1; - goto end; - } - break; - case MH_MAGIC_64: - if (BACKTRACE_BITS == 64) - commands_view->bytes_swapped = 0; - else - { - *incompatible = 1; - goto end; - } - break; - case MH_CIGAM_64: - if (BACKTRACE_BITS == 64) - commands_view->bytes_swapped = 1; - else - { - *incompatible = 1; - goto end; - } - break; - case FAT_MAGIC: - is_fat = 1; - commands_view->bytes_swapped = 0; + case MACH_O_LC_SEGMENT: + sec_header_size = sizeof (struct macho_section); break; - case FAT_CIGAM: - is_fat = 1; - commands_view->bytes_swapped = 1; + case MACH_O_LC_SEGMENT_64: + sec_header_size = sizeof (struct macho_section_64); break; - default: - goto end; + default: + abort (); } - if (is_fat) + secoffset = 0; + for (i = 0; i < nsects; ++i) { - uint32_t native_slice_offset; - size_t archs_total_size; - uint32_t arch_count; - const struct fat_header *fat_header; - const struct fat_arch *archs; - uint32_t i; - - fat_header = file_header_view.data; - arch_count = - macho_file_to_host_u32 (commands_view->bytes_swapped, - fat_header->nfat_arch); - - archs_total_size = arch_count * sizeof (struct fat_arch); - - if (!backtrace_get_view (state, descriptor, sizeof (struct fat_header), - archs_total_size, error_callback, - data, &fat_archs_view)) - goto end; - fat_archs_view_valid = 1; - - native_slice_offset = 0; - archs = fat_archs_view.data; - for (i = 0; i < arch_count; i++) - { - const struct fat_arch *raw_arch = archs + i; - int cpu_type = - (int) macho_file_to_host_u32 (commands_view->bytes_swapped, - (uint32_t) raw_arch->cputype); - - if (cpu_type == NATIVE_CPU_TYPE) - { - native_slice_offset = - macho_file_to_host_u32 (commands_view->bytes_swapped, - raw_arch->offset); - - break; - } - } - - if (native_slice_offset == 0) - { - *incompatible = 1; - goto end; - } - - backtrace_release_view (state, &file_header_view, error_callback, data); - file_header_view_valid = 0; - if (!backtrace_get_view (state, descriptor, native_slice_offset, - sizeof (mach_header_native_t), error_callback, - data, &file_header_view)) - goto end; - file_header_view_valid = 1; - - // The endianess of the slice may be different than the fat image - switch (*(const uint32_t *) file_header_view.data) - { - case MH_MAGIC: - if (BACKTRACE_BITS == 32) - commands_view->bytes_swapped = 0; - else - goto end; - break; - case MH_CIGAM: - if (BACKTRACE_BITS == 32) - commands_view->bytes_swapped = 1; - else - goto end; - break; - case MH_MAGIC_64: - if (BACKTRACE_BITS == 64) - commands_view->bytes_swapped = 0; - else - goto end; - break; - case MH_CIGAM_64: - if (BACKTRACE_BITS == 64) - commands_view->bytes_swapped = 1; - else - goto end; - break; - default: - goto end; - } - - commands_view->base_offset = native_slice_offset; + if (secoffset + sec_header_size > sizesecs) + { + error_callback (data, "section overflow withing segment", 0); + return 0; + } + + switch (cmd) + { + case MACH_O_LC_SEGMENT: + { + struct macho_section section; + + memcpy (§ion, psecs + secoffset, sizeof section); + macho_add_dwarf_section (state, descriptor, section.sectname, + offset + section.offset, section.size, + error_callback, data, dwarf_sections); + } + break; + + case MACH_O_LC_SEGMENT_64: + { + struct macho_section_64 section; + + memcpy (§ion, psecs + secoffset, sizeof section); + macho_add_dwarf_section (state, descriptor, section.sectname, + offset + section.offset, section.size, + error_callback, data, dwarf_sections); + } + break; + + default: + abort (); + } + + secoffset += sec_header_size; } - else - commands_view->base_offset = 0; - - file_header = file_header_view.data; - commands_view->commands_count = - macho_file_to_host_u32 (commands_view->bytes_swapped, - file_header->ncmds); - commands_view->commands_total_size = - macho_file_to_host_u32 (commands_view->bytes_swapped, - file_header->sizeofcmds); - commands_offset = - commands_view->base_offset + sizeof (mach_header_native_t); - - if (!backtrace_get_view (state, descriptor, commands_offset, - commands_view->commands_total_size, error_callback, - data, &commands_view->view)) - goto end; - - ret = 1; - -end: - if (file_header_view_valid) - backtrace_release_view (state, &file_header_view, error_callback, data); - if (fat_archs_view_valid) - backtrace_release_view (state, &fat_archs_view, error_callback, data); - return ret; -} - -int -macho_get_uuid (struct backtrace_state *state ATTRIBUTE_UNUSED, - int descriptor ATTRIBUTE_UNUSED, - backtrace_error_callback error_callback, - void *data, struct macho_commands_view *commands_view, - uuid_t *uuid) -{ - size_t offset = 0; - uint32_t i = 0; - for (i = 0; i < commands_view->commands_count; i++) - { - const struct load_command *raw_command; - struct load_command command; - - if (offset + sizeof (struct load_command) - > commands_view->commands_total_size) - { - error_callback (data, - "executable file contains out of range command offset", - 0); - return 0; - } - - raw_command = - commands_view->view.data + offset; - command.cmd = macho_file_to_host_u32 (commands_view->bytes_swapped, - raw_command->cmd); - command.cmdsize = macho_file_to_host_u32 (commands_view->bytes_swapped, - raw_command->cmdsize); - - if (command.cmd == LC_UUID) - { - const struct uuid_command *uuid_command; - - if (offset + sizeof (struct uuid_command) - > commands_view->commands_total_size) - { - error_callback (data, - "executable file contains out of range command offset", - 0); - return 0; - } - - uuid_command = - (const struct uuid_command *) raw_command; - memcpy (uuid, uuid_command->uuid, sizeof (uuid_t)); - return 1; - } - - offset += command.cmdsize; - } - - error_callback (data, "executable file is missing an identifying UUID", 0); - return 0; + return 1; } -/* Returns the base address of a Mach-O image, as encoded in the file header. - * WARNING: This does not take ASLR into account, which is ubiquitous on recent - * Darwin platforms. - */ -int -macho_get_addr_range (struct backtrace_state *state ATTRIBUTE_UNUSED, - int descriptor ATTRIBUTE_UNUSED, - backtrace_error_callback error_callback, - void *data, struct macho_commands_view *commands_view, - uintptr_t *base_address, uintptr_t *max_address) -{ - size_t offset = 0; - int found_text = 0; - uint32_t i = 0; - - *max_address = 0; +/* Compare struct macho_symbol for qsort. */ - for (i = 0; i < commands_view->commands_count; i++) - { - const struct load_command *raw_command; - struct load_command command; - - if (offset + sizeof (struct load_command) - > commands_view->commands_total_size) - { - error_callback (data, - "executable file contains out of range command offset", - 0); - return 0; - } - - raw_command = commands_view->view.data + offset; - command.cmd = macho_file_to_host_u32 (commands_view->bytes_swapped, - raw_command->cmd); - command.cmdsize = macho_file_to_host_u32 (commands_view->bytes_swapped, - raw_command->cmdsize); - - if (command.cmd == LC_SEGMENT_NATIVE) - { - const segment_command_native_t *raw_segment; - uintptr_t segment_vmaddr; - uintptr_t segment_vmsize; - uintptr_t segment_maxaddr; - uintptr_t text_fileoff; - - if (offset + sizeof (segment_command_native_t) - > commands_view->commands_total_size) - { - error_callback (data, - "executable file contains out of range command offset", - 0); - return 0; - } - - raw_segment = (const segment_command_native_t *) raw_command; - - segment_vmaddr = macho_file_to_host_usize ( - commands_view->bytes_swapped, raw_segment->vmaddr); - segment_vmsize = macho_file_to_host_usize ( - commands_view->bytes_swapped, raw_segment->vmsize); - segment_maxaddr = segment_vmaddr + segment_vmsize; - - if (strncmp (raw_segment->segname, "__TEXT", - sizeof (raw_segment->segname)) == 0) - { - text_fileoff = macho_file_to_host_usize ( - commands_view->bytes_swapped, raw_segment->fileoff); - *base_address = segment_vmaddr - text_fileoff; - - found_text = 1; - } - - if (segment_maxaddr > *max_address) - *max_address = segment_maxaddr; - } - - offset += command.cmdsize; - } +static int +macho_symbol_compare (const void *v1, const void *v2) +{ + const struct macho_symbol *m1 = (const struct macho_symbol *) v1; + const struct macho_symbol *m2 = (const struct macho_symbol *) v2; - if (found_text) + if (m1->address < m2->address) + return -1; + else if (m1->address > m2->address) return 1; else - { - error_callback (data, "executable is missing __TEXT segment", 0); - return 0; - } + return 0; } +/* Compare an address against a macho_symbol for bsearch. We allocate + one extra entry in the array so that this can safely look at the + next entry. */ + static int -macho_symbol_compare_addr (const void *left_raw, const void *right_raw) +macho_symbol_search (const void *vkey, const void *ventry) { - const struct macho_symbol *left = left_raw; - const struct macho_symbol *right = right_raw; + const uintptr_t *key = (const uintptr_t *) vkey; + const struct macho_symbol *entry = (const struct macho_symbol *) ventry; + uintptr_t addr; - if (left->addr > right->addr) - return 1; - else if (left->addr < right->addr) + addr = *key; + if (addr < entry->address) return -1; + else if (entry->name[0] == '\0' + && entry->address == ~(uintptr_t) 0) + return -1; + else if ((entry + 1)->name[0] == '\0' + && (entry + 1)->address == ~(uintptr_t) 0) + return -1; + else if (addr >= (entry + 1)->address) + return 1; else return 0; } -int -macho_symbol_type_relevant (uint8_t type) -{ - uint8_t type_field = (uint8_t) (type & N_TYPE); +/* Return whether the symbol type field indicates a symbol table entry + that we care about: a function or data symbol. */ - return !(type & N_EXT) && - (type_field == N_ABS || type_field == N_SECT); +static int +macho_defined_symbol (uint8_t type) +{ + if ((type & MACH_O_N_STAB) != 0) + return 0; + switch (type & MACH_O_N_TYPE) + { + case MACH_O_N_ABS: + return 1; + case MACH_O_N_SECT: + return 1; + default: + return 0; + } } -int -macho_add_symtab (struct backtrace_state *state, - backtrace_error_callback error_callback, - void *data, int descriptor, - struct macho_commands_view *commands_view, - uintptr_t base_address, uintptr_t max_image_address, - intptr_t vmslide, int *found_sym) +/* Add symbol table information for a Mach-O file. */ + +static int +macho_add_symtab (struct backtrace_state *state, int descriptor, + uintptr_t base_address, int is_64, + off_t symoff, unsigned int nsyms, off_t stroff, + unsigned int strsize, + backtrace_error_callback error_callback, void *data) { - struct macho_syminfo_data *syminfo_data; - - int ret = 0; - size_t offset = 0; - struct backtrace_view symtab_view; - int symtab_view_valid = 0; - struct backtrace_view strtab_view; - int strtab_view_valid = 0; - size_t syminfo_index = 0; - size_t function_count = 0; - uint32_t i = 0; - uint32_t j = 0; - uint32_t symtab_index = 0; + size_t symsize; + struct backtrace_view sym_view; + int sym_view_valid; + struct backtrace_view str_view; + int str_view_valid; + size_t ndefs; + size_t symtaboff; + unsigned int i; + size_t macho_symbol_size; + struct macho_symbol *macho_symbols; + unsigned int j; + struct macho_syminfo_data *sdata; + + sym_view_valid = 0; + str_view_valid = 0; + macho_symbol_size = 0; + macho_symbols = NULL; + + if (is_64) + symsize = sizeof (struct macho_nlist_64); + else + symsize = sizeof (struct macho_nlist); - *found_sym = 0; + if (!backtrace_get_view (state, descriptor, symoff, nsyms * symsize, + error_callback, data, &sym_view)) + goto fail; + sym_view_valid = 1; + + if (!backtrace_get_view (state, descriptor, stroff, strsize, + error_callback, data, &str_view)) + return 0; + str_view_valid = 1; + + ndefs = 0; + symtaboff = 0; + for (i = 0; i < nsyms; ++i, symtaboff += symsize) + { + if (is_64) + { + struct macho_nlist_64 nlist; + + memcpy (&nlist, (const char *) sym_view.data + symtaboff, + sizeof nlist); + if (macho_defined_symbol (nlist.n_type)) + ++ndefs; + } + else + { + struct macho_nlist nlist; + + memcpy (&nlist, (const char *) sym_view.data + symtaboff, + sizeof nlist); + if (macho_defined_symbol (nlist.n_type)) + ++ndefs; + } + } - for (i = 0; i < commands_view->commands_count; i++) + /* Add 1 to ndefs to make room for a sentinel. */ + macho_symbol_size = (ndefs + 1) * sizeof (struct macho_symbol); + macho_symbols = ((struct macho_symbol *) + backtrace_alloc (state, macho_symbol_size, error_callback, + data)); + if (macho_symbols == NULL) + goto fail; + + j = 0; + symtaboff = 0; + for (i = 0; i < nsyms; ++i, symtaboff += symsize) { - const struct load_command *raw_command; - struct load_command command; - - if (offset + sizeof (struct load_command) - > commands_view->commands_total_size) - { - error_callback (data, - "executable file contains out of range command offset", - 0); - return 0; - } - - raw_command = commands_view->view.data + offset; - command.cmd = macho_file_to_host_u32 (commands_view->bytes_swapped, - raw_command->cmd); - command.cmdsize = macho_file_to_host_u32 (commands_view->bytes_swapped, - raw_command->cmdsize); - - if (command.cmd == LC_SYMTAB) - { - const struct symtab_command *symtab_command; - uint32_t symbol_table_offset; - uint32_t symbol_count; - uint32_t string_table_offset; - uint32_t string_table_size; - - if (offset + sizeof (struct symtab_command) - > commands_view->commands_total_size) - { - error_callback (data, - "executable file contains out of range command offset", - 0); - return 0; - } - - symtab_command = (const struct symtab_command *) raw_command; - - symbol_table_offset = macho_file_to_host_u32 ( - commands_view->bytes_swapped, symtab_command->symoff); - symbol_count = macho_file_to_host_u32 ( - commands_view->bytes_swapped, symtab_command->nsyms); - string_table_offset = macho_file_to_host_u32 ( - commands_view->bytes_swapped, symtab_command->stroff); - string_table_size = macho_file_to_host_u32 ( - commands_view->bytes_swapped, symtab_command->strsize); - - - if (!macho_get_view (state, descriptor, symbol_table_offset, - symbol_count * sizeof (nlist_native_t), - error_callback, data, commands_view, - &symtab_view)) - goto end; - symtab_view_valid = 1; - - if (!macho_get_view (state, descriptor, string_table_offset, - string_table_size, error_callback, data, - commands_view, &strtab_view)) - goto end; - strtab_view_valid = 1; - - // Count functions first - for (j = 0; j < symbol_count; j++) - { - const nlist_native_t *raw_sym = - ((const nlist_native_t *) symtab_view.data) + j; - - if (macho_symbol_type_relevant (raw_sym->n_type)) - { - function_count += 1; - } - } - - // Allocate space for the: - // (a) macho_syminfo_data for this image - // (b) macho_symbol entries - syminfo_data = - backtrace_alloc (state, - sizeof (struct macho_syminfo_data), - error_callback, data); - if (syminfo_data == NULL) - goto end; - - syminfo_data->symbols = backtrace_alloc ( - state, function_count * sizeof (struct macho_symbol), - error_callback, data); - if (syminfo_data->symbols == NULL) - goto end; - - syminfo_data->symbol_count = function_count; - syminfo_data->next = NULL; - syminfo_data->min_addr = base_address; - syminfo_data->max_addr = max_image_address; - - for (symtab_index = 0; - symtab_index < symbol_count; symtab_index++) - { - const nlist_native_t *raw_sym = - ((const nlist_native_t *) symtab_view.data) + - symtab_index; - - if (macho_symbol_type_relevant (raw_sym->n_type)) - { - size_t strtab_index; - const char *name; - size_t max_len_plus_one; - - syminfo_data->symbols[syminfo_index].addr = - macho_file_to_host_usize (commands_view->bytes_swapped, - raw_sym->n_value) + vmslide; - - strtab_index = macho_file_to_host_u32 ( - commands_view->bytes_swapped, - raw_sym->n_un.n_strx); - - // Check the range of the supposed "string" we've been - // given - if (strtab_index >= string_table_size) - { - error_callback ( - data, - "dSYM file contains out of range string table index", - 0); - goto end; - } - - name = strtab_view.data + strtab_index; - max_len_plus_one = string_table_size - strtab_index; - - if (strnlen (name, max_len_plus_one) >= max_len_plus_one) - { - error_callback ( - data, - "dSYM file contains unterminated string", - 0); - goto end; - } - - // Remove underscore prefixes - if (name[0] == '_') - { - name = name + 1; - } - - syminfo_data->symbols[syminfo_index].name = name; - - syminfo_index += 1; - } - } - - backtrace_qsort (syminfo_data->symbols, - syminfo_data->symbol_count, - sizeof (struct macho_symbol), - macho_symbol_compare_addr); - - // Calculate symbol sizes - for (syminfo_index = 0; - syminfo_index < syminfo_data->symbol_count; syminfo_index++) - { - if (syminfo_index + 1 < syminfo_data->symbol_count) - { - syminfo_data->symbols[syminfo_index].size = - syminfo_data->symbols[syminfo_index + 1].addr - - syminfo_data->symbols[syminfo_index].addr; - } - else - { - syminfo_data->symbols[syminfo_index].size = - max_image_address - - syminfo_data->symbols[syminfo_index].addr; - } - } - - if (!state->threaded) - { - struct macho_syminfo_data **pp; - - for (pp = (struct macho_syminfo_data **) (void *) &state->syminfo_data; - *pp != NULL; - pp = &(*pp)->next); - *pp = syminfo_data; - } - else - { - while (1) - { - struct macho_syminfo_data **pp; - - pp = (struct macho_syminfo_data **) (void *) &state->syminfo_data; - - while (1) - { - struct macho_syminfo_data *p; - - p = backtrace_atomic_load_pointer (pp); - - if (p == NULL) - break; - - pp = &p->next; - } - - if (__sync_bool_compare_and_swap (pp, NULL, syminfo_data)) - break; - } - } - - strtab_view_valid = 0; // We need to keep string table around - *found_sym = 1; - ret = 1; - goto end; - } - - offset += command.cmdsize; + uint32_t strx; + uint64_t value; + const char *name; + + strx = 0; + value = 0; + if (is_64) + { + struct macho_nlist_64 nlist; + + memcpy (&nlist, (const char *) sym_view.data + symtaboff, + sizeof nlist); + if (!macho_defined_symbol (nlist.n_type)) + continue; + + strx = nlist.n_strx; + value = nlist.n_value; + } + else + { + struct macho_nlist nlist; + + memcpy (&nlist, (const char *) sym_view.data + symtaboff, + sizeof nlist); + if (!macho_defined_symbol (nlist.n_type)) + continue; + + strx = nlist.n_strx; + value = nlist.n_value; + } + + if (strx >= strsize) + { + error_callback (data, "symbol string index out of range", 0); + goto fail; + } + + name = (const char *) str_view.data + strx; + if (name[0] == '_') + ++name; + macho_symbols[j].name = name; + macho_symbols[j].address = value + base_address; + ++j; } - // No symbol table here - ret = 1; - goto end; + sdata = ((struct macho_syminfo_data *) + backtrace_alloc (state, sizeof *sdata, error_callback, data)); + if (sdata == NULL) + goto fail; -end: - if (symtab_view_valid) - backtrace_release_view (state, &symtab_view, error_callback, data); - if (strtab_view_valid) - backtrace_release_view (state, &strtab_view, error_callback, data); - return ret; -} + /* We need to keep the string table since it holds the names, but we + can release the symbol table. */ -int -macho_try_dwarf (struct backtrace_state *state, - backtrace_error_callback error_callback, - void *data, fileline *fileline_fn, uuid_t *executable_uuid, - uintptr_t base_address, uintptr_t max_image_address, - intptr_t vmslide, char *dwarf_filename, int *matched, - int *found_sym, int *found_dwarf) -{ - uuid_t dwarf_uuid; - - int ret = 0; - int dwarf_descriptor; - int dwarf_descriptor_valid = 0; - struct macho_commands_view commands_view; - int commands_view_valid = 0; - struct backtrace_view dwarf_view; - int dwarf_view_valid = 0; - size_t offset = 0; - struct found_dwarf_section dwarf_sections[DEBUG_MAX]; - uintptr_t min_dwarf_offset = 0; - uintptr_t max_dwarf_offset = 0; - uint32_t i = 0; - uint32_t j = 0; - int k = 0; - - *matched = 0; - *found_sym = 0; - *found_dwarf = 0; + backtrace_release_view (state, &sym_view, error_callback, data); + sym_view_valid = 0; + str_view_valid = 0; + + /* Add a trailing sentinel symbol. */ + macho_symbols[j].name = ""; + macho_symbols[j].address = ~(uintptr_t) 0; + + backtrace_qsort (macho_symbols, ndefs + 1, sizeof (struct macho_symbol), + macho_symbol_compare); - if ((dwarf_descriptor = backtrace_open (dwarf_filename, error_callback, - data, NULL)) == 0) - goto end; - dwarf_descriptor_valid = 1; + sdata->next = NULL; + sdata->symbols = macho_symbols; + sdata->count = ndefs; - int incompatible; - if (!macho_get_commands (state, dwarf_descriptor, error_callback, data, - &commands_view, &incompatible)) + if (!state->threaded) { - // Failing to read the header here is fine, because this dSYM may be - // for a different architecture - if (incompatible) - { - ret = 1; - } - goto end; + struct macho_syminfo_data **pp; + + for (pp = (struct macho_syminfo_data **) (void *) &state->syminfo_data; + *pp != NULL; + pp = &(*pp)->next) + ; + *pp = sdata; } - commands_view_valid = 1; + else + { + while (1) + { + struct macho_syminfo_data **pp; + + pp = (struct macho_syminfo_data **) (void *) &state->syminfo_data; + + while (1) + { + struct macho_syminfo_data *p; + + p = backtrace_atomic_load_pointer (pp); + + if (p == NULL) + break; + + pp = &p->next; + } - // Get dSYM UUID and compare - if (!macho_get_uuid (state, dwarf_descriptor, error_callback, data, - &commands_view, &dwarf_uuid)) + if (__sync_bool_compare_and_swap (pp, NULL, sdata)) + break; + } + } + + return 1; + + fail: + if (macho_symbols != NULL) + backtrace_free (state, macho_symbols, macho_symbol_size, + error_callback, data); + if (sym_view_valid) + backtrace_release_view (state, &sym_view, error_callback, data); + if (str_view_valid) + backtrace_release_view (state, &str_view, error_callback, data); + return 0; +} + +/* Return the symbol name and value for an ADDR. */ + +static void +macho_syminfo (struct backtrace_state *state, uintptr_t addr, + backtrace_syminfo_callback callback, + backtrace_error_callback error_callback ATTRIBUTE_UNUSED, + void *data) +{ + struct macho_syminfo_data *sdata; + struct macho_symbol *sym; + + sym = NULL; + if (!state->threaded) { - error_callback (data, "dSYM file is missing an identifying uuid", 0); - goto end; + for (sdata = (struct macho_syminfo_data *) state->syminfo_data; + sdata != NULL; + sdata = sdata->next) + { + sym = ((struct macho_symbol *) + bsearch (&addr, sdata->symbols, sdata->count, + sizeof (struct macho_symbol), macho_symbol_search)); + if (sym != NULL) + break; + } } - if (memcmp (executable_uuid, &dwarf_uuid, sizeof (uuid_t)) != 0) + else { - // DWARF doesn't belong to desired executable - ret = 1; - goto end; + struct macho_syminfo_data **pp; + + pp = (struct macho_syminfo_data **) (void *) &state->syminfo_data; + while (1) + { + sdata = backtrace_atomic_load_pointer (pp); + if (sdata == NULL) + break; + + sym = ((struct macho_symbol *) + bsearch (&addr, sdata->symbols, sdata->count, + sizeof (struct macho_symbol), macho_symbol_search)); + if (sym != NULL) + break; + + pp = &sdata->next; + } } - *matched = 1; + if (sym == NULL) + callback (data, addr, NULL, 0, 0); + else + callback (data, addr, sym->name, sym->address, 0); +} - // Read symbol table - if (!macho_add_symtab (state, error_callback, data, dwarf_descriptor, - &commands_view, base_address, max_image_address, - vmslide, found_sym)) - goto end; +/* Look through a fat file to find the relevant executable. Returns 1 + on success, 0 on failure (in both cases descriptor is closed). */ - // Get DWARF sections +static int +macho_add_fat (struct backtrace_state *state, const char *filename, + int descriptor, int swapped, off_t offset, + const unsigned char *match_uuid, uintptr_t base_address, + int skip_symtab, uint32_t nfat_arch, + backtrace_error_callback error_callback, void *data, + fileline *fileline_fn, int *found_sym) +{ + int arch_view_valid; + unsigned int cputype; + struct backtrace_view arch_view; + size_t archoffset; + unsigned int i; + + arch_view_valid = 0; + +#if defined (__x86_64__) + cputype = MACH_O_CPU_TYPE_X86_64; +#elif defined (__i386__) + cputype = MACH_O_CPU_TYPE_X86; +#elif defined (__aarch64__) + cputype = MACH_O_CPU_TYPE_ARM64; +#elif defined (__arm__) + cputype = MACH_O_CPU_TYPE_ARM; +#else + error_callback (data, "unknown Mach-O architecture", 0); + goto fail; +#endif + + if (!backtrace_get_view (state, descriptor, offset, + nfat_arch * sizeof (struct macho_fat_arch), + error_callback, data, &arch_view)) + goto fail; - memset (dwarf_sections, 0, sizeof (dwarf_sections)); - offset = 0; - for (i = 0; i < commands_view.commands_count; i++) + archoffset = 0; + for (i = 0; i < nfat_arch; ++i) { - const struct load_command *raw_command; - struct load_command command; - - if (offset + sizeof (struct load_command) - > commands_view.commands_total_size) - { - error_callback (data, - "dSYM file contains out of range command offset", 0); - goto end; - } - - raw_command = commands_view.view.data + offset; - command.cmd = macho_file_to_host_u32 (commands_view.bytes_swapped, - raw_command->cmd); - command.cmdsize = macho_file_to_host_u32 (commands_view.bytes_swapped, - raw_command->cmdsize); - - if (command.cmd == LC_SEGMENT_NATIVE) - { - uint32_t section_count; - size_t section_offset; - const segment_command_native_t *raw_segment; - - if (offset + sizeof (segment_command_native_t) - > commands_view.commands_total_size) - { - error_callback (data, - "dSYM file contains out of range command offset", - 0); - goto end; - } - - raw_segment = (const segment_command_native_t *) raw_command; - - if (strncmp (raw_segment->segname, "__DWARF", - sizeof (raw_segment->segname)) == 0) - { - section_count = macho_file_to_host_u32 ( - commands_view.bytes_swapped, - raw_segment->nsects); - - section_offset = offset + sizeof (segment_command_native_t); - - // Search sections for relevant DWARF section names - for (j = 0; j < section_count; j++) - { - const section_native_t *raw_section; - - if (section_offset + sizeof (section_native_t) > - commands_view.commands_total_size) - { - error_callback (data, - "dSYM file contains out of range command offset", - 0); - goto end; - } - - raw_section = commands_view.view.data + section_offset; - - for (k = 0; k < DEBUG_MAX; k++) - { - uintptr_t dwarf_section_end; - - if (strncmp (raw_section->sectname, - debug_section_names[k], - sizeof (raw_section->sectname)) == 0) - { - *found_dwarf = 1; - - dwarf_sections[k].file_offset = - macho_file_to_host_u32 ( - commands_view.bytes_swapped, - raw_section->offset); - dwarf_sections[k].file_size = - macho_file_to_host_usize ( - commands_view.bytes_swapped, - raw_section->size); - - if (min_dwarf_offset == 0 || - dwarf_sections[k].file_offset < - min_dwarf_offset) - min_dwarf_offset = dwarf_sections[k].file_offset; - - dwarf_section_end = - dwarf_sections[k].file_offset + - dwarf_sections[k].file_size; - if (dwarf_section_end > max_dwarf_offset) - max_dwarf_offset = dwarf_section_end; - - break; - } - } - - section_offset += sizeof (section_native_t); - } - - break; - } - } - - offset += command.cmdsize; + struct macho_fat_arch fat_arch; + uint32_t fcputype; + + memcpy (&fat_arch, + ((const char *) arch_view.data + + i * sizeof (struct macho_fat_arch)), + sizeof fat_arch); + + fcputype = fat_arch.cputype; + if (swapped) + fcputype = __builtin_bswap32 (fcputype); + + if (fcputype == cputype) + { + uint32_t foffset; + + /* FIXME: What about cpusubtype? */ + foffset = fat_arch.offset; + if (swapped) + foffset = __builtin_bswap32 (foffset); + backtrace_release_view (state, &arch_view, error_callback, data); + return macho_add (state, filename, descriptor, foffset, match_uuid, + base_address, skip_symtab, error_callback, data, + fileline_fn, found_sym); + } + + archoffset += sizeof (struct macho_fat_arch); } - if (!*found_dwarf) + error_callback (data, "could not find executable in fat file", 0); + + fail: + if (arch_view_valid) + backtrace_release_view (state, &arch_view, error_callback, data); + if (descriptor != -1) + backtrace_close (descriptor, error_callback, data); + return 0; +} + +/* Look for the dsym file for FILENAME. This is called if FILENAME + does not have debug info or a symbol table. Returns 1 on success, + 0 on failure. */ + +static int +macho_add_dsym (struct backtrace_state *state, const char *filename, + uintptr_t base_address, const unsigned char *uuid, + backtrace_error_callback error_callback, void *data, + fileline* fileline_fn) +{ + const char *p; + const char *dirname; + char *diralc; + size_t dirnamelen; + const char *basename; + size_t basenamelen; + const char *dsymsuffixdir; + size_t dsymsuffixdirlen; + size_t dsymlen; + char *dsym; + char *ps; + int d; + int does_not_exist; + int dummy_found_sym; + + diralc = NULL; + dirnamelen = 0; + dsym = NULL; + dsymlen = 0; + + p = strrchr (filename, '/'); + if (p == NULL) { - // No DWARF in this file - ret = 1; - goto end; + dirname = "."; + dirnamelen = 1; + basename = filename; + basenamelen = strlen (basename); + diralc = NULL; + } + else + { + dirnamelen = p - filename; + diralc = backtrace_alloc (state, dirnamelen + 1, error_callback, data); + if (diralc == NULL) + goto fail; + memcpy (diralc, filename, dirnamelen); + diralc[dirnamelen] = '\0'; + dirname = diralc; + basename = p + 1; + basenamelen = strlen (basename); } - if (!macho_get_view (state, dwarf_descriptor, (off_t) min_dwarf_offset, - max_dwarf_offset - min_dwarf_offset, error_callback, - data, &commands_view, &dwarf_view)) - goto end; - dwarf_view_valid = 1; + dsymsuffixdir = ".dSYM/Contents/Resources/DWARF/"; + dsymsuffixdirlen = strlen (dsymsuffixdir); + + dsymlen = (dirnamelen + + basenamelen + + dsymsuffixdirlen + + basenamelen + + 2); + dsym = backtrace_alloc (state, dsymlen, error_callback, data); + if (dsym == NULL) + goto fail; + + ps = dsym; + memcpy (ps, dirname, dirnamelen); + ps += dirnamelen; + *ps++ = '/'; + memcpy (ps, basename, basenamelen); + ps += basenamelen; + memcpy (ps, dsymsuffixdir, dsymsuffixdirlen); + ps += dsymsuffixdirlen; + memcpy (ps, basename, basenamelen); + ps += basenamelen; + *ps = '\0'; + + if (diralc != NULL) + { + backtrace_free (state, diralc, dirnamelen, error_callback, data); + diralc = NULL; + } - for (i = 0; i < DEBUG_MAX; i++) + d = backtrace_open (dsym, error_callback, data, &does_not_exist); + if (d < 0) { - if (dwarf_sections[i].file_offset == 0) - dwarf_sections[i].data = NULL; - else - dwarf_sections[i].data = - dwarf_view.data + dwarf_sections[i].file_offset - min_dwarf_offset; + /* The file does not exist, so we can't read the debug info. + Just return success. */ + backtrace_free (state, dsym, dsymlen, error_callback, data); + return 1; } - if (!backtrace_dwarf_add (state, vmslide, - dwarf_sections[DEBUG_INFO].data, - dwarf_sections[DEBUG_INFO].file_size, - dwarf_sections[DEBUG_LINE].data, - dwarf_sections[DEBUG_LINE].file_size, - dwarf_sections[DEBUG_ABBREV].data, - dwarf_sections[DEBUG_ABBREV].file_size, - dwarf_sections[DEBUG_RANGES].data, - dwarf_sections[DEBUG_RANGES].file_size, - dwarf_sections[DEBUG_STR].data, - dwarf_sections[DEBUG_STR].file_size, - ((__DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN) - ^ commands_view.bytes_swapped), - error_callback, data, fileline_fn)) - goto end; - - // Don't release the DWARF view because it is still in use - dwarf_descriptor_valid = 0; - dwarf_view_valid = 0; - ret = 1; - -end: - if (dwarf_descriptor_valid) - backtrace_close (dwarf_descriptor, error_callback, data); - if (commands_view_valid) - backtrace_release_view (state, &commands_view.view, error_callback, data); - if (dwarf_view_valid) - backtrace_release_view (state, &dwarf_view, error_callback, data); - return ret; + if (!macho_add (state, dsym, d, 0, uuid, base_address, 1, + error_callback, data, fileline_fn, &dummy_found_sym)) + goto fail; + + backtrace_free (state, dsym, dsymlen, error_callback, data); + + return 1; + + fail: + if (dsym != NULL) + backtrace_free (state, dsym, dsymlen, error_callback, data); + if (diralc != NULL) + backtrace_free (state, diralc, dirnamelen, error_callback, data); + return 0; } -int -macho_try_dsym (struct backtrace_state *state, - backtrace_error_callback error_callback, - void *data, fileline *fileline_fn, uuid_t *executable_uuid, - uintptr_t base_address, uintptr_t max_image_address, - intptr_t vmslide, char *dsym_filename, int *matched, - int *found_sym, int *found_dwarf) +/* Add the backtrace data for a Macho-O file. Returns 1 on success, 0 + on failure (in both cases descriptor is closed). + + FILENAME: the name of the executable. + DESCRIPTOR: an open descriptor for the executable, closed here. + OFFSET: the offset within the file of this executable, for fat files. + MATCH_UUID: if not NULL, UUID that must match. + BASE_ADDRESS: the load address of the executable. + SKIP_SYMTAB: if non-zero, ignore the symbol table; used for dSYM files. + FILELINE_FN: set to the fileline function, by backtrace_dwarf_add. + FOUND_SYM: set to non-zero if we found the symbol table. +*/ + +static int +macho_add (struct backtrace_state *state, const char *filename, int descriptor, + off_t offset, const unsigned char *match_uuid, + uintptr_t base_address, int skip_symtab, + backtrace_error_callback error_callback, void *data, + fileline *fileline_fn, int *found_sym) { - int ret = 0; - char dwarf_image_dir_path[PATH_MAX + 1] = ""; - DIR *dwarf_image_dir; - int dwarf_image_dir_valid = 0; - struct dirent *directory_entry; - char dwarf_filename[PATH_MAX + 1] = ""; - int dwarf_matched; - int dwarf_had_sym; - int dwarf_had_dwarf; - - *matched = 0; + struct backtrace_view header_view; + struct macho_header_32 header; + off_t hdroffset; + int is_64; + struct backtrace_view cmds_view; + int cmds_view_valid; + struct dwarf_sections dwarf_sections; + int have_dwarf; + unsigned char uuid[MACH_O_UUID_LEN]; + int have_uuid; + size_t cmdoffset; + unsigned int i; + *found_sym = 0; - *found_dwarf = 0; - strncpy (dwarf_image_dir_path, dsym_filename, PATH_MAX); - strncat (dwarf_image_dir_path, "/Contents/Resources/DWARF", PATH_MAX); + cmds_view_valid = 0; + + /* The 32-bit and 64-bit file headers start out the same, so we can + just always read the 32-bit version. A fat header is shorter but + it will always be followed by data, so it's OK to read extra. */ + + if (!backtrace_get_view (state, descriptor, offset, + sizeof (struct macho_header_32), + error_callback, data, &header_view)) + goto fail; + + memcpy (&header, header_view.data, sizeof header); - if (!(dwarf_image_dir = opendir (dwarf_image_dir_path))) + backtrace_release_view (state, &header_view, error_callback, data); + + switch (header.magic) { - error_callback (data, "could not open DWARF directory in dSYM", - 0); - goto end; + case MACH_O_MH_MAGIC_32: + is_64 = 0; + hdroffset = offset + sizeof (struct macho_header_32); + break; + case MACH_O_MH_MAGIC_64: + is_64 = 1; + hdroffset = offset + sizeof (struct macho_header_64); + break; + case MACH_O_MH_MAGIC_FAT: + { + struct macho_header_fat fat_header; + + hdroffset = offset + sizeof (struct macho_header_fat); + memcpy (&fat_header, &header, sizeof fat_header); + return macho_add_fat (state, filename, descriptor, 0, hdroffset, + match_uuid, base_address, skip_symtab, + fat_header.nfat_arch, error_callback, data, + fileline_fn, found_sym); + } + case MACH_O_MH_CIGAM_FAT: + { + struct macho_header_fat fat_header; + uint32_t nfat_arch; + + hdroffset = offset + sizeof (struct macho_header_fat); + memcpy (&fat_header, &header, sizeof fat_header); + nfat_arch = __builtin_bswap32 (fat_header.nfat_arch); + return macho_add_fat (state, filename, descriptor, 1, hdroffset, + match_uuid, base_address, skip_symtab, + nfat_arch, error_callback, data, + fileline_fn, found_sym); + } + default: + error_callback (data, "executable file is not in Mach-O format", 0); + goto fail; } - dwarf_image_dir_valid = 1; - while ((directory_entry = readdir (dwarf_image_dir))) + switch (header.filetype) { - if (directory_entry->d_type != DT_REG) - continue; - -PRAGMA_GCC8(GCC diagnostic push) -PRAGMA_GCC8(GCC diagnostic ignored "-Wstringop-truncation") - // Silence the warning since the string is initialized to zero and has an extra NUL byte at the end. - strncpy (dwarf_filename, dwarf_image_dir_path, PATH_MAX); -PRAGMA_GCC8(GCC diagnostic pop) - strncat (dwarf_filename, "/", PATH_MAX); - strncat (dwarf_filename, directory_entry->d_name, PATH_MAX); - - if (!macho_try_dwarf (state, error_callback, data, fileline_fn, - executable_uuid, base_address, max_image_address, - vmslide, dwarf_filename, - &dwarf_matched, &dwarf_had_sym, &dwarf_had_dwarf)) - goto end; - - if (dwarf_matched) - { - *matched = 1; - *found_sym = dwarf_had_sym; - *found_dwarf = dwarf_had_dwarf; - ret = 1; - goto end; - } + case MACH_O_MH_EXECUTE: + case MACH_O_MH_DYLIB: + case MACH_O_MH_DSYM: + break; + default: + error_callback (data, "executable file is not an executable", 0); + goto fail; } - // No matching DWARF in this dSYM - ret = 1; - goto end; - -end: - if (dwarf_image_dir_valid) - closedir (dwarf_image_dir); - return ret; -} + if (!backtrace_get_view (state, descriptor, hdroffset, header.sizeofcmds, + error_callback, data, &cmds_view)) + goto fail; + cmds_view_valid = 1; -int -macho_add (struct backtrace_state *state, - backtrace_error_callback error_callback, void *data, int descriptor, - const char *filename, fileline *fileline_fn, intptr_t vmslide, - int *found_sym, int *found_dwarf) -{ - uuid_t image_uuid; - uintptr_t image_file_base_address; - uintptr_t image_file_max_address; - uintptr_t image_actual_base_address = 0; - uintptr_t image_actual_max_address = 0; - - int ret = 0; - struct macho_commands_view commands_view; - int commands_view_valid = 0; - char executable_dirname[PATH_MAX + 1] = ""; - size_t filename_len; - DIR *executable_dir = NULL; - int executable_dir_valid = 0; - struct dirent *directory_entry; - char dsym_full_path[PATH_MAX + 1] = ""; - static const char *extension; - size_t extension_len; - ssize_t i; + memset (&dwarf_sections, 0, sizeof dwarf_sections); + have_dwarf = 0; + memset (&uuid, 0, sizeof uuid); + have_uuid = 0; - *found_sym = 0; - *found_dwarf = 0; - - // Find Mach-O commands list - int incompatible; - if (!macho_get_commands (state, descriptor, error_callback, data, - &commands_view, &incompatible)) - goto end; - commands_view_valid = 1; - - // First we need to get the uuid of our file so we can hunt down the correct - // dSYM - if (!macho_get_uuid (state, descriptor, error_callback, data, &commands_view, - &image_uuid)) - goto end; - - // Now we need to find the in memory base address. Step one is to find out - // what the executable thinks the base address is - if (!macho_get_addr_range (state, descriptor, error_callback, data, - &commands_view, - &image_file_base_address, - &image_file_max_address)) - goto end; - - image_actual_base_address = - image_file_base_address + vmslide; - image_actual_max_address = - image_file_max_address + vmslide; - - if (image_actual_base_address == 0) + cmdoffset = 0; + for (i = 0; i < header.ncmds; ++i) { - error_callback (data, "executable file is not loaded", 0); - goto end; + const char *pcmd; + struct macho_load_command load_command; + + if (cmdoffset + sizeof load_command > header.sizeofcmds) + break; + + pcmd = (const char *) cmds_view.data + cmdoffset; + memcpy (&load_command, pcmd, sizeof load_command); + + switch (load_command.cmd) + { + case MACH_O_LC_SEGMENT: + { + struct macho_segment_command segcmd; + + memcpy (&segcmd, pcmd, sizeof segcmd); + if (memcmp (segcmd.segname, + "__DWARF\0\0\0\0\0\0\0\0\0", + MACH_O_NAMELEN) == 0) + { + if (!macho_add_dwarf_segment (state, descriptor, offset, + load_command.cmd, + pcmd + sizeof segcmd, + (load_command.cmdsize + - sizeof segcmd), + segcmd.nsects, error_callback, + data, &dwarf_sections)) + goto fail; + have_dwarf = 1; + } + } + break; + + case MACH_O_LC_SEGMENT_64: + { + struct macho_segment_64_command segcmd; + + memcpy (&segcmd, pcmd, sizeof segcmd); + if (memcmp (segcmd.segname, + "__DWARF\0\0\0\0\0\0\0\0\0", + MACH_O_NAMELEN) == 0) + { + if (!macho_add_dwarf_segment (state, descriptor, offset, + load_command.cmd, + pcmd + sizeof segcmd, + (load_command.cmdsize + - sizeof segcmd), + segcmd.nsects, error_callback, + data, &dwarf_sections)) + goto fail; + have_dwarf = 1; + } + } + break; + + case MACH_O_LC_SYMTAB: + if (!skip_symtab) + { + struct macho_symtab_command symcmd; + + memcpy (&symcmd, pcmd, sizeof symcmd); + if (!macho_add_symtab (state, descriptor, base_address, is_64, + offset + symcmd.symoff, symcmd.nsyms, + offset + symcmd.stroff, symcmd.strsize, + error_callback, data)) + goto fail; + + *found_sym = 1; + } + break; + + case MACH_O_LC_UUID: + { + struct macho_uuid_command uuidcmd; + + memcpy (&uuidcmd, pcmd, sizeof uuidcmd); + memcpy (&uuid[0], &uuidcmd.uuid[0], MACH_O_UUID_LEN); + have_uuid = 1; + } + break; + + default: + break; + } + + cmdoffset += load_command.cmdsize; } - // Look for dSYM in our executable's directory - strncpy (executable_dirname, filename, PATH_MAX); - filename_len = strlen (executable_dirname); - for (i = filename_len - 1; i >= 0; i--) + if (!backtrace_close (descriptor, error_callback, data)) + goto fail; + descriptor = -1; + + backtrace_release_view (state, &cmds_view, error_callback, data); + cmds_view_valid = 0; + + if (match_uuid != NULL) { - if (executable_dirname[i] == '/') - { - executable_dirname[i] = '\0'; - break; - } - else if (i == 0) - { - executable_dirname[0] = '.'; - executable_dirname[1] = '\0'; - break; - } + /* If we don't have a UUID, or it doesn't match, just ignore + this file. */ + if (!have_uuid + || memcmp (match_uuid, &uuid[0], MACH_O_UUID_LEN) != 0) + return 1; } - if (!(executable_dir = opendir (executable_dirname))) + if (have_dwarf) { - error_callback (data, "could not open directory containing executable", - 0); - goto end; + int is_big_endian; + + is_big_endian = 0; +#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + is_big_endian = 1; +#endif +#endif + + if (!backtrace_dwarf_add (state, base_address, &dwarf_sections, + is_big_endian, NULL, error_callback, data, + fileline_fn, NULL)) + goto fail; } - executable_dir_valid = 1; - extension = ".dSYM"; - extension_len = strlen (extension); - while ((directory_entry = readdir (executable_dir))) + if (!have_dwarf && have_uuid) { - if (directory_entry->d_namlen < extension_len) - continue; - if (strncasecmp (directory_entry->d_name + directory_entry->d_namlen - - extension_len, extension, extension_len) == 0) - { - int matched; - int dsym_had_sym; - int dsym_had_dwarf; - - // Found a dSYM -PRAGMA_GCC8(GCC diagnostic push) -PRAGMA_GCC8(GCC diagnostic ignored "-Wstringop-truncation") - // Silence the warning since the string is initialized to zero and has an extra NUL byte at the end. - strncpy (dsym_full_path, executable_dirname, PATH_MAX); -PRAGMA_GCC8(GCC diagnostic pop) - strncat (dsym_full_path, "/", PATH_MAX); - strncat (dsym_full_path, directory_entry->d_name, PATH_MAX); - - if (!macho_try_dsym (state, error_callback, data, - fileline_fn, &image_uuid, - image_actual_base_address, - image_actual_max_address, vmslide, - dsym_full_path, - &matched, &dsym_had_sym, &dsym_had_dwarf)) - goto end; - - if (matched) - { - *found_sym = dsym_had_sym; - *found_dwarf = dsym_had_dwarf; - ret = 1; - goto end; - } - } + if (!macho_add_dsym (state, filename, base_address, &uuid[0], + error_callback, data, fileline_fn)) + goto fail; } - // No matching dSYM - ret = 1; - goto end; - -end: - if (commands_view_valid) - backtrace_release_view (state, &commands_view.view, error_callback, - data); - if (executable_dir_valid) - closedir (executable_dir); - return ret; + return 1; + + fail: + if (cmds_view_valid) + backtrace_release_view (state, &cmds_view, error_callback, data); + if (descriptor != -1) + backtrace_close (descriptor, error_callback, data); + return 0; } -static int -macho_symbol_search (const void *vkey, const void *ventry) -{ - const uintptr_t *key = (const uintptr_t *) vkey; - const struct macho_symbol *entry = (const struct macho_symbol *) ventry; - uintptr_t addr; +#ifdef HAVE_MACH_O_DYLD_H - addr = *key; - if (addr < entry->addr) - return -1; - else if (addr >= entry->addr + entry->size) - return 1; - else - return 0; -} +/* Initialize the backtrace data we need from a Mach-O executable + using the dyld support functions. This closes descriptor. */ -static void -macho_syminfo (struct backtrace_state *state, - uintptr_t addr, - backtrace_syminfo_callback callback, - backtrace_error_callback error_callback ATTRIBUTE_UNUSED, - void *data) +int +backtrace_initialize (struct backtrace_state *state, const char *filename, + int descriptor, backtrace_error_callback error_callback, + void *data, fileline *fileline_fn) { - struct macho_syminfo_data *edata; - struct macho_symbol *sym = NULL; + uint32_t c; + uint32_t i; + int closed_descriptor; + int found_sym; + fileline macho_fileline_fn; + + closed_descriptor = 0; + found_sym = 0; + macho_fileline_fn = macho_nodebug; + + c = _dyld_image_count (); + for (i = 0; i < c; ++i) + { + uintptr_t base_address; + const char *name; + int d; + fileline mff; + int mfs; + + name = _dyld_get_image_name (i); + if (name == NULL) + continue; + + if (strcmp (name, filename) == 0 && !closed_descriptor) + { + d = descriptor; + closed_descriptor = 1; + } + else + { + int does_not_exist; + + d = backtrace_open (name, error_callback, data, &does_not_exist); + if (d < 0) + continue; + } + + base_address = _dyld_get_image_vmaddr_slide (i); + + mff = macho_nodebug; + if (!macho_add (state, name, d, 0, NULL, base_address, 0, + error_callback, data, &mff, &mfs)) + return 0; + + if (mff != macho_nodebug) + macho_fileline_fn = mff; + if (mfs) + found_sym = 1; + } + + if (!closed_descriptor) + backtrace_close (descriptor, error_callback, data); if (!state->threaded) { - for (edata = (struct macho_syminfo_data *) state->syminfo_data; - edata != NULL; - edata = edata->next) - { - if (addr >= edata->min_addr && addr <= edata->max_addr) - { - sym = ((struct macho_symbol *) - bsearch (&addr, edata->symbols, edata->symbol_count, - sizeof (struct macho_symbol), macho_symbol_search)); - if (sym != NULL) - break; - } - } + if (found_sym) + state->syminfo_fn = macho_syminfo; + else if (state->syminfo_fn == NULL) + state->syminfo_fn = macho_nosyms; } else { - struct macho_syminfo_data **pp; - - pp = (struct macho_syminfo_data **) (void *) &state->syminfo_data; - while (1) - { - edata = backtrace_atomic_load_pointer (pp); - if (edata == NULL) - break; - - if (addr >= edata->min_addr && addr <= edata->max_addr) - { - sym = ((struct macho_symbol *) - bsearch (&addr, edata->symbols, edata->symbol_count, - sizeof (struct macho_symbol), macho_symbol_search)); - if (sym != NULL) - break; - } - - pp = &edata->next; - } + if (found_sym) + backtrace_atomic_store_pointer (&state->syminfo_fn, macho_syminfo); + else + (void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL, + macho_nosyms); } - if (sym == NULL) - callback (data, addr, NULL, 0, 0); + if (!state->threaded) + *fileline_fn = state->fileline_fn; else - callback (data, addr, sym->name, sym->addr, sym->size); -} + *fileline_fn = backtrace_atomic_load_pointer (&state->fileline_fn); + if (*fileline_fn == NULL || *fileline_fn == macho_nodebug) + *fileline_fn = macho_fileline_fn; -static int -macho_nodebug (struct backtrace_state *state ATTRIBUTE_UNUSED, - uintptr_t pc ATTRIBUTE_UNUSED, - backtrace_full_callback callback ATTRIBUTE_UNUSED, - backtrace_error_callback error_callback, void *data) -{ - error_callback (data, "no debug info in Mach-O executable", -1); - return 0; + return 1; } -static void -macho_nosyms (struct backtrace_state *state ATTRIBUTE_UNUSED, - uintptr_t addr ATTRIBUTE_UNUSED, - backtrace_syminfo_callback callback ATTRIBUTE_UNUSED, - backtrace_error_callback error_callback, void *data) -{ - error_callback (data, "no symbol table in Mach-O executable", -1); -} +#else /* !defined (HAVE_MACH_O_DYLD_H) */ + +/* Initialize the backtrace data we need from a Mach-O executable + without using the dyld support functions. This closes + descriptor. */ int -backtrace_initialize (struct backtrace_state *state, - const char *filename, - int descriptor, - backtrace_error_callback error_callback, - void *data, fileline *fileline_fn) +backtrace_initialize (struct backtrace_state *state, const char *filename, + int descriptor, backtrace_error_callback error_callback, + void *data, fileline *fileline_fn) { - fileline macho_fileline_fn = macho_nodebug; - int found_sym = 0; - int found_dwarf = 0; - uint32_t i = 0; - uint32_t loaded_image_count; - - // Add all loaded images - loaded_image_count = _dyld_image_count (); - for (i = 0; i < loaded_image_count; i++) - { - int current_found_sym; - int current_found_dwarf; - int current_descriptor; - intptr_t current_vmslide; - const char *current_name; - - current_vmslide = _dyld_get_image_vmaddr_slide (i); - current_name = _dyld_get_image_name (i); - - if (current_name == NULL || (i != 0 && current_vmslide == 0)) - continue; - - if (!(current_descriptor = - backtrace_open (current_name, error_callback, data, NULL))) - { - continue; - } - - if (macho_add (state, error_callback, data, current_descriptor, - current_name, &macho_fileline_fn, current_vmslide, - ¤t_found_sym, ¤t_found_dwarf)) - { - found_sym = found_sym || current_found_sym; - found_dwarf = found_dwarf || current_found_dwarf; - } - - backtrace_close (current_descriptor, error_callback, data); - } + fileline macho_fileline_fn; + int found_sym; + + macho_fileline_fn = macho_nodebug; + if (!macho_add (state, filename, descriptor, 0, NULL, 0, 0, + error_callback, data, &macho_fileline_fn, &found_sym)) + return 0; if (!state->threaded) { if (found_sym) - state->syminfo_fn = macho_syminfo; + state->syminfo_fn = macho_syminfo; else if (state->syminfo_fn == NULL) - state->syminfo_fn = macho_nosyms; + state->syminfo_fn = macho_nosyms; } else { if (found_sym) - backtrace_atomic_store_pointer (&state->syminfo_fn, macho_syminfo); + backtrace_atomic_store_pointer (&state->syminfo_fn, macho_syminfo); else - (void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL, - macho_nosyms); + (void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL, + macho_nosyms); } if (!state->threaded) - { - if (state->fileline_fn == NULL || state->fileline_fn == macho_nodebug) - *fileline_fn = macho_fileline_fn; - } + *fileline_fn = state->fileline_fn; else - { - fileline current_fn; + *fileline_fn = backtrace_atomic_load_pointer (&state->fileline_fn); - current_fn = backtrace_atomic_load_pointer (&state->fileline_fn); - if (current_fn == NULL || current_fn == macho_nodebug) - *fileline_fn = macho_fileline_fn; - } + if (*fileline_fn == NULL || *fileline_fn == macho_nodebug) + *fileline_fn = macho_fileline_fn; return 1; } +#endif /* !defined (HAVE_MACH_O_DYLD_H) */ diff --git a/3rdparty/libbacktrace/mmap.c b/3rdparty/libbacktrace/mmap.c index 32fcba62399..dd7d519cc56 100644 --- a/3rdparty/libbacktrace/mmap.c +++ b/3rdparty/libbacktrace/mmap.c @@ -1,5 +1,5 @@ /* mmap.c -- Memory allocation with mmap. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -321,5 +321,7 @@ backtrace_vector_release (struct backtrace_state *state, backtrace_free (state, (char *) vec->base + aligned, alc, error_callback, data); vec->alc = 0; + if (vec->size == 0) + vec->base = NULL; return 1; } diff --git a/3rdparty/libbacktrace/mmapio.c b/3rdparty/libbacktrace/mmapio.c index 165714f0a75..5dd39525ba1 100644 --- a/3rdparty/libbacktrace/mmapio.c +++ b/3rdparty/libbacktrace/mmapio.c @@ -1,5 +1,5 @@ /* mmapio.c -- File views using mmap. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ POSSIBILITY OF SUCH DAMAGE. */ int backtrace_get_view (struct backtrace_state *state ATTRIBUTE_UNUSED, - int descriptor, off_t offset, size_t size, + int descriptor, off_t offset, uint64_t size, backtrace_error_callback error_callback, void *data, struct backtrace_view *view) { @@ -60,8 +60,14 @@ backtrace_get_view (struct backtrace_state *state ATTRIBUTE_UNUSED, off_t pageoff; void *map; + if ((uint64_t) (size_t) size != size) + { + error_callback (data, "file size too large", 0); + return 0; + } + pagesize = getpagesize (); - inpage = (unsigned int)(offset % (unsigned int)pagesize); + inpage = offset % pagesize; pageoff = offset - inpage; size += inpage; diff --git a/3rdparty/libbacktrace/nounwind.c b/3rdparty/libbacktrace/nounwind.c index 0a046cc2943..68078a70bc2 100644 --- a/3rdparty/libbacktrace/nounwind.c +++ b/3rdparty/libbacktrace/nounwind.c @@ -1,5 +1,5 @@ /* backtrace.c -- Entry point for stack backtrace library. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without diff --git a/3rdparty/libbacktrace/pecoff.c b/3rdparty/libbacktrace/pecoff.c index 3fb1bf469be..b37b7f04b9b 100644 --- a/3rdparty/libbacktrace/pecoff.c +++ b/3rdparty/libbacktrace/pecoff.c @@ -1,5 +1,5 @@ /* pecoff.c -- Get debug data from a PE/COFFF file for backtraces. - Copyright (C) 2015-2018 Free Software Foundation, Inc. + Copyright (C) 2015-2020 Free Software Foundation, Inc. Adapted from elf.c by Tristan Gingold, AdaCore. Redistribution and use in source and binary forms, with or without @@ -133,19 +133,7 @@ typedef struct { uint16_t sc; } b_coff_internal_symbol; -/* An index of sections we care about. */ - -enum debug_section -{ - DEBUG_INFO, - DEBUG_LINE, - DEBUG_ABBREV, - DEBUG_RANGES, - DEBUG_STR, - DEBUG_MAX -}; - -/* Names of sections, indexed by enum debug_section. */ +/* Names of sections, indexed by enum dwarf_section in internal.h. */ static const char * const debug_section_names[DEBUG_MAX] = { @@ -153,7 +141,11 @@ static const char * const debug_section_names[DEBUG_MAX] = ".debug_line", ".debug_abbrev", ".debug_ranges", - ".debug_str" + ".debug_str", + ".debug_addr", + ".debug_str_offsets", + ".debug_line_str", + ".debug_rnglists" }; /* Information we gather for the sections we care about. */ @@ -164,8 +156,6 @@ struct debug_section_info off_t offset; /* Section size. */ size_t size; - /* Section contents, after read from file. */ - const unsigned char *data; }; /* Information we keep for an coff symbol. */ @@ -618,6 +608,7 @@ coff_add (struct backtrace_state *state, int descriptor, struct backtrace_view debug_view; int debug_view_valid; uintptr_t image_base; + struct dwarf_sections dwarf_sections; *found_sym = 0; *found_dwarf = 0; @@ -750,24 +741,24 @@ coff_add (struct backtrace_state *state, int descriptor, for (i = 0; i < sects_num; ++i) { const b_coff_section_header *s = sects + i; - unsigned int str_off1; + unsigned int str_off; int j; if (s->name[0] == '/') { /* Extended section name. */ - str_off1 = atoi (s->name + 1); + str_off = atoi (s->name + 1); } else - str_off1 = 0; + str_off = 0; for (j = 0; j < (int) DEBUG_MAX; ++j) { const char *dbg_name = debug_section_names[j]; int match; - if (str_off1 != 0) - match = coff_long_name_eq (dbg_name, str_off1, &str_view); + if (str_off != 0) + match = coff_long_name_eq (dbg_name, str_off, &str_view); else match = coff_short_name_eq (dbg_name, s->name); if (match) @@ -850,26 +841,20 @@ coff_add (struct backtrace_state *state, int descriptor, for (i = 0; i < (int) DEBUG_MAX; ++i) { - if (sections[i].size == 0) - sections[i].data = NULL; + size_t size = sections[i].size; + dwarf_sections.size[i] = size; + if (size == 0) + dwarf_sections.data[i] = NULL; else - sections[i].data = ((const unsigned char *) debug_view.data - + (sections[i].offset - min_offset)); + dwarf_sections.data[i] = ((const unsigned char *) debug_view.data + + (sections[i].offset - min_offset)); } - if (!backtrace_dwarf_add (state, /* base_address */ 0, - sections[DEBUG_INFO].data, - sections[DEBUG_INFO].size, - sections[DEBUG_LINE].data, - sections[DEBUG_LINE].size, - sections[DEBUG_ABBREV].data, - sections[DEBUG_ABBREV].size, - sections[DEBUG_RANGES].data, - sections[DEBUG_RANGES].size, - sections[DEBUG_STR].data, - sections[DEBUG_STR].size, - 0, /* FIXME */ - error_callback, data, fileline_fn)) + if (!backtrace_dwarf_add (state, /* base_address */ 0, &dwarf_sections, + 0, /* FIXME: is_bigendian */ + NULL, /* altlink */ + error_callback, data, fileline_fn, + NULL /* returned fileline_entry */)) goto fail; *found_dwarf = 1; @@ -922,7 +907,8 @@ backtrace_initialize (struct backtrace_state *state, if (found_sym) backtrace_atomic_store_pointer (&state->syminfo_fn, coff_syminfo); else - __sync_bool_compare_and_swap (&state->syminfo_fn, NULL, coff_nosyms); + (void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL, + coff_nosyms); } if (!state->threaded) diff --git a/3rdparty/libbacktrace/posix.c b/3rdparty/libbacktrace/posix.c index ce441d98ffb..356e72b4a3b 100644 --- a/3rdparty/libbacktrace/posix.c +++ b/3rdparty/libbacktrace/posix.c @@ -1,5 +1,5 @@ /* posix.c -- POSIX file I/O routines for the backtrace library. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without diff --git a/3rdparty/libbacktrace/print.c b/3rdparty/libbacktrace/print.c index 3c6bad28352..6d75050eb29 100644 --- a/3rdparty/libbacktrace/print.c +++ b/3rdparty/libbacktrace/print.c @@ -1,5 +1,5 @@ /* print.c -- Print the current backtrace. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -80,7 +80,7 @@ error_callback (void *data, const char *msg, int errnum) /* Print a backtrace. */ -void +void __attribute__((noinline)) backtrace_print (struct backtrace_state *state, int skip, FILE *f) { struct print_data data; diff --git a/3rdparty/libbacktrace/read.c b/3rdparty/libbacktrace/read.c index 211d6457cff..1a6052bf613 100644 --- a/3rdparty/libbacktrace/read.c +++ b/3rdparty/libbacktrace/read.c @@ -1,5 +1,5 @@ /* read.c -- File views without mmap. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -46,11 +46,18 @@ POSSIBILITY OF SUCH DAMAGE. */ int backtrace_get_view (struct backtrace_state *state, int descriptor, - off_t offset, size_t size, + off_t offset, uint64_t size, backtrace_error_callback error_callback, void *data, struct backtrace_view *view) { - ssize_t got; + uint64_t got; + ssize_t r; + + if ((uint64_t) (size_t) size != size) + { + error_callback (data, "file size too large", 0); + return 0; + } if (lseek (descriptor, offset, SEEK_SET) < 0) { @@ -64,15 +71,22 @@ backtrace_get_view (struct backtrace_state *state, int descriptor, view->data = view->base; view->len = size; - got = read (descriptor, view->base, size); - if (got < 0) + got = 0; + while (got < size) { - error_callback (data, "read", errno); - free (view->base); - return 0; + r = read (descriptor, view->base, size - got); + if (r < 0) + { + error_callback (data, "read", errno); + free (view->base); + return 0; + } + if (r == 0) + break; + got += (uint64_t) r; } - if ((size_t) got < size) + if (got < size) { error_callback (data, "file too short", 0); free (view->base); diff --git a/3rdparty/libbacktrace/simple.c b/3rdparty/libbacktrace/simple.c index 510877c235e..b9b971af95e 100644 --- a/3rdparty/libbacktrace/simple.c +++ b/3rdparty/libbacktrace/simple.c @@ -1,5 +1,5 @@ /* simple.c -- The backtrace_simple function. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -90,7 +90,7 @@ simple_unwind (struct _Unwind_Context *context, void *vdata) /* Get a simple stack backtrace. */ -int +int __attribute__((noinline)) backtrace_simple (struct backtrace_state *state, int skip, backtrace_simple_callback callback, backtrace_error_callback error_callback, void *data) diff --git a/3rdparty/libbacktrace/sort.c b/3rdparty/libbacktrace/sort.c index 9121bcb8d99..1f064763615 100644 --- a/3rdparty/libbacktrace/sort.c +++ b/3rdparty/libbacktrace/sort.c @@ -1,5 +1,5 @@ /* sort.c -- Sort without allocating memory - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without diff --git a/3rdparty/libbacktrace/state.c b/3rdparty/libbacktrace/state.c index ad360a6b16e..bed780cef1e 100644 --- a/3rdparty/libbacktrace/state.c +++ b/3rdparty/libbacktrace/state.c @@ -1,5 +1,5 @@ /* state.c -- Create the backtrace state. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without diff --git a/3rdparty/libbacktrace/stest.c b/3rdparty/libbacktrace/stest.c index 2eb98808d46..6c544af1644 100644 --- a/3rdparty/libbacktrace/stest.c +++ b/3rdparty/libbacktrace/stest.c @@ -1,5 +1,5 @@ /* stest.c -- Test for libbacktrace internal sort function - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without diff --git a/3rdparty/libbacktrace/testlib.c b/3rdparty/libbacktrace/testlib.c index 6dbef7c38f3..9560d37d9e5 100644 --- a/3rdparty/libbacktrace/testlib.c +++ b/3rdparty/libbacktrace/testlib.c @@ -1,5 +1,5 @@ /* testlib.c -- test functions for libbacktrace library - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without diff --git a/3rdparty/libbacktrace/testlib.h b/3rdparty/libbacktrace/testlib.h index 5094656f175..a844f1bbeee 100644 --- a/3rdparty/libbacktrace/testlib.h +++ b/3rdparty/libbacktrace/testlib.h @@ -1,5 +1,5 @@ /* testlib.h -- Header for test functions for libbacktrace library - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without diff --git a/3rdparty/libbacktrace/ttest.c b/3rdparty/libbacktrace/ttest.c index ca55e9b3722..693d59f7057 100644 --- a/3rdparty/libbacktrace/ttest.c +++ b/3rdparty/libbacktrace/ttest.c @@ -1,5 +1,5 @@ /* ttest.c -- Test for libbacktrace library - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without diff --git a/3rdparty/libbacktrace/unknown.c b/3rdparty/libbacktrace/unknown.c index be521a85c50..3d27cd5e27f 100644 --- a/3rdparty/libbacktrace/unknown.c +++ b/3rdparty/libbacktrace/unknown.c @@ -1,5 +1,5 @@ /* unknown.c -- used when backtrace configury does not know file format. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without diff --git a/3rdparty/libbacktrace/xcoff.c b/3rdparty/libbacktrace/xcoff.c index 1ae001dd1de..507edded709 100644 --- a/3rdparty/libbacktrace/xcoff.c +++ b/3rdparty/libbacktrace/xcoff.c @@ -1,5 +1,5 @@ /* xcoff.c -- Get debug data from an XCOFF file for backtraces. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2020 Free Software Foundation, Inc. Adapted from elf.c. Redistribution and use in source and binary forms, with or without @@ -338,27 +338,32 @@ struct xcoff_incl_vector size_t count; }; -/* Map a single PC value to a file/function/line. */ +/* A growable vector of functions information. */ -struct xcoff_line +struct xcoff_func { /* PC. */ uintptr_t pc; - /* File name. Many entries in the array are expected to point to - the same file name. */ - const char *filename; + /* The size of the function. */ + size_t size; /* Function name. */ - const char *function; - /* Line number. */ - int lineno; + const char *name; + /* File name. */ + const char *filename; + /* Pointer to first lnno entry. */ + uintptr_t lnnoptr; + /* Base address of containing section. */ + uintptr_t sect_base; + /* Starting source line number. */ + int lnno; }; -/* A growable vector of line number information. This is used while - reading the line numbers. */ +/* A growable vector of function information. This is used while + reading the function symbols. */ -struct xcoff_line_vector +struct xcoff_func_vector { - /* Memory. This is an array of struct xcoff_line. */ + /* Memory. This is an array of struct xcoff_func. */ struct backtrace_vector vec; /* Number of valid mappings. */ size_t count; @@ -370,20 +375,16 @@ struct xcoff_fileline_data { /* The data for the next file we know about. */ struct xcoff_fileline_data *next; - /* Line number information. */ - struct xcoff_line_vector vec; -}; - -/* An index of DWARF sections we care about. */ - -enum dwarf_section -{ - DWSECT_INFO, - DWSECT_LINE, - DWSECT_ABBREV, - DWSECT_RANGES, - DWSECT_STR, - DWSECT_MAX + /* Functions information. */ + struct xcoff_func_vector func_vec; + /* Include files information. */ + struct xcoff_incl_vector incl_vec; + /* Line numbers information. */ + const unsigned char *linenos; + size_t linenos_size; + uint64_t lnnoptr0; + /* Loader address. */ + uintptr_t base_address; }; /* Information we gather for the DWARF sections we care about. */ @@ -509,6 +510,7 @@ xcoff_syminfo (struct backtrace_state *state ATTRIBUTE_UNUSED, uintptr_t addr, { struct xcoff_syminfo_data *edata; struct xcoff_symbol *sym = NULL; + const char *name; if (!state->threaded) { @@ -547,7 +549,13 @@ xcoff_syminfo (struct backtrace_state *state ATTRIBUTE_UNUSED, uintptr_t addr, if (sym == NULL) callback (data, addr, NULL, 0, 0); else - callback (data, addr, sym->name, sym->address, sym->size); + { + name = sym->name; + /* AIX prepends a '.' to function entry points, remove it. */ + if (name && *name == '.') + ++name; + callback (data, addr, name, sym->address, sym->size); + } } /* Return the name of an XCOFF symbol. */ @@ -640,43 +648,76 @@ xcoff_initialize_syminfo (struct backtrace_state *state, return 1; } -/* Compare struct xcoff_line for qsort. */ +/* Compare struct xcoff_func for qsort. */ static int -xcoff_line_compare (const void *v1, const void *v2) +xcoff_func_compare (const void *v1, const void *v2) { - const struct xcoff_line *ln1 = (const struct xcoff_line *) v1; - const struct xcoff_line *ln2 = (const struct xcoff_line *) v2; + const struct xcoff_func *fn1 = (const struct xcoff_func *) v1; + const struct xcoff_func *fn2 = (const struct xcoff_func *) v2; - if (ln1->pc < ln2->pc) + if (fn1->pc < fn2->pc) return -1; - else if (ln1->pc > ln2->pc) + else if (fn1->pc > fn2->pc) return 1; else return 0; } -/* Find a PC in a line vector. We always allocate an extra entry at - the end of the lines vector, so that this routine can safely look - at the next entry. */ +/* Compare a PC against an xcoff_func for bsearch. */ static int -xcoff_line_search (const void *vkey, const void *ventry) +xcoff_func_search (const void *vkey, const void *ventry) { const uintptr_t *key = (const uintptr_t *) vkey; - const struct xcoff_line *entry = (const struct xcoff_line *) ventry; + const struct xcoff_func *entry = (const struct xcoff_func *) ventry; uintptr_t pc; pc = *key; if (pc < entry->pc) return -1; - else if ((entry + 1)->pc == (uintptr_t) -1 || pc >= (entry + 1)->pc) + else if ((entry->size == 0 && pc > entry->pc) + || (entry->size > 0 && pc >= entry->pc + entry->size)) + return 1; + else + return 0; +} + +/* Compare struct xcoff_incl for qsort. */ + +static int +xcoff_incl_compare (const void *v1, const void *v2) +{ + const struct xcoff_incl *in1 = (const struct xcoff_incl *) v1; + const struct xcoff_incl *in2 = (const struct xcoff_incl *) v2; + + if (in1->begin < in2->begin) + return -1; + else if (in1->begin > in2->begin) + return 1; + else + return 0; +} + +/* Find a lnnoptr in an include file. */ + +static int +xcoff_incl_search (const void *vkey, const void *ventry) +{ + const uintptr_t *key = (const uintptr_t *) vkey; + const struct xcoff_incl *entry = (const struct xcoff_incl *) ventry; + uintptr_t lnno; + + lnno = *key; + if (lnno < entry->begin) + return -1; + else if (lnno > entry->end) return 1; else return 0; } -/* Look for a PC in the line vector for one module. On success, +/* Look for a PC in the function vector for one module. On success, call CALLBACK and return whatever it returns. On error, call ERROR_CALLBACK and return 0. Sets *FOUND to 1 if the PC is found, 0 if not. */ @@ -688,26 +729,82 @@ xcoff_lookup_pc (struct backtrace_state *state ATTRIBUTE_UNUSED, backtrace_error_callback error_callback ATTRIBUTE_UNUSED, void *data, int *found) { - const struct xcoff_line *ln; + const struct xcoff_incl *incl, *bincl; + const struct xcoff_func *fn; + const b_xcoff_lineno *lineno; + const unsigned char *lineptr; const char *function; + const char *filename; + uintptr_t lnnoptr, match; + uint32_t lnno = 0; *found = 1; - ln = (struct xcoff_line *) bsearch (&pc, fdata->vec.vec.base, - fdata->vec.count, - sizeof (struct xcoff_line), - xcoff_line_search); - if (ln == NULL) + if ((pc & 3) != 0) + ++pc; + + /* Find the function first. */ + fn = ((struct xcoff_func *) + bsearch (&pc, fdata->func_vec.vec.base, fdata->func_vec.count, + sizeof (struct xcoff_func), xcoff_func_search)); + if (fn == NULL) { *found = 0; return 0; } - function = ln->function; + filename = fn->filename; + + /* Find the line number next. */ + + /* Skip first entry that points to symtab. */ + lnnoptr = fn->lnnoptr + LINESZ; + match = lnnoptr; + + lineptr = fdata->linenos + (lnnoptr - fdata->lnnoptr0); + while (lineptr + LINESZ <= fdata->linenos + fdata->linenos_size) + { + lineno = (const b_xcoff_lineno *) lineptr; + if (lineno->l_lnno == 0) + break; + if (pc <= fdata->base_address + lineno->l_addr.l_paddr - fn->sect_base) + break; + match = lnnoptr; + lnno = lineno->l_lnno; + + lnnoptr += LINESZ; + lineptr += LINESZ; + } + + /* If part of a function other than the beginning comes from an + include file, the line numbers are absolute, rather than + relative to the beginning of the function. */ + incl = ((struct xcoff_incl *) + bsearch (&match, fdata->incl_vec.vec.base, + fdata->incl_vec.count, sizeof (struct xcoff_incl), + xcoff_incl_search)); + if (incl != NULL) + { + bincl = ((struct xcoff_incl *) + bsearch (&fn->lnnoptr, fdata->incl_vec.vec.base, + fdata->incl_vec.count, sizeof (struct xcoff_incl), + xcoff_incl_search)); + if (bincl != NULL && strcmp (incl->filename, bincl->filename) == 0) + { + lnno += fn->lnno - 1; + } + filename = incl->filename; + } + else + { + lnno += fn->lnno - 1; + } + + function = fn->name; /* AIX prepends a '.' to function entry points, remove it. */ - if (*function == '.') + if (function != NULL && *function == '.') ++function; - return callback (data, pc, ln->filename, ln->lineno, function); + return callback (data, pc, filename, lnno, function); } /* Return the file/line information for a PC using the XCOFF lineno @@ -760,146 +857,7 @@ xcoff_fileline (struct backtrace_state *state, uintptr_t pc, return callback (data, pc, NULL, 0, NULL); } -/* Compare struct xcoff_incl for qsort. */ - -static int -xcoff_incl_compare (const void *v1, const void *v2) -{ - const struct xcoff_incl *in1 = (const struct xcoff_incl *) v1; - const struct xcoff_incl *in2 = (const struct xcoff_incl *) v2; - - if (in1->begin < in2->begin) - return -1; - else if (in1->begin > in2->begin) - return 1; - else - return 0; -} - -/* Find a lnnoptr in an include file. */ - -static int -xcoff_incl_search (const void *vkey, const void *ventry) -{ - const uintptr_t *key = (const uintptr_t *) vkey; - const struct xcoff_incl *entry = (const struct xcoff_incl *) ventry; - uintptr_t lnno; - - lnno = *key; - if (lnno < entry->begin) - return -1; - else if (lnno > entry->end) - return 1; - else - return 0; -} - -/* Add a new mapping to the vector of line mappings that we are - building. Returns 1 on success, 0 on failure. */ - -static int -xcoff_add_line (struct backtrace_state *state, uintptr_t pc, - const char *filename, const char *function, uint32_t lnno, - backtrace_error_callback error_callback, void *data, - struct xcoff_line_vector *vec) -{ - struct xcoff_line *ln; - - ln = ((struct xcoff_line *) - backtrace_vector_grow (state, sizeof (struct xcoff_line), - error_callback, data, &vec->vec)); - if (ln == NULL) - return 0; - - ln->pc = pc; - ln->filename = filename; - ln->function = function; - ln->lineno = lnno; - - ++vec->count; - - return 1; -} - -/* Add the line number entries for a function to the line vector. */ - -static int -xcoff_process_linenos (struct backtrace_state *state, uintptr_t base_address, - const b_xcoff_syment *fsym, const char *filename, - const b_xcoff_scnhdr *sects, - const unsigned char *strtab, size_t strtab_size, - uint32_t fcn_lnno, struct xcoff_incl_vector *vec, - struct xcoff_line_vector *lvec, - const unsigned char *linenos, size_t linenos_size, - uintptr_t lnnoptr0, - backtrace_error_callback error_callback, void *data) -{ - const b_xcoff_auxent *aux; - const b_xcoff_lineno *lineno; - const unsigned char *lineptr; - const char *function; - struct xcoff_incl *incl = NULL; - uintptr_t lnnoptr; - uintptr_t pc; - uint32_t lnno; - int begincl; - - aux = (const b_xcoff_auxent *) (fsym + 1); - lnnoptr = aux->x_fcn.x_lnnoptr; - - if (lnnoptr < lnnoptr0 || lnnoptr + LINESZ > lnnoptr0 + linenos_size) - return 0; - - function = xcoff_symname (fsym, strtab, strtab_size); - if (function == NULL) - return 0; - - /* Skip first entry that points to symtab. */ - - lnnoptr += LINESZ; - - lineptr = linenos + (lnnoptr - lnnoptr0); - - begincl = -1; - while (lineptr + LINESZ <= linenos + linenos_size) - { - lineno = (const b_xcoff_lineno *) lineptr; - - lnno = lineno->l_lnno; - if (lnno == 0) - break; - - /* If part of a function other than the beginning comes from an - include file, the line numbers are absolute, rather than - relative to the beginning of the function. */ - incl = (struct xcoff_incl *) bsearch (&lnnoptr, vec->vec.base, - vec->count, - sizeof (struct xcoff_incl), - xcoff_incl_search); - if (begincl == -1) - begincl = incl != NULL; - if (incl != NULL) - { - filename = incl->filename; - if (begincl == 1) - lnno += fcn_lnno - 1; - } - else - lnno += fcn_lnno - 1; - - pc = base_address + lineno->l_addr.l_paddr - - sects[fsym->n_scnum - 1].s_paddr; - xcoff_add_line (state, pc, filename, function, lnno, error_callback, - data, lvec); - - lnnoptr += LINESZ; - lineptr += LINESZ; - } - - return 1; -} - -/* Initialize the line vector info for xcoff_fileline. */ +/* Initialize the function vector info for xcoff_fileline. */ static int xcoff_initialize_fileline (struct backtrace_state *state, @@ -912,15 +870,15 @@ xcoff_initialize_fileline (struct backtrace_state *state, backtrace_error_callback error_callback, void *data) { struct xcoff_fileline_data *fdata; - struct xcoff_incl_vector vec; - struct xcoff_line *ln; + struct xcoff_func *fn; const b_xcoff_syment *fsym; const b_xcoff_auxent *aux; const char *filename; const char *name; struct xcoff_incl *incl; uintptr_t begin, end; - uintptr_t lnno; + uintptr_t lnno, lnnoptr; + uint32_t fsize; size_t i; fdata = ((struct xcoff_fileline_data *) @@ -928,13 +886,17 @@ xcoff_initialize_fileline (struct backtrace_state *state, error_callback, data)); if (fdata == NULL) return 0; - memset (fdata, 0, sizeof *fdata); - memset (&vec, 0, sizeof vec); - - /* Process include files first. */ + fdata->base_address = base_address; + fdata->linenos = linenos; + fdata->linenos_size = linenos_size; + fdata->lnnoptr0 = lnnoptr0; begin = 0; + filename = NULL; + fsym = NULL; + lnnoptr = 0; + fsize = 0; for (i = 0; i < nsyms; ++i) { const b_xcoff_syment *asym = &syms[i]; @@ -951,32 +913,18 @@ xcoff_initialize_fileline (struct backtrace_state *state, end = asym->n_value; incl = ((struct xcoff_incl *) backtrace_vector_grow (state, sizeof (struct xcoff_incl), - error_callback, data, &vec.vec)); + error_callback, data, + &fdata->incl_vec.vec)); if (incl != NULL) { incl->filename = xcoff_symname (asym, strtab, strtab_size); incl->begin = begin; incl->end = end; - ++vec.count; + ++fdata->incl_vec.count; } begin = 0; break; - } - - i += asym->n_numaux; - } - - backtrace_qsort (vec.vec.base, vec.count, - sizeof (struct xcoff_incl), xcoff_incl_compare); - - filename = NULL; - fsym = NULL; - for (i = 0; i < nsyms; ++i) - { - const b_xcoff_syment *asym = &syms[i]; - switch (asym->n_sclass) - { case C_FILE: filename = xcoff_symname (asym, strtab, strtab_size); if (filename == NULL) @@ -988,7 +936,7 @@ xcoff_initialize_fileline (struct backtrace_state *state, file auxiliary entry (by convention) contains the source file name. */ - if (asym->n_numaux > 0 && !strcmp (filename, ".file")) + if (asym->n_numaux > 0 && strcmp (filename, ".file") == 0) { aux = (const b_xcoff_auxent *) (asym + 1); if (aux->x_file._x.x_zeroes != 0) @@ -1010,10 +958,20 @@ xcoff_initialize_fileline (struct backtrace_state *state, case C_HIDEXT: case C_WEAKEXT: fsym = NULL; - if (!ISFCN (asym->n_type) || asym->n_numaux == 0) + lnnoptr = 0; + fsize = 0; + if (!ISFCN (asym->n_type) || asym->n_numaux == 0 + || asym->n_scnum <= 0) break; if (filename == NULL) break; + aux = (const b_xcoff_auxent *) (asym + 1); + lnnoptr = aux->x_fcn.x_lnnoptr; + if (lnnoptr < lnnoptr0 + || lnnoptr + LINESZ > lnnoptr0 + linenos_size) + break; + /* x_fsize will be 0 if there is no debug information. */ + fsize = aux->x_fcn.x_fsize; fsym = asym; break; @@ -1023,8 +981,11 @@ xcoff_initialize_fileline (struct backtrace_state *state, if (fsym == NULL) break; name = xcoff_symname (asym, strtab, strtab_size); - if (name == NULL) - break; + if (name == NULL || strcmp (name, ".bf") != 0) + { + fsym = NULL; + break; + } aux = (const b_xcoff_auxent *) (asym + 1); #if BACKTRACE_XCOFF_SIZE == 32 lnno = (uint32_t) aux->x_block.x_lnnohi << 16 @@ -1032,39 +993,37 @@ xcoff_initialize_fileline (struct backtrace_state *state, #else lnno = aux->x_block.x_lnno; #endif - if (!strcmp (name, ".bf")) - { - xcoff_process_linenos (state, base_address, fsym, filename, - sects, strtab, strtab_size, lnno, &vec, - &fdata->vec, linenos, linenos_size, - lnnoptr0, error_callback, data); - } - else if (!strcmp (name, ".ef")) - { - fsym = NULL; - } + fn = ((struct xcoff_func *) + backtrace_vector_grow (state, sizeof (struct xcoff_func), + error_callback, data, + &fdata->func_vec.vec)); + if (fn == NULL) + break; + fn->name = xcoff_symname (fsym, strtab, strtab_size); + fn->filename = filename; + fn->sect_base = sects[fsym->n_scnum - 1].s_paddr; + fn->pc = base_address + fsym->n_value - fn->sect_base; + fn->size = fsize; + fn->lnno = lnno; + fn->lnnoptr = lnnoptr; + ++fdata->func_vec.count; break; } i += asym->n_numaux; } - /* Allocate one extra entry at the end. */ - ln = ((struct xcoff_line *) - backtrace_vector_grow (state, sizeof (struct xcoff_line), - error_callback, data, &fdata->vec.vec)); - if (ln == NULL) + if (!backtrace_vector_release (state, &fdata->func_vec.vec, error_callback, + data)) goto fail; - ln->pc = (uintptr_t) -1; - ln->filename = NULL; - ln->function = NULL; - ln->lineno = 0; + backtrace_qsort (fdata->func_vec.vec.base, fdata->func_vec.count, + sizeof (struct xcoff_func), xcoff_func_compare); - if (!backtrace_vector_release (state, &fdata->vec.vec, error_callback, data)) + if (!backtrace_vector_release (state, &fdata->incl_vec.vec, error_callback, + data)) goto fail; - - backtrace_qsort (fdata->vec.vec.base, fdata->vec.count, - sizeof (struct xcoff_line), xcoff_line_compare); + backtrace_qsort (fdata->incl_vec.vec.base, fdata->incl_vec.count, + sizeof (struct xcoff_incl), xcoff_incl_compare); if (!state->threaded) { @@ -1129,7 +1088,7 @@ xcoff_add (struct backtrace_state *state, int descriptor, off_t offset, off_t str_off; off_t min_offset; off_t max_offset; - struct dwsect_info dwsect[DWSECT_MAX]; + struct dwsect_info dwsect[DEBUG_MAX]; size_t sects_size; size_t syms_size; int32_t str_size; @@ -1140,6 +1099,7 @@ xcoff_add (struct backtrace_state *state, int descriptor, off_t offset, int dwarf_view_valid; int magic_ok; int i; + struct dwarf_sections dwarf_sections; *found_sym = 0; @@ -1284,19 +1244,19 @@ xcoff_add (struct backtrace_state *state, int descriptor, off_t offset, switch (sects[i].s_flags & 0xffff0000) { case SSUBTYP_DWINFO: - idx = DWSECT_INFO; + idx = DEBUG_INFO; break; case SSUBTYP_DWLINE: - idx = DWSECT_LINE; + idx = DEBUG_LINE; break; case SSUBTYP_DWABREV: - idx = DWSECT_ABBREV; + idx = DEBUG_ABBREV; break; case SSUBTYP_DWARNGE: - idx = DWSECT_RANGES; + idx = DEBUG_RANGES; break; case SSUBTYP_DWSTR: - idx = DWSECT_STR; + idx = DEBUG_STR; break; default: continue; @@ -1317,7 +1277,7 @@ xcoff_add (struct backtrace_state *state, int descriptor, off_t offset, goto fail; dwarf_view_valid = 1; - for (i = 0; i < (int) DWSECT_MAX; ++i) + for (i = 0; i < (int) DEBUG_MAX; ++i) { if (dwsect[i].offset == 0) dwsect[i].data = NULL; @@ -1326,25 +1286,30 @@ xcoff_add (struct backtrace_state *state, int descriptor, off_t offset, + (dwsect[i].offset - min_offset)); } - if (!backtrace_dwarf_add (state, 0, - dwsect[DWSECT_INFO].data, - dwsect[DWSECT_INFO].size, + memset (&dwarf_sections, 0, sizeof dwarf_sections); + + dwarf_sections.data[DEBUG_INFO] = dwsect[DEBUG_INFO].data; + dwarf_sections.size[DEBUG_INFO] = dwsect[DEBUG_INFO].size; #if BACKTRACE_XCOFF_SIZE == 32 - /* XXX workaround for broken lineoff */ - dwsect[DWSECT_LINE].data - 4, + /* XXX workaround for broken lineoff */ + dwarf_sections.data[DEBUG_LINE] = dwsect[DEBUG_LINE].data - 4; #else - /* XXX workaround for broken lineoff */ - dwsect[DWSECT_LINE].data - 12, + /* XXX workaround for broken lineoff */ + dwarf_sections.data[DEBUG_LINE] = dwsect[DEBUG_LINE].data - 12; #endif - dwsect[DWSECT_LINE].size, - dwsect[DWSECT_ABBREV].data, - dwsect[DWSECT_ABBREV].size, - dwsect[DWSECT_RANGES].data, - dwsect[DWSECT_RANGES].size, - dwsect[DWSECT_STR].data, - dwsect[DWSECT_STR].size, + dwarf_sections.size[DEBUG_LINE] = dwsect[DEBUG_LINE].size; + dwarf_sections.data[DEBUG_ABBREV] = dwsect[DEBUG_ABBREV].data; + dwarf_sections.size[DEBUG_ABBREV] = dwsect[DEBUG_ABBREV].size; + dwarf_sections.data[DEBUG_RANGES] = dwsect[DEBUG_RANGES].data; + dwarf_sections.size[DEBUG_RANGES] = dwsect[DEBUG_RANGES].size; + dwarf_sections.data[DEBUG_STR] = dwsect[DEBUG_STR].data; + dwarf_sections.size[DEBUG_STR] = dwsect[DEBUG_STR].size; + + if (!backtrace_dwarf_add (state, 0, &dwarf_sections, 1, /* big endian */ - error_callback, data, fileline_fn)) + NULL, /* altlink */ + error_callback, data, fileline_fn, + NULL /* returned fileline_entry */)) goto fail; } @@ -1354,6 +1319,7 @@ xcoff_add (struct backtrace_state *state, int descriptor, off_t offset, { size_t linenos_size = (size_t) nlnno * LINESZ; + /* We never release this view. */ if (!backtrace_get_view (state, descriptor, offset + lnnoptr, linenos_size, error_callback, data, &linenos_view)) @@ -1366,9 +1332,6 @@ xcoff_add (struct backtrace_state *state, int descriptor, off_t offset, linenos_view.data, linenos_size, lnnoptr, error_callback, data)) *fileline_fn = xcoff_fileline; - - backtrace_release_view (state, &linenos_view, error_callback, data); - linenos_view_valid = 0; } backtrace_release_view (state, §s_view, error_callback, data); @@ -1621,7 +1584,8 @@ backtrace_initialize (struct backtrace_state *state, if (found_sym) backtrace_atomic_store_pointer (&state->syminfo_fn, xcoff_syminfo); else - __sync_bool_compare_and_swap (&state->syminfo_fn, NULL, xcoff_nosyms); + (void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL, + xcoff_nosyms); } if (!state->threaded) diff --git a/3rdparty/libbacktrace/ztest.c b/3rdparty/libbacktrace/ztest.c index 9cd712a1e0b..2663c90061a 100644 --- a/3rdparty/libbacktrace/ztest.c +++ b/3rdparty/libbacktrace/ztest.c @@ -1,5 +1,5 @@ /* ztest.c -- Test for libbacktrace inflate code. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without @@ -89,7 +89,8 @@ struct zlib_test /* Error callback. */ static void -error_callback_compress (void *vdata, const char *msg, int errnum) +error_callback_compress (void *vdata ATTRIBUTE_UNUSED, const char *msg, + int errnum) { fprintf (stderr, "%s", msg); if (errnum > 0) @@ -314,8 +315,8 @@ test_large (struct backtrace_state *state) size_t ctimes[16]; size_t ztimes[16]; static const char * const names[] = { - "Mark.Twain-Tom.Sawyer.txt", - "../libgo/go/compress/testdata/Mark.Twain-Tom.Sawyer.txt" + "Isaac.Newton-Opticks.txt", + "../libgo/go/testdata/Isaac.Newton-Opticks.txt", }; orig_buf = NULL; @@ -360,7 +361,7 @@ test_large (struct backtrace_state *state) fclose (e); if (got > 0) { - orig_buf = rbuf; + orig_buf = (unsigned char *) rbuf; orig_bufsize = got; break; } @@ -383,7 +384,7 @@ test_large (struct backtrace_state *state) } compress_sizearg = compressed_bufsize - 12; - r = compress (compressed_buf + 12, &compress_sizearg, + r = compress ((unsigned char *) compressed_buf + 12, &compress_sizearg, orig_buf, orig_bufsize); if (r != Z_OK) { @@ -406,7 +407,8 @@ test_large (struct backtrace_state *state) } uncompressed_bufsize = orig_bufsize; - if (!backtrace_uncompress_zdebug (state, compressed_buf, compressed_bufsize, + if (!backtrace_uncompress_zdebug (state, (unsigned char *) compressed_buf, + compressed_bufsize, error_callback_compress, NULL, &uncompressed_buf, &uncompressed_bufsize)) { @@ -443,7 +445,8 @@ test_large (struct backtrace_state *state) return; } - if (!backtrace_uncompress_zdebug (state, compressed_buf, + if (!backtrace_uncompress_zdebug (state, + (unsigned char *) compressed_buf, compressed_bufsize, error_callback_compress, NULL, &uncompressed_buf, @@ -472,8 +475,9 @@ test_large (struct backtrace_state *state) } uncompress_sizearg = uncompressed_bufsize; - r = uncompress (uncompressed_buf, &uncompress_sizearg, - compressed_buf + 12, compressed_bufsize - 12); + r = uncompress ((unsigned char *) uncompressed_buf, &uncompress_sizearg, + (unsigned char *) compressed_buf + 12, + compressed_bufsize - 12); if (clock_gettime (cid, &ts2) < 0) { From 483f2d1278a0aa79244a66b2f78865ab12a5559a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 21 Apr 2022 21:01:05 +0300 Subject: [PATCH 40/50] Add missing end line on nullpo callback error message --- src/common/nullpo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/nullpo.c b/src/common/nullpo.c index e8218515fbc..c4f1b6c0717 100644 --- a/src/common/nullpo.c +++ b/src/common/nullpo.c @@ -58,7 +58,7 @@ static char executable_path[PATH_MAX]; static void nullpo_error_callback(void *data, const char *msg, int errnum) { - ShowError("Error: %s (%d)", msg, errnum); + ShowError("Error: %s (%d)\n", msg, errnum); } static int nullpo_print_callback(void *data, uintptr_t pc, const char *filename, int lineno, const char *function) From 2f7a3c993500b9a27f8b138c5cfb87a591dbe917 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 23:30:53 +0300 Subject: [PATCH 41/50] Fix clang cast issues in libbacktrace --- 3rdparty/libbacktrace/dwarf.c | 6 +++--- 3rdparty/libbacktrace/elf.c | 4 ++-- 3rdparty/libbacktrace/mmapio.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/3rdparty/libbacktrace/dwarf.c b/3rdparty/libbacktrace/dwarf.c index 8f9c1a41603..3ae4807ca02 100644 --- a/3rdparty/libbacktrace/dwarf.c +++ b/3rdparty/libbacktrace/dwarf.c @@ -2619,7 +2619,7 @@ add_line (struct backtrace_state *state, struct dwarf_data *ddata, ln->filename = filename; ln->lineno = lineno; - ln->idx = vec->count; + ln->idx = (int)vec->count; ++vec->count; @@ -3085,7 +3085,7 @@ read_line_program (struct backtrace_state *state, struct dwarf_data *ddata, f = read_string (line_buf); if (f == NULL) return 0; - dir_index = read_uleb128 (line_buf); + dir_index = (unsigned int)read_uleb128 (line_buf); /* Ignore that time and length. */ read_uleb128 (line_buf); read_uleb128 (line_buf); @@ -3621,7 +3621,7 @@ read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata, case DW_AT_call_line: if (val.encoding == ATTR_VAL_UINT) - function->caller_lineno = val.u.uint; + function->caller_lineno = (int)val.u.uint; break; case DW_AT_abstract_origin: diff --git a/3rdparty/libbacktrace/elf.c b/3rdparty/libbacktrace/elf.c index 1216af86fd9..b808a03a4ad 100644 --- a/3rdparty/libbacktrace/elf.c +++ b/3rdparty/libbacktrace/elf.c @@ -2757,7 +2757,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, shdr = (const b_elf_shdr *) shdr_view.data; if (shnum == 0) - shnum = shdr->sh_size; + shnum = (unsigned int)shdr->sh_size; if (shstrndx == SHN_XINDEX) { @@ -2940,7 +2940,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, debugaltlink_buildid_data = debugaltlink_data + debugaltlink_name_len; - debugaltlink_buildid_size = shdr->sh_size - debugaltlink_name_len; + debugaltlink_buildid_size = (unsigned int)(shdr->sh_size - debugaltlink_name_len); } } diff --git a/3rdparty/libbacktrace/mmapio.c b/3rdparty/libbacktrace/mmapio.c index 5dd39525ba1..d02ebc474a3 100644 --- a/3rdparty/libbacktrace/mmapio.c +++ b/3rdparty/libbacktrace/mmapio.c @@ -67,7 +67,7 @@ backtrace_get_view (struct backtrace_state *state ATTRIBUTE_UNUSED, } pagesize = getpagesize (); - inpage = offset % pagesize; + inpage = (unsigned int)(offset % pagesize); pageoff = offset - inpage; size += inpage; From a65f51ce0ded8dde61a75020584e8983e9e5a3fd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 11 May 2022 23:44:27 +0300 Subject: [PATCH 42/50] Switch in github ci from clang-13 to clang-15 --- .github/workflows/{clang13_test.yml => clang15_test.yml} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename .github/workflows/{clang13_test.yml => clang15_test.yml} (95%) diff --git a/.github/workflows/clang13_test.yml b/.github/workflows/clang15_test.yml similarity index 95% rename from .github/workflows/clang13_test.yml rename to .github/workflows/clang15_test.yml index f34ec1fd59f..bc316412e80 100644 --- a/.github/workflows/clang13_test.yml +++ b/.github/workflows/clang15_test.yml @@ -1,4 +1,4 @@ -name: clang13_test +name: clang15_test on: [workflow_call, pull_request] @@ -14,8 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - # clang-8, clang-9 removed for reduce number of jobs - CC: [clang-13] + CC: [clang-15] RENEWAL: ["", "--disable-renewal"] CLIENT_TYPE: ["", "--enable-packetver-re", "--enable-packetver-zero"] SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"] From e2b8c1a499c5c92a51ad49ca7dea8820eea18a9c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 12 May 2022 00:05:54 +0300 Subject: [PATCH 43/50] Disable some clang-15 warnings Look like false positives inside libconfig. --- configure | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++- configure.ac | 4 ++ 2 files changed, 191 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 44ef76bd20c..9739e44a627 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac 98c1e55f2. +# From configure.ac 7cae47cac. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71. # @@ -9726,6 +9726,192 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +# issue in clang-15 in libconfig + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-deprecated-non-prototype" >&5 +printf %s "checking whether $CC supports -Wno-deprecated-non-prototype... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-deprecated-non-prototype" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Recent versions of gcc don't fail if -Wno-foo is not recognized + # (unless there are also other warnings), so we also check for -Wfoo + # which always fails if not supported + CFLAGS="$OLD_CFLAGS -Werror -Wdeprecated-non-prototype" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-deprecated-non-prototype" + # Optionally, run a test + if test "x" != "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-deprecated-non-prototype" >&5 +printf %s "checking whether $CC can actually use -Wno-deprecated-non-prototype... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wdeprecated-non-prototype" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not needed but enabled" >&5 +printf "%s\n" "not needed but enabled" >&6; } + CFLAGS="$OLD_CFLAGS" + +else $as_nop + + CFLAGS="$OLD_CFLAGS -Werror -Wno-deprecated-non-prototype" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-deprecated-non-prototype" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +# issue in clang-15 in libconfig + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-unused-but-set-variable" >&5 +printf %s "checking whether $CC supports -Wno-unused-but-set-variable... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-unused-but-set-variable" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Recent versions of gcc don't fail if -Wno-foo is not recognized + # (unless there are also other warnings), so we also check for -Wfoo + # which always fails if not supported + CFLAGS="$OLD_CFLAGS -Werror -Wunused-but-set-variable" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-unused-but-set-variable" + # Optionally, run a test + if test "x" != "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-unused-but-set-variable" >&5 +printf %s "checking whether $CC can actually use -Wno-unused-but-set-variable... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wunused-but-set-variable" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not needed but enabled" >&5 +printf "%s\n" "not needed but enabled" >&6; } + CFLAGS="$OLD_CFLAGS" + +else $as_nop + + CFLAGS="$OLD_CFLAGS -Werror -Wno-unused-but-set-variable" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-unused-but-set-variable" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Certain versions of gcc make -Wshadow completely useless by making it flood # you with unnecessary warnings diff --git a/configure.ac b/configure.ac index 45bffd6db70..30262cfb486 100644 --- a/configure.ac +++ b/configure.ac @@ -1176,6 +1176,10 @@ AC_CHECK_COMPILER_WNOFLAG(missing-field-initializers) #AC_CHECK_COMPILER_WNOFLAG(suggest-attribute=format) AC_CHECK_COMPILER_WNOFLAG(incompatible-pointer-types-discards-qualifiers) AC_CHECK_COMPILER_WNOFLAG(discarded-qualifiers) +# issue in clang-15 in libconfig +AC_CHECK_COMPILER_WNOFLAG(deprecated-non-prototype) +# issue in clang-15 in libconfig +AC_CHECK_COMPILER_WNOFLAG(unused-but-set-variable) # Certain versions of gcc make -Wshadow completely useless by making it flood # you with unnecessary warnings From 0d8c2339f148baa6f1fb2915e836a63fdbe4179f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 18 May 2022 19:23:59 +0300 Subject: [PATCH 44/50] Convert packet ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item into struct Also add enum with type values for packet ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN --- src/map/clif.c | 24 ++++++++++++++---------- src/map/clif.h | 6 ++++++ src/map/packets_struct.h | 7 +++++-- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 413bda2f558..295a6bbe225 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -21456,23 +21456,27 @@ static void clif_scriptclear(struct map_session_data *sd, int npcid) /* Made Possible Thanks to Yommy! */ static void clif_package_item_announce(struct map_session_data *sd, int nameid, int containerid) { - struct packet_package_item_announce p; +#if PACKETVER >= 20091201 + struct PACKET_ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item p; nullpo_retv(sd); - p.PacketType = package_item_announceType; #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 - p.PacketLength = 7 + 4 + 4 + NAME_LENGTH; -#else - p.PacketLength = 7 + 2 + 2 + NAME_LENGTH; -#endif - p.type = 0x0; + const int itemLen = 4; +#else // PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + const int itemLen = 2; +#endif // PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + + p.PacketType = HEADER_ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item; + p.PacketLength = sizeof(struct PACKET_ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item); + p.type = ITEM_OBTAIN_TYPE_BOX_ITEM; p.ItemID = nameid; p.len = NAME_LENGTH; safestrncpy(p.Name, sd->status.name, sizeof(p.Name)); - p.unknown = 0x2; // some strange byte, IDA shows.. BYTE3(BoxItemIDLength) = 2; + p.boxItemID_len = itemLen; p.BoxItemID = containerid; clif->send(&p, p.PacketLength, &sd->bl, ALL_CLIENT); +#endif // 20091201 } /* Made Possible Thanks to Yommy! */ @@ -21489,11 +21493,11 @@ static void clif_item_drop_announce(struct map_session_data *sd, int nameid, cha safestrncpy(p.Name, sd->status.name, sizeof(p.Name)); if (monsterName == NULL) { // message: MSG_BROADCASTING_SPECIAL_ITEM_OBTAIN2 - p.type = 0x2; + p.type = ITEM_OBTAIN_TYPE_NPC_ITEM; p.PacketLength -= NAME_LENGTH; } else { // message: MSG_BROADCASTING_SPECIAL_ITEM_OBTAIN - p.type = 0x1; + p.type = ITEM_OBTAIN_TYPE_MONSTER_ITEM; safestrncpy(p.monsterName, monsterName, sizeof(p.monsterName)); } clif->send(&p, p.PacketLength, &sd->bl, ALL_CLIENT); diff --git a/src/map/clif.h b/src/map/clif.h index a1ee4ce1e46..7f7994baef5 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -868,6 +868,12 @@ enum play_sound_act { PLAY_SOUND_STOP = 2, }; +enum ITEM_OBTAIN_TYPE { + ITEM_OBTAIN_TYPE_BOX_ITEM = 0, + ITEM_OBTAIN_TYPE_MONSTER_ITEM = 1, + ITEM_OBTAIN_TYPE_NPC_ITEM = 2, +}; + /** * Clif.c Interface **/ diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 7110e8a7f75..329803996c3 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1041,8 +1041,9 @@ struct packet_script_clear { uint32 NpcID; } __attribute__((packed)); +#if PACKETVER >= 20091201 /* made possible thanks to Yommy!! */ -struct packet_package_item_announce { +struct PACKET_ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item { int16 PacketType; int16 PacketLength; uint8 type; @@ -1053,13 +1054,15 @@ struct packet_package_item_announce { #endif int8 len; char Name[NAME_LENGTH]; - int8 unknown; // probably unused + int8 boxItemID_len; #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 uint32 BoxItemID; #else uint16 BoxItemID; #endif } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item, 0x07fd) +#endif /* made possible thanks to Yommy!! */ struct packet_item_drop_announce { From b3c3b4feb811f1a2339061d4a1c23850b6e69500 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 18 May 2022 19:25:04 +0300 Subject: [PATCH 45/50] Update HPM --- src/common/HPMDataCheck.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index cf6e71501df..15164a79d88 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -855,7 +855,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "packet_mission_info_sub", sizeof(struct packet_mission_info_sub), SERVER_TYPE_MAP }, { "packet_monster_hp", sizeof(struct packet_monster_hp), SERVER_TYPE_MAP }, { "packet_notify_bounditem", sizeof(struct packet_notify_bounditem), SERVER_TYPE_MAP }, - { "packet_package_item_announce", sizeof(struct packet_package_item_announce), SERVER_TYPE_MAP }, { "packet_party_leader_changed", sizeof(struct packet_party_leader_changed), SERVER_TYPE_MAP }, { "packet_quest_add_header", sizeof(struct packet_quest_add_header), SERVER_TYPE_MAP }, { "packet_quest_hunt_info", sizeof(struct packet_quest_hunt_info), SERVER_TYPE_MAP }, From c97d8127ca098eec85fa409b0ab387e809a2fc5d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 18 May 2022 19:33:33 +0300 Subject: [PATCH 46/50] Update packet ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item --- src/map/clif.c | 4 ++++ src/map/packets_struct.h | 28 +++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/map/clif.c b/src/map/clif.c index 295a6bbe225..029f3d8786c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -21474,6 +21474,10 @@ static void clif_package_item_announce(struct map_session_data *sd, int nameid, safestrncpy(p.Name, sd->status.name, sizeof(p.Name)); p.boxItemID_len = itemLen; p.BoxItemID = containerid; +#if PACKETVER_MAIN_NUM >= 20220518 || PACKETVER_ZERO_NUM >= 20220518 + p.refineLevel_len = itemLen; + p.refineLevel = 0; +#endif // PACKETVER_MAIN_NUM >= 20091201 clif->send(&p, p.PacketLength, &sd->bl, ALL_CLIENT); #endif // 20091201 diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 329803996c3..53e824883ba 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1041,7 +1041,33 @@ struct packet_script_clear { uint32 NpcID; } __attribute__((packed)); -#if PACKETVER >= 20091201 +#if PACKETVER_MAIN_NUM >= 20220518 || PACKETVER_ZERO_NUM >= 20220518 +struct PACKET_ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item { + int16 PacketType; + int16 PacketLength; + uint8 type; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 ItemID; +#else + uint16 ItemID; +#endif + int8 len; + char Name[NAME_LENGTH]; + int8 boxItemID_len; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 BoxItemID; +#else + uint16 BoxItemID; +#endif + int8 refineLevel_len; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 refineLevel; +#else + uint16 refineLevel; +#endif +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item, 0x0bba) +#elif PACKETVER >= 20091201 /* made possible thanks to Yommy!! */ struct PACKET_ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item { int16 PacketType; From cc9e5aef3225b6de13163840863c2172711c8600 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 18 May 2022 19:53:19 +0300 Subject: [PATCH 47/50] Rename packet CZ_SEE_GUILD_MEMBERS into official name CZ_APPROXIMATE_ACTOR --- src/map/clif.c | 4 ++-- src/map/packets_struct.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 029f3d8786c..342adea78b0 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -15854,9 +15854,9 @@ static void clif_parse_GuildMembersNear(int fd, struct map_session_data *sd) __a static void clif_parse_GuildMembersNear(int fd, struct map_session_data *sd) { #if PACKETVER_MAIN_NUM >= 20220216 - const struct PACKET_CZ_SEE_GUILD_MEMBERS *packet = RP2PTR(fd); + const struct PACKET_CZ_APPROXIMATE_ACTOR *packet = RP2PTR(fd); if (packet->unused1 != 1 || packet->unused2 != 1) { - ShowWarning("Unknown flags in CZ_SEE_GUILD_MEMBERS"); + ShowWarning("Unknown flags in CZ_APPROXIMATE_ACTOR"); } #endif // PACKETVER_MAIN_NUM >= 20220216 } diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 53e824883ba..4b8bc2fe0a3 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -5493,13 +5493,13 @@ DEFINE_PACKET_HEADER(ZC_UPDATE_GDID, 0x016c) #endif // PACKETVER_MAIN_NUM >= 20220216 #if PACKETVER_MAIN_NUM >= 20220216 -struct PACKET_CZ_SEE_GUILD_MEMBERS { +struct PACKET_CZ_APPROXIMATE_ACTOR { int16 PacketType; uint32 masterGID; uint16 unused1; uint8 unused2; } __attribute__((packed)); -DEFINE_PACKET_HEADER(CZ_SEE_GUILD_MEMBERS, 0x0bb0) +DEFINE_PACKET_HEADER(CZ_APPROXIMATE_ACTOR, 0x0bb0) #endif // PACKETVER_MAIN_NUM >= 20220216 From 5f50f0f12e29ddc3129e763b838facc4027a4a72 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 18 May 2022 20:07:55 +0300 Subject: [PATCH 48/50] Add refine field in clif->package_announce --- src/map/clif.c | 4 ++-- src/map/clif.h | 2 +- src/map/itemdb.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 342adea78b0..918489593af 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -21454,7 +21454,7 @@ static void clif_scriptclear(struct map_session_data *sd, int npcid) } /* Made Possible Thanks to Yommy! */ -static void clif_package_item_announce(struct map_session_data *sd, int nameid, int containerid) +static void clif_package_item_announce(struct map_session_data *sd, int nameid, int containerid, int refine_level) { #if PACKETVER >= 20091201 struct PACKET_ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN_item p; @@ -21476,7 +21476,7 @@ static void clif_package_item_announce(struct map_session_data *sd, int nameid, p.BoxItemID = containerid; #if PACKETVER_MAIN_NUM >= 20220518 || PACKETVER_ZERO_NUM >= 20220518 p.refineLevel_len = itemLen; - p.refineLevel = 0; + p.refineLevel = refine_level; #endif // PACKETVER_MAIN_NUM >= 20091201 clif->send(&p, p.PacketLength, &sd->bl, ALL_CLIENT); diff --git a/src/map/clif.h b/src/map/clif.h index 7f7994baef5..ccf066c72e9 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -951,7 +951,7 @@ struct clif_interface { void (*cart_additem_ack) (struct map_session_data *sd, int flag); void (*cashshop_load) (void); void (*cashShopSchedule) (int fd, struct map_session_data *sd); - void (*package_announce) (struct map_session_data *sd, int nameid, int containerid); + void (*package_announce) (struct map_session_data *sd, int nameid, int containerid, int refine_level); void (*item_drop_announce) (struct map_session_data *sd, int nameid, char *monsterName); /* unit-related */ void (*clearunit_single) (int id, enum clr_type type, int fd); diff --git a/src/map/itemdb.c b/src/map/itemdb.c index f7e2b8c8843..ebe12093ce9 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -261,7 +261,7 @@ static void itemdb_package_item(struct map_session_data *sd, struct item_package } if( package->must_items[i].announce ) - clif->package_announce(sd,package->must_items[i].id,package->id); + clif->package_announce(sd, package->must_items[i].id, package->id, it.refine); if ( package->must_items[i].force_serial ) it.unique_id = itemdb->unique_id(sd); @@ -305,7 +305,7 @@ static void itemdb_package_item(struct map_session_data *sd, struct item_package } if( entry->announce ) - clif->package_announce(sd,entry->id,package->id); + clif->package_announce(sd, entry->id, package->id, it.refine); get_count = itemdb->isstackable(entry->id) ? entry->qty : 1; From 95be2711f0a9648762eef222bac6cf246727af73 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 18 May 2022 20:08:42 +0300 Subject: [PATCH 49/50] Update HPM --- src/plugins/HPMHooking/HPMHooking.Defs.inc | 4 ++-- src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 00732708e72..7a5effef0e6 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1162,8 +1162,8 @@ typedef void (*HPMHOOK_pre_clif_cashshop_load) (void); typedef void (*HPMHOOK_post_clif_cashshop_load) (void); typedef void (*HPMHOOK_pre_clif_cashShopSchedule) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_cashShopSchedule) (int fd, struct map_session_data *sd); -typedef void (*HPMHOOK_pre_clif_package_announce) (struct map_session_data **sd, int *nameid, int *containerid); -typedef void (*HPMHOOK_post_clif_package_announce) (struct map_session_data *sd, int nameid, int containerid); +typedef void (*HPMHOOK_pre_clif_package_announce) (struct map_session_data **sd, int *nameid, int *containerid, int *refine_level); +typedef void (*HPMHOOK_post_clif_package_announce) (struct map_session_data *sd, int nameid, int containerid, int refine_level); typedef void (*HPMHOOK_pre_clif_item_drop_announce) (struct map_session_data **sd, int *nameid, char **monsterName); typedef void (*HPMHOOK_post_clif_item_drop_announce) (struct map_session_data *sd, int nameid, char *monsterName); typedef void (*HPMHOOK_pre_clif_clearunit_single) (int *id, enum clr_type *type, int *fd); diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 363a2fd6e51..66ef2f967fe 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -9760,14 +9760,14 @@ void HP_clif_cashShopSchedule(int fd, struct map_session_data *sd) { } return; } -void HP_clif_package_announce(struct map_session_data *sd, int nameid, int containerid) { +void HP_clif_package_announce(struct map_session_data *sd, int nameid, int containerid, int refine_level) { int hIndex = 0; if (HPMHooks.count.HP_clif_package_announce_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, int *nameid, int *containerid); + void (*preHookFunc) (struct map_session_data **sd, int *nameid, int *containerid, int *refine_level); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_package_announce_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_package_announce_pre[hIndex].func; - preHookFunc(&sd, &nameid, &containerid); + preHookFunc(&sd, &nameid, &containerid, &refine_level); } if (*HPMforce_return) { *HPMforce_return = false; @@ -9775,13 +9775,13 @@ void HP_clif_package_announce(struct map_session_data *sd, int nameid, int conta } } { - HPMHooks.source.clif.package_announce(sd, nameid, containerid); + HPMHooks.source.clif.package_announce(sd, nameid, containerid, refine_level); } if (HPMHooks.count.HP_clif_package_announce_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, int nameid, int containerid); + void (*postHookFunc) (struct map_session_data *sd, int nameid, int containerid, int refine_level); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_package_announce_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_package_announce_post[hIndex].func; - postHookFunc(sd, nameid, containerid); + postHookFunc(sd, nameid, containerid, refine_level); } } return; From 012d719767fae30646a15f00cf51a171b9c6b44a Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 2 Jun 2022 04:49:00 +0200 Subject: [PATCH 50/50] Update GitHub Actions workflow controller Signed-off-by: Haru --- .github/workflows/controller.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/controller.yml b/.github/workflows/controller.yml index fd75d26071e..2a42c0ea91b 100644 --- a/.github/workflows/controller.yml +++ b/.github/workflows/controller.yml @@ -20,10 +20,10 @@ jobs: needs: tools if: ${{ !failure() && !cancelled() }} uses: ./.github/workflows/build.yml - clang13_test: + clang15_test: needs: build if: ${{ !failure() && !cancelled() }} - uses: ./.github/workflows/clang13_test.yml + uses: ./.github/workflows/clang15_test.yml gcc_test: needs: build if: ${{ !failure() && !cancelled() }}