ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2005
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
28 participants
703 discussions
Start a n
N
ew thread
[arty] 12884: Solved an stupid error with kbdes.c
by arty@svn.reactos.com
Solved an stupid error with kbdes.c -- HUMA2000 Modified: trunk/reactos/lib/kbdes/kbdes.c _____ Modified: trunk/reactos/lib/kbdes/kbdes.c --- trunk/reactos/lib/kbdes/kbdes.c 2005-01-08 09:34:37 UTC (rev 12883) +++ trunk/reactos/lib/kbdes/kbdes.c 2005-01-08 11:57:34 UTC (rev 12884) @@ -1,398 +1,586 @@ - /* - * ReactOS ESASCII Keyboard layout - * Copyright (C) 2003 ReactOS - * License: LGPL, see: LGPL.txt - * Created by HUMA2000 from kbdus, kbdgr and kbdfr - * huma2000(a)terra.es - * - * Thanks to:
http://www.barcodeman.com/altek/mule/scandoc.php
- * and
http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html
- */ - - #include <windows.h> - #include <internal/kbd.h> - #ifdef _M_IA64 - #define ROSDATA static __declspec(allocate(".data")) - #else - #pragma data_seg(".data") - #define ROSDATA static - #endif - - #define VK_EMPTY 0xff /* The non-existent VK */ - #define KSHIFT 0x001 /* Shift modifier */ - #define KCTRL 0x002 /* Ctrl modifier */ - #define KALT 0x004 /* Alt modifier */ - #define KEXT 0x100 /* Extended key code */ - #define KMULTI 0x200 /* Multi-key */ - #define KSPEC 0x400 /* Special key */ - #define KNUMP 0x800 /* Number-pad */ - #define KNUMS 0xc00 /* Special + number pad */ - #define KMEXT 0x300 /* Multi + ext */ - /* Thanks to
http://asp.flaaten.dk/pforum/keycode/keycode.htm
*/ - #ifndef VK_OEM_1 - #define VK_OEM_1 0xba - #endif - #ifndef VK_OEM_PLUS - #define VK_OEM_PLUS 0xbb - #endif - #ifndef VK_OEM_COMMA - #define VK_OEM_COMMA 0xbc - #endif - #ifndef VK_OEM_MINUS - #define VK_OEM_MINUS 0xbd - #endif - #ifndef VK_OEM_PERIOD - #define VK_OEM_PERIOD 0xbe - #endif - #ifndef VK_OEM_2 - #define VK_OEM_2 0xbf - #endif - #ifndef VK_OEM_3 - #define VK_OEM_3 0xc0 - #endif - #ifndef VK_OEM_4 - #define VK_OEM_4 0xdb - #endif - #ifndef VK_OEM_5 - #define VK_OEM_5 0xdc - #endif - #ifndef VK_OEM_6 - #define VK_OEM_6 0xdd - #endif - #ifndef VK_OEM_7 - #define VK_OEM_7 0xde - #endif - #ifndef VK_OEM_8 - #define VK_OEM_8 0xdf - #endif - #ifndef VK_OEM_102 - #define VK_OEM_102 0xe1 - #endif - #ifndef VK_acentos - #define VK_acentos 0x0e - #endif - - ROSDATA USHORT scancode_to_vk[] = { - /* Numbers Row */ - /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ - VK_acentos, '1', '2', - '3', '4', '5', '6', - '7', '8', '9', '0', - VK_OEM_MINUS, VK_OEM_PLUS, VK_BACK, - /* - 0f - */ - /* First Letters Row */ - VK_TAB, 'Q', 'W', 'E', - 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', - VK_OEM_4, VK_OEM_6, VK_RETURN, - /* - 1d - */ - /* Second Letters Row */ - VK_LCONTROL, - 'A', 'S', 'D', 'F', - 'G', 'H', 'J', 'K', - 'L', 'Ñ', VK_OEM_7, VK_OEM_3, - VK_LSHIFT, VK_OEM_5, - /* - 2c - */ - /* Third letters row */ - VK_OEM_102, 'Z', 'X', 'C', 'V', - 'B', 'N', 'M', VK_OEM_COMMA, - VK_OEM_PERIOD, VK_OEM_2, VK_RSHIFT, - /* - 37 - */ - /* Bottom Row */ - VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - /* - 3b - */ - /* F-Keys */ - VK_ESCAPE, VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, - VK_F7, VK_F8, VK_F9, VK_F10, - /* - 45 - */ - /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, - /* - 47 - */ - /* Number-Pad */ - VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, - VK_SUBTRACT, - VK_LEFT | KNUMS, VK_CLEAR | KNUMS, VK_RIGHT | KNUMS, VK_ADD, - VK_END | KNUMS, VK_DOWN | KNUMS, VK_NEXT | KNUMS, - VK_INSERT | KNUMS, VK_DELETE | KNUMS, - /* - 54 - */ - /* Presumably PrtSc */ - VK_SNAPSHOT, - /* - 55 - */ - /* Oddities, and the remaining standard F-Keys */ - VK_EMPTY, VK_EMPTY, VK_F11, VK_F12, - /* - 59 - */ - VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* - EREOF */ - VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, - /* - 64 - */ - /* Even more F-Keys (for example, NCR keyboards from the early 90's) - */ - VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, - /* - 6f - */ - /* Not sure who uses these codes */ - VK_EMPTY, VK_EMPTY, VK_EMPTY, - /* - 72 - */ - VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, - /* - 76 - */ - /* One more f-key */ - VK_F24, - /* - 77 - */ - VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, - VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* PA1 */ - VK_EMPTY, - /* - 80 - */ - 0 - }; - ROSDATA VSC_VK extcode0_to_vk[] = { - { 0, 0 }, - }; - - ROSDATA VSC_VK extcode1_to_vk[] = { - { 0, 0 }, - }; - ROSDATA VK_TO_BIT modifier_keys[] = { - { VK_SHIFT, KSHIFT }, - { VK_CONTROL, KCTRL }, - { VK_MENU, KALT }, - { 0, 0 } - }; - - typedef struct _mymod { - PVOID mod_keys; - WORD maxmod; - BYTE mod_max[4]; - } INTERNAL_KBD_MODIFIERS; - ROSDATA INTERNAL_KBD_MODIFIERS modifier_bits[] = { - modifier_keys, - 3, - { 0, 1, 2, 3 } /* Modifier bit order, NONE, SHIFT, CTRL, ALT */ - }; - - #define NOCAPS 0 - #define CAPS KSHIFT /* Caps -> shift */ - ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { - /* Normal vs Shifted */ - /* The numbers */ - //Del 1 al 5 tienen tres estados - { '4', NOCAPS, '4', '$' }, - //El 6 tiene 3 estados - { '7', NOCAPS, '7', '&' }, - { '8', NOCAPS, '8', '*' }, - { '9', NOCAPS, '9', '(' }, - { '0', NOCAPS, '0', ')' }, - /* First letter row */ - { 'Q', CAPS, 'q', 'Q' }, - { 'W', CAPS, 'w', 'W' }, - //La E tiene 3 estados - { 'R', CAPS, 'r', 'R' }, - { 'T', CAPS, 't', 'T' }, - { 'Y', CAPS, 'y', 'Y' }, - { 'U', CAPS, 'u', 'U' }, - { 'I', CAPS, 'i', 'I' }, - { 'O', CAPS, 'o', 'O' }, - { 'P', CAPS, 'p', 'P' }, - /* Second letter row */ - { 'A', CAPS, 'a', 'A' }, - { 'S', CAPS, 's', 'S' }, - { 'D', CAPS, 'd', 'D' }, - { 'F', CAPS, 'f', 'F' }, - { 'G', CAPS, 'g', 'G' }, - { 'H', CAPS, 'h', 'H' }, - { 'J', CAPS, 'j', 'J' }, - { 'K', CAPS, 'k', 'K' }, - { 'L', CAPS, 'l', 'L' }, - { 'Ñ', CAPS, 'ñ', 'Ñ' }, //No se si funcionara así - /* Third letter row */ - { 'Z', CAPS, 'z', 'Z' }, - { 'X', CAPS, 'x', 'X' }, - { 'C', CAPS, 'c', 'C' }, - { 'V', CAPS, 'v', 'V' }, - { 'B', CAPS, 'b', 'B' }, - { 'N', CAPS, 'n', 'N' }, - { 'M', CAPS, 'm', 'M' }, - - /* Specials */ - /* Ctrl-_ generates ES */ - { VK_OEM_PLUS ,NOCAPS, '=', '+' }, - { VK_OEM_1 ,NOCAPS, ';', ':' }, - { VK_OEM_COMMA ,NOCAPS, ',', ';' }, - { VK_OEM_PERIOD ,NOCAPS, '.', ':' }, - { VK_OEM_2 ,NOCAPS, '-', '_' }, - { VK_OEM_102 ,NOCAPS, '<', '>' }, - /* Keys that do not have shift states */ - { VK_TAB ,NOCAPS, '\t','\t'}, - { VK_ADD ,NOCAPS, '+', '+' }, - { VK_SUBTRACT,NOCAPS, '-', '-' }, - { VK_MULTIPLY,NOCAPS, '*', '*' }, - { VK_DIVIDE ,NOCAPS, '/', '/' }, - { VK_ESCAPE ,NOCAPS, '\x1b','\x1b' }, - { VK_SPACE ,NOCAPS, ' ', ' ' }, - { 0, 0 } - }; - - ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { - /* Normal, Shifted, Ctrl */ - /* Legacy (telnet-style) ascii escapes */ - { '1', NOCAPS, '1', '!', '|' }, // ¿Funcionara? - { '2', NOCAPS, '2', '"', '@' }, // ¿Funcionara? - { '3', NOCAPS, '3', '·','#' }, // ¿Funcionara? - { '5', NOCAPS, '5', '%', 0x20AC }, // añadir caracter EUR, asi no va a funcionar - { '6', NOCAPS, '6', '&', '¬' }, // ¿Funcionara? - { 'E', CAPS, 'e', 'E', 0x20AC }, // añadir caracter EUR, asi no va a funcionar - { VK_OEM_4, 0, '[', '{', 0x1b /* ESC */ }, - { VK_OEM_6, 0, ']', '}', 0x1d /* GS */ }, - { VK_OEM_5, 0, '\\','|', 0x1c /* FS */ }, - { VK_RETURN,0, '\r', '\r', '\n' }, - { VK_OEM_7 ,NOCAPS, '´','¨','{'}, // Tecla ¨ ´{ a ver si funciona - { VK_OEM_3 ,NOCAPS, 'ç', 'Ç', '}' }, // Tecla ç Ç } a ver si funciona - { VK_acentos ,NOCAPS, 'º', 'ª', '\\' }, // Tecla º ª \ a ver si funciona - { VK_OEM_MINUS, NOCAPS, 0x0027, '?' }, // Tecla ' ? a ver si funciona, no creo, debo definir ' de alguna otra manera - { VK_OEM_PLUS, NOCAPS, '¡', '¿' }, // Tecla ¡ ¿ a ver si funciona - { 0,0 } - }; - - ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { - /* Normal, Shifted, Ctrl, C-S-x */ - /* Legacy Ascii generators */ - { 0, 0 } - }; - ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { - { VK_NUMPAD0, 0, '0' }, - { VK_NUMPAD1, 0, '1' }, - { VK_NUMPAD2, 0, '2' }, - { VK_NUMPAD3, 0, '3' }, - { VK_NUMPAD4, 0, '4' }, - { VK_NUMPAD5, 0, '5' }, - { VK_NUMPAD6, 0, '6' }, - { VK_NUMPAD7, 0, '7' }, - { VK_NUMPAD8, 0, '8' }, - { VK_NUMPAD9, 0, '9' }, - { VK_DECIMAL, 0, '.' }, - { VK_BACK, 0, '\010' }, - { 0,0 } - }; - - #define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) } - ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[] = { - vk_master(1,keypad_numbers), - vk_master(2,key_to_chars_2mod), - vk_master(3,key_to_chars_3mod), - vk_master(4,key_to_chars_4mod), - { 0,0,0 } - }; - - ROSDATA VSC_LPWSTR key_names[] = { - { 0x00, L"" }, - { 0x01, L"Esc" }, - { 0x0e, L"Backspace" }, - { 0x0f, L"Tab" }, - { 0x1c, L"Enter" }, - { 0x1d, L"Ctrl" }, - { 0x2a, L"Shift" }, - { 0x36, L"Right Shift" }, - { 0x37, L"Num *" }, - { 0x38, L"Alt" }, - { 0x39, L"Space" }, - { 0x3a, L"Caps Lock" }, - { 0x3b, L"F1" }, - { 0x3c, L"F2" }, - { 0x3d, L"F3" }, - { 0x3e, L"F4" }, - { 0x3f, L"F5" }, - { 0x40, L"F6" }, - { 0x41, L"F7" }, - { 0x42, L"F8" }, - { 0x43, L"F9" }, - { 0x44, L"F10" }, - { 0x45, L"Pause" }, - { 0x46, L"Scroll Lock" }, - { 0x47, L"Num 7" }, - { 0x48, L"Num 8" }, - { 0x49, L"Num 9" }, - { 0x4a, L"Num -" }, - { 0x4b, L"Num 4" }, - { 0x4c, L"Num 5" }, - { 0x4d, L"Num 6" }, - { 0x4e, L"Num +" }, - { 0x4f, L"Num 1" }, - { 0x50, L"Num 2" }, - { 0x51, L"Num 3" }, - { 0x52, L"Num 0" }, - { 0x53, L"Num Del" }, - { 0x54, L"Sys Req" }, - { 0x57, L"F11" }, - { 0x58, L"F12" }, - { 0x7c, L"F13" }, - { 0x7d, L"F14" }, - { 0x7e, L"F15" }, - { 0x7f, L"F16" }, - { 0x80, L"F17" }, - { 0x81, L"F18" }, - { 0x82, L"F19" }, - { 0x83, L"F20" }, - { 0x84, L"F21" }, - { 0x85, L"F22" }, - { 0x86, L"F23" }, - { 0x87, L"F24" }, - { 0, NULL }, - }; - ROSDATA VSC_LPWSTR extended_key_names[] = { - { 0x1c, L"Num Enter" }, - { 0x1d, L"Right Ctrl" }, - { 0x35, L"Num /" }, - { 0x37, L"Prnt Scrn" }, - { 0x38, L"Right Alt" }, - { 0x45, L"Num Lock" }, - { 0x46, L"Break" }, - { 0x47, L"Home" }, - { 0x48, L"Up" }, - { 0x49, L"Page Up" }, - { 0x4a, L"Left" }, - { 0x4c, L"Center" }, - { 0x4d, L"Right" }, - { 0x4f, L"End" }, - { 0x50, L"Down" }, - { 0x51, L"Page Down" }, - { 0x52, L"Insert" }, - { 0x53, L"Delete" }, - { 0x54, L"<ReactOS>" }, - { 0x55, L"Help" }, - { 0x56, L"Left Windows" }, - { 0x5b, L"Right Windows" }, - { 0, NULL }, - }; - - /* Finally, the master table */ - ROSDATA KBDTABLES keyboard_layout_table = { - /* modifier assignments */ - (PMODIFIERS)&modifier_bits, - /* character from vk tables */ - vk_to_wchar_master_table, - - /* diacritical marks -- currently implemented by wine code */ - /* English doesn't have any, anyway */ - NULL, - /* Key names */ - (VSC_LPWSTR *)key_names, - (VSC_LPWSTR *)extended_key_names, - NULL, /* Dead key names */ - - /* scan code to virtual key maps */ - scancode_to_vk, - sizeof(scancode_to_vk) / sizeof(scancode_to_vk[0]), - extcode0_to_vk, - extcode1_to_vk, - MAKELONG(0,1), /* Version 1.0 */ - - /* Ligatures -- Spanish doesn't have any */ - 0, - 0, - NULL - }; - PKBDTABLES STDCALL KbdLayerDescriptor() { - return &keyboard_layout_table; - } +/* + * ReactOS ESASCII Keyboard layout + * Copyright (C) 2003 ReactOS + * License: LGPL, see: LGPL.txt + * Created by HUMA2000 from kbdus, kbdgr, kbdda and kbdfr + * huma2000(a)terra.es + * Thanks to arty for the kbtest utility and help + * Thanks to carraca from
reactos.com
forum for his fixes + * Thanks Elrond for help + * + * Thanks to:
http://www.barcodeman.com/altek/mule/scandoc.php
+ * and
http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html
+ */ + + +#include <windows.h> +#include <internal/kbd.h> + + +#ifdef _M_IA64 +#define ROSDATA static __declspec(allocate(".data")) +#else +#pragma data_seg(".data") +#define ROSDATA static +#endif + + +#define VK_EMPTY 0xff /* The non-existent VK */ +#define KSHIFT 0x001 /* Shift modifier */ +#define KCTRL 0x002 /* Ctrl modifier */ +#define KALT 0x004 /* Alt modifier */ +#define KEXT 0x100 /* Extended key code */ +#define KMULTI 0x200 /* Multi-key */ +#define KSPEC 0x400 /* Special key */ +#define KNUMP 0x800 /* Number-pad */ +#define KNUMS 0xc00 /* Special + number pad */ +#define KMEXT 0x300 /* Multi + ext */ + +#define SHFT_INVALID 0x0F + +/* Thanks to
http://asp.flaaten.dk/pforum/keycode/keycode.htm
*/ + + +#ifndef VK_OEM_1 +#define VK_OEM_1 0xba /* Tecla `^[ */ +#endif +#ifndef VK_OEM_PLUS +#define VK_OEM_PLUS 0xbb /* Tecla +*] */ +#endif +#ifndef VK_OEM_COMMA +#define VK_OEM_COMMA 0xbc /* Tecla ,; */ +#endif +#ifndef VK_OEM_MINUS +#define VK_OEM_MINUS 0xbd /* Tecla -_ */ +#endif +#ifndef VK_OEM_PERIOD +#define VK_OEM_PERIOD 0xbe /* Tecla .: */ +#endif +#ifndef VK_OEM_2 +#define VK_OEM_2 0xbf /* Tecla çÇ} */ +#endif +#ifndef VK_OEM_3 +#define VK_OEM_3 0xc0 /* Tecla ñÑ */ +#endif +#ifndef VK_OEM_4 +#define VK_OEM_4 0xdb /* Tecla '? */ +#endif +#ifndef VK_OEM_5 +#define VK_OEM_5 0xdc /* Tecla ºª\ */ +#endif +#ifndef VK_OEM_6 +#define VK_OEM_6 0xdd /* Tecla ¡¿ */ +#endif +#ifndef VK_OEM_7 +#define VK_OEM_7 0xde /* Tecla ´¨{ */ +#endif +#ifndef VK_OEM_8 +#define VK_OEM_8 0xdf +#endif +#ifndef VK_OEM_102 +#define VK_OEM_102 0xe2 /* Tecla < > */ +#endif + + +ROSDATA USHORT scancode_to_vk[] = { +/* 00 */ VK_EMPTY, +/* 01 */ VK_ESCAPE, +/* 02 */ '1', +/* 03 */ '2', +/* 04 */ '3', +/* 05 */ '4', +/* 06 */ '5', +/* 07 */ '6', +/* 08 */ '7', +/* 09 */ '8', +/* 0a */ '9', +/* 0b */ '0', +/* 0c */ VK_OEM_4, +/* 0d */ VK_OEM_6, +/* 0e */ VK_BACK, +/* 0f */ VK_TAB, +/* 10 */ 'Q', +/* 11 */ 'W', +/* 12 */ 'E', +/* 13 */ 'R', +/* 14 */ 'T', +/* 15 */ 'Y', +/* 16 */ 'U', +/* 17 */ 'I', +/* 18 */ 'O', +/* 19 */ 'P', +/* 1a */ VK_OEM_1, +/* 1b */ VK_OEM_PLUS, +/* 1c */ VK_RETURN, +/* 1d */ VK_LCONTROL, +/* 1e */ 'A', +/* 1f */ 'S', +/* 20 */ 'D', +/* 21 */ 'F', +/* 22 */ 'G', +/* 23 */ 'H', +/* 24 */ 'J', +/* 25 */ 'K', +/* 26 */ 'L', +/* 27 */ VK_OEM_3, +/* 28 */ VK_OEM_7, +/* 29 */ VK_OEM_5, +/* 2a */ VK_LSHIFT, +/* 2b */ VK_OEM_2, +/* 2c */ 'Z', +/* 2d */ 'X', +/* 2e */ 'C', +/* 2f */ 'V', +/* 30 */ 'B', +/* 31 */ 'N', +/* 32 */ 'M', +/* 33 */ VK_OEM_COMMA, +/* 34 */ VK_OEM_PERIOD, +/* 35 */ VK_OEM_MINUS, +/* 36 */ VK_RSHIFT, +/* 37 */ VK_MULTIPLY, +/* 38 */ VK_LMENU, +/* 39 */ VK_SPACE, +/* 3a */ VK_CAPITAL, +/* 3b */ VK_F1, +/* 3c */ VK_F2, +/* 3d */ VK_F3, +/* 3e */ VK_F4, +/* 3f */ VK_F5, +/* 40 */ VK_F6, +/* 41 */ VK_F7, +/* 42 */ VK_F8, +/* 43 */ VK_F9, +/* 44 */ VK_F10, +/* 45 */ VK_NUMLOCK | KMEXT, +/* 46 */ VK_SCROLL | KMULTI, +/* 47 */ VK_HOME | KNUMS, +/* 48 */ VK_UP | KNUMS, +/* 49 */ VK_PRIOR | KNUMS, +/* 4a */ VK_SUBTRACT, +/* 4b */ VK_LEFT | KNUMS, +/* 4c */ VK_CLEAR | KNUMS, +/* 4d */ VK_RIGHT | KNUMS, +/* 4e */ VK_ADD, +/* 4f */ VK_END | KNUMS, +/* 50 */ VK_DOWN | KNUMS, +/* 51 */ VK_NEXT | KNUMS, +/* 52 */ VK_INSERT | KNUMS, +/* 53 */ VK_DELETE | KNUMS, +/* 54 */ VK_SNAPSHOT, +/* 55 */ VK_EMPTY, +/* 56 */ VK_OEM_102, +/* 57 */ VK_F11, +/* 58 */ VK_F12, +/* 59 */ VK_EMPTY, +/* 5a */ VK_CLEAR, +/* 5b */ VK_EMPTY, +/* 5c */ VK_EMPTY, +/* 5d */ VK_EMPTY, +/* 5e */ VK_EMPTY, /* EREOF */ +/* 5f */ VK_EMPTY, +/* 60 */ VK_EMPTY, +/* 61 */ VK_EMPTY, +/* 62 */ VK_EMPTY, +/* 63 */ VK_EMPTY, /* ZOOM */ +/* 64 */ VK_HELP, +/* 65 */ VK_F13, +/* 66 */ VK_F14, +/* 67 */ VK_F15, +/* 68 */ VK_F16, +/* 69 */ VK_F17, +/* 6a */ VK_F18, +/* 6b */ VK_F19, +/* 6c */ VK_F20, +/* 6d */ VK_F21, +/* 6e */ VK_F22, +/* 6f */ VK_F23, +/* 70 */ VK_EMPTY, +/* 71 */ VK_EMPTY, +/* 72 */ VK_EMPTY, +/* 73 */ VK_EMPTY, +/* 74 */ VK_EMPTY, +/* 75 */ VK_EMPTY, +/* 76 */ VK_EMPTY, +/* 77 */ VK_F24, +/* 78 */ VK_EMPTY, +/* 79 */ VK_EMPTY, +/* 7a */ VK_EMPTY, +/* 7b */ VK_EMPTY, +/* 7c */ VK_EMPTY, +/* 7d */ VK_EMPTY, +/* 7e */ VK_EMPTY, +/* 7f */ VK_EMPTY, +/* 80 */ VK_EMPTY, +/* 00 */ 0 +}; + +ROSDATA VSC_VK extcode0_to_vk[] = { + { 0x10, VK_MEDIA_PREV_TRACK | KEXT }, // Pista anterior, no puedo probarlo hasta que no se implemente el sonido + { 0x19, VK_MEDIA_NEXT_TRACK | KEXT }, // Pista siguiente, + { 0x1D, VK_RCONTROL | KEXT }, // Tecla control + { 0x20, VK_VOLUME_MUTE | KEXT }, // Silenciar volumen + { 0x21, VK_LAUNCH_APP2 | KEXT }, // Tecla calculadora + { 0x22, VK_MEDIA_PLAY_PAUSE | KEXT }, // Play/pause + { 0x24, VK_MEDIA_STOP | KEXT }, // Stop + { 0x2E, VK_VOLUME_DOWN | KEXT }, // Bajar volumen + { 0x30, VK_VOLUME_UP | KEXT }, // Subir volumen + { 0x32, VK_BROWSER_HOME | KEXT }, // Pagina de inicio del navegador de internet o abrirlo si no esta activolo + { 0x35, VK_DIVIDE | KEXT }, // Tecla + { 0x37, VK_SNAPSHOT | KEXT }, // La tecla de imprimir pantalla + { 0x38, VK_RMENU | KEXT }, // Tecla alt + { 0x47, VK_HOME | KEXT }, // Tecla inicio + { 0x48, VK_UP | KEXT }, // Cursor arriba + { 0x49, VK_PRIOR | KEXT }, // Tecla Re pag + { 0x4B, VK_LEFT | KEXT }, // Cursor izquierda + { 0x4D, VK_RIGHT | KEXT }, // Cursor derecha + { 0x4F, VK_END | KEXT }, // Tecla Fin + { 0x50, VK_DOWN | KEXT }, // Cursor abajo + { 0x51, VK_NEXT | KEXT }, // Tecla Av pag + { 0x52, VK_INSERT | KEXT }, // Tecla insertar + { 0x53, VK_DELETE | KEXT }, // Tecla deletear + { 0x5B, VK_LWIN | KEXT }, // Tecla windows izquierda + { 0x5C, VK_RWIN | KEXT }, // Tecla windows derecha + { 0x5D, VK_APPS | KEXT }, // Tecla menu aplicacion derecha + { 0x5F, VK_SLEEP | KEXT }, // Tecla Sleep + { 0x65, VK_BROWSER_SEARCH | KEXT }, // Pagina de búsqueda en el navegador de internet + { 0x66, VK_BROWSER_FAVORITES | KEXT }, // Favoritos, tengo que esperar a que el tcp/ip + { 0x67, VK_BROWSER_REFRESH | KEXT }, // Refrescar el navegador de internet + { 0x68, VK_BROWSER_STOP | KEXT }, // Stop en el navegador de internet + { 0x69, VK_BROWSER_FORWARD | KEXT }, // Adelante en el navegador de internet + { 0x6A, VK_BROWSER_BACK | KEXT }, // Atrás en el navegador de internet + { 0x6B, VK_LAUNCH_APP1 | KEXT }, // Tecla Mi pc + { 0x6C, VK_LAUNCH_MAIL | KEXT }, // Abrir programa de e-mail + { 0x6D, VK_LAUNCH_MEDIA_SELECT | KEXT }, // Abrir reproductor multimedia + { 0x1C, VK_RETURN | KEXT }, // La tecla de intro + { 0x46, VK_CANCEL | KEXT }, // Tecla escape + { 0, 0 }, +}; + + +ROSDATA VSC_VK extcode1_to_vk[] = { + { 0, 0 }, +}; + +ROSDATA VK_TO_BIT modifier_keys[] = { + { VK_SHIFT, KSHIFT }, + { VK_CONTROL, KCTRL }, + { VK_MENU, KALT }, + { 0, 0 } +}; + +typedef struct _mymod { + PVOID mod_keys; + WORD maxmod; + BYTE mod_max[7]; +} INTERNAL_KBD_MODIFIERS; + +ROSDATA INTERNAL_KBD_MODIFIERS modifier_bits[] = { + modifier_keys, + 6, + { 0, 1, 2, 4, SHFT_INVALID, SHFT_INVALID, 3 } +/* NONE, SHIFT, CTRL, CTRL+SHIFT, ALT */ +}; + +#define NOCAPS 0 +#define CAPS KSHIFT /* Caps -> shift */ + +ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { + /* Normal vs Shifted */ + /* The numbers */ + //Del 1 al 5 tienen tres estados + { '4', NOCAPS, '4', '$' }, + { '5', NOCAPS, '5', '%' }, + //El 6 tiene 3 estados + { '7', NOCAPS, '7', '/' }, + { '8', NOCAPS, '8', '(' }, + { '9', NOCAPS, '9', ')' }, + { '0', NOCAPS, '0', '=' }, + /* First letter row */ + { 'Q', CAPS, 'q', 'Q' }, + { 'W', CAPS, 'w', 'W' }, + //La E tiene 3 estados + { 'R', CAPS, 'r', 'R' }, + { 'T', CAPS, 't', 'T' }, + { 'Y', CAPS, 'y', 'Y' }, + { 'U', CAPS, 'u', 'U' }, + { 'I', CAPS, 'i', 'I' }, + { 'O', CAPS, 'o', 'O' }, + { 'P', CAPS, 'p', 'P' }, + /* Second letter row */ + { 'A', CAPS, 'a', 'A' }, + { 'S', CAPS, 's', 'S' }, + { 'D', CAPS, 'd', 'D' }, + { 'F', CAPS, 'f', 'F' }, + { 'G', CAPS, 'g', 'G' }, + { 'H', CAPS, 'h', 'H' }, + { 'J', CAPS, 'j', 'J' }, + { 'K', CAPS, 'k', 'K' }, + { 'L', CAPS, 'l', 'L' }, + { VK_OEM_3, CAPS, 0x00F1, 0x00D1 }, // ñÑ + /* Third letter row */ + { 'Z', CAPS, 'z', 'Z' }, + { 'X', CAPS, 'x', 'X' }, + { 'C', CAPS, 'c', 'C' }, + { 'V', CAPS, 'v', 'V' }, + { 'B', CAPS, 'b', 'B' }, + { 'N', CAPS, 'n', 'N' }, + { 'M', CAPS, 'm', 'M' }, + + /* Specials */ + /* Ctrl-_ generates ES */ + { VK_OEM_6 ,NOCAPS, 0x00a1, 0x00bf }, // ¡¿ + { VK_OEM_4 ,NOCAPS, 0x0027, '?' }, //'? + { VK_OEM_COMMA ,NOCAPS, ',', ';' }, + { VK_OEM_PERIOD ,NOCAPS, '.', ':' }, + { VK_OEM_MINUS ,NOCAPS, '-', '_' }, + { VK_OEM_102 ,NOCAPS, '<', '>' }, + + /* Keys that do not have shift states */ + { VK_TAB, NOCAPS, '\t', '\t' }, + { VK_ADD, NOCAPS, '+', '+' }, + { VK_SUBTRACT, NOCAPS, '-', '-' }, + { VK_MULTIPLY, NOCAPS, '*', '*'}, + { VK_DIVIDE, NOCAPS, '/', '/' }, + { VK_ESCAPE, NOCAPS, '\x1b', '\x1b' }, + { VK_SPACE, NOCAPS, ' ', ' ' }, + { 0, 0 } +}; + + +ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { + /* Normal, Shifted, Ctrl */ + /* Legacy (telnet-style) ascii escapes */ + { VK_RETURN, NOCAPS, '\r', '\r', '\n' }, + { 0,0 } +}; + + +ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { +/* Normal, shifted, control, Alt+Gr */ + { '1', NOCAPS, '1', '!', WCH_NONE, 0x00a6 }, // 1!| + { '2', NOCAPS, '2', '"', WCH_NONE, '@' }, // 2"@ + { '3', NOCAPS, '3', 0x00B7, WCH_NONE, '#' }, // 3·# + { '6', NOCAPS, '6', '&', WCH_NONE, 0x00AC }, // 6&¬ + { 'E', CAPS, 'e', 'E', WCH_NONE, 0x20AC }, // eE? + { VK_OEM_PLUS, NOCAPS, '+', '*', WCH_NONE, 0x005d }, // +*] + { VK_OEM_2, NOCAPS, 0x00e7, 0x00c7, WCH_NONE, '}' }, // çÇ} + + { VK_OEM_7, NOCAPS, WCH_DEAD, WCH_DEAD, WCH_NONE, '{' }, // ´¨{ + { VK_EMPTY, NOCAPS, 0xB4, 0xA8, WCH_NONE, WCH_NONE }, // ´¨{ + + { VK_OEM_1, NOCAPS, WCH_DEAD, WCH_DEAD, WCH_NONE, 0x5B }, // `^[ + { VK_EMPTY, NOCAPS, 0x60, 0x5e, WCH_NONE, WCH_NONE }, // `^[ + + { VK_OEM_5, NOCAPS, 0x00BA, 0x00AA, WCH_NONE, 0x005c }, // çÇ} + { 0, 0 } +}; + + + +ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { + { VK_NUMPAD0, 0, '0' }, + { VK_NUMPAD1, 0, '1' }, + { VK_NUMPAD2, 0, '2' }, + { VK_NUMPAD3, 0, '3' }, + { VK_NUMPAD4, 0, '4' }, + { VK_NUMPAD5, 0, '5' }, + { VK_NUMPAD6, 0, '6' }, + { VK_NUMPAD7, 0, '7' }, + { VK_NUMPAD8, 0, '8' }, + { VK_NUMPAD9, 0, '9' }, + { VK_DECIMAL, 0, '.' }, + { VK_BACK, 0, '\010' }, + { 0,0 } +}; + + +#define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) } + + +ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[] = { + vk_master(1,keypad_numbers), + vk_master(2,key_to_chars_2mod), + vk_master(3,key_to_chars_3mod), + vk_master(4,key_to_chars_4mod), + { 0,0,0 } +}; + +#define DEADTRANS(ch, accent, comp, flags) MAKELONG(ch, accent), comp, flags //no funciona +ROSDATA DEADKEY deadkey[] = +{ + //*´* + { DEADTRANS(L'a', 0xb4, 0xE1, 0x00) }, // letra a con ´ + { DEADTRANS(L'A', 0xb4, 0xC1, 0x00) }, // letra A con ´ + { DEADTRANS(L'e', 0xb4, 0xE9, 0x00) }, // letra e con ´ + { DEADTRANS(L'E', 0xb4, 0xC9, 0x00) }, // letra E con ´ + { DEADTRANS(L'i', 0xb4, 0xED, 0x00) }, // letra i con ´ + { DEADTRANS(L'I', 0xb4, 0xCD, 0x00) }, // letra I con ´ + { DEADTRANS(L'o', 0xb4, 0xF3, 0x00) }, // letra o con ´ + { DEADTRANS(L'O', 0xb4, 0xD3, 0x00) }, // letra O con ´ + { DEADTRANS(L'u', 0xb4, 0xFA, 0x00) }, // letra u con ´ + { DEADTRANS(L'U', 0xb4, 0xDA, 0x00) }, // letra U con ´ + //*`* + { DEADTRANS(L'a', 0x60, 0xE0, 0x00) }, // letra a con ` + { DEADTRANS(L'A', 0x60, 0xC0, 0x00) }, // letra A con ` + { DEADTRANS(L'e', 0x60, 0xE8, 0x00) }, // letra e con ` + { DEADTRANS(L'E', 0x60, 0xC8, 0x00) }, // letra E con ` + { DEADTRANS(L'i', 0x60, 0xEC, 0x00) }, // letra i con ` + { DEADTRANS(L'I', 0x60, 0xCC, 0x00) }, // letra I con ` + { DEADTRANS(L'o', 0x60, 0xF2, 0x00) }, // letra o con ` + { DEADTRANS(L'O', 0x60, 0xD2, 0x00) }, // letra O con ` + { DEADTRANS(L'u', 0x60, 0xF9, 0x00) }, // letra u con ` + { DEADTRANS(L'U', 0x60, 0xD9, 0x00) }, // letra U con ` + //*^* + { DEADTRANS(L'a', 0x5E, 0xE2, 0x00) }, // letra a con ^ + { DEADTRANS(L'A', 0x5E, 0xC2, 0x00) }, // letra A con ^ + { DEADTRANS(L'e', 0x5E, 0xEA, 0x00) }, // letra e con ^ + { DEADTRANS(L'E', 0x5E, 0xCA, 0x00) }, // letra E con ^ + { DEADTRANS(L'i', 0x5E, 0xEE, 0x00) }, // letra i con ^ + { DEADTRANS(L'I', 0x5E, 0xCE, 0x00) }, // letra I con ^ + { DEADTRANS(L'o', 0x5E, 0xF4, 0x00) }, // letra o con ^ + { DEADTRANS(L'O', 0x5E, 0xD4, 0x00) }, // letra O con ^ + { DEADTRANS(L'u', 0x5E, 0xFB, 0x00) }, // letra u con ^ + { DEADTRANS(L'U', 0x5E, 0xDB, 0x00) }, // letra U con ^ + //*¨* + { DEADTRANS(L'a', 0xA8, 0xE4, 0x00) }, // letra a con ¨ + { DEADTRANS(L'A', 0xA8, 0xC4, 0x00) }, // letra A con ¨ + { DEADTRANS(L'e', 0xA8, 0xEB, 0x00) }, // letra e con ¨ + { DEADTRANS(L'E', 0xA8, 0xCB, 0x00) }, // letra E con ¨ + { DEADTRANS(L'i', 0xA8, 0xEF, 0x00) }, // letra i con ¨ + { DEADTRANS(L'I', 0xA8, 0xCF, 0x00) }, // letra I con ¨ + { DEADTRANS(L'o', 0xA8, 0xF6, 0x00) }, // letra o con ¨ + { DEADTRANS(L'O', 0xA8, 0xD6, 0x00) }, // letra O con ¨ + { DEADTRANS(L'u', 0xA8, 0xFC, 0x00) }, // letra u con ¨ + { DEADTRANS(L'U', 0xA8, 0xDC, 0x00) }, // letra U con ¨ + { 0, 0, 0} +}; + +ROSDATA VSC_LPWSTR key_names[] = { + { 0x00, L"" }, + { 0x01, L"Escape" }, + { 0x0e, L"Borrar" }, + { 0x0f, L"Tabulador" }, + { 0x1c, L"Intro" }, + { 0x1d, L"Ctrl" }, + { 0x2a, L"Shift" }, + { 0x36, L"Shift derecho" }, + { 0x37, L"* numerico" }, + { 0x38, L"Alt" }, + { 0x39, L"Espacio" }, + { 0x3a, L"Bloqueo mayusculas" }, + { 0x3b, L"F1" }, + { 0x3c, L"F2" }, + { 0x3d, L"F3" }, + { 0x3e, L"F4" }, + { 0x3f, L"F5" }, + { 0x40, L"F6" }, + { 0x41, L"F7" }, + { 0x42, L"F8" }, + { 0x43, L"F9" }, + { 0x44, L"F10" }, + { 0x45, L"Pausa" }, + { 0x46, L"Bloqueo de scroll" }, + { 0x47, L"Num 7" }, + { 0x48, L"Num 8" }, + { 0x49, L"Num 9" }, + { 0x4a, L"Num -" }, + { 0x4b, L"Num 4" }, + { 0x4c, L"Num 5" }, + { 0x4d, L"Num 6" }, + { 0x4e, L"Num +" }, + { 0x4f, L"Num 1" }, + { 0x50, L"Num 2" }, + { 0x51, L"Num 3" }, + { 0x52, L"Num 0" }, + { 0x53, L"Borrardo numerico" }, + { 0x54, L"Peticion de sistema" }, + { 0x57, L"F11" }, + { 0x58, L"F12" }, + { 0x7c, L"F13" }, + { 0x7d, L"F14" }, + { 0x7e, L"F15" }, + { 0x7f, L"F16" }, + { 0x80, L"F17" }, + { 0x81, L"F18" }, + { 0x82, L"F19" }, + { 0x83, L"F20" }, + { 0x84, L"F21" }, + { 0x85, L"F22" }, + { 0x86, L"F23" }, + { 0x87, L"F24" }, + { 0, NULL }, +}; + +ROSDATA VSC_LPWSTR extended_key_names[] = { + { 0x1c, L"Intro numerico" }, + { 0x1d, L"Ctrl derecho" }, + { 0x35, L"/ numerica" }, + { 0x37, L"Imprimir pantalla" }, + { 0x38, L"Alt derecho" }, + { 0x45, L"Bloqueo numerico" }, + { 0x46, L"Interrumpir" }, + { 0x47, L"Inicio" }, + { 0x48, L"Arriba" }, + { 0x49, L"Subir pagina" }, + { 0x4b, L"Izquierda" }, + { 0x4c, L"Centrar" }, + { 0x4d, L"Derecha" }, + { 0x4f, L"Fin" }, + { 0x50, L"Abajo" }, + { 0x51, L"Bajar pagina" }, + { 0x52, L"Insertar" }, + { 0x53, L"Borrar" }, + { 0x54, L"<ReactOS>" }, + { 0x55, L"Ayuda" }, + { 0x5b, L"Windows izquierda" }, + { 0x5c, L"Windows derecha" }, + { 0, NULL }, +}; + +ROSDATA DEADKEY_LPWSTR dead_key_names[] = { + L"\x00b4" L"Agudo", + L"\x0060" L"Grave", + L"\x005e" L"Circunflejo", + L"\x00A8" L"Dieresis", + NULL +}; + + +/* Finally, the master table */ +ROSDATA KBDTABLES keyboard_layout_table = { + + /* modifier assignments */ + (PMODIFIERS)&modifier_bits, + + /* character from vk tables */ + vk_to_wchar_master_table, + + /* diacritical marks -- currently implemented by wine code */ + /* Spanish have severals */ + deadkey, + + /* Key names */ + (VSC_LPWSTR *)key_names, + (VSC_LPWSTR *)extended_key_names, + NULL, + /* Dead key names */ + + /* scan code to virtual key maps */ + scancode_to_vk, + sizeof(scancode_to_vk) / sizeof(scancode_to_vk[0]), + extcode0_to_vk, + extcode1_to_vk, + + MAKELONG(0,1), /* Version 1.0 */ + + /* Ligatures -- Spanish doesn't have any */ + 0, + 0, + NULL +}; + + +PKBDTABLES STDCALL KbdLayerDescriptor() { + return &keyboard_layout_table; +}
19 years, 10 months
1
0
0
0
[hbirr] 12883: - Fixed the initialization of critical section objects.
by hbirr@svn.reactos.com
- Fixed the initialization of critical section objects. Modified: trunk/reactos/lib/ntdll/rtl/critical.c _____ Modified: trunk/reactos/lib/ntdll/rtl/critical.c --- trunk/reactos/lib/ntdll/rtl/critical.c 2005-01-08 06:36:03 UTC (rev 12882) +++ trunk/reactos/lib/ntdll/rtl/critical.c 2005-01-08 09:34:37 UTC (rev 12883) @@ -216,6 +216,7 @@ CriticalSection->RecursionCount = 0; CriticalSection->OwningThread = 0; CriticalSection->SpinCount = (NtCurrentPeb()->NumberOfProcessors > 1) ? SpinCount : 0; + CriticalSection->LockSemaphore = 0; /* Allocate the Debug Data */ CritcalSectionDebugData = RtlpAllocateDebugInfo(); @@ -479,9 +480,10 @@ if (!NT_SUCCESS(Status)) { /* We've failed */ - DPRINT1("Signaling Failed for: %x, %x\n", + DPRINT1("Signaling Failed for: %x, %x, %x\n", CriticalSection, - CriticalSection->LockSemaphore); + CriticalSection->LockSemaphore, + Status); RtlRaiseStatus(Status); } }
19 years, 10 months
1
0
0
0
[royce] 12882: use ROS_TEMPORARY and ROS_INTERMEDIATE to allow builder to override locations for created files. Fix name conflict with temporary files
by royce@svn.reactos.com
use ROS_TEMPORARY and ROS_INTERMEDIATE to allow builder to override locations for created files. Fix name conflict with temporary files Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-08 05:22:02 UTC (rev 12881) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-08 06:36:03 UTC (rev 12882) @@ -78,7 +78,7 @@ Module& module = *ProjectNode.modules[i]; fprintf ( fMakefile, " %s", - module.GetPath ().c_str () ); + FixupTargetFilename(module.GetPath ()).c_str () ); } fprintf ( fMakefile, "\n\t\n\n" ); } @@ -105,3 +105,9 @@ moduleHandlers.push_back ( new MingwKernelModuleHandler ( fMakefile ) ); moduleHandlers.push_back ( new MingwStaticLibraryModuleHandler ( fMakefile ) ); } + +string +FixupTargetFilename ( const string& targetFilename ) +{ + return string("$(ROS_INTERMEDIATE)") + targetFilename; +} _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h 2005-01-08 05:22:02 UTC (rev 12881) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h 2005-01-08 06:36:03 UTC (rev 12882) @@ -40,4 +40,6 @@ FILE* fMakefile; }; +std::string FixupTargetFilename ( const std::string& targetFilename ); + #endif /* MINGW_H */ _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-08 05:22:02 UTC (rev 12881) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-08 06:36:03 UTC (rev 12882) @@ -33,7 +33,7 @@ string MingwModuleHandler::GetModuleArchiveFilename ( const Module& module ) const { - return ReplaceExtension ( module.GetPath ().c_str (), + return ReplaceExtension ( FixupTargetFilename(module.GetPath ()).c_str (), ".a" ); } @@ -50,7 +50,7 @@ dependencies += " "; const Module* importedModule = module.project.LocateModule ( module.libraries[i]->name ); assert ( importedModule != NULL ); - dependencies += importedModule->GetPath ().c_str (); + dependencies += FixupTargetFilename(importedModule->GetPath ()).c_str (); } return dependencies; } @@ -74,8 +74,9 @@ string MingwModuleHandler::GetObjectFilename ( const string& sourceFilename ) const { - return ReplaceExtension ( sourceFilename, - ".o" ); + return + FixupTargetFilename ( ReplaceExtension ( sourceFilename, + ".o" ) ); } string @@ -242,39 +243,45 @@ void MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module ) { + static string ros_junk ( "$(ROS_TEMPORARY)" ); + //static string ros_output ( "$(ROS_INTERMEDIATE)" ); + string target ( FixupTargetFilename(module.GetPath()) ); string workingDirectory = GetWorkingDirectory ( ); string archiveFilename = GetModuleArchiveFilename ( module ); string importLibraryDependencies = GetImportLibraryDependencies ( module ); + string base_tmp = ros_junk + module.name + ".base.tmp"; + string junk_tmp = ros_junk + module.name + ".junk.tmp"; + string temp_exp = ros_junk + module.name + ".temp.exp"; fprintf ( fMakefile, "%s: %s %s\n", - module.GetPath ().c_str (), + target.c_str (), archiveFilename.c_str (), importLibraryDependencies.c_str () ); fprintf ( fMakefile, - "\t${gcc} -Wl,--base-file,%s" SSEP "base.tmp -o %s" SSEP "junk.tmp %s %s\n", - workingDirectory.c_str (), - workingDirectory.c_str (), + "\t${gcc} -Wl,--base-file,%s -o %s %s %s\n", + base_tmp.c_str (), + junk_tmp.c_str (), archiveFilename.c_str (), importLibraryDependencies.c_str () ); fprintf ( fMakefile, - "\t${rm} %s" SSEP "junk.tmp\n", - workingDirectory.c_str () ); + "\t${rm} %s\n", + junk_tmp.c_str () ); fprintf ( fMakefile, - "\t${dlltool} --dllname %s --base-file %s" SSEP "base.tmp --output-exp %s" SSEP "temp.exp --kill-at\n", - module.GetPath ().c_str (), - workingDirectory.c_str (), - workingDirectory.c_str ()); + "\t${dlltool} --dllname %s --base-file %s --output-exp %s --kill-at\n", + target.c_str (), + base_tmp.c_str (), + temp_exp.c_str ()); fprintf ( fMakefile, - "\t${rm} %s" SSEP "base.tmp\n", - workingDirectory.c_str () ); + "\t${rm} %s\n", + base_tmp.c_str () ); fprintf ( fMakefile, - "\t${ld} -Wl,%s" SSEP "temp.exp -o %s %s %s\n", - workingDirectory.c_str (), - module.GetPath ().c_str (), + "\t${ld} -Wl,%s -o %s %s %s\n", + temp_exp.c_str (), + target.c_str (), archiveFilename.c_str (), importLibraryDependencies.c_str () ); fprintf ( fMakefile, - "\t${rm} %s" SSEP "temp.exp\n", - workingDirectory.c_str () ); + "\t${rm} %s\n", + temp_exp.c_str () ); GenerateArchiveTarget ( module ); GenerateObjectFileTargets ( module ); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-08 05:22:02 UTC (rev 12881) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-08 06:36:03 UTC (rev 12882) @@ -16,6 +16,7 @@ std::string GetModuleArchiveFilename ( const Module& module ) const; std::string GetImportLibraryDependencies ( const Module& module ) const; std::string GetSourceFilenames ( const Module& module ) const; + std::string GetObjectFilename ( const std::string& sourceFilename ) const; std::string GetObjectFilenames ( const Module& module ) const; void GenerateObjectFileTargets ( const Module& module ) const;
19 years, 10 months
1
0
0
0
[royce] 12881: don't allow duplicate module names
by royce@svn.reactos.com
don't allow duplicate module names Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-08 04:33:01 UTC (rev 12880) +++ branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-08 05:22:02 UTC (rev 12881) @@ -77,7 +77,14 @@ string subpath(path); if ( e.name == "module" ) { - modules.push_back ( new Module ( *this, e, path ) ); + Module* module = new Module ( *this, e, path ); + if ( LocateModule ( module->name ) ) + throw InvalidBuildFileException ( + node->location, + "module name conflict: '%s' (originally defined at %s)", + module->name.c_str(), + module->node.location.c_str() ); + modules.push_back ( module ); return; // defer processing until later } else if ( e.name == "directory" )
19 years, 10 months
1
0
0
0
[royce] 12880: <include> now has attribute 'base' which allows to specify subdirectory of another module
by royce@svn.reactos.com
<include> now has attribute 'base' which allows to specify subdirectory of another module Modified: branches/xmlbuildsystem/reactos/ReactOS.xml Modified: branches/xmlbuildsystem/reactos/lib/kjs/module.xml Modified: branches/xmlbuildsystem/reactos/ntoskrnl/module.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/include.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp _____ Modified: branches/xmlbuildsystem/reactos/ReactOS.xml --- branches/xmlbuildsystem/reactos/ReactOS.xml 2005-01-08 03:37:32 UTC (rev 12879) +++ branches/xmlbuildsystem/reactos/ReactOS.xml 2005-01-08 04:33:01 UTC (rev 12880) @@ -1,4 +1,6 @@ -<project name="ReactOS" makefile="Makefile.auto"> +<?xml version="1.0"?> +<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> +<project name="ReactOS" makefile="Makefile.auto" xmlns:xi="
http://www.w3.org/2001/XInclude
"> <define name="_M_IX86"></define> <include>include</include> <include>w32api/include</include> _____ Modified: branches/xmlbuildsystem/reactos/lib/kjs/module.xml --- branches/xmlbuildsystem/reactos/lib/kjs/module.xml 2005-01-08 03:37:32 UTC (rev 12879) +++ branches/xmlbuildsystem/reactos/lib/kjs/module.xml 2005-01-08 04:33:01 UTC (rev 12880) @@ -1,7 +1,7 @@ <module name="kjs" type="staticlibrary"> - <include>.</include> - <include>src</include> - <include>include</include> + <include base="kjs">.</include> + <include base="kjs">src</include> + <include base="kjs">include</include> <directory name="ksrc"> <file>setjmp.S</file> <file>longjmp.S</file> _____ Modified: branches/xmlbuildsystem/reactos/ntoskrnl/module.xml --- branches/xmlbuildsystem/reactos/ntoskrnl/module.xml 2005-01-08 03:37:32 UTC (rev 12879) +++ branches/xmlbuildsystem/reactos/ntoskrnl/module.xml 2005-01-08 04:33:01 UTC (rev 12880) @@ -4,8 +4,7 @@ <define name="__NTOSKRNL__" /> <define name="__3GB__" /> <include>.</include> - <include>./include</include> - <include>../lib/kjs/include</include> + <include base="kjs">./include</include> <library>kjs</library> <directory name="cc"> <file>cacheman.c</file> _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-08 03:37:32 UTC (rev 12879) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-08 04:33:01 UTC (rev 12880) @@ -140,8 +140,7 @@ } string -MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const string& basePath, - const vector<Include*>& includes ) const +MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector<Include*>& includes ) const { string parameters; for (size_t i = 0; i < includes.size (); i++) @@ -149,9 +148,7 @@ Include& include = *includes[i]; if (parameters.length () > 0) parameters += " "; - parameters += "-I"; - parameters += ConcatenatePaths ( basePath, - include.directory ); + parameters += "-I" + include.directory; } return parameters; } @@ -159,10 +156,8 @@ string MingwModuleHandler::GenerateGccIncludeParameters ( const Module& module ) const { - string parameters = GenerateGccIncludeParametersFromVector ( ".", - module.project.includes ); - string s = GenerateGccIncludeParametersFromVector ( module.path, - module.includes ); + string parameters = GenerateGccIncludeParametersFromVector ( module.project.includes ); + string s = GenerateGccIncludeParametersFromVector ( module.includes ); if (s.length () > 0) { parameters += " "; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-08 03:37:32 UTC (rev 12879) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-08 04:33:01 UTC (rev 12880) @@ -26,8 +26,7 @@ const std::string& path2 ) const; std::string GenerateGccDefineParametersFromVector ( const std::vector<Define*>& defines ) const; std::string GenerateGccDefineParameters ( const Module& module ) const; - std::string GenerateGccIncludeParametersFromVector ( const std::string& basePath, - const std::vector<Include*>& includes ) const; + std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes ) const; std::string GenerateGccIncludeParameters ( const Module& module ) const; std::string GenerateGccParameters ( const Module& module ) const; }; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp 2005-01-08 03:37:32 UTC (rev 12879) +++ branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp 2005-01-08 04:33:01 UTC (rev 12880) @@ -10,7 +10,8 @@ const XMLElement& includeNode ) : project(project_), module(NULL), - node(includeNode) + node(includeNode), + base(NULL) { Initialize(); } @@ -20,7 +21,8 @@ const XMLElement& includeNode ) : project(project_), module(module_), - node(includeNode) + node(includeNode), + base(NULL) { Initialize(); } @@ -32,10 +34,27 @@ void Include::Initialize() { - directory = FixSeparator ( node.value ); } void Include::ProcessXML() { + const XMLAttribute* att; + att = node.GetAttribute("base",false); + if ( att ) + { + if ( !module ) + throw InvalidBuildFileException ( + node.location, + "'base' attribute illegal from global <include>" ); + base = project.LocateModule ( att->value ); + if ( !base ) + throw InvalidBuildFileException ( + node.location, + "<include> attribute 'base' references non-existant module '%s'", + att->value.c_str() ); + directory = FixSeparator ( base->GetBasePath() + "/" + node.value ); + } + else + directory = FixSeparator ( node.value ); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-08 03:37:32 UTC (rev 12879) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-08 04:33:01 UTC (rev 12880) @@ -62,8 +62,14 @@ size_t i; for ( i = 0; i < node.subElements.size(); i++ ) ProcessXMLSubElement ( *node.subElements[i], path ); + for ( i = 0; i < files.size(); i++ ) + files[i]->ProcessXML(); for ( i = 0; i < libraries.size(); i++ ) libraries[i]->ProcessXML(); + for ( i = 0; i < includes.size(); i++ ) + includes[i]->ProcessXML(); + for ( i = 0; i < defines.size(); i++ ) + defines[i]->ProcessXML(); } void @@ -137,9 +143,15 @@ } string +Module::GetBasePath() const +{ + return path; +} + +string Module::GetPath () const { - return FixSeparator (path) + CSEP + name + extension; + return path + CSEP + name + extension; } @@ -148,6 +160,10 @@ { } +void +File::ProcessXML() +{ +} Library::Library ( const XMLElement& _node, const Module& _module, _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-08 03:37:32 UTC (rev 12879) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-08 04:33:01 UTC (rev 12880) @@ -79,6 +79,7 @@ const std::string& modulePath ); ~Module (); ModuleType GetModuleType (const XMLAttribute& attribute ); + std::string GetBasePath() const; std::string GetPath () const; void ProcessXML(); private: @@ -95,6 +96,7 @@ const Module* module; const XMLElement& node; std::string directory; + const Module* base; Include ( const Project& project, const XMLElement& includeNode ); @@ -135,6 +137,8 @@ std::string name; File ( const std::string& _name ); + + void ProcessXML(); }; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/include.xml --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/include.xml 2005-01-08 03:37:32 UTC (rev 12879) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/include.xml 2005-01-08 04:33:01 UTC (rev 12880) @@ -3,7 +3,12 @@ <include>include1</include> <directory name="dir1"> <module name="module1" type="buildtool"> - <include>include2</include> + <include>include2</include> </module> </directory> + <directory name="dir2"> + <module name="module2" type="buildtool"> + <include base="module1">include3</include> + </module> + </directory> </project> _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp 2005-01-08 03:37:32 UTC (rev 12879) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp 2005-01-08 04:33:01 UTC (rev 12880) @@ -10,10 +10,15 @@ Include& include1 = *project.includes[0]; ARE_EQUAL("include1", include1.directory); - ARE_EQUAL(1, project.modules.size()); + ARE_EQUAL(2, project.modules.size()); Module& module1 = *project.modules[0]; + Module& module2 = *project.modules[1]; ARE_EQUAL(1, module1.includes.size()); Include& include2 = *module1.includes[0]; ARE_EQUAL("include2", include2.directory); + + ARE_EQUAL(1, module2.includes.size()); + Include& include3 = *module2.includes[0]; + ARE_EQUAL(FixSeparator("./dir1/include3"), include3.directory); }
19 years, 10 months
1
0
0
0
[royce] 12879: xml nodes now store the location they were parsed from; invalidbuildexceptions now required a location of the error; don't allow modules to process xml until all modules are created; don't allow libraries, defines, includes, etc to process xml until all modules have processed; don't allow module to link against itself or a non-existant module; don't allow library to specify non-existant module;
by royce@svn.reactos.com
xml nodes now store the location they were parsed from; invalidbuildexceptions now required a location of the error; don't allow modules to process xml until all modules are created; don't allow libraries, defines, includes, etc to process xml until all modules have processed; don't allow module to link against itself or a non-existant module; don't allow library to specify non-existant module; Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/define.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/exception.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/exception.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp 2005-01-08 02:33:09 UTC (rev 12878) +++ branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp 2005-01-08 03:37:32 UTC (rev 12879) @@ -306,8 +306,9 @@ { } -XMLElement::XMLElement() - : parentElement(NULL) +XMLElement::XMLElement ( const string& location_ ) + : location(location_), + parentElement(NULL) { } @@ -476,7 +477,7 @@ return NULL; } - XMLElement* e = new XMLElement; + XMLElement* e = new XMLElement ( f.Location() ); bool bNeedEnd = e->Parse ( token, end_tag ); if ( e->name == "xi:include" ) _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.h --- branches/xmlbuildsystem/reactos/tools/rbuild/XML.h 2005-01-08 02:33:09 UTC (rev 12878) +++ branches/xmlbuildsystem/reactos/tools/rbuild/XML.h 2005-01-08 03:37:32 UTC (rev 12879) @@ -58,13 +58,14 @@ class XMLElement { public: + std::string location; std::string name; std::vector<XMLAttribute*> attributes; XMLElement* parentElement; std::vector<XMLElement*> subElements; std::string value; - XMLElement(); + XMLElement ( const std::string& location_ ); ~XMLElement(); bool Parse(const std::string& token, bool& end_tag); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-08 02:33:09 UTC (rev 12878) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-08 03:37:32 UTC (rev 12879) @@ -48,7 +48,7 @@ { if ( dependencies.size () > 0 ) dependencies += " "; - Module* importedModule = module.project->LocateModule ( module.libraries[i]->name ); + const Module* importedModule = module.project.LocateModule ( module.libraries[i]->name ); assert ( importedModule != NULL ); dependencies += importedModule->GetPath ().c_str (); } @@ -117,7 +117,7 @@ string MingwModuleHandler::GenerateGccDefineParameters ( const Module& module ) const { - string parameters = GenerateGccDefineParametersFromVector ( module.project->defines ); + string parameters = GenerateGccDefineParametersFromVector ( module.project.defines ); string s = GenerateGccDefineParametersFromVector ( module.defines ); if (s.length () > 0) { @@ -160,7 +160,7 @@ MingwModuleHandler::GenerateGccIncludeParameters ( const Module& module ) const { string parameters = GenerateGccIncludeParametersFromVector ( ".", - module.project->includes ); + module.project.includes ); string s = GenerateGccIncludeParametersFromVector ( module.path, module.includes ); if (s.length () > 0) _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/define.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/define.cpp 2005-01-08 02:33:09 UTC (rev 12878) +++ branches/xmlbuildsystem/reactos/tools/rbuild/define.cpp 2005-01-08 03:37:32 UTC (rev 12879) @@ -6,23 +6,23 @@ using std::string; using std::vector; -Define::Define ( Project* project, +Define::Define ( const Project& project, const XMLElement& defineNode ) : project(project), module(NULL), node(defineNode) { - Initialize (defineNode); + Initialize(); } -Define::Define ( Project* project, - Module* module, +Define::Define ( const Project& project, + const Module* module, const XMLElement& defineNode ) : project(project), module(module), node(defineNode) { - Initialize (defineNode); + Initialize(); } Define::~Define () @@ -30,15 +30,15 @@ } void -Define::Initialize ( const XMLElement& defineNode ) +Define::Initialize() { - const XMLAttribute* att = defineNode.GetAttribute ( "name", true ); + const XMLAttribute* att = node.GetAttribute ( "name", true ); assert(att); name = att->value; - value = defineNode.value; + value = node.value; } void -Define::ProcessXML ( const XMLElement& e ) +Define::ProcessXML() { } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/exception.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/exception.cpp 2005-01-08 02:33:09 UTC (rev 12878) +++ branches/xmlbuildsystem/reactos/tools/rbuild/exception.cpp 2005-01-08 03:37:32 UTC (rev 12879) @@ -58,14 +58,14 @@ } -InvalidBuildFileException::InvalidBuildFileException ( const char* message, +InvalidBuildFileException::InvalidBuildFileException ( const string& location, + const char* message, ...) { va_list args; va_start ( args, message ); - SetMessage ( message, - args ); + SetLocationMessage ( location, message, args ); va_end ( args ); } @@ -73,6 +73,13 @@ { } +void +InvalidBuildFileException::SetLocationMessage ( const std::string& location, + const char* message, + va_list args ) +{ + Message = location + ": " + ssvprintf ( message, args ); +} XMLSyntaxErrorException::XMLSyntaxErrorException ( const string& location, const char* message, @@ -81,7 +88,7 @@ va_list args; va_start ( args, message ); - Message = location + ": " + ssvprintf ( message, args ); + SetLocationMessage ( location, message, args ); va_end ( args ); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/exception.h --- branches/xmlbuildsystem/reactos/tools/rbuild/exception.h 2005-01-08 02:33:09 UTC (rev 12878) +++ branches/xmlbuildsystem/reactos/tools/rbuild/exception.h 2005-01-08 03:37:32 UTC (rev 12879) @@ -40,12 +40,15 @@ std::string Filename; }; - class InvalidBuildFileException : public Exception { public: - InvalidBuildFileException ( const char* message, + InvalidBuildFileException ( const std::string& location, + const char* message, ...); + void SetLocationMessage ( const std::string& location, + const char* message, + va_list args ); protected: InvalidBuildFileException (); }; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp 2005-01-08 02:33:09 UTC (rev 12878) +++ branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp 2005-01-08 03:37:32 UTC (rev 12879) @@ -6,21 +6,23 @@ using std::string; using std::vector; -Include::Include ( Project* project, +Include::Include ( const Project& project_, const XMLElement& includeNode ) - : project(project), + : project(project_), + module(NULL), node(includeNode) { - Initialize ( includeNode ); + Initialize(); } -Include::Include ( Project* project, - Module* module, +Include::Include ( const Project& project_, + const Module* module_, const XMLElement& includeNode ) - : project(project), + : project(project_), + module(module_), node(includeNode) { - Initialize ( includeNode ); + Initialize(); } Include::~Include () @@ -28,12 +30,12 @@ } void -Include::Initialize ( const XMLElement& includeNode ) +Include::Initialize() { - directory = FixSeparator ( includeNode.value ); + directory = FixSeparator ( node.value ); } void -Include::ProcessXML ( const XMLElement& e ) +Include::ProcessXML() { } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-08 02:33:09 UTC (rev 12878) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-08 03:37:32 UTC (rev 12879) @@ -21,14 +21,17 @@ return s2; } -Module::Module ( Project* project, +Module::Module ( const Project& project, const XMLElement& moduleNode, const string& modulePath ) : project(project), node(moduleNode) { - path = FixSeparator ( modulePath ); + if ( node.name != "module" ) + throw Exception ( "internal tool error: Module created with non-<module> node" ); + path = FixSeparator ( modulePath ); + const XMLAttribute* att = moduleNode.GetAttribute ( "name", true ); assert(att); name = att->value; @@ -54,17 +57,30 @@ } void -Module::ProcessXML ( const XMLElement& e, - const string& path ) +Module::ProcessXML() { + size_t i; + for ( i = 0; i < node.subElements.size(); i++ ) + ProcessXMLSubElement ( *node.subElements[i], path ); + for ( i = 0; i < libraries.size(); i++ ) + libraries[i]->ProcessXML(); +} + +void +Module::ProcessXMLSubElement ( const XMLElement& e, + const string& path ) +{ + bool subs_invalid = false; string subpath ( path ); if ( e.name == "file" && e.value.size () ) { files.push_back ( new File ( FixSeparator ( path + CSEP + e.value ) ) ); + subs_invalid = true; } else if ( e.name == "library" && e.value.size () ) { - libraries.push_back ( new Library ( e.value ) ); + libraries.push_back ( new Library ( e, *this, e.value ) ); + subs_invalid = true; } else if ( e.name == "directory" ) { @@ -74,18 +90,21 @@ } else if ( e.name == "include" ) { - Include* include = new Include ( project, this, e ); - includes.push_back ( include ); - include->ProcessXML ( e ); + includes.push_back ( new Include ( project, this, e ) ); + subs_invalid = true; } else if ( e.name == "define" ) { - Define* define = new Define ( project, this, e ); - defines.push_back ( define ); - define->ProcessXML ( e ); + defines.push_back ( new Define ( project, this, e ) ); + subs_invalid = true; } + if ( subs_invalid && e.subElements.size() ) + throw InvalidBuildFileException ( + e.location, + "<%s> cannot have sub-elements", + e.name.c_str() ); for ( size_t i = 0; i < e.subElements.size (); i++ ) - ProcessXML ( *e.subElements[i], subpath ); + ProcessXMLSubElement ( *e.subElements[i], subpath ); } ModuleType @@ -102,7 +121,7 @@ } string -Module::GetDefaultModuleExtension () +Module::GetDefaultModuleExtension () const { switch (type) { @@ -130,7 +149,27 @@ } -Library::Library ( const string& _name ) - : name(_name) +Library::Library ( const XMLElement& _node, + const Module& _module, + const string& _name ) + : node(_node), + module(_module), + name(_name) { + if ( module.name == name ) + throw InvalidBuildFileException ( + node.location, + "module '%s' cannot link against itself", + name.c_str() ); } + +void +Library::ProcessXML() +{ + if ( !module.project.LocateModule ( name ) ) + throw InvalidBuildFileException ( + node.location, + "module '%s' trying to link against non-existant module '%s'", + module.name.c_str(), + name.c_str() ); +} _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-08 02:33:09 UTC (rev 12878) +++ branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-08 03:37:32 UTC (rev 12879) @@ -22,7 +22,7 @@ { for ( size_t i = 0; i < modules.size (); i++ ) delete modules[i]; - delete head; + delete node; } void @@ -32,38 +32,54 @@ do { - head = XMLParse ( xmlfile, path ); - if ( !head ) - throw InvalidBuildFileException ( "Document contains no 'project' tag." ); - } while ( head->name != "project" ); + node = XMLParse ( xmlfile, path ); + if ( !node ) + throw InvalidBuildFileException ( + node->location, + "Document contains no 'project' tag." ); + } while ( node->name != "project" ); - this->ProcessXML ( *head, "." ); + this->ProcessXML ( "." ); } void -Project::ProcessXML ( const XMLElement& e, const string& path ) +Project::ProcessXML ( const string& path ) { const XMLAttribute *att; + if ( node->name != "project" ) + throw Exception ( "internal tool error: Project::ProcessXML() called with non-<project> node" ); + + att = node->GetAttribute ( "name", false ); + if ( !att ) + name = "Unnamed"; + else + name = att->value; + + att = node->GetAttribute ( "makefile", true ); + assert(att); + makefile = att->value; + + size_t i; + for ( i = 0; i < node->subElements.size(); i++ ) + ProcessXMLSubElement ( *node->subElements[i], path ); + for ( i = 0; i < modules.size(); i++ ) + modules[i]->ProcessXML(); + for ( i = 0; i < includes.size(); i++ ) + includes[i]->ProcessXML(); + for ( i = 0; i < defines.size(); i++ ) + defines[i]->ProcessXML(); +} + +void +Project::ProcessXMLSubElement ( const XMLElement& e, const string& path ) +{ + bool subs_invalid = false; string subpath(path); - if ( e.name == "project" ) + if ( e.name == "module" ) { - att = e.GetAttribute ( "name", false ); - if ( !att ) - name = "Unnamed"; - else - name = att->value; - - att = e.GetAttribute ( "makefile", true ); - assert(att); - makefile = att->value; + modules.push_back ( new Module ( *this, e, path ) ); + return; // defer processing until later } - else if ( e.name == "module" ) - { - Module* module = new Module ( this, e, path ); - modules.push_back ( module ); - module->ProcessXML ( e, path ); - return; - } else if ( e.name == "directory" ) { const XMLAttribute* att = e.GetAttribute ( "name", true ); @@ -72,22 +88,25 @@ } else if ( e.name == "include" ) { - Include* include = new Include ( this, e ); - includes.push_back ( include ); - include->ProcessXML ( e ); + includes.push_back ( new Include ( *this, e ) ); + subs_invalid = true; } else if ( e.name == "define" ) { - Define* define = new Define ( this, e ); - defines.push_back ( define ); - define->ProcessXML ( e ); + defines.push_back ( new Define ( *this, e ) ); + subs_invalid = true; } + if ( subs_invalid && e.subElements.size() ) + throw InvalidBuildFileException ( + e.location, + "<%s> cannot have sub-elements", + e.name.c_str() ); for ( size_t i = 0; i < e.subElements.size (); i++ ) - ProcessXML ( *e.subElements[i], subpath ); + ProcessXMLSubElement ( *e.subElements[i], subpath ); } Module* -Project::LocateModule ( string name ) +Project::LocateModule ( const string& name ) { for ( size_t i = 0; i < modules.size (); i++ ) { @@ -97,3 +116,15 @@ return NULL; } + +const Module* +Project::LocateModule ( const string& name ) const +{ + for ( size_t i = 0; i < modules.size (); i++ ) + { + if (modules[i]->name == name) + return modules[i]; + } + + return NULL; +} _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-08 02:33:09 UTC (rev 12878) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-08 03:37:32 UTC (rev 12879) @@ -40,13 +40,15 @@ Project (); Project ( const std::string& filename ); ~Project (); - void ProcessXML ( const XMLElement& e, - const std::string& path ); - Module* LocateModule ( std::string name ); + void ProcessXML ( const std::string& path ); + Module* LocateModule ( const std::string& name ); + const Module* LocateModule ( const std::string& name ) const; private: void ReadXml (); XMLFile xmlfile; - XMLElement* head; + XMLElement* node; + void ProcessXMLSubElement ( const XMLElement& e, + const std::string& path ); }; @@ -61,7 +63,7 @@ class Module { public: - Project* project; + const Project& project; const XMLElement& node; std::string name; std::string extension; @@ -72,56 +74,58 @@ std::vector<Include*> includes; std::vector<Define*> defines; - Module ( Project* project, + Module ( const Project& project, const XMLElement& moduleNode, const std::string& modulePath ); ~Module (); ModuleType GetModuleType (const XMLAttribute& attribute ); std::string GetPath () const; - void ProcessXML ( const XMLElement& e, const std::string& path ); + void ProcessXML(); private: - std::string GetDefaultModuleExtension (); + std::string GetDefaultModuleExtension () const; + void ProcessXMLSubElement ( const XMLElement& e, + const std::string& path ); }; class Include { public: - Project* project; - Module* module; + const Project& project; + const Module* module; const XMLElement& node; std::string directory; - Include ( Project* project, + Include ( const Project& project, const XMLElement& includeNode ); - Include ( Project* project, - Module* module, + Include ( const Project& project, + const Module* module, const XMLElement& includeNode ); ~Include (); - void ProcessXML ( const XMLElement& e ); + void ProcessXML(); private: - void Initialize ( const XMLElement& includeNode ); + void Initialize(); }; class Define { public: - Project* project; - Module* module; + const Project& project; + const Module* module; const XMLElement& node; std::string name; std::string value; - Define ( Project* project, + Define ( const Project& project, const XMLElement& defineNode ); - Define ( Project* project, - Module* module, + Define ( const Project& project, + const Module* module, const XMLElement& defineNode ); ~Define(); - void ProcessXML ( const XMLElement& e ); + void ProcessXML(); private: - void Initialize ( const XMLElement& defineNode ); + void Initialize(); }; @@ -137,9 +141,15 @@ class Library { public: + const XMLElement& node; + const Module& module; std::string name; - Library ( const std::string& _name ); + Library ( const XMLElement& _node, + const Module& _module, + const std::string& _name ); + + void ProcessXML(); }; extern std::string
19 years, 10 months
1
0
0
0
[royce] 12878: Don't pass objects ( particularly vectors ) by value unless absolutely necessary. Also applied some const-correctness
by royce@svn.reactos.com
Don't pass objects ( particularly vectors ) by value unless absolutely necessary. Also applied some const-correctness Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-08 00:25:48 UTC (rev 12877) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-08 02:33:09 UTC (rev 12878) @@ -100,7 +100,7 @@ } void -MingwBackend::GetModuleHandlers ( MingwModuleHandlerList& moduleHandlers ) +MingwBackend::GetModuleHandlers ( MingwModuleHandlerList& moduleHandlers ) const { moduleHandlers.push_back ( new MingwKernelModuleHandler ( fMakefile ) ); moduleHandlers.push_back ( new MingwStaticLibraryModuleHandler ( fMakefile ) ); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h 2005-01-08 00:25:48 UTC (rev 12877) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h 2005-01-08 02:33:09 UTC (rev 12878) @@ -7,6 +7,9 @@ class MingwModuleHandlerList : public std::vector<MingwModuleHandler*> { public: + MingwModuleHandlerList() + { + } ~MingwModuleHandlerList() { for ( size_t i = 0; i < size(); i++ ) @@ -14,6 +17,10 @@ delete (*this)[i]; } } +private: + // disable copy semantics + MingwModuleHandlerList ( const MingwModuleHandlerList& ); + MingwModuleHandlerList& operator = ( const MingwModuleHandlerList& ); }; @@ -24,7 +31,7 @@ virtual void Process (); private: void ProcessModule ( Module& module ); - void GetModuleHandlers ( MingwModuleHandlerList& moduleHandlers ); + void GetModuleHandlers ( MingwModuleHandlerList& moduleHandlers ) const; void CreateMakefile (); void CloseMakefile (); void GenerateHeader (); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-08 00:25:48 UTC (rev 12877) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-08 02:33:09 UTC (rev 12878) @@ -15,14 +15,14 @@ } string -MingwModuleHandler::GetWorkingDirectory () +MingwModuleHandler::GetWorkingDirectory () const { return "."; } string -MingwModuleHandler::ReplaceExtension ( string filename, - string newExtension ) +MingwModuleHandler::ReplaceExtension ( const string& filename, + const string& newExtension ) const { size_t index = filename.find_last_of ( '.' ); if (index != string::npos) @@ -31,14 +31,14 @@ } string -MingwModuleHandler::GetModuleArchiveFilename ( Module& module ) +MingwModuleHandler::GetModuleArchiveFilename ( const Module& module ) const { return ReplaceExtension ( module.GetPath ().c_str (), ".a" ); } string -MingwModuleHandler::GetImportLibraryDependencies ( Module& module ) +MingwModuleHandler::GetImportLibraryDependencies ( const Module& module ) const { if ( module.libraries.size () == 0 ) return ""; @@ -56,7 +56,7 @@ } string -MingwModuleHandler::GetSourceFilenames ( Module& module ) +MingwModuleHandler::GetSourceFilenames ( const Module& module ) const { if ( module.files.size () == 0 ) return ""; @@ -72,14 +72,14 @@ } string -MingwModuleHandler::GetObjectFilename ( string sourceFilename ) +MingwModuleHandler::GetObjectFilename ( const string& sourceFilename ) const { return ReplaceExtension ( sourceFilename, ".o" ); } string -MingwModuleHandler::GetObjectFilenames ( Module& module ) +MingwModuleHandler::GetObjectFilenames ( const Module& module ) const { if ( module.files.size () == 0 ) return ""; @@ -95,7 +95,7 @@ } string -MingwModuleHandler::GenerateGccDefineParametersFromVector ( vector<Define*> defines ) +MingwModuleHandler::GenerateGccDefineParametersFromVector ( const vector<Define*>& defines ) const { string parameters; for (size_t i = 0; i < defines.size (); i++) @@ -115,7 +115,7 @@ } string -MingwModuleHandler::GenerateGccDefineParameters ( Module& module ) +MingwModuleHandler::GenerateGccDefineParameters ( const Module& module ) const { string parameters = GenerateGccDefineParametersFromVector ( module.project->defines ); string s = GenerateGccDefineParametersFromVector ( module.defines ); @@ -128,8 +128,8 @@ } string -MingwModuleHandler::ConcatenatePaths ( string path1, - string path2 ) +MingwModuleHandler::ConcatenatePaths ( const string& path1, + const string& path2 ) const { if ( ( path1.length () == 0 ) || ( path1 == "." ) || ( path1 == "./" ) ) return path2; @@ -140,8 +140,8 @@ } string -MingwModuleHandler::GenerateGccIncludeParametersFromVector ( string basePath, - vector<Include*> includes ) +MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const string& basePath, + const vector<Include*>& includes ) const { string parameters; for (size_t i = 0; i < includes.size (); i++) @@ -157,7 +157,7 @@ } string -MingwModuleHandler::GenerateGccIncludeParameters ( Module& module ) +MingwModuleHandler::GenerateGccIncludeParameters ( const Module& module ) const { string parameters = GenerateGccIncludeParametersFromVector ( ".", module.project->includes ); @@ -172,7 +172,7 @@ } string -MingwModuleHandler::GenerateGccParameters ( Module& module ) +MingwModuleHandler::GenerateGccParameters ( const Module& module ) const { string parameters = GenerateGccDefineParameters ( module ); string s = GenerateGccIncludeParameters ( module ); @@ -185,7 +185,7 @@ } void -MingwModuleHandler::GenerateObjectFileTargets ( Module& module ) +MingwModuleHandler::GenerateObjectFileTargets ( const Module& module ) const { if ( module.files.size () == 0 ) return; @@ -209,7 +209,7 @@ } void -MingwModuleHandler::GenerateArchiveTarget ( Module& module ) +MingwModuleHandler::GenerateArchiveTarget ( const Module& module ) const { string archiveFilename = GetModuleArchiveFilename ( module ); string sourceFilenames = GetSourceFilenames ( module ); @@ -233,19 +233,19 @@ } bool -MingwKernelModuleHandler::CanHandleModule ( Module& module ) +MingwKernelModuleHandler::CanHandleModule ( const Module& module ) const { return module.type == KernelModeDLL; } void -MingwKernelModuleHandler::Process ( Module& module ) +MingwKernelModuleHandler::Process ( const Module& module ) { GenerateKernelModuleTarget ( module ); } void -MingwKernelModuleHandler::GenerateKernelModuleTarget ( Module& module ) +MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module ) { string workingDirectory = GetWorkingDirectory ( ); string archiveFilename = GetModuleArchiveFilename ( module ); @@ -292,19 +292,19 @@ } bool -MingwStaticLibraryModuleHandler::CanHandleModule ( Module& module ) +MingwStaticLibraryModuleHandler::CanHandleModule ( const Module& module ) const { return module.type == StaticLibrary; } void -MingwStaticLibraryModuleHandler::Process ( Module& module ) +MingwStaticLibraryModuleHandler::Process ( const Module& module ) { GenerateStaticLibraryModuleTarget ( module ); } void -MingwStaticLibraryModuleHandler::GenerateStaticLibraryModuleTarget ( Module& module ) +MingwStaticLibraryModuleHandler::GenerateStaticLibraryModuleTarget ( const Module& module ) { GenerateArchiveTarget ( module ); GenerateObjectFileTargets ( module ); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-08 00:25:48 UTC (rev 12877) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-08 02:33:09 UTC (rev 12878) @@ -7,29 +7,29 @@ { public: MingwModuleHandler ( FILE* fMakefile ); - virtual bool CanHandleModule ( Module& module ) = 0; - virtual void Process ( Module& module ) = 0; + virtual bool CanHandleModule ( const Module& module ) const = 0; + virtual void Process ( const Module& module ) = 0; protected: - std::string MingwModuleHandler::GetWorkingDirectory (); - std::string ReplaceExtension ( std::string filename, - std::string newExtension ); - std::string GetModuleArchiveFilename ( Module& module ); - std::string GetImportLibraryDependencies ( Module& module ); - std::string GetSourceFilenames ( Module& module ); - std::string GetObjectFilename ( std::string sourceFilename ); - std::string GetObjectFilenames ( Module& module ); - void GenerateObjectFileTargets ( Module& module ); - void GenerateArchiveTarget ( Module& module ); + std::string MingwModuleHandler::GetWorkingDirectory () const; + std::string ReplaceExtension ( const std::string& filename, + const std::string& newExtension ) const; + std::string GetModuleArchiveFilename ( const Module& module ) const; + std::string GetImportLibraryDependencies ( const Module& module ) const; + std::string GetSourceFilenames ( const Module& module ) const; + std::string GetObjectFilename ( const std::string& sourceFilename ) const; + std::string GetObjectFilenames ( const Module& module ) const; + void GenerateObjectFileTargets ( const Module& module ) const; + void GenerateArchiveTarget ( const Module& module ) const; FILE* fMakefile; private: - std::string ConcatenatePaths ( std::string path1, - std::string path2 ); - std::string GenerateGccDefineParametersFromVector ( std::vector<Define*> defines ); - std::string GenerateGccDefineParameters ( Module& module ); - std::string GenerateGccIncludeParametersFromVector ( std::string basePath, - std::vector<Include*> includes ); - std::string GenerateGccIncludeParameters ( Module& module ); - std::string GenerateGccParameters ( Module& module ); + std::string ConcatenatePaths ( const std::string& path1, + const std::string& path2 ) const; + std::string GenerateGccDefineParametersFromVector ( const std::vector<Define*>& defines ) const; + std::string GenerateGccDefineParameters ( const Module& module ) const; + std::string GenerateGccIncludeParametersFromVector ( const std::string& basePath, + const std::vector<Include*>& includes ) const; + std::string GenerateGccIncludeParameters ( const Module& module ) const; + std::string GenerateGccParameters ( const Module& module ) const; }; @@ -37,10 +37,10 @@ { public: MingwKernelModuleHandler ( FILE* fMakefile ); - virtual bool CanHandleModule ( Module& module ); - virtual void Process ( Module& module ); + virtual bool CanHandleModule ( const Module& module ) const; + virtual void Process ( const Module& module ); private: - void GenerateKernelModuleTarget ( Module& module ); + void GenerateKernelModuleTarget ( const Module& module ); }; @@ -48,10 +48,10 @@ { public: MingwStaticLibraryModuleHandler ( FILE* fMakefile ); - virtual bool CanHandleModule ( Module& module ); - virtual void Process ( Module& module ); + virtual bool CanHandleModule ( const Module& module ) const; + virtual void Process ( const Module& module ); private: - void GenerateStaticLibraryModuleTarget ( Module& module ); + void GenerateStaticLibraryModuleTarget ( const Module& module ); }; #endif /* MINGW_MODULEHANDLER_H */ _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-08 00:25:48 UTC (rev 12877) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-08 02:33:09 UTC (rev 12878) @@ -118,7 +118,7 @@ } string -Module::GetPath () +Module::GetPath () const { return FixSeparator (path) + CSEP + name + extension; } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-08 00:25:48 UTC (rev 12877) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-08 02:33:09 UTC (rev 12878) @@ -77,7 +77,7 @@ const std::string& modulePath ); ~Module (); ModuleType GetModuleType (const XMLAttribute& attribute ); - std::string GetPath (); + std::string GetPath () const; void ProcessXML ( const XMLElement& e, const std::string& path ); private: std::string GetDefaultModuleExtension ();
19 years, 10 months
1
0
0
0
[chorns] 12877: Static library module type.
by chorns@svn.reactos.com
Static library module type. Modified: branches/xmlbuildsystem/reactos/ReactOS.xml Modified: branches/xmlbuildsystem/reactos/lib/kjs/module.xml Modified: branches/xmlbuildsystem/reactos/ntoskrnl/module.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/exception.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/exception.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h _____ Modified: branches/xmlbuildsystem/reactos/ReactOS.xml --- branches/xmlbuildsystem/reactos/ReactOS.xml 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/ReactOS.xml 2005-01-08 00:25:48 UTC (rev 12877) @@ -1,7 +1,7 @@ <project name="ReactOS" makefile="Makefile.auto"> <define name="_M_IX86"></define> - <include>./include</include> - <include>./w32api/include</include> + <include>include</include> + <include>w32api/include</include> <directory name="tools"> <module name="depends" type="buildtool"> <file>depends.c</file> _____ Modified: branches/xmlbuildsystem/reactos/lib/kjs/module.xml --- branches/xmlbuildsystem/reactos/lib/kjs/module.xml 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/lib/kjs/module.xml 2005-01-08 00:25:48 UTC (rev 12877) @@ -1,7 +1,7 @@ <module name="kjs" type="staticlibrary"> <include>.</include> - <include>./src</include> - <include>./include</include> + <include>src</include> + <include>include</include> <directory name="ksrc"> <file>setjmp.S</file> <file>longjmp.S</file> @@ -24,7 +24,6 @@ <file>vmjumps.c</file> <file>vmswitch.c</file> <file>vmswt0.c</file> - <file>longjmp.c</file> </directory> <directory name="src"> <file>b_array.c</file> _____ Modified: branches/xmlbuildsystem/reactos/ntoskrnl/module.xml --- branches/xmlbuildsystem/reactos/ntoskrnl/module.xml 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/ntoskrnl/module.xml 2005-01-08 00:25:48 UTC (rev 12877) @@ -1,8 +1,8 @@ -<module name="ntoskrnl" type="kernelmodedll"> - <define name="_SEH_NO_NATIVE_NLG"></define> - <define name="_DISABLE_TIDENTS"></define> - <define name="__NTOSKRNL__"></define> - <define name="__3GB__"></define> +<module name="ntoskrnl" type="kernelmodedll" extension=".exe"> + <define name="_SEH_NO_NATIVE_NLG" /> + <define name="_DISABLE_TIDENTS" /> + <define name="__NTOSKRNL__" /> + <define name="__3GB__" /> <include>.</include> <include>./include</include> <include>../lib/kjs/include</include> @@ -44,12 +44,14 @@ </group> </if> <or> + <!-- <if property="kdbg" value="true"> <group> <file>kdb_stabs.c</file> <file>kdb_symbols.c</file> </group> </if> + --> <if property="dbg" value="true"> <group> <file>kdb_stabs.c</file> _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-08 00:25:48 UTC (rev 12877) @@ -103,4 +103,5 @@ MingwBackend::GetModuleHandlers ( MingwModuleHandlerList& moduleHandlers ) { moduleHandlers.push_back ( new MingwKernelModuleHandler ( fMakefile ) ); + moduleHandlers.push_back ( new MingwStaticLibraryModuleHandler ( fMakefile ) ); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-08 00:25:48 UTC (rev 12877) @@ -128,8 +128,21 @@ } string -MingwModuleHandler::GenerateGccIncludeParametersFromVector ( vector<Include*> includes ) +MingwModuleHandler::ConcatenatePaths ( string path1, + string path2 ) { + if ( ( path1.length () == 0 ) || ( path1 == "." ) || ( path1 == "./" ) ) + return path2; + if ( path1[path1.length ()] == CSEP ) + return path1 + path2; + else + return path1 + CSEP + path2; +} + +string +MingwModuleHandler::GenerateGccIncludeParametersFromVector ( string basePath, + vector<Include*> includes ) +{ string parameters; for (size_t i = 0; i < includes.size (); i++) { @@ -137,7 +150,8 @@ if (parameters.length () > 0) parameters += " "; parameters += "-I"; - parameters += include.directory; + parameters += ConcatenatePaths ( basePath, + include.directory ); } return parameters; } @@ -145,8 +159,10 @@ string MingwModuleHandler::GenerateGccIncludeParameters ( Module& module ) { - string parameters = GenerateGccIncludeParametersFromVector ( module.project->includes ); - string s = GenerateGccIncludeParametersFromVector ( module.includes ); + string parameters = GenerateGccIncludeParametersFromVector ( ".", + module.project->includes ); + string s = GenerateGccIncludeParametersFromVector ( module.path, + module.includes ); if (s.length () > 0) { parameters += " "; @@ -202,7 +218,7 @@ fprintf ( fMakefile, "%s: %s\n", archiveFilename.c_str (), - sourceFilenames.c_str ()); + objectFilenames.c_str ()); fprintf ( fMakefile, "\t${ar} -rc %s %s\n\n", @@ -219,7 +235,7 @@ bool MingwKernelModuleHandler::CanHandleModule ( Module& module ) { - return true; + return module.type == KernelModeDLL; } void @@ -268,3 +284,28 @@ GenerateArchiveTarget ( module ); GenerateObjectFileTargets ( module ); } + + +MingwStaticLibraryModuleHandler::MingwStaticLibraryModuleHandler ( FILE* fMakefile ) + : MingwModuleHandler ( fMakefile ) +{ +} + +bool +MingwStaticLibraryModuleHandler::CanHandleModule ( Module& module ) +{ + return module.type == StaticLibrary; +} + +void +MingwStaticLibraryModuleHandler::Process ( Module& module ) +{ + GenerateStaticLibraryModuleTarget ( module ); +} + +void +MingwStaticLibraryModuleHandler::GenerateStaticLibraryModuleTarget ( Module& module ) +{ + GenerateArchiveTarget ( module ); + GenerateObjectFileTargets ( module ); +} _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-08 00:25:48 UTC (rev 12877) @@ -22,9 +22,12 @@ void GenerateArchiveTarget ( Module& module ); FILE* fMakefile; private: + std::string ConcatenatePaths ( std::string path1, + std::string path2 ); std::string GenerateGccDefineParametersFromVector ( std::vector<Define*> defines ); std::string GenerateGccDefineParameters ( Module& module ); - std::string GenerateGccIncludeParametersFromVector ( std::vector<Include*> includes ); + std::string GenerateGccIncludeParametersFromVector ( std::string basePath, + std::vector<Include*> includes ); std::string GenerateGccIncludeParameters ( Module& module ); std::string GenerateGccParameters ( Module& module ); }; @@ -40,4 +43,15 @@ void GenerateKernelModuleTarget ( Module& module ); }; + +class MingwStaticLibraryModuleHandler : public MingwModuleHandler +{ +public: + MingwStaticLibraryModuleHandler ( FILE* fMakefile ); + virtual bool CanHandleModule ( Module& module ); + virtual void Process ( Module& module ); +private: + void GenerateStaticLibraryModuleTarget ( Module& module ); +}; + #endif /* MINGW_MODULEHANDLER_H */ _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/exception.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/exception.cpp 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/tools/rbuild/exception.cpp 2005-01-08 00:25:48 UTC (rev 12877) @@ -5,58 +5,71 @@ using std::string; -Exception::Exception() +Exception::Exception () { } -Exception::Exception(const string& message) +Exception::Exception ( const string& message ) { Message = message; } -Exception::Exception(const char* format, - ...) +Exception::Exception ( const char* format, + ...) { va_list args; - va_start(args, - format); - Message = ssvprintf(format, - args); - va_end(args); + va_start ( args, + format); + Message = ssvprintf ( format, + args); + va_end ( args ); } -void Exception::SetMessage(const char* message, - va_list args) +void Exception::SetMessage ( const char* message, + va_list args) { - Message = ssvprintf(message, - args); + Message = ssvprintf ( message, + args); } -FileNotFoundException::FileNotFoundException(const string& filename) - : Exception ( "File '%s' not found.", filename.c_str() ) +InvalidOperationException::InvalidOperationException ( const char* filename, + const int linenumber) { + Message = ssprintf ( "%s:%d", + filename, + linenumber ); +} + + +FileNotFoundException::FileNotFoundException ( const string& filename ) + : Exception ( "File '%s' not found.", + filename.c_str() ) +{ Filename = filename; } -AccessDeniedException::AccessDeniedException(const string& filename) - : Exception ( "Access denied to file '%s'.", filename.c_str() ) +AccessDeniedException::AccessDeniedException ( const string& filename) + : Exception ( "Access denied to file '%s'.", + filename.c_str() ) { Filename = filename; } -InvalidBuildFileException::InvalidBuildFileException(const char* message, - ...) +InvalidBuildFileException::InvalidBuildFileException ( const char* message, + ...) { va_list args; - va_start( args, message); - SetMessage(message, args); - va_end(args); + va_start ( args, + message ); + SetMessage ( message, + args ); + va_end ( args ); } -InvalidBuildFileException::InvalidBuildFileException() +InvalidBuildFileException::InvalidBuildFileException () { } @@ -66,36 +79,39 @@ ... ) { va_list args; - va_start ( args, message ); + va_start ( args, + message ); Message = location + ": " + ssvprintf ( message, args ); va_end ( args ); } -RequiredAttributeNotFoundException::RequiredAttributeNotFoundException( const string& attributeName, - const string& elementName) +RequiredAttributeNotFoundException::RequiredAttributeNotFoundException ( const string& attributeName, + const string& elementName ) : InvalidBuildFileException ( "Required attribute '%s' not found on '%s'.", attributeName.c_str (), elementName.c_str ()) { } -InvalidAttributeValueException::InvalidAttributeValueException(const string& name, - const string& value) +InvalidAttributeValueException::InvalidAttributeValueException ( const string& name, + const string& value ) : InvalidBuildFileException ( "Attribute '%s' has an invalid value '%s'.", name.c_str (), - value.c_str ()) + value.c_str () ) { } BackendNameConflictException::BackendNameConflictException ( const string& name ) - : Exception ( "Backend name conflict: '%s'", name.c_str() ) + : Exception ( "Backend name conflict: '%s'", + name.c_str() ) { } UnknownBackendException::UnknownBackendException ( const string& name ) - : Exception ( "Unknown Backend requested: '%s'", name.c_str() ) + : Exception ( "Unknown Backend requested: '%s'", + name.c_str() ) { } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/exception.h --- branches/xmlbuildsystem/reactos/tools/rbuild/exception.h 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/tools/rbuild/exception.h 2005-01-08 00:25:48 UTC (rev 12877) @@ -6,21 +6,29 @@ class Exception { public: - Exception(const std::string& message); - Exception(const char* format, - ...); + Exception ( const std::string& message ); + Exception ( const char* format, + ...); std::string Message; protected: - Exception(); - void SetMessage(const char* message, - va_list args); + Exception (); + void SetMessage ( const char* message, + va_list args); }; +class InvalidOperationException : public Exception +{ +public: + InvalidOperationException ( const char* filename, + const int linenumber); +}; + + class FileNotFoundException : public Exception { public: - FileNotFoundException(const std::string& filename); + FileNotFoundException ( const std::string& filename ); std::string Filename; }; @@ -28,7 +36,7 @@ class AccessDeniedException : public Exception { public: - AccessDeniedException(const std::string& filename); + AccessDeniedException ( const std::string& filename ); std::string Filename; }; @@ -39,7 +47,7 @@ InvalidBuildFileException ( const char* message, ...); protected: - InvalidBuildFileException(); + InvalidBuildFileException (); }; @@ -55,16 +63,16 @@ class RequiredAttributeNotFoundException : public InvalidBuildFileException { public: - RequiredAttributeNotFoundException(const std::string& attributeName, - const std::string& elementName); + RequiredAttributeNotFoundException ( const std::string& attributeName, + const std::string& elementName ); }; class InvalidAttributeValueException : public InvalidBuildFileException { public: - InvalidAttributeValueException(const std::string& name, - const std::string& value); + InvalidAttributeValueException ( const std::string& name, + const std::string& value ); }; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp 2005-01-08 00:25:48 UTC (rev 12877) @@ -30,7 +30,7 @@ void Include::Initialize ( const XMLElement& includeNode ) { - directory = includeNode.value; + directory = FixSeparator ( includeNode.value ); } void _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-08 00:25:48 UTC (rev 12877) @@ -23,14 +23,25 @@ Module::Module ( Project* project, const XMLElement& moduleNode, - const string& moduleName, const string& modulePath ) : project(project), - node(moduleNode), - name(moduleName), - path(modulePath) + node(moduleNode) { - type = GetModuleType ( *moduleNode.GetAttribute ( "type", true ) ); + path = FixSeparator ( modulePath ); + + const XMLAttribute* att = moduleNode.GetAttribute ( "name", true ); + assert(att); + name = att->value; + + att = moduleNode.GetAttribute ( "type", true ); + assert(att); + type = GetModuleType ( *att ); + + att = moduleNode.GetAttribute ( "extension", false ); + if (att != NULL) + extension = att->value; + else + extension = GetDefaultModuleExtension (); } Module::~Module () @@ -49,7 +60,7 @@ string subpath ( path ); if ( e.name == "file" && e.value.size () ) { - files.push_back ( new File ( path + CSEP + e.value ) ); + files.push_back ( new File ( FixSeparator ( path + CSEP + e.value ) ) ); } else if ( e.name == "library" && e.value.size () ) { @@ -59,7 +70,7 @@ { const XMLAttribute* att = e.GetAttribute ( "name", true ); assert(att); - subpath = path + CSEP + att->value; + subpath = FixSeparator ( path + CSEP + att->value ); } else if ( e.name == "include" ) { @@ -91,9 +102,25 @@ } string +Module::GetDefaultModuleExtension () +{ + switch (type) + { + case BuildTool: + return EXEPOSTFIX; + case StaticLibrary: + return ".a"; + case KernelModeDLL: + return ".dll"; + } + throw InvalidOperationException (__FILE__, + __LINE__); +} + +string Module::GetPath () { - return FixSeparator (path) + CSEP + name + EXEPOSTFIX; + return FixSeparator (path) + CSEP + name + extension; } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-08 00:25:48 UTC (rev 12877) @@ -59,9 +59,7 @@ } else if ( e.name == "module" ) { - att = e.GetAttribute ( "name", true ); - assert(att); - Module* module = new Module ( this, e, att->value, path ); + Module* module = new Module ( this, e, path ); modules.push_back ( module ); module->ProcessXML ( e, path ); return; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-07 21:46:18 UTC (rev 12876) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-08 00:25:48 UTC (rev 12877) @@ -64,6 +64,7 @@ Project* project; const XMLElement& node; std::string name; + std::string extension; std::string path; ModuleType type; std::vector<File*> files; @@ -73,12 +74,13 @@ Module ( Project* project, const XMLElement& moduleNode, - const std::string& moduleName, const std::string& modulePath ); ~Module (); ModuleType GetModuleType (const XMLAttribute& attribute ); std::string GetPath (); void ProcessXML ( const XMLElement& e, const std::string& path ); +private: + std::string GetDefaultModuleExtension (); };
19 years, 10 months
1
0
0
0
[chorns] 12876: Include and define support.
by chorns@svn.reactos.com
Include and define support. Modified: branches/xmlbuildsystem/reactos/ReactOS.xml Modified: branches/xmlbuildsystem/reactos/ntoskrnl/module.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h Added: branches/xmlbuildsystem/reactos/tools/rbuild/define.cpp Added: branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/makefile Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/test.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/alltests.cpp Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/define.xml Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/include.xml Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/definetest.cpp Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp _____ Modified: branches/xmlbuildsystem/reactos/ReactOS.xml --- branches/xmlbuildsystem/reactos/ReactOS.xml 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/ReactOS.xml 2005-01-07 21:46:18 UTC (rev 12876) @@ -1,4 +1,7 @@ <project name="ReactOS" makefile="Makefile.auto"> + <define name="_M_IX86"></define> + <include>./include</include> + <include>./w32api/include</include> <directory name="tools"> <module name="depends" type="buildtool"> <file>depends.c</file> _____ Modified: branches/xmlbuildsystem/reactos/ntoskrnl/module.xml --- branches/xmlbuildsystem/reactos/ntoskrnl/module.xml 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/ntoskrnl/module.xml 2005-01-07 21:46:18 UTC (rev 12876) @@ -1,4 +1,9 @@ <module name="ntoskrnl" type="kernelmodedll"> + <define name="_SEH_NO_NATIVE_NLG"></define> + <define name="_DISABLE_TIDENTS"></define> + <define name="__NTOSKRNL__"></define> + <define name="__3GB__"></define> + <include>.</include> <include>./include</include> <include>../lib/kjs/include</include> <library>kjs</library> @@ -7,7 +12,6 @@ <file>copy.c</file> <file>fs.c</file> <file>mdl.c</file> - <file>misc.c</file> <file>pin.c</file> <file>view.c</file> </directory> @@ -35,8 +39,8 @@ <file>kdb.c</file> <file>kdb_keyboard.c</file> <file>kdb_serial.c</file> + <file>rdebug.c</file> <file>profile.c</file> - <file>rdebug.c</file> </group> </if> <or> @@ -53,10 +57,10 @@ </group> </if> </or> - <file>user.c</file> <file>dbgctrl.c</file> <file>errinfo.c</file> <file>print.c</file> + <file>user.c</file> </directory> <directory name="ex"> <if property="arch" value="i386"> @@ -100,10 +104,6 @@ <file>util.c</file> </directory> <directory name="inbv"> - <if property="arch" value="i386"> - <directory name="i386"> - </directory> - </if> <file>inbv.c</file> </directory> <directory name="io"> @@ -177,9 +177,8 @@ <file>i386-mcount.S</file> <file>idt.c</file> <file>irq.c</file> - <file>irqhand.S</file> + <file>irqhand.s</file> <file>kernel.c</file> - <file>kernel.c</file> <file>ldt.c</file> <file>multiboot.S</file> <file>stkswitch.S</file> @@ -251,6 +250,9 @@ <file>balance.c</file> <file>cont.c</file> <file>drvlck.c</file> + <file>elf32.c</file> + <file>elf64.c</file> + <file>elf.c</file> <file>freelist.c</file> <file>iospace.c</file> <file>kmap.c</file> @@ -266,6 +268,7 @@ <file>pager.c</file> <file>pagfault.c</file> <file>paging.c</file> + <file>pe.c</file> <file>physical.c</file> <file>pool.c</file> <file>ppool.c</file> Property changes on: branches/xmlbuildsystem/reactos/tools/rbuild ___________________________________________________________________ Name: svn:ignore + *.exe _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-07 21:46:18 UTC (rev 12876) @@ -7,6 +7,7 @@ #include "modulehandler.h" using std::string; +using std::vector; MingwModuleHandler::MingwModuleHandler ( FILE* fMakefile ) : fMakefile ( fMakefile ) @@ -93,6 +94,80 @@ return objectFilenames; } +string +MingwModuleHandler::GenerateGccDefineParametersFromVector ( vector<Define*> defines ) +{ + string parameters; + for (size_t i = 0; i < defines.size (); i++) + { + Define& define = *defines[i]; + if (parameters.length () > 0) + parameters += " "; + parameters += "-D"; + parameters += define.name; + if (define.value.length () > 0) + { + parameters += "="; + parameters += define.value; + } + } + return parameters; +} + +string +MingwModuleHandler::GenerateGccDefineParameters ( Module& module ) +{ + string parameters = GenerateGccDefineParametersFromVector ( module.project->defines ); + string s = GenerateGccDefineParametersFromVector ( module.defines ); + if (s.length () > 0) + { + parameters += " "; + parameters += s; + } + return parameters; +} + +string +MingwModuleHandler::GenerateGccIncludeParametersFromVector ( vector<Include*> includes ) +{ + string parameters; + for (size_t i = 0; i < includes.size (); i++) + { + Include& include = *includes[i]; + if (parameters.length () > 0) + parameters += " "; + parameters += "-I"; + parameters += include.directory; + } + return parameters; +} + +string +MingwModuleHandler::GenerateGccIncludeParameters ( Module& module ) +{ + string parameters = GenerateGccIncludeParametersFromVector ( module.project->includes ); + string s = GenerateGccIncludeParametersFromVector ( module.includes ); + if (s.length () > 0) + { + parameters += " "; + parameters += s; + } + return parameters; +} + +string +MingwModuleHandler::GenerateGccParameters ( Module& module ) +{ + string parameters = GenerateGccDefineParameters ( module ); + string s = GenerateGccIncludeParameters ( module ); + if (s.length () > 0) + { + parameters += " "; + parameters += s; + } + return parameters; +} + void MingwModuleHandler::GenerateObjectFileTargets ( Module& module ) { @@ -108,9 +183,10 @@ objectFilename.c_str (), sourceFilename.c_str() ); fprintf ( fMakefile, - "\t${gcc} -c %s -o %s\n", + "\t${gcc} -c %s -o %s %s\n", sourceFilename.c_str (), - objectFilename.c_str () ); + objectFilename.c_str (), + GenerateGccParameters ( module ).c_str () ); } fprintf ( fMakefile, "\n" ); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-07 21:46:18 UTC (rev 12876) @@ -21,6 +21,12 @@ void GenerateObjectFileTargets ( Module& module ); void GenerateArchiveTarget ( Module& module ); FILE* fMakefile; +private: + std::string GenerateGccDefineParametersFromVector ( std::vector<Define*> defines ); + std::string GenerateGccDefineParameters ( Module& module ); + std::string GenerateGccIncludeParametersFromVector ( std::vector<Include*> includes ); + std::string GenerateGccIncludeParameters ( Module& module ); + std::string GenerateGccParameters ( Module& module ); }; _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/define.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/define.cpp 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/define.cpp 2005-01-07 21:46:18 UTC (rev 12876) @@ -0,0 +1,44 @@ +#include "pch.h" +#include <assert.h> + +#include "rbuild.h" + +using std::string; +using std::vector; + +Define::Define ( Project* project, + const XMLElement& defineNode ) + : project(project), + module(NULL), + node(defineNode) +{ + Initialize (defineNode); +} + +Define::Define ( Project* project, + Module* module, + const XMLElement& defineNode ) + : project(project), + module(module), + node(defineNode) +{ + Initialize (defineNode); +} + +Define::~Define () +{ +} + +void +Define::Initialize ( const XMLElement& defineNode ) +{ + const XMLAttribute* att = defineNode.GetAttribute ( "name", true ); + assert(att); + name = att->value; + value = defineNode.value; +} + +void +Define::ProcessXML ( const XMLElement& e ) +{ +} _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/include.cpp 2005-01-07 21:46:18 UTC (rev 12876) @@ -0,0 +1,39 @@ +#include "pch.h" +#include <assert.h> + +#include "rbuild.h" + +using std::string; +using std::vector; + +Include::Include ( Project* project, + const XMLElement& includeNode ) + : project(project), + node(includeNode) +{ + Initialize ( includeNode ); +} + +Include::Include ( Project* project, + Module* module, + const XMLElement& includeNode ) + : project(project), + node(includeNode) +{ + Initialize ( includeNode ); +} + +Include::~Include () +{ +} + +void +Include::Initialize ( const XMLElement& includeNode ) +{ + directory = includeNode.value; +} + +void +Include::ProcessXML ( const XMLElement& e ) +{ +} _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/makefile --- branches/xmlbuildsystem/reactos/tools/rbuild/makefile 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/makefile 2005-01-07 21:46:18 UTC (rev 12876) @@ -14,7 +14,9 @@ BASE_OBJECTS = \ $(BACKEND_BASE_OBJECTS) \ + define.o \ exception.o \ + include.o \ module.o \ project.o \ ssprintf.o \ @@ -23,6 +25,8 @@ OBJECTS = $(BASE_OBJECTS) rbuild.o TESTS = \ + tests/definetest.o \ + tests/includetest.o \ tests/moduletest.o \ tests/projecttest.o _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-07 21:46:18 UTC (rev 12876) @@ -61,6 +61,18 @@ assert(att); subpath = path + CSEP + att->value; } + else if ( e.name == "include" ) + { + Include* include = new Include ( project, this, e ); + includes.push_back ( include ); + include->ProcessXML ( e ); + } + else if ( e.name == "define" ) + { + Define* define = new Define ( project, this, e ); + defines.push_back ( define ); + define->ProcessXML ( e ); + } for ( size_t i = 0; i < e.subElements.size (); i++ ) ProcessXML ( *e.subElements[i], subpath ); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-07 21:46:18 UTC (rev 12876) @@ -72,6 +72,18 @@ assert(att); subpath = path + CSEP + att->value; } + else if ( e.name == "include" ) + { + Include* include = new Include ( this, e ); + includes.push_back ( include ); + include->ProcessXML ( e ); + } + else if ( e.name == "define" ) + { + Define* define = new Define ( this, e ); + defines.push_back ( define ); + define->ProcessXML ( e ); + } for ( size_t i = 0; i < e.subElements.size (); i++ ) ProcessXML ( *e.subElements[i], subpath ); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-07 21:46:18 UTC (rev 12876) @@ -23,6 +23,8 @@ class Project; class Module; +class Include; +class Define; class File; class Library; @@ -32,7 +34,9 @@ std::string name; std::string makefile; std::vector<Module*> modules; - + std::vector<Include*> includes; + std::vector<Define*> defines; + Project (); Project ( const std::string& filename ); ~Project (); @@ -53,6 +57,7 @@ KernelModeDLL }; + class Module { public: @@ -63,18 +68,61 @@ ModuleType type; std::vector<File*> files; std::vector<Library*> libraries; + std::vector<Include*> includes; + std::vector<Define*> defines; Module ( Project* project, const XMLElement& moduleNode, const std::string& moduleName, const std::string& modulePath ); - ~Module(); + ~Module (); ModuleType GetModuleType (const XMLAttribute& attribute ); std::string GetPath (); void ProcessXML ( const XMLElement& e, const std::string& path ); }; +class Include +{ +public: + Project* project; + Module* module; + const XMLElement& node; + std::string directory; + + Include ( Project* project, + const XMLElement& includeNode ); + Include ( Project* project, + Module* module, + const XMLElement& includeNode ); + ~Include (); + void ProcessXML ( const XMLElement& e ); +private: + void Initialize ( const XMLElement& includeNode ); +}; + + +class Define +{ +public: + Project* project; + Module* module; + const XMLElement& node; + std::string name; + std::string value; + + Define ( Project* project, + const XMLElement& defineNode ); + Define ( Project* project, + Module* module, + const XMLElement& defineNode ); + ~Define(); + void ProcessXML ( const XMLElement& e ); +private: + void Initialize ( const XMLElement& defineNode ); +}; + + class File { public: _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/test.h --- branches/xmlbuildsystem/reactos/tools/rbuild/test.h 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/test.h 2005-01-07 21:46:18 UTC (rev 12876) @@ -52,4 +52,18 @@ void Run(); }; + +class DefineTest : public BaseTest +{ +public: + void Run(); +}; + + +class IncludeTest : public BaseTest +{ +public: + void Run(); +}; + #endif /* __TEST_H */ _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/alltests.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/alltests.cpp 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/alltests.cpp 2005-01-07 21:46:18 UTC (rev 12876) @@ -147,6 +147,8 @@ { tests.push_back(new ProjectTest()); tests.push_back(new ModuleTest()); + tests.push_back(new DefineTest()); + tests.push_back(new IncludeTest()); } }; _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/define.xml --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/define.xml 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/define.xml 2005-01-07 21:46:18 UTC (rev 12876) @@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<project name="Project" makefile="Makefile"> + <define name="define1">value1</define> + <directory name="dir1"> + <module name="module1" type="buildtool"> + <define name="define2">value2</define> + </module> + </directory> +</project> _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/include.xml --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/include.xml 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/include.xml 2005-01-07 21:46:18 UTC (rev 12876) @@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<project name="Project" makefile="Makefile"> + <include>include1</include> + <directory name="dir1"> + <module name="module1" type="buildtool"> + <include>include2</include> + </module> + </directory> +</project> _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/definetest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/definetest.cpp 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/definetest.cpp 2005-01-07 21:46:18 UTC (rev 12876) @@ -0,0 +1,21 @@ +#include "test.h" + +using std::string; + +void DefineTest::Run() +{ + string projectFilename ( "tests/data/define.xml" ); + Project project ( projectFilename ); + ARE_EQUAL(1, project.defines.size()); + Define& define1 = *project.defines[0]; + ARE_EQUAL("define1", define1.name); + ARE_EQUAL("value1", define1.value); + + ARE_EQUAL(1, project.modules.size()); + Module& module1 = *project.modules[0]; + + ARE_EQUAL(1, module1.defines.size()); + Define& define2 = *module1.defines[0]; + ARE_EQUAL("define2", define2.name); + ARE_EQUAL("value2", define2.value); +} _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp 2005-01-07 19:24:54 UTC (rev 12875) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/includetest.cpp 2005-01-07 21:46:18 UTC (rev 12876) @@ -0,0 +1,19 @@ +#include "test.h" + +using std::string; + +void IncludeTest::Run() +{ + string projectFilename ( "tests/data/include.xml" ); + Project project ( projectFilename ); + ARE_EQUAL(1, project.includes.size()); + Include& include1 = *project.includes[0]; + ARE_EQUAL("include1", include1.directory); + + ARE_EQUAL(1, project.modules.size()); + Module& module1 = *project.modules[0]; + + ARE_EQUAL(1, module1.includes.size()); + Include& include2 = *module1.includes[0]; + ARE_EQUAL("include2", include2.directory); +}
19 years, 10 months
1
0
0
0
[arty] 12875: Added makefile.
by arty@svn.reactos.com
Added makefile. Added: trunk/reactos/lib/kbdes/makefile _____ Added: trunk/reactos/lib/kbdes/makefile --- trunk/reactos/lib/kbdes/makefile 2005-01-07 19:16:19 UTC (rev 12874) +++ trunk/reactos/lib/kbdes/makefile 2005-01-07 19:24:54 UTC (rev 12875) @@ -0,0 +1,22 @@ +PATH_TO_TOP = ../.. + +TARGET_TYPE = kmdll + +TARGET_NAME = kbdes + +TARGET_BASE = 0x5500000 + +TARGET_CFLAGS = -I$(PATH_TO_TOP)/ntoskrnl/include + +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + +TARGET_OBJECTS = kbdes.o + +DEP_OBJECTS = $(TARGET_OBJECTS) + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk + +include $(TOOLS_PATH)/depend.mk
19 years, 10 months
1
0
0
0
← Newer
1
...
47
48
49
50
51
52
53
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200