blob: 32e7f67a260e0c275531422f04b37f6160e24cc6 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META NAME="keywords" CONTENT="netbeans,magazine,C,C++,Pack,native,IDE,development">
<META NAME="description" CONTENT="NetBeans Magazine: Introducing NetBeans C++ Pack">
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<title>Introducing NetBeans C/C++ Pack</title>
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Verdana";
panose-1:0 0 0 0 0 0 0 0 0 0;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-format:other;
mso-font-pitch:variable;
mso-font-signature:3 0 0 0 1 0;}
@font-face
{font-family:"Verdana";
panose-1:0 0 0 0 0 0 0 0 0 0;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-format:other;
mso-font-pitch:variable;
mso-font-signature:3 0 0 0 1 0;}
@font-face
{font-family:"Verdana";
panose-1:0 0 0 0 0 0 0 0 0 0;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-format:other;
mso-font-pitch:variable;
mso-font-signature:3 0 0 0 1 0;}
@font-face
{font-family:Times;
panose-1:0 0 5 0 0 0 0 0 0 0;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:536902279 -2147483648 8 0 511 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.Noparagraphstyle, li.Noparagraphstyle, div.Noparagraphstyle
{mso-style-name:"\[No paragraph style\]";
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
line-height:120%;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:12.0pt;
font-family:Times;
mso-fareast-font-family:"Times New Roman";
color:black;
mso-ansi-language:EN-US;}
p.NB-Corpo, li.NB-Corpo, div.NB-Corpo
{mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Interttulo, li.NB-Interttulo, div.NB-Interttulo
{mso-style-name:"NB - Intert�tulo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:8.5pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:120%;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:13.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#98201A;
mso-ansi-language:EN-US;
font-weight:bold;}
p.NB-Interttulo2, li.NB-Interttulo2, div.NB-Interttulo2
{mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
p.NB-Notadica, li.NB-Notadica, div.NB-Notadica
{mso-style-name:"NB - Nota\/dica";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
line-height:13.0pt;
mso-pagination:none;
mso-hyphenate:none;
tab-stops:14.15pt;
mso-layout-grid-align:none;
text-autospace:none;
font-size:10.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Cdigointerno, li.NB-Cdigointerno, div.NB-Cdigointerno
{mso-style-name:"NB - C�digo interno";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
line-height:10.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:8.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
mso-ansi-language:EN-US;}
p.NB-Legendaimagem, li.NB-Legendaimagem, div.NB-Legendaimagem
{mso-style-name:"NB - Legenda imagem";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
mso-hyphenate:none;
tab-stops:14.15pt;
mso-layout-grid-align:none;
text-autospace:none;
font-size:10.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-GB;}
span.NB-NegritoTcnico
{mso-style-name:"NB - Negrito T�cnico";
mso-style-parent:"";
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
font-family:"Verdana";
mso-ascii-font-family:"Verdana";
mso-hansi-font-family:"Verdana";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-font-width:100%;
font-weight:bold;
vertical-align:baseline;}
span.NB-Legendanegrito
{mso-style-name:"NB - Legenda negrito";
mso-style-parent:"";
font-weight:bold;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:581.1pt 779.55pt;
margin:36.0pt 36.0pt 36.0pt 36.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
div.NB-Interttulo21 {mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
li.NB-Interttulo21 {mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
p.NB-Interttulo21 {mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
div.NB-Corpo1 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
li.NB-Corpo1 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo1 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
div.NB-Cdigointerno1 {mso-style-name:"NB - C�digo interno";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
line-height:10.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:8.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
mso-ansi-language:EN-US;}
div.NB-Corpo2 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
div.NB-Interttulo1 {mso-style-name:"NB - Intert�tulo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:8.5pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:120%;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:13.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#98201A;
mso-ansi-language:EN-US;
font-weight:bold;}
div.NB-Interttulo22 {mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
div.NB-Notadica1 {mso-style-name:"NB - Nota\/dica";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
line-height:13.0pt;
mso-pagination:none;
mso-hyphenate:none;
tab-stops:14.15pt;
mso-layout-grid-align:none;
text-autospace:none;
font-size:10.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
div.Noparagraphstyle1 {mso-style-name:"\[No paragraph style\]";
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
line-height:120%;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:12.0pt;
font-family:Times;
mso-fareast-font-family:"Times New Roman";
color:black;
mso-ansi-language:EN-US;}
li.NB-Cdigointerno1 {mso-style-name:"NB - C�digo interno";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
line-height:10.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:8.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
mso-ansi-language:EN-US;}
li.NB-Corpo2 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
li.NB-Interttulo1 {mso-style-name:"NB - Intert�tulo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:8.5pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:120%;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:13.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#98201A;
mso-ansi-language:EN-US;
font-weight:bold;}
li.NB-Interttulo22 {mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
li.NB-Notadica1 {mso-style-name:"NB - Nota\/dica";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
line-height:13.0pt;
mso-pagination:none;
mso-hyphenate:none;
tab-stops:14.15pt;
mso-layout-grid-align:none;
text-autospace:none;
font-size:10.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
li.Noparagraphstyle1 {mso-style-name:"\[No paragraph style\]";
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
line-height:120%;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:12.0pt;
font-family:Times;
mso-fareast-font-family:"Times New Roman";
color:black;
mso-ansi-language:EN-US;}
p.NB-Cdigointerno1 {mso-style-name:"NB - C�digo interno";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
line-height:10.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:8.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
mso-ansi-language:EN-US;}
p.NB-Corpo2 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo11 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Interttulo1 {mso-style-name:"NB - Intert�tulo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:8.5pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:120%;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:13.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#98201A;
mso-ansi-language:EN-US;
font-weight:bold;}
p.NB-Interttulo22 {mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
p.NB-Notadica1 {mso-style-name:"NB - Nota\/dica";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
line-height:13.0pt;
mso-pagination:none;
mso-hyphenate:none;
tab-stops:14.15pt;
mso-layout-grid-align:none;
text-autospace:none;
font-size:10.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.Noparagraphstyle1 {mso-style-name:"\[No paragraph style\]";
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
line-height:120%;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:12.0pt;
font-family:Times;
mso-fareast-font-family:"Times New Roman";
color:black;
mso-ansi-language:EN-US;}
span.NB-NegritoTcnico1 {mso-style-name:"NB - Negrito T�cnico";
mso-style-parent:"";
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
font-family:"Verdana";
mso-ascii-font-family:"Verdana";
mso-hansi-font-family:"Verdana";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-font-width:100%;
font-weight:bold;
vertical-align:baseline;}
.NB-Listagenstitulos {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #FFFFFF;
font-size: 14px;
}
.NB-Listagens {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
.NB-Quadrotitulo {font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; font-size: 14px; font-weight: bold; }
.style2 {font-family: "Courier New", Courier, monospace; font-size: 12px; color: #000000; }
p.NB-Corpo21 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
span.NB-NegritoTcnico11 {mso-style-name:"NB - Negrito T�cnico";
mso-style-parent:"";
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
font-family:"Verdana";
mso-ascii-font-family:"Verdana";
mso-hansi-font-family:"Verdana";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-font-width:100%;
font-weight:bold;
vertical-align:baseline;}
div.NB-Interttulo23 {mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
div.NB-TabelaCorpo {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
div.NB-TabelaIntertitulo {mso-style-name:"NB - Tabela Intertitulo";
mso-style-parent:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
letter-spacing:-.05pt;
mso-ansi-language:EN-GB;
font-weight:bold;}
li.NB-Interttulo23 {mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
li.NB-TabelaCorpo {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
li.NB-TabelaIntertitulo {mso-style-name:"NB - Tabela Intertitulo";
mso-style-parent:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
letter-spacing:-.05pt;
mso-ansi-language:EN-GB;
font-weight:bold;}
p.NB-Interttulo23 {mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
p.NB-TabelaCorpo {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
p.NB-TabelaIntertitulo {mso-style-name:"NB - Tabela Intertitulo";
mso-style-parent:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
letter-spacing:-.05pt;
mso-ansi-language:EN-GB;
font-weight:bold;}
p.NB-Interttulo231 {mso-style-name:"NB - Intert�tulo 2";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:#BC371F;
mso-ansi-language:EN-US;
font-weight:bold;}
p.NB-TabelaCorpo1 {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
p.NB-TabelaIntertitulo1 {mso-style-name:"NB - Tabela Intertitulo";
mso-style-parent:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
letter-spacing:-.05pt;
mso-ansi-language:EN-GB;
font-weight:bold;}
div.NB-TabelaCorpo1 {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
div.NB-TabelaIntertitulo1 {mso-style-name:"NB - Tabela Intertitulo";
mso-style-parent:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
letter-spacing:-.05pt;
mso-ansi-language:EN-GB;
font-weight:bold;}
li.NB-TabelaCorpo1 {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
li.NB-TabelaIntertitulo1 {mso-style-name:"NB - Tabela Intertitulo";
mso-style-parent:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
letter-spacing:-.05pt;
mso-ansi-language:EN-GB;
font-weight:bold;}
p.NB-TabelaCorpo2 {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
p.NB-TabelaIntertitulo2 {mso-style-name:"NB - Tabela Intertitulo";
mso-style-parent:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
letter-spacing:-.05pt;
mso-ansi-language:EN-GB;
font-weight:bold;}
p.NB-Corpo111 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo112 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo1121 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo11211 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo112111 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo1121111 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo1121112 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo1121113 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo11211131 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo1111 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-TabelaCorpo21 {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
p.NB-TabelaIntertitulo21 {mso-style-name:"NB - Tabela Intertitulo";
mso-style-parent:"\[No paragraph style\]";
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
line-height:12.0pt;
mso-pagination:none;
page-break-after:avoid;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
letter-spacing:-.05pt;
mso-ansi-language:EN-GB;
font-weight:bold;}
div.NB-TabelaCorpo2 {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
li.NB-TabelaCorpo2 {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
p.NB-TabelaCorpo3 {mso-style-name:"NB - Tabela Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:14.0pt;
mso-pagination:none;
mso-hyphenate:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:white;
mso-ansi-language:EN-US;}
span.Fontepar00E1gpadr00E3o2 {mso-style-name:"Fonte par<00E1>g\. padr<00E3>o2";
mso-style-parent:"";
mso-font-width:100%;}
span.NB-NegritoTcnico2 {mso-style-name:"NB - Negrito T�cnico";
mso-style-parent:"";
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
font-family:"Verdana";
mso-ascii-font-family:"Verdana";
mso-hansi-font-family:"Verdana";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-font-width:100%;
font-weight:bold;
vertical-align:baseline;}
span.Refdenotaderodap00E9 {mso-style-name:"Ref\. de nota de rodap<00E9>";
mso-style-parent:"";
mso-font-width:100%;
vertical-align:super;}
p.NB-Corpo11111 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo112111311 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo1121113111 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo1112 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
mso-ansi-language:EN-US;}
.style1 {font-size: 9.0pt}
.style3 {font-size: 11px;
font-weight: bold;
}
p.NB-Corpo22 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
.style5 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; font-size: 9pt; }
.style7 {font-family: "Courier New", Courier, monospace; font-size: 9pt; color: #000000; }
p.NB-Corpo1122 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo23 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo11212 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo112112 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo1121114 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo11211111 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo11211132 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo11211121 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo1121113112 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo11211131111 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo112111312 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
letter-spacing:.05pt;
mso-ansi-language:EN-US;}
p.NB-Corpo11112 {mso-style-name:"NB - Corpo";
mso-style-parent:"\[No paragraph style\]";
mso-style-next:"\[No paragraph style\]";
margin:0cm;
margin-bottom:.0001pt;
text-align:left;
text-indent:5.65pt;
line-height:16.0pt;
mso-pagination:none;
mso-layout-grid-align:none;
text-autospace:none;
font-size:9.0pt;
font-family:"Verdana";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Verdana";
color:black;
mso-ansi-language:EN-US;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tabela normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]-->
</head>
<body lang=PT-BR style='tab-interval:36.0pt;text-justify-trim:punctuation'>
<div class=Section1>
<table width="770" height="14242" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="200"><img src="/images_www/magazine/c++/top_C++_web.jpg" width="770" height="200"></td>
</tr>
<tr>
<td width="785" height="42"><p class=NB-Corpo22 style='text-indent:0cm'>&nbsp;</p>
<p class=NB-Corpo22 style='text-indent:0cm'><strong><span lang=EN-US style='letter-spacing:
-.05pt'>Prepare your environment for cross-platform
C/C++ development with NetBeans, and put the
C/C++ Pack to work creating a native library for Java applications</span></strong></p>
</td>
</tr>
<tr>
<td><div class=Section1>
<p class=NB-Corpo2 style='text-indent:0cm'>&nbsp;</p>
<p class=NB-Corpo2 style='text-indent:0cm'><span lang=EN-US style='letter-spacing:
-.05pt'>When NetBeans 5.5 was released in late 2006, it radically changed its
own value proposition by offering first-class support for a language that
doesn&rsquo;t run inside a JVM. The NetBeans C/C++ pack provided to C/C++ programmers
most features Java developers were already used to: advanced source editing
with syntax highlighting and code completion, built-in CVS support, hyperlinks
to navigate function declarations, a class hierarchy browser, an integrated
debugger, and integration with the <i>make</i> tool.
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>This article
focuses on how the C/C++ pack can help Java developers. Although I&rsquo;m sure you
all would like to code the whole world in pure Java, reality frequently
challenges us to interface with native code, be it legacy systems, a device
vendor SDK or a high-performance math library. Also, sometimes we need to use
native code to improve the user experience, by means of tighter integration
with the underlying operating system. Wouldn&rsquo;t it be better to do all this from
the same IDE we already use for Java development?
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>We&rsquo;ll show how
to leverage NetBeans and the C/C++ Pack to develop portable native libraries
using C/C++, and how to integrate them with Java code in a way that eases
deployment in multiple platforms.
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>NetBeans C/C++
Pack is more than just C/C++ coding support for the Java developer. It also
suits many native code projects very well. The <b>sidebar</b> &ldquo;Other open
source C/C++ IDEs&rdquo; compares the Pack with some popular open-source <br>
IDEs for C/C++.
<o:p></o:p>
</span></p>
<p class=NB-Interttulo1><span lang=EN-US style='letter-spacing:-.05pt'>Installing
NetBeans C/C++ Pack
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>Installing the
C/C++ Pack per se will be a no-brainer for most users. No matter if you&rsquo;ve
installed the NetBeans IDE using the zip package or one of the native
installers, you only need to run C/C++ Pack&rsquo;s installer and point it to your
NetBeans IDE installation directory. (Note that, although the C/C++ Pack is
mostly Java code with just one tiny native library, there&rsquo;s no multiplatform
zip archive like the ones provided for the IDE.)
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>The installer
itself will work the same for all supported platforms: Windows, Linux and
Solaris. But configuring your environment for using C/C++ Pack may not be so
easy. Just like the core NetBeans IDE needs a compatible JDK installation, the
C/C++ Pack will require a C/C++ compiler and standard libraries and headers. So
you need to install and configure these in advance.
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>To meet the
Pack&rsquo;s prerequisites, we&rsquo;ll rely on the popular suite formed by the GNU C
Compiler (GCC), GNU Binutils, GNU Make and GNU Debugger (GDB). This is the
suite that received most of the QA effort of the C/C++ Pack developer team</span><sup><span
lang=EN-US style='font-size:10.0pt;letter-spacing:-.05pt'>1</span></sup><span
lang=EN-US style='letter-spacing:-.05pt'>, and it&rsquo;s portable to Windows, Linux
and Solaris environments.
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>Using the same
compiler suite for all platforms greatly simplifies dealing with portable (and
even non-portable) C/C++ code, as you won&rsquo;t need to spend time fighting
compiler directives, runtime library inconsistencies and language dialects.
Besides, you&rsquo;ll find that in most cases the GNU toolset competes head-to-head
with other C compilers in both speed and optimization quality.
<o:p></o:p>
</span></p>
<p class=NB-Corpo2>&nbsp;</p>
<p class=NB-Corpo2><em>1 The only other compiler suite supported so far is the Sun Studio product for Solaris
and Linux.</em></p>
<p class=NB-Corpo2>&nbsp;</p>
<p class=NB-Interttulo22><span lang=EN-US style='letter-spacing:-.05pt'>Installing
the GNU toolset on Linux
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>Linux users
should have no problem obtaining the GNU toolset for their preferred platform.
Mine is Fedora Core 6, and as I installed a &ldquo;development workstation&rdquo; using
Anaconda I already had everything ready for NetBeans C/C++ Pack. Users who
didn&rsquo;t install Linux development tools when configuring their systems should
have no problem using either <i>yum</i>, <i>up2date</i>, <i>yast</i> or <i>apt</i> to install the GNU toolset.
<o:p></o:p>
</span></p>
<p class=NB-Corpo2>&nbsp;</p>
<p class=NB-Notadica1><span lang=EN-US>Stay clear of CD-bootable mini-distros
like Knoppix for real development work. Instead, install a full-featured distro
in a native Linux partition in your main hard disk. The few additional
gigabytes used will prove to be a small cost for all the hassle you&rsquo;ll avoid.</span></p>
<p class=NB-Notadica1>&nbsp;</p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>Solaris users
will also find it easy to install the GNU toolset; there are detailed
instructions on the NetBeans Web site. But be warned: if you think you&rsquo;d be
better served by the native platform C compiler (Sun Studio), think again. This
is because NetBeans C/C++ Pack&rsquo;s debugger <i>needs</i> the GNU Debugger, and
GDB has some issues running code generated by Sun compilers. So you can use
Sun&rsquo;s compiler to produce final code, but you&rsquo;d better use the GNU toolchain
for development.
<o:p></o:p>
</span><br>
<br>
</p>
<p class=NB-Interttulo22><span lang=EN-US style='letter-spacing:-.05pt'>Installing
the GNU toolset on Windows
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>Windows users
won&rsquo;t be able to use native C/C++ compilers from Microsoft, Borland or Intel,
and will have to stick with a Windows port of the GNU toolset. There are two
options: Cygwin <br>
and MinGW.
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>The C/C++
Pack&rsquo;s docs at <i>netbeans.org</i> provide detailed instructions for using
Cygwin, but I strongly advise you to use MinGW instead. The reason is that
Cygwin relies on a Unix emulation layer, while MinGW uses native Windows DLLs
for everything. Code compiled with Cygwin uses the standard GNU runtime library
(<i>glibc</i>) on an emulation of Unix system calls, and semantics like mount
points, pipes and path separators. But code compiled with MinGW will use
standard Microsoft runtime libraries such as <i>MSVCRT.DLL</i>.
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>Cygwin has its
uses, as many Linux and Unix software (specially open-source software) that has
not yet been ported to Windows is easy to run under Cygwin without
virtualization overhead. But I doubt you&rsquo;d want to compromise stability and
compatibility with the native platform when developing native libraries for use
with Java applications. So MinGW is the way to go. The <b>sidebar</b> &ldquo;Installing MinGW&rdquo; provides detailed instructions.
<o:p></o:p>
</span><br>
<br>
</p>
<p class=NB-Interttulo22><span lang=EN-US style='letter-spacing:-.05pt'>Checking
prerequisites
<o:p></o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US style='letter-spacing:-.05pt'>Whatever your
platform of choice, you need access to the GNU toolset from your operating
system command prompt. It may be necessary to configure the system PATH before
using NetBeans C/C++ Pack. You can check that you have all prerequisites are
available </span><span lang=EN-US>before proceeding by using the commands
displayed in <b>Figure 1</b>. (Although this figure shows a Windows command
prompt, you&rsquo;ll be able to run the same commands from either the Linux or
Solaris shells.) If you get software releases older than the ones shown,
consider upgrading your GNU toolset.</span></p>
<p class=NB-Corpo2>&nbsp;</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image011.png" width="700" height="378"></td>
</tr>
<tr>
<td><p class=NB-Corpo11> <strong>Figure 1.</strong> Verifying that the GNU toolset is installed and configured correctly, and is using compatible releases.</p></td>
</tr>
</table>
<p class=NB-Interttulo1><span lang=EN-US>When pure
Java
is not enough</span></p>
<p class=NB-Corpo2><span lang=EN-US>Now that you have NetBeans C/C++ installed
and its prerequisites configured, let&rsquo;s present this article&rsquo;s use case. You&rsquo;re
developing a desktop Java application with cryptographic features, which saves
sensitive data such as key rings and private keys in a local file system
folder. You want to be sure that only the user who&rsquo;s running the application
can read (and of course write) files to that folder.</span></p>
<p class=NB-Corpo2><span lang=EN-US>The standard Java libraries provide methods
in the </span><span class=NB-NegritoTcnico1><span lang=EN-US style='font-size:
10.0pt'>java.io.File</span></span><span lang=EN-US> class for checking if a
file can be read or written by the current user, but these methods don&rsquo;t check
if other users can also read or write the same files. There are new methods in
Java SE 6 that deal with file permissions, and work in progress under JSR 293;
but if your application has to support Java 5 or 1.4, there&rsquo;s no escaping from
native code. So our application will use native system calls to verify local
folder permissions during initialization, and refuse to start if it finds the
folder is not secure.</span></p>
<p class=NB-Corpo2><span lang=EN-US>Java doesn&rsquo;t provide an easy way to declare
external methods, like Free Pascal or Visual Basic, but it does of course
provide the Java Native Interface, a standard and portable way to call native
code from Java and vice versa. With the above use case in mind, we have to
design an abstraction that hides platform details and the corresponding native
code from the higher application layers. In the end, the apparent complexity of
dealing with JNI may actually be an advantage, because it forces us to design
the interface between Java and native code, instead of just going ahead and
invoking operating system APIs directly.</span></p>
<p class=NB-Interttulo1><span lang=EN-US>The Java wrapper code</span></p>
<p class=NB-Corpo2><span lang=EN-US>Let&rsquo;s get our feet wet. Start NetBeans,
create a Java Class Library Project, and name it &ldquo;OSlib&rdquo;. This project will
contain all interfaces between our hypothetical application and the native
operating system. Then create a new class named &ldquo;FilePermissions&rdquo;, with the
code shown</span><span class=NB-NegritoTcnico1><span lang=EN-US
style='font-size:10.0pt'> </span></span><span lang=EN-US>in <b>Listing 1</b>.</span><br>
<br>
</p>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#98201A">
<tr class="NB-Legendaimagem">
<td height="26" bgcolor="#98201A" class="NB-Interttulo NB-Listagenstitulos">
<p class="style5"><strong>Listing 1.</strong> FilePermissions.java &ndash; Utility class with a native method.</p>
</td>
</tr>
<tr>
<td><blockquote>
<p class="style2">package org.netbeans.nbmag3.util;</p>
<p class="style2">import java.io.File;</p>
<p class="style2">public class FilePermissions {<br>
<br>
static {<br>
System.loadLibrary(&quot;NativeOSlib&quot;);<br>
}<br>
<br>
public FilePermissions() {}<br>
<br>
// Checks if a file or folder can only <br>
// be read/written by the current user<br>
public static native boolean isPrivate(String path);<br>
}</p>
<p></p>
</blockquote></td>
</tr>
</table>
<br>
<br>
<p class=NB-Corpo2><span lang=EN-US>The </span><span class=NB-NegritoTcnico1><span
lang=EN-US style='font-size:10.0pt'>native</span></span><span lang=EN-US> keyword, you&rsquo;ll remember, means that the method&rsquo;s implementation will be
provided by a native dynamic library. That library in our code is loaded by a
static initializer in the class itself.</span></p>
<p class=NB-Corpo2><span lang=EN-US>Following Test-Driven Development practices,
I&rsquo;ll create unit tests instead of creating a test application for the OS
interface. Right click <i>Test Packages</i> in the Projects window and select <i>New&gt;Test
for Existing Class</i> to generate a skeleton for testing the native method.
Then change this skeleton to make it look like <b>Listing 2</b>. </span><br>
<br>
</p>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#98201A">
<tr class="NB-Legendaimagem">
<td height="26" bgcolor="#98201A" class="NB-Interttulo NB-Listagenstitulos">
<p class="NB-Listagenstitulos"><strong>Listing 2.</strong> Unit tests for FilePermissions native methods</p>
</td>
</tr>
<tr>
<td><blockquote>
<p class="style2"><br>
<strong>FilePermissionsTest.java</strong><br>
-------------------------------------------------------------------------------------------------<br>
package org.netbeans.nbmag3.util;</p>
<p class="style2">import java.util.Properties;<br>
import junit.framework.*;<br>
import java.io.File;</p>
<p class="style2">public class FilePermissionsTest extends TestCase {<br>
Properties paths = null;</p>
<p class="style2"> public FilePermissionsTest(String testName) {<br>
super(testName);<br>
}</p>
<p class="style2"> protected void setUp() throws Exception {<br>
paths = new Properties();<br>
paths.load(this.getClass().getResourceAsStream(&quot;/paths.properties&quot;));<br>
}</p>
<p class="style2"> protected void tearDown() throws Exception {}</p>
<p class="style2"> public void testIsPrivateOk() {<br>
String fileName = paths.getProperty(&quot;FilePermissions.test.privateOk&quot;);<br>
assertTrue(&quot;File does not exist&quot;, new File(fileName).exists());<br>
boolean result = FilePermissions.isPrivate(fileName);<br>
assertEquals(true, result);<br>
}<br>
<br>
public void testCanReadButNotWrite() {<br>
boolean result = FilePermissions.isPrivate(<br>
paths.getProperty(&quot;FilePermissions.test.readButNotWrite&quot;));<br>
assertEquals(false, result);<br>
}<br>
<br>
public void testCanBeReadByOthers() {<br>
boolean result = FilePermissions.isPrivate(<br>
paths.getProperty(&quot;FilePermissions.test.readByOthers&quot;));<br>
assertEquals(false, result);<br>
}<br>
<br>
public void testCanBeWrittenByOthers() {<br>
boolean result = FilePermissions.isPrivate(<br>
paths.getProperty(&quot;FilePermissions.test.writtenByOthers&quot;));<br>
assertEquals(false, result);<br>
} <br>
}</p>
<p class="style2"><span class="NB-Corpo1"><strong>paths.properties</strong></span><br>
-------------------------------------------------------------------------------------------------<br>
# For testing under Linux / Unix<br>
FilePermissions.test.privateOk = /home/fernando/privateOk<br>
FilePermissions.test.readButNotWrite = /home/fernando/readButNotWrite<br>
FilePermissions.test.readByOthers = /home/fernando/readByOthers<br>
FilePermissions.test.writrenByOthers = /home/fernando/writtenByOthers</p>
<p class="style2"># For testing under Windows<br>
#FilePermissions.test.privateOk = C:\\test\\privateOk<br>
#FilePermissions.test.readButNotWrite = C:\\test\\readButNotWrite<br>
#FilePermissions.test.readByOthers = C:\\test\\readByOthers<br>
#FilePermissions.test.writrenByOthers = C:\\test\\writtenByOthers</p>
</blockquote></td>
</tr>
</table>
<p class=NB-Corpo2><br>
</p>
<p class=NB-Corpo2><span lang=EN-US>The unit tests use a properties file (shown
in the same listing) to get each test&rsquo;s target filesystem path. This way, all
file paths can be easily changed to comply with native-platform naming
conventions, without needing to recompile the tests themselves. Also, don&rsquo;t
forget to create the target files and give them appropriate permissions.</span></p>
<p class=NB-Corpo2><span lang=EN-US>If everything is fine so far, running the
tests (by selecting the </span><span class=NB-NegritoTcnico1><span lang=EN-US
style='font-size:10.0pt'>FilePermissionsTest</span></span><span lang=EN-US> class and pressing <i>Shift+F6</i>) should give the output shown in <b>Figure 2</b>.
The </span><span class=NB-NegritoTcnico1><span lang=EN-US style='font-size:10.0pt'>UnsatisfiedLinkError</span></span><span
lang=EN-US> exception is thrown because we haven&rsquo;t yet provided the native
method implementation. </span></p>
<p class=NB-Corpo2>&nbsp;</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image013.png" width="594" height="219"></td>
</tr>
<tr>
<td><p class=NB-Corpo1122> <strong>Figure 2. </strong> Running JUnit tests for the unfinished native method.<br>
</p></td>
</tr>
</table>
<p class=NB-Corpo23></p>
<p class=NB-Corpo2>&nbsp;</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="33" bgcolor="#98201A" class="NB-Quadrotitulo">Other open-source C/C++ IDEs</td>
</tr>
<tr>
<td height="33" bgcolor="#F1B5B1" ><p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>C and C++ are of course much older than Java, and are still the
languages of choice for many high-profile open-source projects. Based on that,
on could guess there would be many other strong cross-platform and open-source
C/C++ IDEs. You&rsquo;ll find that NetBeans C/C++ Pack may be the strongest one
around, however. Let&rsquo;s look at some C/C++ Pack&rsquo;s competitors.
<o:p></o:p>
</span></p>
<p class=NB-Interttulo23><span lang=EN-GB style='color:black;letter-spacing:
-.1pt;mso-ansi-language:EN-GB'>DevCPP
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>DevCPP is very popular among Windows developers. It&rsquo;s lightweight, well
supported, and, like NetBeans, relies on external make tools and C/C++
compilers. Additionally, it supports a wide variety of C/C++ compilers. Though
DevCPP is written using Borland Delphi, an attempt to port it to Linux (using
Kylix) failed. So DevCPP is not an option for cross-platform C/C++ development.
<o:p></o:p>
</span></p>
<p class=NB-Interttulo23 style='margin-top:5.65pt'><span lang=EN-GB
style='color:black;letter-spacing:-.1pt;mso-ansi-language:EN-GB'>OpenWatcom
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>The Watcom C/C++ compiler is cross-platform but offers no Unix support;
it targets Windows and OS/2. Though not very user-friendly, it comes with an
integrated debugger and a help system. It was once the compiler of choice for
high-performance C/C++ applications, with its enhanced code optimizer and
support for all Intel processor variants. When Sybase bought Watcom, though,
the C/C++ compilers and IDEs fell into obscurity. Later the tools were released
as open-source software. Nowadays, it looks like the community project is going
well, but there&rsquo;s still no support for Unix and Linux systems. This makes
OpenWatcom essentially a Windows-only IDE and not suitable for our purposes.
<o:p></o:p>
</span></p>
<p class=NB-TabelaIntertitulo style='margin-top:11.35pt'><span lang=EN-GB
style='color:black;letter-spacing:-.1pt'>Anjuta
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>Anjuta is based on the complete GNU toolset for C/C++ development. In
addition to the tools supported by C/C++ Pack, it supports the GNU Autotools, a
set of scripts that simplifies generating Makefiles for multiple operating
systems and compilers. It&rsquo;s also focused on GNOME development, so it provides
templates for GTK, Gnome and Glade applications.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>While DevCPP and OpenWatcom are Windows-only, Anjuta and KDeveloper (see
next) are Unix-only. Some users have reported success running both under Cygwin,
but they are still far from providing robust support for compiling and
debugging native Windows applications.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>For Unix developers, Anjuta provides integrated access to <i>man</i> pages and GNOME documentation. Its integrated debugger, like C/C++ Pack, relies
on GDB. The latest releases provide integration with Glade, the Gnome visual UI
builder.
<o:p></o:p>
</span></p>
<p class=NB-Interttulo23><span lang=EN-GB style='color:black;letter-spacing:
-.1pt;mso-ansi-language:EN-GB'>KDevelop
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>Everything said before about Anjuta applies to KDevelop, if you just
replace GTK/Glade/GNOME with Qt/QtDesigner/KDE. Anjuta and KDevelop are strong
C/C++ IDEs for open-source desktops, but they don&rsquo;t cut it as cross-platform
IDEs.
<o:p></o:p>
</span></p>
<p class=NB-TabelaIntertitulo><span lang=EN-GB style='color:black;letter-spacing:
-.1pt'>Eclipse CDT
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>C/C++ development support in Eclipse is almost as old as Eclipse IDE
itself, but it has not matured as fast as the support for Java. Although
currently labeled as release 4.0, Eclipse CDT doesn&rsquo;t provide many features
beyond those in NetBeans C/C++ Pack (which is younger).
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>Also like NetBeans, Eclipse CDT doesn&rsquo;t integrate yet with visual
development tools for Gnome, KDE or Windows. It has the advantage of supporting
compilers other than the GNU compilers, but this won&rsquo;t be a real plus if your
goal is developing cross-platform C code.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>Red Hat is developing GNU Autotools and RPM generation plug-ins which,
when they are released as production level, may become Eclipse CDT&rsquo;s real
advantage over NetBeans C/C++ Pack (at least for Unix/Linux users). On the
other hand, NetBeans is the development IDE for Open Solaris, so don&rsquo;t expect
it to fall short in enhancements for Unix developers.
<o:p></o:p>
</span></p>
<p class=NB-TabelaIntertitulo><span lang=EN-GB style='color:black;letter-spacing:
-.1pt'>Conclusion
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo><span lang=EN-US style='color:black;letter-spacing:
-.1pt'>The only flaw one would find in C/C++ Pack, comparing it to other
open-source alternatives for C/C++ development, is the lack of operating-system
and third-party library documentation support in the help system. That would be
also its main drawback when compared to proprietary C/C++ IDEs. But if you
evaluate alternatives for cross-platform C/C++ development, the strongest (and
only) competitor for NetBeans is also its main competitor in the Java space,
that is, Eclipse.
<o:p></o:p>
</span><br>
<br>
<br>
</p> </td>
</tr>
</table>
<p class=NB-Corpo2>&nbsp;</p>
<p class=NB-Interttulo1><span lang=EN-US>The native code project</span></p>
<p class=NB-Corpo2><span lang=EN-US>Our unit tests are ready, but getting native
code working alongside Java code is not trivial. We&rsquo;ll mock the native method
implementation so we can focus on how to build a native library that can be
called by Java code. Start by creating a C/C++ Dynamic Library Project, as
shown in <b>Figure 3</b>. Name the project &ldquo;NativeOSlib&rdquo; and clear the &ldquo;Set as
main project&rdquo; checkbox. </span><br>
<br>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image015.png" width="731" height="499"></td>
</tr>
<tr>
<td><p class=NB-Corpo11212> <strong>Figure 3.</strong> Creating a C/C++ Project in NetBeans.<br>
</p></td>
</tr>
</table>
<p class=NB-Corpo2><br>
</p>
<p class=NB-Corpo2><span lang=EN-US>New C/C++ projects are created empty, except
for a generated <i>Makefile</i> (see <b>Figure 4</b>), and are structured in
virtual folders organized by file type &ndash; not by package names like Java
projects. You&rsquo;ll be pleased to know that NetBeans C/C++ Pack includes a
Makefile editor (even though there&rsquo;s still no support for running arbitrary
Makefile targets as there is for Ant buildfiles).</span><br>
<br>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image017.png" width="252" height="337"></td>
</tr>
<tr>
<td><p class=NB-Corpo112112> <strong>Figure 4.</strong> The new C/C++ project in NetBeans&rsquo; Projects window.<br>
<br>
</p></td>
</tr>
</table>
<br>
<p class=NB-Interttulo22><span lang=EN-US>Generating JNI Stubs</span></p>
<p class=NB-Corpo2><span lang=EN-US>We&rsquo;re ready to begin writing our C code.
First remember that all JNI-compliant native methods should use the declaration
generated by JDK&rsquo;s <i>javah</i> tool. You could turn to the operating system
command prompt to generate the C JNI stubs, but there&rsquo;s a better solution. It&rsquo;s
the JNI Maker project, a plug-in module that adds a context menu for generating
JNI header files from Java classes. Just get the <i>nbm</i> package from <i>jnimaker.dev.java.net</i> and install it using NetBeans&rsquo;s Update Center. After restarting the IDE, you
should see a new menu item as shown in <b>Figure 5</b>.</span><br>
<br>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image019.png" width="252" height="337"></td>
</tr>
<tr>
<td height="21"><p class=NB-Corpo1121114> <strong>Figure 5. </strong>Generating a JNI stub using the JNI Maker plug-in module.<br>
<br>
</p></td>
</tr>
</table>
<p class=NB-Corpo2><br>
</p>
<p class=NB-Notadica1 style='margin-top:11.35pt'><span lang=EN-US>Before
generating JNI stubs, make sure you&rsquo;ve built the Java project. JNI Maker uses
the distribution JARs.<br>
</span></p>
<p class=NB-Corpo2><span lang=EN-US>Now select <i>Generate JNI Stub</i> from the </span><span class=NB-NegritoTcnico1><span lang=EN-US style='font-size:10.0pt'>FilePermissions</span></span><span
lang=EN-US> class&rsquo;s context menu. NetBeans shows a standard <i>File Save</i> dialog, where you can select a folder to save the generated <i>FilePermissions.h</i> header file. Move into the <i>NativeOSlib</i> project folder and create a new <i>src</i> folder (C/C++ Projects do not have a default file structure with separate
source and test folders like Java projects do). Save the header file there. The
output window will look like <b>Figure 6</b> if the operation is successful.</span></p>
<p class=NB-Corpo2>&nbsp;</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image021.png" width="765" height="198"></td>
</tr>
<tr>
<td height="21"><p class=NB-Corpo11211111> <strong>Figure 6. </strong>Output from the Generate JNI Stub command. <br>
<br>
</p></td>
</tr>
</table>
<p class=Noparagraphstyle1><span lang=EN-US style='font-size:9.0pt;line-height:
120%;font-family:"Verdana";mso-bidi-font-family:"Verdana";letter-spacing:
.05pt'>
<o:p>&nbsp;</o:p>
</span></p>
<p class=NB-Notadica1><span lang=EN-US>JNI Maker Release 1.0 will only work
correctly under Windows, but the generated code will compile and run fine on
Unix/Linux. The project developers have been contacted about the module&rsquo;s
cross-platform issues and by the time you read this there should be a new
release that will work on all platforms supported by NetBeans C/C++ Pack</span></p>
<p class=Noparagraphstyle1><span lang=EN-US style='font-family:"Verdana";
mso-bidi-font-family:"Verdana"'>
<o:p>&nbsp;</o:p>
</span></p>
<p class=NB-Corpo2><span lang=EN-US>Using the JNI Maker module has the same
effect as running the following command from the operating system prompt,
assuming the <i>OSlib</i> project folder is the current directory and <i>NativeOSlib</i> project folder is a sibling:</span></p>
<p class="style7">$ javah -classpath dist/OSlib.jar
-jni -o ../NativeOSlib/src/FilePermissions.h</p>
<blockquote>
<p class="style7">org.netbeans.nbmag3.util.FilePermissions</p>
</blockquote>
<p class=NB-Corpo2>&nbsp;</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="33" bgcolor="#98201A" class="NB-Quadrotitulo">Installing MinGW</td>
</tr>
<tr>
<td height="33" bgcolor="#F1B5B1" ><p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>The MinGW project provides a native port of the
GNU toolset for Windows platforms. Included in the base distribution are GNU C,
C++, Objective-C, Ada, Java and Fortran compilers, plus an assembler and a
linker; there&rsquo;s also support for dynamic libraries and Windows resource files.
Additional packages provide useful tools like Red Hat Source Navigator, Insight
GUI debugger and a handful of Unix ports like the <i>wget</i> download manager.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>MinGW stands for &ldquo;Minimalist GNU for Windows&rdquo;.
But it&rsquo;s &ldquo;minimalist&rdquo; only when compared to the Cygwin environment. (Cygwin
tries to emulate a full Unix shell, complete with bash scripting, user commands
and a Unix-like view of the filesystem.)
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>In fact, MinGW is complete to the point of
providing Win32 API header files, and many popular open-source applications
like Firefox have their Windows releases compiled using it. (Recent Cygwin
releases include many MinGW enhancements as a cross-compiling feature, showing
how Windows development is &ldquo;alien&rdquo; to MinGW alternatives.)
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.35pt;mso-ansi-language:EN-GB'>If you check the project&rsquo;s website, it looks
like MinGW development has been stalled for quite a few years; the problem is
that the site was automatically generated by a script that read the project&rsquo;s
SourceForge area, and developers simply got tired of catching up with <i>sf.net&rsquo;s</i> design changes. However, MinGW is a very healthy project with active mailing
lists and frequent file releases.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>There is an installer for the base distribution
named <i>mingw-x.x.exe</i> that downloads selected packages from SourceForge
and installs them. The same installer can be used to update an existing MinGW
installation.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>Individual packages are downloaded to the same
folder where the installer was started. This allows you to later copy the
entire folder to another workstation and install MinGW there without the need
of an Internet connection. Most extra packages provide their own installers or
can simply be unpacked over an existing MinGW installation.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>To satisfy C/C++ Pack&rsquo;s prerequisites, you&rsquo;ll
need to download and install three MinGW packages: the base distribution
itself, the GDB debugger, and the MSys distribution.
<o:p></o:p>
</span></p>
<p class=NB-TabelaIntertitulo2><span lang=EN-GB style='color:black'>Installing
MinGW
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>Download <i>MinGW-5.1.3.exe</i> (or newer) from
the project&rsquo;s current file releases at <i>sf.net/project/showfiles.php?group_id=2435</i>,
then launch it to see a standard Windows installer.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>On the third step of the wizard (the second
screen in <b>Figure S1</b>) you only need to select &ldquo;MinGW base tools&rdquo; and
optionally &ldquo;g++ compiler&rdquo;. Also, the Java Compiler may be interesting to play
with, because of its ability to generate native machine code from Java sources
and bytecodes, but it&rsquo;s not supported by NetBeans yet. Interestingly, the g77
(Fortran) compiler will be officially supported very soon.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>After downloading all selected packages, the
installer will ask for the destination directory and unpack all packages there.
It&rsquo;s left to the user to configure environment variables so that MinGW tools
can be used from the Windows command prompt.
<o:p></o:p>
</span></p>
<p class=NB-TabelaIntertitulo2><span lang=EN-GB style='color:black'>Installing
GDB
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>As we&rsquo;ve seen, NetBeans C/C++ Pack needs GDB to
be able to debug C programs. The MinGW distribution packages GDB as a
stand-alone installer.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>At the time of writing, the latest stable MinGW
package for GDB was release 5.2.1, which won&rsquo;t refresh the NetBeans debugger&rsquo;s
Local Variables window correctly. To solve this, download <i>gdb-6.3-2.exe</i> (or newer) from MinGW Snapshot Releases to a temporary folder and run it.
Though you don&rsquo;t need to install GDB over MinGW, your life will be easier if
you do, as you won&rsquo;t need to add another folder to your PATH system environment
variable.
<o:p></o:p>
</span></p>
<p class=NB-TabelaIntertitulo2><span lang=EN-GB style='color:black'>Installing
MSys
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>The MinGW base distribution already includes a
make tool named <i>mingw32-make.exe</i>, but NetBeans C/C++ Pack won&rsquo;t be happy
with it. MinGW&rsquo;s make tool is patched to be more compatible with other native
Windows C compilers, and NetBeans expects a Unix-style make tool. NetBeans
generated Makefiles even expect to find standard Unix file utilities such as <i>cp</i> and <i>rm</i>.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;mso-ansi-language:
EN-GB'>The MinGW MSys package satisfies these dependencies. <span
style='letter-spacing:-.25pt'>It is a &ldquo;Minimal System&rdquo; that provides a
Unix-style shell and file utilities, and allows open-source projects based on
GNU Autotools to be easily built using MinGW.
<o:p></o:p>
</span></span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>Download <i>msys-1.0.10.exe</i> or newer to a
temporary folder and start it. At the final installation step, a batch script
configures the integration between MSys and MinGW. You will still have to add
the MSys programs folder to the system PATH (in my case, <i>E:\MSys\1.0\bin</i>),
as you did for the MinGW base distribution.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>That&rsquo;s it. After running three installers and
downloading about 23 MB, we are ready to develop C/C++ applications and libraries
using the NetBeans IDE and C/C++ Pack on Windows.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo2><span lang=EN-GB style='color:black;letter-spacing:
-.25pt;mso-ansi-language:EN-GB'>
<o:p>&nbsp;</o:p>
</span></p> </td>
</tr>
<tr>
<td height="33" bgcolor="#F1B5B1" ><img src="/images_www/magazine/c++/images/image001.png" width="503" height="393"></td>
</tr>
<tr>
<td height="19" bgcolor="#F1B5B1" class="NB-Corpo11" >&nbsp;</td>
</tr>
<tr>
<td height="33" bgcolor="#F1B5B1" ><img src="/images_www/magazine/c++/images/image003.png" width="503" height="393"></td>
</tr>
<tr>
<td bgcolor="#F1B5B1"><p class=NB-Corpo111> <strong>Figure S1.</strong> Screens from MinGW&rsquo;s base distribution installer.<br>
</p></td>
</tr>
</table>
<p class=NB-Corpo2>&nbsp;</p>
<p class=NB-Corpo2>&nbsp;</p>
<p class=NB-Corpo2><span lang=EN-US>(The command is broken to fit the column
width, but it should be typed in a single line, of course.)</span></p>
<p class=NB-Corpo2><span lang=EN-US>Now add the generated C header file to the
NativeOSlib project. Right click <i>Header Files</i> inside the <i>NativeOSlib</i> project folder in NetBeans&rsquo; Projects window, and select <i>Add Existing Item</i>.
Then browse to the file <i>src/FilePermissions.h</i> and open it. The code will
look like <b>Listing 3</b>.</span><br>
<br>
<br>
</p>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#98201A">
<tr class="NB-Legendaimagem">
<td height="23" bgcolor="#98201A" class="NB-Interttulo NB-Listagenstitulos">
<p class="NB-Listagenstitulos"><strong>Listing 3.</strong> FilePermissions.h &ndash; JNI Stub for native methods in the FilePermissions class.</p>
</td>
</tr>
<tr>
<td height="374"><blockquote>
<p class="style2"><br>/* DO NOT EDIT THIS FILE - it is machine generated */<br>
#include &lt;jni.h&gt;<br>
/* Header for class org_netbeans_nbmag3_util_FilePermissions */</p>
<p class="style2"><span class="style2">#ifndef _Included_org_netbeans_nbmag3_util_FilePermissions<br>
#define _Included_org_netbeans_nbmag3_util_FilePermissions</span><br>
#ifdef __cplusplus<br>
extern &quot;C&quot; {<br>
#endif<br>
/*<br>
&nbsp;* Class:&nbsp;&nbsp;&nbsp;&nbsp; org_netbeans_nbmag3_util_FilePermissions<br>
&nbsp;* Method:&nbsp;&nbsp;&nbsp; isPrivate<br>
&nbsp;* Signature: (Ljava/io/File;)Z<br>
&nbsp;*/<br>
<strong>JNIEXPORT jboolean JNICALL Java_org_netbeans_nbmag3_util_FilePermissions_isPrivate</strong><br>
<strong>&nbsp; (JNIEnv *, jclass, jobject);</strong></p>
<p class="style2">#ifdef __cplusplus<br>
}<br>
#endif<br>
#endif</p>
</blockquote></td>
</tr>
</table>
<br>
<br>
<p class=NB-Interttulo22><span lang=EN-US>Mocking native code</span></p>
<p class=NB-Corpo2><span lang=EN-US>Due to space constraints, we won&rsquo;t show you
the final C code for the </span><span class=NB-NegritoTcnico1><span lang=EN-US
style='font-size:10.0pt'>FilePermissions.isPrivate()</span></span><span
lang=EN-US> native method, but the sources available for download will provide
working implementations for both Windows and Unix (Posix) systems.</span></p>
<p class=NB-Corpo2><span lang=EN-US>To create the C implementation file, right
click <i>Source Files</i> and select <i>New&gt;Empty C File</i>, then type
&ldquo;FilePermissions.c&rdquo; as the file name and &ldquo;src&rdquo; as the folder name. A new node
named <i>FilePermissions.c</i> should be created under <i>Source Files</i>.</span></p>
<p class=NB-Corpo2><span lang=EN-US>Copy the C stub function declaration from <i>FilePermissions.h</i> to <i>FilePermissions.c</i> and change it to include the header file. Also add
parameter names. The code should look like <b>Listing 4</b>. (<b>Listing 3</b> highlights the declaration you have to copy, and <b>Listing 4</b> highlights
the changes after copying.)</span><br>
<br>
</p>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#98201A">
<tr class="NB-Legendaimagem">
<td height="23" bgcolor="#98201A" class="NB-Interttulo NB-Listagenstitulos">
<p class="NB-Listagenstitulos"><strong>Listing 4.</strong> FilePermissions.h &ndash; JNI mock implementation for the FilePermissions native methods.</p>
</td>
</tr>
<tr>
<td height="120"><blockquote>
<p class="style2"><br>
#include &quot;FilePermissions.h&quot;</p>
<p><span class="style2">JNIEXPORT jboolean JNICALL Java_org_netbeans_nbmag3_util_FilePermissions_isPrivate<br>
(JNIEnv *env, jclass clazz, jstring path) {<br>
return JNI_TRUE;<br>
}</span><br>
</p>
</blockquote></td>
</tr>
</table>
<p class=NB-Corpo2><br>
</p>
<p class=NB-Corpo2><span lang=EN-US>At this point, Unix and Linux users should
be ready to build the native code and run unit tests again</span><sup><span
lang=EN-US style='font-size:10.0pt'>2</span></sup><span lang=EN-US>. But
Windows users first have to change a few project properties to make MinGW
generate Windows-compatible JNI DLLs. The <b>sidebar</b> &ldquo;JNI and MinGW&rdquo;
details these <br>
configurations.</span></p>
<p class=NB-Corpo2>&nbsp;</p>
<p class=NB-Corpo2><em>2 At least if you use JDK packages compatible with your distro package manager, like the IBM and BEA JDKs provided by RHEL and SuSE Enterprise, or the RPM Packages from jpackage.org. If not, you&rsquo;ll have to add your JDK include folder to the GNU C compiler include directory. The configurations will be similar to the ones presented in the &ldquo;JNI and MinGW&rdquo; sidebar, but you won&rsquo;t need to change either the linker output file name or additional compiler options.</em><br></p>
<p class=NB-Corpo2><span lang=EN-US>Right click the <i>NativeOSlib</i> project
and select <i>Clean and Build Project</i>. If there are no errors, you should
see <i>make</i>&rsquo;s output as in <b>Figure 7</b>.</span><br>
<br>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image023.png" width="700" height="190"></td>
</tr>
<tr>
<td height="21"><p class=NB-Corpo11211121> <strong>Figure 7. </strong>Building the NativeOSlib project under Linux. <br>
<br>
</p></td>
</tr>
</table>
<p class=NB-Corpo2><br>
</p>
<p class=NB-Interttulo22><span lang=EN-US>Running unit tests again</span></p>
<p class=NB-Corpo2><span lang=EN-US>You need to set the <i>OSlib </i>project&rsquo;s </span><span
class=NB-NegritoTcnico1><span lang=EN-US style='font-size:10.0pt'>java.library.path</span></span><span
lang=EN-US> system property before running it, or you&rsquo;ll still get </span><span
class=NB-NegritoTcnico1><span lang=EN-US style='font-size:10.0pt'>UnsatisfiedLinkError</span></span><span
lang=EN-US> exceptions. Open the project&rsquo;s Properties dialog, select the <i>Run</i> category and change <i>VM Options</i> to specify the full path to the <i>NativeOSlib</i> project&rsquo;s platform-specific native-library folder, which is inside the <i>dist</i> folder (see <b>Figure 8</b>). In Linux, this will be <i>PROJECT_HOME/dist/Debug/GNU-Linux-x86</i>;
in Windows, <i>PROJECT_HOME\dist\Debug\GNU-Windows</i>.</span><br>
<br>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image025.png" width="700" height="225"></td>
</tr>
<tr>
<td height="21"><p class=NB-Corpo11211132> <strong>Figure 8. </strong>Configuring the java.library.path property so unit tests can find the native code library on Linux.<br>
<br>
</p></td>
</tr>
</table>
<p class=NB-Corpo2><br>
</p>
<p class=NB-Corpo2><span lang=EN-US>Now run the unit tests again. The result
should be as shown in <b>Figure 9</b>. Since the mock native code always
returns true, some tests pass even if you have not created target test folders
or forgotten to setup their access permissions. Anyway, the first test should
fail because it takes an extra step to check if the target file path <br>
actually exists.</span></p>
<p class=NB-Corpo2><br>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image027.png" width="600" height="239"></td>
</tr>
<tr>
<td height="21"><p class=NB-Corpo112111312> <strong>Figure 9. </strong> Running unit tests using a mock native implementation.<br>
<br>
</p></td>
</tr>
</table>
<p class=NB-Corpo2><br>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="33" bgcolor="#98201A" class="NB-Quadrotitulo">JNI and MinGW</td>
</tr>
<tr>
<td height="33" bgcolor="#F1B5B1" ><p class=NB-TabelaCorpo3><span lang=EN-US style='color:black;letter-spacing:
-.2pt'>Unix and Windows native C/C++ compilers use different conventions for
mangling function names<sup>1<span class=Refdenotaderodap00E9>*</span></sup>,
exporting global symbols from libraries and setting up stack frames. JNI on
Windows uses Microsoft conventions for Windows DLLs, while GCC uses its own
conventions for dynamic libraries. This means that if you simply try to compile
and link a dynamic library, MinGW will stick to its Unix origins and produce a
DLL that is incompatible with native Windows C/C++ compilers. The JVM won&rsquo;t be
able to get native method implementations from that library and will generate
more </span><span class=NB-NegritoTcnico2><span lang=EN-US style='font-size:
10.0pt;letter-spacing:-.2pt'>UnsatisfiedLinkException</span></span><span
class=Fontepar00E1gpadr00E3o2><span lang=EN-US style='color:black;letter-spacing:
-.2pt'>s</span></span><span lang=EN-US style='color:black;letter-spacing:-.2pt'>.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo3><span lang=EN-GB style='color:black;letter-spacing:
-.2pt;mso-ansi-language:EN-GB'>The solution is to add a few command-line
options when compiling C/C++ sources: </span><span class=NB-NegritoTcnico2><span
lang=EN-GB style='font-size:10.0pt;letter-spacing:-.2pt;mso-ansi-language:EN-GB'>&#8209;D_JNI_IMPLEMENTATION
-Wl,--kill-at</span></span><span lang=EN-GB style='color:black;letter-spacing:
-.2pt;mso-ansi-language:EN-GB'>. Open the C/C++ Dynamic Library Project
properties and expand <i>C/C++</i>&gt;<i>Command Line</i>, then type these
options in the <i>Additional Options</i> text field (see <b>Figure S1</b>).
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo3><span lang=EN-GB style='color:black;letter-spacing:
-.1pt;mso-ansi-language:EN-GB'>You also need to add your JDK include folders (<i>JAVA_HOME\include</i> and <i>JAVA_HOME\include\win32</i>) to the project properties. Open <br>
C<i>/C++</i>&gt;<i>GNU C Compiler</i>&gt;<i>General</i> and change the <i>Include
Directories</i> field as shown in <b>Figure S2</b>.
<o:p></o:p>
</span></p>
<p class=NB-TabelaCorpo3><span lang=EN-GB style='color:black;letter-spacing:
-.2pt;mso-ansi-language:EN-GB'>You need one last change in the C/C++ Dynamic
Library Project properties so you can generate a JNI-compatible DLL. By
default, NetBeans chooses a library name that corresponds to Cygwin
conventions, but we need to use native Windows conventions. So you need to
enter the <i>Linker</i>&gt;<i>General</i> category and remove the &ldquo;cyg&rdquo; prefix
from the <i>Output</i> field (<b>Figure S3</b>)</span>.</p>
<p class=NB-TabelaCorpo3>&nbsp;</p>
<p class=NB-TabelaCorpo3><em><span lang=EN-GB style='color:black;letter-spacing:
-.2pt;mso-ansi-language:EN-GB'>1&ldquo;Mangling&rdquo; is the process used for generating public C++ function names in object files. It&rsquo;s needed because the C language doesn&rsquo;t support function overloading, and, to keep backward compatibility, C++ compilers generate a function name that encodes parameter types.</span></em></p>
<p class=NB-TabelaCorpo3>&nbsp;</p></td>
</tr>
<tr>
<td height="33" bgcolor="#F1B5B1" ><img src="/images_www/magazine/c++/images/image005.png" width="645" height="325"></td>
</tr>
<tr>
<td height="19" bgcolor="#F1B5B1" class="NB-Corpo11" ><p class=NB-Corpo11111> <strong>Figure S1.</strong> MinGW compiler options for generating JNI-compatible DLLs<br>
<br>
<br>
</p></td>
</tr>
<tr>
<td height="33" bgcolor="#F1B5B1" ><img src="/images_www/magazine/c++/images/image007.png" width="621" height="387"> </td>
</tr>
<tr>
<td bgcolor="#F1B5B1"><p class=NB-Corpo1111> <strong>Figure S2.</strong> Configuring JDK include folders for MinGW<br>
<br>
<br>
</p></td>
</tr>
<tr>
<td bgcolor="#F1B5B1"><img src="/images_www/magazine/c++/images/image009.png" width="681" height="387"></td>
</tr>
<tr>
<td bgcolor="#F1B5B1"><p class=NB-Corpo1111> <strong>Figure S3.</strong> Changing the output file name for compliance with Windows DLL naming conventions<br>
<br>
</p></td>
</tr>
</table>
<p class=NB-Interttulo1>&nbsp;</p>
<p class=NB-Interttulo1><span lang=EN-US>Managing platform-specific compiler
settings</span></p>
<p class=NB-Corpo2><span lang=EN-US>NetBeans C/C++ Pack puts object files in the <i>build</i> and <i>dist</i> folders, inside subdirectories named after the
target platform, for example <i>GNU-Linux-x86</i> or <i>GNU-Windows</i>. But it
won&rsquo;t save different compiler options for each target, forcing you to have a
different project for each platform if there&rsquo;s a need for platform-specific
compiler settings.</span></p>
<p class=NB-Corpo2><span lang=EN-US>You can solve this using NetBeans C/C++
Pack&rsquo;s multiple configurations feature. Open <i>NativeOSlib</i>&rsquo;s project
properties and notice the <i>Configuration</i> combo box on the top of the
window (<b>Figure 10</b>). The default configurations are meant to save
different compiler settings for Debug and Release builds, like keeping symbol
information for Debug builds and optimizing code for Release builds. So if you
want platform-specific configurations, you may need to create Release and Debug
variants for each platform.</span><br>
<br>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image029.png" width="616" height="303"></td>
</tr>
<tr>
<td height="21"><p class=NB-Corpo1121113112> <strong>Figure 10. </strong> Combo box for changing compiler configurations for a C/C++ project.<br>
<br>
</p></td>
</tr>
</table>
<p class=NB-Corpo2><br>
</p>
<p class=NB-Corpo2><span lang=EN-US>The <i>Manage Configurations</i> button to
the side of the combo box lets you create new configurations either from
scratch or as a copy of an existing configuration (see <b>Figure 11</b>).
You&rsquo;ll notice I renamed the generated Debug configuration to <i>Debug-Linux</i> and copied it to a new configuration named <i>Debug-Windows</i>. Doing this
lets you change the Windows configuration to include all options needed by
MinGW for generating JNI-compatible DLLs, while keeping the default settings
for the Linux configuration. </span><br>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images_www/magazine/c++/images/image029.png" width="616" height="303"></td>
</tr>
<tr>
<td height="21"><p class=NB-Corpo11211131111> <strong>Figure 11. </strong> Creating, renaming or copying configurations.<br>
<br>
</p></td>
</tr>
</table>
<br>
<br>
<p class=NB-Corpo2><span lang=EN-US>NetBeans-generated Makefiles provide many
extension points (like the Ant buildfiles generated by the IDE), and they can
be used outside the IDE. For example, for building the <i>Debug-Windows</i> configuration you&rsquo;d type the following command at the operating system prompt:</span></p>
<p class=style7><span lang=EN-US>make CONF=Debug-Windows</span></p>
<p class=NB-Corpo2><span lang=EN-US>Thus, you could have Continuous Integration
servers for many platforms, all being fed by the same CVS or Subversion source
tree. And thanks to GNU C cross-compiler features it would be possible to have
a &ldquo;compile farm&rdquo; that generates native binaries for multiple platforms, without
the need for multiple OS installations. For example, a Linux server could
generate both Windows and Solaris <br>
SPARC binaries.</span><br></p>
<p class=NB-Interttulo1><span lang=EN-US>Conclusions</span></p>
<p class=NB-Corpo2><span lang=EN-US>NetBeans C/C++ Pack provides a rich
environment for developing C and C++ applications and libraries. It&rsquo;s useful
for Java developers that need to interface with native code and, of course, for
developing fully-native applications. Compiler configuration may pose some
challenges for Windows developers if they never tried GNU compilers before, but
the effort will certainly pay off because of the increased portability of both
code and Makefiles.</span>
<!--[if gte vml 1]><v:shapetype id="_x0000_t202"
coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe">
<v:stroke joinstyle="miter"/>
<v:path gradientshapeok="t" o:connecttype="rect"/>
</v:shapetype><v:shape id="_x0000_s1026" type="#_x0000_t202" style='position:absolute;
margin-left:0;margin-top:0;width:7.1pt;height:7.6pt;text-indent:0;z-index:1;
mso-wrap-distance-left:0;mso-wrap-distance-right:0;mso-position-horizontal:left;
mso-position-horizontal-relative:char;mso-position-vertical:center;
mso-position-vertical-relative:line' o:allowincell="f">
<v:textbox>
<![if !mso]>
<table cellpadding=0 cellspacing=0 width="100%">
<tr>
<td><![endif]>
<div>
<p class=NB-Legendaimagem><span class=NB-NegritoTcnico><span lang=EN-US
style='mso-ansi-language:EN-US'>t<o:p></o:p></span></span></p>
</div>
<![if !mso]></td>
</tr>
</table>
<![endif]></v:textbox>
<w:wrap type="square" anchorx="margin" anchory="margin"/>
</v:shape><![endif]-->
<![if !vml]><![endif]>
<br>
<br>
</p>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#98201A">
<tr class="NB-Legendaimagem">
<td height="33" bgcolor="#98201A" class="NB-Interttulo NB-Listagenstitulos">
<p class="NB-Listagenstitulos"><strong>Links</strong></p>
</td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40">&nbsp;</td>
<td><a href="https://netbeans.org/features/cpp/index.html"><span class="style3"><font color="#98201A" face="Verdana">netbeans.org/features/cpp/index.html
</font></span></a></td>
</tr>
<tr>
<td height="19">&nbsp;</td>
<td><font size=1 color=black face="Verdana"><span style="font-size:9.0pt;letter-spacing:0pt">NetBeans C/C++ Pack home page
</span></font></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40">&nbsp;</td>
<td><a href="http://plugins.netbeans.org/plugin/556/mko-jni-stub-maker"><span class="style3"><font color="#98201A" face="Verdana">MKO-JNI Stub Maker
</font></span></a></td>
</tr>
<tr>
<td height="19">&nbsp;</td>
<td><span class="style1"><font color=black face="Verdana">MKO JNI Stub Maker, a NetBeans plug-in for generating JNI headers
</font></span></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40">&nbsp;</td>
<td><a href="http://java.sun.com/javase/6/docs/technotes/guides/jni"><span class="style3"><font color="#98201A" face="Verdana">java.sun.com/javase/6/docs/technotes/guides/jni
</font></span></a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><span class="style1"><font color=black face="Verdana">Java Native Interface specification and related tips
</font></span></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40">&nbsp;</td>
<td><a href="http://mingw.sf.net"><span class="style3"><font color="#98201A" face="Verdana">mingw.sf.net
</font></span></a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><span class="style1"><font color=black face="Verdana">MinGW, the native GNU toolset for Windows
</font></span></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40">&nbsp;</td>
<td><a href="http://sf.net/project/showfiles.php?group_id=2435"><span class="style3"><font color="#98201A" face="Verdana">sf.net/project/showfiles.php?group_id=2435
</font></span></a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><span class="style1"><font color=black face="Verdana">SourceForge file releases for MinGW
</font></span></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40">&nbsp;</td>
<td><a href="http://cygwin.com"><span class="style3"><font color="#98201A" face="Verdana">cygwin.com
</font></span></a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><span class="style1"><font color=black face="Verdana">Cygwin, a GNU toolset for Windows.
</font></span></td>
</tr>
</table> </tr>
</table>
<p class=NB-Corpo2 style4>&nbsp;</p>
<table width="770" border="1" cellpadding="0" cellspacing="0" bordercolor="#BC001C">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#BC001C">
<tr>
<td width="93"><div align="center"><img src="/images_www/magazine/autores/Fernando-Lozano.jpg" alt="Autor" width="80" height="94"></div></td>
<td width="677" valign="middle"><p class=NB-Corpo11112><span class="NB-Corpo1112"><strong>Fernando Lozano</strong><br>
(fernando@lozano.eti.br) is an independent consultant and has worked with information systems since 1991. He&rsquo;s the Community Leader of the Linux Community at Java.net, webmaster for the Free Software Foundation and counselor to the Linux Professional Institute. Lozano helps many open-source projects and teaches at undergraduate and postgraduate college courses. He&rsquo;s also a technical writer and book author, as well as Contributing Editor at Java Magazine (Brazil) and freelance writer for other leading IT publications.</span></p></td>
</tr>
</table></td>
</tr>
</table>
<br>
</div></td>
</tr>
</table>
<p class=NB-Corpo style='text-indent:0cm'>&nbsp;</p>
</div>
</body>
</html>