<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Comunidad Gambas-es - C/C++]]></title>
		<link>https://gambas-es.org/</link>
		<description><![CDATA[Comunidad Gambas-es - https://gambas-es.org]]></description>
		<pubDate>Mon, 31 Aug 2026 06:01:14 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Extern: Uso de la libreria C TagLib, id3.module, libtag_c, TagLib]]></title>
			<link>https://gambas-es.org/thread-2024.html</link>
			<pubDate>Tue, 18 Aug 2026 20:28:16 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=12">tincho</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-2024.html</guid>
			<description><![CDATA[Hola a todos,<br />
<br />
Hice una adaptacion de un ejemplo del wiki italiano de gambas [1] que muestra como usar <span style="font-weight: bold;" class="mycode_b">libtag_c</span> [2] para usarlo como una funcion que devuelve una <span style="font-style: italic;" class="mycode_i">Collection.</span><br />
Al modulo lo llame <span style="font-weight: bold;" class="mycode_b">id3.module</span><br />
<br />
[1] <a href="https://www.gambas-it.org/wiki/index.php/Estrarre_informazioni_e_TAG_da_file_audio_con_le_funzioni_esterne_del_API_di_Libtag_c" target="_blank" rel="noopener" class="mycode_url">https://www.gambas-it.org/wiki/index.php...i_Libtag_c</a><br />
[2] <a href="https://taglib.org/" target="_blank" rel="noopener" class="mycode_url">https://taglib.org/</a><br />
<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>' Gambas module file<br />
<br />
Export<br />
Library "libtag_c"<br />
<br />
Public Struct TagLib_File<br />
  dummy As Integer<br />
End Struct<br />
<br />
Public Struct TagLib_Tag<br />
  dummy As Integer<br />
End Struct<br />
<br />
Public Struct TagLib_AudioProperties<br />
  dummy As Integer<br />
End Struct<br />
<br />
' void taglib_set_strings_unicode(BOOL unicode)<br />
' By default all strings coming into or out of TagLib's C API are in UTF8.<br />
' However, it may be desirable For TagLib To operate On Latin1(ISO - 8859 - 1) strings In which Case this should be set To FALSE.<br />
Private Extern taglib_set_strings_unicode(unicode As Boolean)<br />
<br />
' TagLib_File *taglib_file_new_type(const char *filename)<br />
' Creates a TagLib file based on &#92;a filename.<br />
Private Extern taglib_file_new(filename As String) As TagLib_File<br />
<br />
' TagLib_Tag *taglib_file_tag(const TagLib_File *file)<br />
' Returns a pointer to the tag associated with this file.<br />
Private Extern taglib_file_tag(_file As TagLib_File) As TagLib_Tag<br />
<br />
' char *taglib_tag_title(const TagLib_Tag *tag)<br />
' Returns a string with this tag's title.<br />
Private Extern taglib_tag_title(tag As TagLib_Tag) As String<br />
<br />
' char *taglib_tag_artist(const TagLib_Tag *tag)<br />
' Returns a string with this tag's artist.<br />
Private Extern taglib_tag_artist(tag As TagLib_Tag) As String<br />
<br />
' char *taglib_tag_album(const TagLib_Tag *tag)<br />
' Returns a string with this tag's album name.<br />
Private Extern taglib_tag_album(tag As TagLib_Tag) As String<br />
<br />
' unsigned int taglib_tag_year(const TagLib_Tag *tag)<br />
' Returns the tag's year or 0 if year is not set.<br />
Private Extern taglib_tag_year(tag As TagLib_Tag) As Integer<br />
<br />
' char *taglib_tag_comment(const TagLib_Tag *tag)<br />
' Returns a string with this tag's comment.<br />
Private Extern taglib_tag_comment(tag As TagLib_Tag) As String<br />
<br />
' unsigned int taglib_tag_track(const TagLib_Tag *tag)<br />
' Returns the tag's track number or 0 if track number is not set.<br />
Private Extern taglib_tag_track(tag As TagLib_Tag) As Integer<br />
<br />
'Private Extern taglib_tag_encoder(tag As TagLib_Tag) As String<br />
'Private Extern taglib_tag_volume_number(tag As TagLib_Tag) As Integer<br />
<br />
' char *taglib_tag_genre(const TagLib_Tag *tag)<br />
' Returns a string with this tag's genre.<br />
Private Extern taglib_tag_genre(tag As TagLib_Tag) As String<br />
<br />
' const TagLib_AudioProperties *taglib_file_audioproperties(const TagLib_File *file)<br />
' Returns a pointer to the the audio properties associated with this file.<br />
Private Extern taglib_file_audioproperties(_file As TagLib_File) As TagLib_AudioProperties<br />
<br />
' int taglib_audioproperties_length(const TagLib_AudioProperties *audioProperties)<br />
' Returns the length of the file in seconds.<br />
Private Extern taglib_audioproperties_length(audioProperties As TagLib_AudioProperties) As Integer<br />
<br />
' int taglib_audioproperties_bitrate(const TagLib_AudioProperties *audioProperties)<br />
' Returns the bitrate of the file in kb/s.<br />
Private Extern taglib_audioproperties_bitrate(audioProperties As TagLib_AudioProperties) As Integer<br />
<br />
' int taglib_audioproperties_samplerate(const TagLib_AudioProperties *audioProperties)<br />
' Returns the sample rate of the file in Hz.<br />
Private Extern taglib_audioproperties_samplerate(audioProperties As TagLib_AudioProperties) As Integer<br />
<br />
' int taglib_audioproperties_channels(const TagLib_AudioProperties *audioProperties)<br />
' Returns the number of channels in the audio stream.<br />
Private Extern taglib_audioproperties_channels(audioProperties As TagLib_AudioProperties) As Integer<br />
<br />
' void taglib_tag_free_strings(void)<br />
' Frees all of the strings that have been created by the tag.<br />
Private Extern taglib_tag_free_strings()<br />
<br />
' void taglib_file_free(TagLib_File *file)<br />
' Frees and closes the file.<br />
Private Extern taglib_file_free(_file As TagLib_File)<br />
<br />
Public Function Info(fileaudio As String) As Collection<br />
<br />
  Dim fl As TagLib_File<br />
  Dim autag As TagLib_Tag<br />
  Dim auprop As TagLib_AudioProperties<br />
  '  Dim secondi, minuti As Integer<br />
  '<br />
  Dim inf As New Collection<br />
<br />
  taglib_set_strings_unicode(False)<br />
  taglib_set_strings_unicode(True)<br />
<br />
  fl = taglib_file_new(fileaudio)<br />
  If IsNull(fl) Then Error.Raise("Impossibile caricare il file audio: " &amp; fileaudio)<br />
<br />
  autag = taglib_file_tag(fl)<br />
  If IsNull(autag) Then Error.Raise("Impossibile ottenere i tag dal file audio: " &amp; fileaudio)<br />
<br />
  inf.Add(taglib_tag_album(autag), "album")<br />
  inf.Add(taglib_tag_artist(autag), "artist")<br />
  inf.Add(taglib_tag_track(autag), "track")<br />
  inf.Add(taglib_tag_title(autag), "title")<br />
  inf.Add(taglib_tag_year(autag), "year")<br />
  inf.Add(taglib_tag_genre(autag), "genre")<br />
  inf.Add(taglib_tag_comment(autag), "comment")<br />
<br />
  inf.Add(File.Ext(fileaudio), "format")<br />
<br />
  ' Mostra le proprietà del file audio:<br />
  auprop = taglib_file_audioproperties(fl)<br />
<br />
  If IsNull(auprop) Then<br />
    inf.Add(True, "audioerror")<br />
  Else<br />
    inf.Add(taglib_audioproperties_length(auprop), "length")<br />
    inf.Add(taglib_audioproperties_bitrate(auprop), "bitrate")<br />
    inf.Add(taglib_audioproperties_samplerate(auprop), "frequency")<br />
    inf.Add(taglib_audioproperties_channels(auprop), "channels")<br />
  Endif<br />
  inf.Add(taglib_tag_comment(autag), "comment")<br />
  ' Va in chiusura:<br />
  taglib_tag_free_strings()<br />
  taglib_file_free(fl)<br />
<br />
  Return inf<br />
<br />
End</code></div></div>Luego se usa de esta manera para obtener los metadatos de un archivo de audio:<br />
<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>  Dim sFile As String ' Ruta dle archivo<br />
  Dim oID3 As Collection<br />
<br />
  oID3 = id3.Info(sFile)</code></div></div>]]></description>
			<content:encoded><![CDATA[Hola a todos,<br />
<br />
Hice una adaptacion de un ejemplo del wiki italiano de gambas [1] que muestra como usar <span style="font-weight: bold;" class="mycode_b">libtag_c</span> [2] para usarlo como una funcion que devuelve una <span style="font-style: italic;" class="mycode_i">Collection.</span><br />
Al modulo lo llame <span style="font-weight: bold;" class="mycode_b">id3.module</span><br />
<br />
[1] <a href="https://www.gambas-it.org/wiki/index.php/Estrarre_informazioni_e_TAG_da_file_audio_con_le_funzioni_esterne_del_API_di_Libtag_c" target="_blank" rel="noopener" class="mycode_url">https://www.gambas-it.org/wiki/index.php...i_Libtag_c</a><br />
[2] <a href="https://taglib.org/" target="_blank" rel="noopener" class="mycode_url">https://taglib.org/</a><br />
<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>' Gambas module file<br />
<br />
Export<br />
Library "libtag_c"<br />
<br />
Public Struct TagLib_File<br />
  dummy As Integer<br />
End Struct<br />
<br />
Public Struct TagLib_Tag<br />
  dummy As Integer<br />
End Struct<br />
<br />
Public Struct TagLib_AudioProperties<br />
  dummy As Integer<br />
End Struct<br />
<br />
' void taglib_set_strings_unicode(BOOL unicode)<br />
' By default all strings coming into or out of TagLib's C API are in UTF8.<br />
' However, it may be desirable For TagLib To operate On Latin1(ISO - 8859 - 1) strings In which Case this should be set To FALSE.<br />
Private Extern taglib_set_strings_unicode(unicode As Boolean)<br />
<br />
' TagLib_File *taglib_file_new_type(const char *filename)<br />
' Creates a TagLib file based on &#92;a filename.<br />
Private Extern taglib_file_new(filename As String) As TagLib_File<br />
<br />
' TagLib_Tag *taglib_file_tag(const TagLib_File *file)<br />
' Returns a pointer to the tag associated with this file.<br />
Private Extern taglib_file_tag(_file As TagLib_File) As TagLib_Tag<br />
<br />
' char *taglib_tag_title(const TagLib_Tag *tag)<br />
' Returns a string with this tag's title.<br />
Private Extern taglib_tag_title(tag As TagLib_Tag) As String<br />
<br />
' char *taglib_tag_artist(const TagLib_Tag *tag)<br />
' Returns a string with this tag's artist.<br />
Private Extern taglib_tag_artist(tag As TagLib_Tag) As String<br />
<br />
' char *taglib_tag_album(const TagLib_Tag *tag)<br />
' Returns a string with this tag's album name.<br />
Private Extern taglib_tag_album(tag As TagLib_Tag) As String<br />
<br />
' unsigned int taglib_tag_year(const TagLib_Tag *tag)<br />
' Returns the tag's year or 0 if year is not set.<br />
Private Extern taglib_tag_year(tag As TagLib_Tag) As Integer<br />
<br />
' char *taglib_tag_comment(const TagLib_Tag *tag)<br />
' Returns a string with this tag's comment.<br />
Private Extern taglib_tag_comment(tag As TagLib_Tag) As String<br />
<br />
' unsigned int taglib_tag_track(const TagLib_Tag *tag)<br />
' Returns the tag's track number or 0 if track number is not set.<br />
Private Extern taglib_tag_track(tag As TagLib_Tag) As Integer<br />
<br />
'Private Extern taglib_tag_encoder(tag As TagLib_Tag) As String<br />
'Private Extern taglib_tag_volume_number(tag As TagLib_Tag) As Integer<br />
<br />
' char *taglib_tag_genre(const TagLib_Tag *tag)<br />
' Returns a string with this tag's genre.<br />
Private Extern taglib_tag_genre(tag As TagLib_Tag) As String<br />
<br />
' const TagLib_AudioProperties *taglib_file_audioproperties(const TagLib_File *file)<br />
' Returns a pointer to the the audio properties associated with this file.<br />
Private Extern taglib_file_audioproperties(_file As TagLib_File) As TagLib_AudioProperties<br />
<br />
' int taglib_audioproperties_length(const TagLib_AudioProperties *audioProperties)<br />
' Returns the length of the file in seconds.<br />
Private Extern taglib_audioproperties_length(audioProperties As TagLib_AudioProperties) As Integer<br />
<br />
' int taglib_audioproperties_bitrate(const TagLib_AudioProperties *audioProperties)<br />
' Returns the bitrate of the file in kb/s.<br />
Private Extern taglib_audioproperties_bitrate(audioProperties As TagLib_AudioProperties) As Integer<br />
<br />
' int taglib_audioproperties_samplerate(const TagLib_AudioProperties *audioProperties)<br />
' Returns the sample rate of the file in Hz.<br />
Private Extern taglib_audioproperties_samplerate(audioProperties As TagLib_AudioProperties) As Integer<br />
<br />
' int taglib_audioproperties_channels(const TagLib_AudioProperties *audioProperties)<br />
' Returns the number of channels in the audio stream.<br />
Private Extern taglib_audioproperties_channels(audioProperties As TagLib_AudioProperties) As Integer<br />
<br />
' void taglib_tag_free_strings(void)<br />
' Frees all of the strings that have been created by the tag.<br />
Private Extern taglib_tag_free_strings()<br />
<br />
' void taglib_file_free(TagLib_File *file)<br />
' Frees and closes the file.<br />
Private Extern taglib_file_free(_file As TagLib_File)<br />
<br />
Public Function Info(fileaudio As String) As Collection<br />
<br />
  Dim fl As TagLib_File<br />
  Dim autag As TagLib_Tag<br />
  Dim auprop As TagLib_AudioProperties<br />
  '  Dim secondi, minuti As Integer<br />
  '<br />
  Dim inf As New Collection<br />
<br />
  taglib_set_strings_unicode(False)<br />
  taglib_set_strings_unicode(True)<br />
<br />
  fl = taglib_file_new(fileaudio)<br />
  If IsNull(fl) Then Error.Raise("Impossibile caricare il file audio: " &amp; fileaudio)<br />
<br />
  autag = taglib_file_tag(fl)<br />
  If IsNull(autag) Then Error.Raise("Impossibile ottenere i tag dal file audio: " &amp; fileaudio)<br />
<br />
  inf.Add(taglib_tag_album(autag), "album")<br />
  inf.Add(taglib_tag_artist(autag), "artist")<br />
  inf.Add(taglib_tag_track(autag), "track")<br />
  inf.Add(taglib_tag_title(autag), "title")<br />
  inf.Add(taglib_tag_year(autag), "year")<br />
  inf.Add(taglib_tag_genre(autag), "genre")<br />
  inf.Add(taglib_tag_comment(autag), "comment")<br />
<br />
  inf.Add(File.Ext(fileaudio), "format")<br />
<br />
  ' Mostra le proprietà del file audio:<br />
  auprop = taglib_file_audioproperties(fl)<br />
<br />
  If IsNull(auprop) Then<br />
    inf.Add(True, "audioerror")<br />
  Else<br />
    inf.Add(taglib_audioproperties_length(auprop), "length")<br />
    inf.Add(taglib_audioproperties_bitrate(auprop), "bitrate")<br />
    inf.Add(taglib_audioproperties_samplerate(auprop), "frequency")<br />
    inf.Add(taglib_audioproperties_channels(auprop), "channels")<br />
  Endif<br />
  inf.Add(taglib_tag_comment(autag), "comment")<br />
  ' Va in chiusura:<br />
  taglib_tag_free_strings()<br />
  taglib_file_free(fl)<br />
<br />
  Return inf<br />
<br />
End</code></div></div>Luego se usa de esta manera para obtener los metadatos de un archivo de audio:<br />
<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>  Dim sFile As String ' Ruta dle archivo<br />
  Dim oID3 As Collection<br />
<br />
  oID3 = id3.Info(sFile)</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Creando bibliotecas compartidas en C]]></title>
			<link>https://gambas-es.org/thread-1789.html</link>
			<pubDate>Thu, 12 Sep 2024 11:39:59 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=12">tincho</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-1789.html</guid>
			<description><![CDATA[Hola.<br />
Hace un momento hice una prueba, le pedi a ChatGPT que me escribiera una biblioteca compartida en C que a su vez usa la librería LibreDWG y el resultado fue:<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>#include &lt;stdio.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;libredwg.h&gt;<br />
<br />
const char* list_blocks(const char* filename) {<br />
static char result[4096];<br />
DWG_Data *dwg;<br />
int i;<br />
<br />
// Inicializa la biblioteca<br />
dwg = dwg_read(filename);<br />
if (!dwg) {<br />
return "Error reading DWG file.";<br />
}<br />
<br />
// Recorre los bloques y crea una lista<br />
result[0] = '&#92;0';<br />
for (i = 0; i &lt; dwg-&gt;num_blocks; i++) {<br />
strcat(result, dwg-&gt;blocks[i].name);<br />
strcat(result, "&#92;n");<br />
}<br />
<br />
// Limpia<br />
dwg_free(dwg);<br />
<br />
return result;<br />
}</code></div></div><hr class="mycode_hr" />
Por supuesto no funciono, por un lado en mi sistema no existe libredwg.h, pero se puede descargar el código fuente:<br />
<a href="https://github.com/LibreDWG/libredwg" target="_blank" rel="noopener" class="mycode_url">https://github.com/LibreDWG/libredwg</a><br />
A ver si algún experto en C tiene ganas de experimentar un poco con esta herramienta.<br />
<hr class="mycode_hr" />
Luego en el codigo fuente se puede ver un ejemlo que lista, en lugar de los "Blocks", los "Layers"<br />
<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>/*****************************************************************************/<br />
/*  LibreDWG - free implementation of the DWG file format                    */<br />
/*                                                                           */<br />
/*  Copyright (C) 2018-2019 Free Software Foundation, Inc.                   */<br />
/*                                                                           */<br />
/*  This library is free software, licensed under the terms of the GNU       */<br />
/*  General Public License as published by the Free Software Foundation,     */<br />
/*  either version 3 of the License, or (at your option) any later version.  */<br />
/*  You should have received a copy of the GNU General Public License        */<br />
/*  along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.    */<br />
/*****************************************************************************/<br />
<br />
/*<br />
 * dwglayers.c: print list of layers in a DWG<br />
 *<br />
 * written by Reini Urban<br />
 */<br />
<br />
#include "../src/config.h"<br />
#include &lt;stdio.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;string.h&gt;<br />
#include &lt;assert.h&gt;<br />
#include &lt;getopt.h&gt;<br />
#ifdef HAVE_VALGRIND_VALGRIND_H<br />
#  include &lt;valgrind/valgrind.h&gt;<br />
#endif<br />
<br />
#include &lt;dwg.h&gt;<br />
#include "common.h"<br />
#include "bits.h"<br />
#include "logging.h"<br />
<br />
static int<br />
usage (void)<br />
{<br />
  printf ("&#92;nUsage: dwglayers [-f|--flags] [--on] &lt;input_file.dwg&gt;&#92;n");<br />
  return 1;<br />
}<br />
static int<br />
opt_version (void)<br />
{<br />
  printf ("dwglayers %s&#92;n", PACKAGE_VERSION);<br />
  return 0;<br />
}<br />
static int<br />
help (void)<br />
{<br />
  printf ("&#92;nUsage: dwglayers [OPTION]... DWGFILE&#92;n");<br />
  printf ("Print list of layers.&#92;n"<br />
          "&#92;n");<br />
#ifdef HAVE_GETOPT_LONG<br />
  printf ("  -x, --extnames            prints EXTNAMES (r13-r14 only)&#92;n"<br />
          "                i.e. space instead of _&#92;n");<br />
  printf ("  -f, --flags               prints also flags:&#92;n"<br />
          "                3 chars for: f for frozen, + or - for ON or OFF, l "<br />
          "for locked&#92;n");<br />
  printf ("  -o, --on                  prints only ON layers&#92;n");<br />
  printf ("  -h, --help                display this help and exit&#92;n");<br />
  printf ("      --version             output version information and exit&#92;n"<br />
          "&#92;n");<br />
#else<br />
  printf ("  -x            prints EXTNAMES (r13-r14 only)&#92;n"<br />
          "                i.e. space instead of _&#92;n");<br />
  printf ("  -f            prints also flags:&#92;n"<br />
          "                3 chars for: f for frozen, + or - for ON or OFF, l "<br />
          "for locked&#92;n");<br />
  printf ("  -o            prints only ON layers&#92;n");<br />
  printf ("  -h            display this help and exit&#92;n");<br />
  printf ("  -i            output version information and exit&#92;n"<br />
          "&#92;n");<br />
#endif<br />
  printf ("GNU LibreDWG online manual: "<br />
          "&lt;https://www.gnu.org/software/libredwg/&gt;&#92;n");<br />
  return 0;<br />
}<br />
<br />
int<br />
main (int argc, char *argv[])<br />
{<br />
  int error;<br />
  long i = 1;<br />
  int flags = 0, on = 0, extnames = 0;<br />
  char *filename_in;<br />
  Dwg_Data dwg;<br />
  Dwg_Object *obj;<br />
  Dwg_Object_LAYER *layer;<br />
  Dwg_Object_LAYER_CONTROL *_ctrl;<br />
  int c;<br />
#ifdef HAVE_GETOPT_LONG<br />
  int option_index = 0;<br />
  static struct option long_options[] = { { "flags", 0, 0, 'f' },<br />
                                          { "extnames", 0, 0, 'x' },<br />
                                          { "on", 0, 0, 'o' },<br />
                                          { "help", 0, 0, 0 },<br />
                                          { "version", 0, 0, 0 },<br />
                                          { NULL, 0, NULL, 0 } };<br />
#endif<br />
<br />
  while<br />
#ifdef HAVE_GETOPT_LONG<br />
      ((c = getopt_long (argc, argv, "xfoh", long_options, &amp;option_index))<br />
       != -1)<br />
#else<br />
      ((c = getopt (argc, argv, "xfohi")) != -1)<br />
#endif<br />
    {<br />
      if (c == -1)<br />
        break;<br />
      switch (c)<br />
        {<br />
#ifdef HAVE_GETOPT_LONG<br />
        case 0:<br />
          if (!strcmp (long_options[option_index].name, "version"))<br />
            return opt_version ();<br />
          if (!strcmp (long_options[option_index].name, "help"))<br />
            return help ();<br />
          break;<br />
#else<br />
        case 'i':<br />
          return opt_version ();<br />
#endif<br />
        case 'x':<br />
          extnames = 1;<br />
          break;<br />
        case 'f':<br />
          flags = 1;<br />
          break;<br />
        case 'o':<br />
          on = 1;<br />
          break;<br />
        case 'h':<br />
          return help ();<br />
        case '?':<br />
          fprintf (stderr, "%s: invalid option '-%c' ignored&#92;n", argv[0],<br />
                   optopt);<br />
          break;<br />
        default:<br />
          return usage ();<br />
        }<br />
    }<br />
  i = optind;<br />
  if (i &gt;= argc)<br />
    return usage ();<br />
<br />
  filename_in = argv[i];<br />
  memset (&amp;dwg, 0, sizeof (Dwg_Data));<br />
  error = dwg_read_file (filename_in, &amp;dwg);<br />
  if (error &gt;= DWG_ERR_CRITICAL)<br />
    fprintf (stderr, "READ ERROR %s: 0x%x&#92;n", filename_in, error);<br />
<br />
  obj = dwg_get_first_object (&amp;dwg, DWG_TYPE_LAYER_CONTROL);<br />
  _ctrl = obj-&gt;tio.object-&gt;tio.LAYER_CONTROL;<br />
  for (i = 0; i &lt; _ctrl-&gt;num_entries; i++)<br />
    {<br />
      char *name;<br />
      assert (_ctrl-&gt;entries);<br />
      assert (_ctrl-&gt;entries[i]);<br />
      obj = _ctrl-&gt;entries[i]-&gt;obj;<br />
      if (!obj || obj-&gt;type != DWG_TYPE_LAYER) // can be DICTIONARY also<br />
        continue;<br />
      assert (_ctrl-&gt;entries[i]-&gt;obj-&gt;tio.object);<br />
      layer = _ctrl-&gt;entries[i]-&gt;obj-&gt;tio.object-&gt;tio.LAYER;<br />
      if (on &amp;&amp; (!layer-&gt;on || layer-&gt;frozen))<br />
        continue;<br />
      if (flags)<br />
        printf ("%s%s%s&#92;t", layer-&gt;frozen ? "f" : " ", layer-&gt;on ? "+" : "-",<br />
                layer-&gt;locked ? "l" : " ");<br />
      if (extnames &amp;&amp; dwg.header.from_version &gt;= R_13 &amp;&amp; dwg.header.from_version &lt; R_2000)<br />
        {<br />
          if (!(name = dwg_find_table_extname (&amp;dwg, obj)))<br />
            name = layer-&gt;name;<br />
        }<br />
      else<br />
        name = layer-&gt;name;<br />
      // since r2007 unicode, converted to utf-8<br />
      if (dwg.header.from_version &gt;= R_2007)<br />
        {<br />
          char *utf8 = bit_convert_TU ((BITCODE_TU)name);<br />
          printf ("%s&#92;n", utf8);<br />
          free (utf8);<br />
        }<br />
      else<br />
        printf ("%s&#92;n", name);<br />
      fflush (stdout);<br />
    }<br />
<br />
  // forget about valgrind. really huge DWG's need endlessly here.<br />
  if ((dwg.header.version &amp;&amp; dwg.num_objects &lt; 1000)<br />
#if defined __SANITIZE_ADDRESS__ || __has_feature(address_sanitizer)<br />
      || 1<br />
#endif<br />
#ifdef HAVE_VALGRIND_VALGRIND_H<br />
      || (RUNNING_ON_VALGRIND)<br />
#endif<br />
  )<br />
    dwg_free (&amp;dwg);<br />
  return error &gt;= DWG_ERR_CRITICAL ? 1 : 0;<br />
}</code></div></div>]]></description>
			<content:encoded><![CDATA[Hola.<br />
Hace un momento hice una prueba, le pedi a ChatGPT que me escribiera una biblioteca compartida en C que a su vez usa la librería LibreDWG y el resultado fue:<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>#include &lt;stdio.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;libredwg.h&gt;<br />
<br />
const char* list_blocks(const char* filename) {<br />
static char result[4096];<br />
DWG_Data *dwg;<br />
int i;<br />
<br />
// Inicializa la biblioteca<br />
dwg = dwg_read(filename);<br />
if (!dwg) {<br />
return "Error reading DWG file.";<br />
}<br />
<br />
// Recorre los bloques y crea una lista<br />
result[0] = '&#92;0';<br />
for (i = 0; i &lt; dwg-&gt;num_blocks; i++) {<br />
strcat(result, dwg-&gt;blocks[i].name);<br />
strcat(result, "&#92;n");<br />
}<br />
<br />
// Limpia<br />
dwg_free(dwg);<br />
<br />
return result;<br />
}</code></div></div><hr class="mycode_hr" />
Por supuesto no funciono, por un lado en mi sistema no existe libredwg.h, pero se puede descargar el código fuente:<br />
<a href="https://github.com/LibreDWG/libredwg" target="_blank" rel="noopener" class="mycode_url">https://github.com/LibreDWG/libredwg</a><br />
A ver si algún experto en C tiene ganas de experimentar un poco con esta herramienta.<br />
<hr class="mycode_hr" />
Luego en el codigo fuente se puede ver un ejemlo que lista, en lugar de los "Blocks", los "Layers"<br />
<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>/*****************************************************************************/<br />
/*  LibreDWG - free implementation of the DWG file format                    */<br />
/*                                                                           */<br />
/*  Copyright (C) 2018-2019 Free Software Foundation, Inc.                   */<br />
/*                                                                           */<br />
/*  This library is free software, licensed under the terms of the GNU       */<br />
/*  General Public License as published by the Free Software Foundation,     */<br />
/*  either version 3 of the License, or (at your option) any later version.  */<br />
/*  You should have received a copy of the GNU General Public License        */<br />
/*  along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.    */<br />
/*****************************************************************************/<br />
<br />
/*<br />
 * dwglayers.c: print list of layers in a DWG<br />
 *<br />
 * written by Reini Urban<br />
 */<br />
<br />
#include "../src/config.h"<br />
#include &lt;stdio.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;string.h&gt;<br />
#include &lt;assert.h&gt;<br />
#include &lt;getopt.h&gt;<br />
#ifdef HAVE_VALGRIND_VALGRIND_H<br />
#  include &lt;valgrind/valgrind.h&gt;<br />
#endif<br />
<br />
#include &lt;dwg.h&gt;<br />
#include "common.h"<br />
#include "bits.h"<br />
#include "logging.h"<br />
<br />
static int<br />
usage (void)<br />
{<br />
  printf ("&#92;nUsage: dwglayers [-f|--flags] [--on] &lt;input_file.dwg&gt;&#92;n");<br />
  return 1;<br />
}<br />
static int<br />
opt_version (void)<br />
{<br />
  printf ("dwglayers %s&#92;n", PACKAGE_VERSION);<br />
  return 0;<br />
}<br />
static int<br />
help (void)<br />
{<br />
  printf ("&#92;nUsage: dwglayers [OPTION]... DWGFILE&#92;n");<br />
  printf ("Print list of layers.&#92;n"<br />
          "&#92;n");<br />
#ifdef HAVE_GETOPT_LONG<br />
  printf ("  -x, --extnames            prints EXTNAMES (r13-r14 only)&#92;n"<br />
          "                i.e. space instead of _&#92;n");<br />
  printf ("  -f, --flags               prints also flags:&#92;n"<br />
          "                3 chars for: f for frozen, + or - for ON or OFF, l "<br />
          "for locked&#92;n");<br />
  printf ("  -o, --on                  prints only ON layers&#92;n");<br />
  printf ("  -h, --help                display this help and exit&#92;n");<br />
  printf ("      --version             output version information and exit&#92;n"<br />
          "&#92;n");<br />
#else<br />
  printf ("  -x            prints EXTNAMES (r13-r14 only)&#92;n"<br />
          "                i.e. space instead of _&#92;n");<br />
  printf ("  -f            prints also flags:&#92;n"<br />
          "                3 chars for: f for frozen, + or - for ON or OFF, l "<br />
          "for locked&#92;n");<br />
  printf ("  -o            prints only ON layers&#92;n");<br />
  printf ("  -h            display this help and exit&#92;n");<br />
  printf ("  -i            output version information and exit&#92;n"<br />
          "&#92;n");<br />
#endif<br />
  printf ("GNU LibreDWG online manual: "<br />
          "&lt;https://www.gnu.org/software/libredwg/&gt;&#92;n");<br />
  return 0;<br />
}<br />
<br />
int<br />
main (int argc, char *argv[])<br />
{<br />
  int error;<br />
  long i = 1;<br />
  int flags = 0, on = 0, extnames = 0;<br />
  char *filename_in;<br />
  Dwg_Data dwg;<br />
  Dwg_Object *obj;<br />
  Dwg_Object_LAYER *layer;<br />
  Dwg_Object_LAYER_CONTROL *_ctrl;<br />
  int c;<br />
#ifdef HAVE_GETOPT_LONG<br />
  int option_index = 0;<br />
  static struct option long_options[] = { { "flags", 0, 0, 'f' },<br />
                                          { "extnames", 0, 0, 'x' },<br />
                                          { "on", 0, 0, 'o' },<br />
                                          { "help", 0, 0, 0 },<br />
                                          { "version", 0, 0, 0 },<br />
                                          { NULL, 0, NULL, 0 } };<br />
#endif<br />
<br />
  while<br />
#ifdef HAVE_GETOPT_LONG<br />
      ((c = getopt_long (argc, argv, "xfoh", long_options, &amp;option_index))<br />
       != -1)<br />
#else<br />
      ((c = getopt (argc, argv, "xfohi")) != -1)<br />
#endif<br />
    {<br />
      if (c == -1)<br />
        break;<br />
      switch (c)<br />
        {<br />
#ifdef HAVE_GETOPT_LONG<br />
        case 0:<br />
          if (!strcmp (long_options[option_index].name, "version"))<br />
            return opt_version ();<br />
          if (!strcmp (long_options[option_index].name, "help"))<br />
            return help ();<br />
          break;<br />
#else<br />
        case 'i':<br />
          return opt_version ();<br />
#endif<br />
        case 'x':<br />
          extnames = 1;<br />
          break;<br />
        case 'f':<br />
          flags = 1;<br />
          break;<br />
        case 'o':<br />
          on = 1;<br />
          break;<br />
        case 'h':<br />
          return help ();<br />
        case '?':<br />
          fprintf (stderr, "%s: invalid option '-%c' ignored&#92;n", argv[0],<br />
                   optopt);<br />
          break;<br />
        default:<br />
          return usage ();<br />
        }<br />
    }<br />
  i = optind;<br />
  if (i &gt;= argc)<br />
    return usage ();<br />
<br />
  filename_in = argv[i];<br />
  memset (&amp;dwg, 0, sizeof (Dwg_Data));<br />
  error = dwg_read_file (filename_in, &amp;dwg);<br />
  if (error &gt;= DWG_ERR_CRITICAL)<br />
    fprintf (stderr, "READ ERROR %s: 0x%x&#92;n", filename_in, error);<br />
<br />
  obj = dwg_get_first_object (&amp;dwg, DWG_TYPE_LAYER_CONTROL);<br />
  _ctrl = obj-&gt;tio.object-&gt;tio.LAYER_CONTROL;<br />
  for (i = 0; i &lt; _ctrl-&gt;num_entries; i++)<br />
    {<br />
      char *name;<br />
      assert (_ctrl-&gt;entries);<br />
      assert (_ctrl-&gt;entries[i]);<br />
      obj = _ctrl-&gt;entries[i]-&gt;obj;<br />
      if (!obj || obj-&gt;type != DWG_TYPE_LAYER) // can be DICTIONARY also<br />
        continue;<br />
      assert (_ctrl-&gt;entries[i]-&gt;obj-&gt;tio.object);<br />
      layer = _ctrl-&gt;entries[i]-&gt;obj-&gt;tio.object-&gt;tio.LAYER;<br />
      if (on &amp;&amp; (!layer-&gt;on || layer-&gt;frozen))<br />
        continue;<br />
      if (flags)<br />
        printf ("%s%s%s&#92;t", layer-&gt;frozen ? "f" : " ", layer-&gt;on ? "+" : "-",<br />
                layer-&gt;locked ? "l" : " ");<br />
      if (extnames &amp;&amp; dwg.header.from_version &gt;= R_13 &amp;&amp; dwg.header.from_version &lt; R_2000)<br />
        {<br />
          if (!(name = dwg_find_table_extname (&amp;dwg, obj)))<br />
            name = layer-&gt;name;<br />
        }<br />
      else<br />
        name = layer-&gt;name;<br />
      // since r2007 unicode, converted to utf-8<br />
      if (dwg.header.from_version &gt;= R_2007)<br />
        {<br />
          char *utf8 = bit_convert_TU ((BITCODE_TU)name);<br />
          printf ("%s&#92;n", utf8);<br />
          free (utf8);<br />
        }<br />
      else<br />
        printf ("%s&#92;n", name);<br />
      fflush (stdout);<br />
    }<br />
<br />
  // forget about valgrind. really huge DWG's need endlessly here.<br />
  if ((dwg.header.version &amp;&amp; dwg.num_objects &lt; 1000)<br />
#if defined __SANITIZE_ADDRESS__ || __has_feature(address_sanitizer)<br />
      || 1<br />
#endif<br />
#ifdef HAVE_VALGRIND_VALGRIND_H<br />
      || (RUNNING_ON_VALGRIND)<br />
#endif<br />
  )<br />
    dwg_free (&amp;dwg);<br />
  return error &gt;= DWG_ERR_CRITICAL ? 1 : 0;<br />
}</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[LLVM Clang vs GCC (C development on OpenBSD)]]></title>
			<link>https://gambas-es.org/thread-1385.html</link>
			<pubDate>Fri, 02 Jun 2023 09:21:47 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=3">Shell</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-1385.html</guid>
			<description><![CDATA[Buenas!.<br />
<br />
En este vídeo se compara el compilador Clang con GCC<br />
<br />
No se duerman escuchando al creador del vídeo.  <img src="https://gambas-es.org/images/smilies/rolleyes.png" alt="Rolleyes" title="Rolleyes" class="smilie smilie_6" /><br />
<br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/FwRjPY79uQI" frameborder="0" allowfullscreen="true"></iframe><br />
<br />
<a href="https://www.incredibuild.com/blog/gcc-vs-clang-battle-of-the-behemoths" target="_blank" rel="noopener" class="mycode_url">GCC vs Clang: Battle of the Behemoths</a><br />
<br />
<br />
Cuando creamos una aplicación desde su fuente, estás buscan que tenemos instalado en el sistema. Por ejemplo el compilador.<br />
Pero, en ese scripts, ¿ hay preferencias ?.  Quiero decir si tenemos instalado GCC y Clang, ¿ usaría uno de los dos  ( el primero que se encuentre )<br />
ó existiría una preferencia en usar uno u otro ?.<br />
<hr class="mycode_hr" />
Y como puede ser una elección. Que mejor que recordar una buena elección. <img src="https://gambas-es.org/images/smilies/tongue.png" alt="Tongue" title="Tongue" class="smilie smilie_5" /><br />
No es para hacer publicidad.<br />
<br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/K1SThErlA3U" frameborder="0" allowfullscreen="true"></iframe><br />
<br />
A ver que usan ustedes. Gcc o Clang. Si tienen dudas vean de nuevo el anuncio del detergente. <img src="https://gambas-es.org/images/smilies/wink.png" alt="Wink" title="Wink" class="smilie smilie_2" /><br />
<br />
Saludos]]></description>
			<content:encoded><![CDATA[Buenas!.<br />
<br />
En este vídeo se compara el compilador Clang con GCC<br />
<br />
No se duerman escuchando al creador del vídeo.  <img src="https://gambas-es.org/images/smilies/rolleyes.png" alt="Rolleyes" title="Rolleyes" class="smilie smilie_6" /><br />
<br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/FwRjPY79uQI" frameborder="0" allowfullscreen="true"></iframe><br />
<br />
<a href="https://www.incredibuild.com/blog/gcc-vs-clang-battle-of-the-behemoths" target="_blank" rel="noopener" class="mycode_url">GCC vs Clang: Battle of the Behemoths</a><br />
<br />
<br />
Cuando creamos una aplicación desde su fuente, estás buscan que tenemos instalado en el sistema. Por ejemplo el compilador.<br />
Pero, en ese scripts, ¿ hay preferencias ?.  Quiero decir si tenemos instalado GCC y Clang, ¿ usaría uno de los dos  ( el primero que se encuentre )<br />
ó existiría una preferencia en usar uno u otro ?.<br />
<hr class="mycode_hr" />
Y como puede ser una elección. Que mejor que recordar una buena elección. <img src="https://gambas-es.org/images/smilies/tongue.png" alt="Tongue" title="Tongue" class="smilie smilie_5" /><br />
No es para hacer publicidad.<br />
<br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/K1SThErlA3U" frameborder="0" allowfullscreen="true"></iframe><br />
<br />
A ver que usan ustedes. Gcc o Clang. Si tienen dudas vean de nuevo el anuncio del detergente. <img src="https://gambas-es.org/images/smilies/wink.png" alt="Wink" title="Wink" class="smilie smilie_2" /><br />
<br />
Saludos]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[GB#]]></title>
			<link>https://gambas-es.org/thread-1380.html</link>
			<pubDate>Tue, 30 May 2023 14:17:02 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=19">tercoide</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-1380.html</guid>
			<description><![CDATA[Investigando alguna opcion para programar cross-plattform estuve viendo codigo de : Go, Rust, C++, JS y......C# . Estoy sorprendido lo parecido que es en estructura C# y GB. Practicamente que me anima a hacer un "traductor" GB&lt;-&gt;C#  <img src="https://gambas-es.org/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /><br />
<br />
 <br />
<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>class Vehicle  // base class (parent) <br />
{<br />
  public string brand = "Ford";  // Vehicle field<br />
  public void honk()             // Vehicle method <br />
  {                    <br />
    Console.WriteLine("Tuut, tuut!");<br />
  }<br />
}<br />
<br />
class Car : Vehicle  // derived class (child)<br />
{<br />
  public string modelName = "Mustang";  // Car field<br />
}<br />
<br />
class Program<br />
{<br />
  static void Main(string[] args)<br />
  {<br />
    // Create a myCar object<br />
    Car myCar = new Car();<br />
<br />
    // Call the honk() method (From the Vehicle class) on the myCar object<br />
    myCar.honk();<br />
<br />
    // Display the value of the brand field (from the Vehicle class) and the value of the modelName from the Car class<br />
    Console.WriteLine(myCar.brand + " " + myCar.modelName);<br />
  }<br />
}</code></div></div>]]></description>
			<content:encoded><![CDATA[Investigando alguna opcion para programar cross-plattform estuve viendo codigo de : Go, Rust, C++, JS y......C# . Estoy sorprendido lo parecido que es en estructura C# y GB. Practicamente que me anima a hacer un "traductor" GB&lt;-&gt;C#  <img src="https://gambas-es.org/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /><br />
<br />
 <br />
<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>class Vehicle  // base class (parent) <br />
{<br />
  public string brand = "Ford";  // Vehicle field<br />
  public void honk()             // Vehicle method <br />
  {                    <br />
    Console.WriteLine("Tuut, tuut!");<br />
  }<br />
}<br />
<br />
class Car : Vehicle  // derived class (child)<br />
{<br />
  public string modelName = "Mustang";  // Car field<br />
}<br />
<br />
class Program<br />
{<br />
  static void Main(string[] args)<br />
  {<br />
    // Create a myCar object<br />
    Car myCar = new Car();<br />
<br />
    // Call the honk() method (From the Vehicle class) on the myCar object<br />
    myCar.honk();<br />
<br />
    // Display the value of the brand field (from the Vehicle class) and the value of the modelName from the Car class<br />
    Console.WriteLine(myCar.brand + " " + myCar.modelName);<br />
  }<br />
}</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Problema con matriz en Cpp]]></title>
			<link>https://gambas-es.org/thread-485.html</link>
			<pubDate>Thu, 24 Jun 2021 15:50:34 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=65">AlfredoSC</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-485.html</guid>
			<description><![CDATA[Hola:<br />
<br />
Estoy haciendo un programa en Cpp el cual ya compilado se carga en un microcontrolador.<br />
<br />
El uC recibirá un pack de datos (22,34,34,176,90,20,60,0) que se definen de la siguiente manera:<br />
<br />
<br />
#define dato0  recibe[0]<br />
#define dato1  recibe[1]<br />
#define dato2  recibe[2]<br />
#define dato3  recibe[3]<br />
#define dato4  recibe[4]<br />
#define dato5  recibe[5]<br />
#define dato6  recibe[6]<br />
#define dato7  recibe[7]<br />
<br />
int8 recibe[8];     // Éste es el Pack<br />
<br />
Justo después de recibir el pack, se envía el mismo a una PC vía Serial (RS-232) en modo Bytes<br />
(no string) de la siguiente manera:<br />
<br />
putc(recibe[]);<br />
<br />
Y en la PC, usando CuteCom en modo HEX como Software Serial, se recibe el pack como:<br />
<br />
[0x16][0x22][0x22][0xB0][0x5A][0x14][0x3C][0x00]<br />
<br />
Lo cual es correcto.<br />
<br />
Pero si en vez de enviar recibe[], mando uno a uno sus componentes:<br />
<br />
putc(dato0);<br />
putc(dato1);<br />
putc(dato2);<br />
putc(dato3);<br />
putc(dato4);<br />
putc(dato5);<br />
putc(dato6);<br />
putc(dato7);<br />
<br />
Recibo lo siguiente, que no es lo esperado:<br />
<br />
[0x16][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x22][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x22][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0xB0][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x5A][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x14][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x3C][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x00][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
<br />
Lo cual provoca que mi proyecto no funcione, por el "exceso" de datos extras que vienen con<br />
cada dato0,1,...7.<br />
<br />
Admito que me cuesta trabajo entender los arreglos, porque tal parece que:<br />
<br />
recibe[0] está compuesto por dato0[0], dato0[1], ......dato0[7]<br />
recibe[1] está compuesto por dato1[0], dato1[1], ......dato1[7]<br />
<br />
y así todos los demás.<br />
<br />
De todos modos mando mi código completo en Cpp por si alguien tiene una idea de cómo solucionarlo.<br />
<br />
Gracias.<br /><!-- start: postbit_attachments_attachment -->
<div class="row mt-2 g-1 text-muted">
	<div class="col-auto align-self-center">

<!-- start: attachment_icon -->
<img src="https://gambas-es.org/images/attachtypes/tar.png" title="GZIP Compressed File" style="height: 16px; width: 16px" border="0" alt=".gz" />
<!-- end: attachment_icon -->
		
	</div>
	<div class="col align-self-center">
		<a href="attachment.php?aid=130" target="_blank" title="">18f14k50_cdc_usb_sc6928.c.tar.gz</a> (Tamaño: <span class="text-dark">3 KB</span> Descargas: <span class="text-dark">0)</span>
	</div>
</div>
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[Hola:<br />
<br />
Estoy haciendo un programa en Cpp el cual ya compilado se carga en un microcontrolador.<br />
<br />
El uC recibirá un pack de datos (22,34,34,176,90,20,60,0) que se definen de la siguiente manera:<br />
<br />
<br />
#define dato0  recibe[0]<br />
#define dato1  recibe[1]<br />
#define dato2  recibe[2]<br />
#define dato3  recibe[3]<br />
#define dato4  recibe[4]<br />
#define dato5  recibe[5]<br />
#define dato6  recibe[6]<br />
#define dato7  recibe[7]<br />
<br />
int8 recibe[8];     // Éste es el Pack<br />
<br />
Justo después de recibir el pack, se envía el mismo a una PC vía Serial (RS-232) en modo Bytes<br />
(no string) de la siguiente manera:<br />
<br />
putc(recibe[]);<br />
<br />
Y en la PC, usando CuteCom en modo HEX como Software Serial, se recibe el pack como:<br />
<br />
[0x16][0x22][0x22][0xB0][0x5A][0x14][0x3C][0x00]<br />
<br />
Lo cual es correcto.<br />
<br />
Pero si en vez de enviar recibe[], mando uno a uno sus componentes:<br />
<br />
putc(dato0);<br />
putc(dato1);<br />
putc(dato2);<br />
putc(dato3);<br />
putc(dato4);<br />
putc(dato5);<br />
putc(dato6);<br />
putc(dato7);<br />
<br />
Recibo lo siguiente, que no es lo esperado:<br />
<br />
[0x16][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x22][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x22][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0xB0][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x5A][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x14][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x3C][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
[0x00][0x00][0x00][0x00][0x00][0x00][0x00][0x00]<br />
<br />
Lo cual provoca que mi proyecto no funcione, por el "exceso" de datos extras que vienen con<br />
cada dato0,1,...7.<br />
<br />
Admito que me cuesta trabajo entender los arreglos, porque tal parece que:<br />
<br />
recibe[0] está compuesto por dato0[0], dato0[1], ......dato0[7]<br />
recibe[1] está compuesto por dato1[0], dato1[1], ......dato1[7]<br />
<br />
y así todos los demás.<br />
<br />
De todos modos mando mi código completo en Cpp por si alguien tiene una idea de cómo solucionarlo.<br />
<br />
Gracias.<br /><!-- start: postbit_attachments_attachment -->
<div class="row mt-2 g-1 text-muted">
	<div class="col-auto align-self-center">

<!-- start: attachment_icon -->
<img src="https://gambas-es.org/images/attachtypes/tar.png" title="GZIP Compressed File" style="height: 16px; width: 16px" border="0" alt=".gz" />
<!-- end: attachment_icon -->
		
	</div>
	<div class="col align-self-center">
		<a href="attachment.php?aid=130" target="_blank" title="">18f14k50_cdc_usb_sc6928.c.tar.gz</a> (Tamaño: <span class="text-dark">3 KB</span> Descargas: <span class="text-dark">0)</span>
	</div>
</div>
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[PSeInt - Pseudo interprete]]></title>
			<link>https://gambas-es.org/thread-395.html</link>
			<pubDate>Tue, 04 May 2021 22:49:05 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=12">tincho</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-395.html</guid>
			<description><![CDATA[Hola amigos.<br />
Como didáctico es didáctico, desde la charla en otro tema sobre programación en español me puse a revolver la red de redes y encontré algunas cosas interesante una es PSeudo Intérprete, PSeInt.<br />
<a href="https://es.wikipedia.org/wiki/PSeInt" target="_blank" rel="noopener" class="mycode_url">https://es.wikipedia.org/wiki/PSeInt</a><br />
Este es mi primer programa y pantallazo:<br />
<img src="https://i.imgur.com/skhfoQv.png" loading="lazy"  alt="[Imagen: skhfoQv.png]" class="mycode_img" /><br />
Saludos.]]></description>
			<content:encoded><![CDATA[Hola amigos.<br />
Como didáctico es didáctico, desde la charla en otro tema sobre programación en español me puse a revolver la red de redes y encontré algunas cosas interesante una es PSeudo Intérprete, PSeInt.<br />
<a href="https://es.wikipedia.org/wiki/PSeInt" target="_blank" rel="noopener" class="mycode_url">https://es.wikipedia.org/wiki/PSeInt</a><br />
Este es mi primer programa y pantallazo:<br />
<img src="https://i.imgur.com/skhfoQv.png" loading="lazy"  alt="[Imagen: skhfoQv.png]" class="mycode_img" /><br />
Saludos.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Lenguaje C±]]></title>
			<link>https://gambas-es.org/thread-268.html</link>
			<pubDate>Mon, 08 Feb 2021 15:38:16 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=3">Shell</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-268.html</guid>
			<description><![CDATA[Buenas!.<br />
<br />
¿ Qué es eso de C± ?.<br />
<br />
Tiene tanto de C++ y de C.<br />
<br />
No aparenta ser C#..<br />
<br />
Se puede escribir, compilar, editar con un entorno de desarrollo C++, tiene extensión cpp<br />
<br />
<a href="https://www.librosuned.com/LU12501/Fundamentos-de-programaci%C3%B3n-.aspx" target="_blank" rel="noopener" class="mycode_url">librosUNED. Fundamentos de la programación</a><br />
<br />
Saludos!]]></description>
			<content:encoded><![CDATA[Buenas!.<br />
<br />
¿ Qué es eso de C± ?.<br />
<br />
Tiene tanto de C++ y de C.<br />
<br />
No aparenta ser C#..<br />
<br />
Se puede escribir, compilar, editar con un entorno de desarrollo C++, tiene extensión cpp<br />
<br />
<a href="https://www.librosuned.com/LU12501/Fundamentos-de-programaci%C3%B3n-.aspx" target="_blank" rel="noopener" class="mycode_url">librosUNED. Fundamentos de la programación</a><br />
<br />
Saludos!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Diferencias de C y C++]]></title>
			<link>https://gambas-es.org/thread-240.html</link>
			<pubDate>Thu, 21 Jan 2021 11:51:23 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=3">Shell</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-240.html</guid>
			<description><![CDATA[Buenos días!.<br />
<br />
Para los que quieran conocer sus diferencias. Una parte del texto.<br />
 <br />
<blockquote class="mycode_quote"><cite>Cita:</cite>C es un lenguaje libre estandarizado por ISO <span style="font-weight: bold;" class="mycode_b">MUY PEQUEÑO</span> que admite programación estructurada (la de toda la vida), nada más. Útil en programación de microchips, sistemas operativos, drivers y programación web... Poco más.<br />
<br />
C++ es un lenguaje libre estandarizado por ISO <span style="font-weight: bold;" class="mycode_b">MUY GRANDE</span>, que admite: Programación estructurada (la de toda la vida), la totalidad de la POO (objetos, herencia simple, herencia múltiple, polimorfismo, upcasting, downcasting, RTTI, interfaces, clases abstractas, clases amigas, operadores, sobrecarga... y mil cosas más avanzadas), programación genérica (plantillas, STL, conceptos de contenedores, estructuras de datos genéricas, &lt;b&gt;metaprogramación&lt;/b&gt;... es una programación que no dispone ningún otro lenguaje mayoritario por el momento)... y otras características más avanzadas como los punteros inteligentes, programación lambda, programación "física"... También se usa como programación por eventos (MFC, Qt, Gtk y otras GUIs). Se usa para cualquier cosa, desde sistemas operativos hasta los juegos 3D de última generación pasando por servidores, pasando por las típicas aplicaciones de escritorio o un Office o OpenOffice, un reproductor WinAMP y Windows Media Player, un explorador web (Internet Explorer, Mozilla, Firefox...), un cliente eMule, un cliente Torrent.<br />
<br />
C# es un invento de Microsoft (lenguaje propietario) que mezcla las características básicas de C++ (no las avanzadas) simplificándolas al estilo Java y ofreciendo un framework. El problema es que es .Net, y deja de ser código nativo/portable. Eso sí, el framework provee bastante facilidad de programación de tareas comunes, al igual que Java. Por ello se genera el debate ¿Java o C#? Su funcionalidad viene a ser parecida. .Net es más nativo y Java más virtual.<br />
....</blockquote>
<br />
<a href="https://sites.google.com/site/efectolinux/diferencias-de-c-y-c" target="_blank" rel="noopener" class="mycode_url">Diferencias de C y C++</a><br />
<br />
Parece que estamos ante un programador de C++ ( experto en "C")<br />
<br />
Muy probablemente "C" haga mucho más.<br />
<br />
Saludos]]></description>
			<content:encoded><![CDATA[Buenos días!.<br />
<br />
Para los que quieran conocer sus diferencias. Una parte del texto.<br />
 <br />
<blockquote class="mycode_quote"><cite>Cita:</cite>C es un lenguaje libre estandarizado por ISO <span style="font-weight: bold;" class="mycode_b">MUY PEQUEÑO</span> que admite programación estructurada (la de toda la vida), nada más. Útil en programación de microchips, sistemas operativos, drivers y programación web... Poco más.<br />
<br />
C++ es un lenguaje libre estandarizado por ISO <span style="font-weight: bold;" class="mycode_b">MUY GRANDE</span>, que admite: Programación estructurada (la de toda la vida), la totalidad de la POO (objetos, herencia simple, herencia múltiple, polimorfismo, upcasting, downcasting, RTTI, interfaces, clases abstractas, clases amigas, operadores, sobrecarga... y mil cosas más avanzadas), programación genérica (plantillas, STL, conceptos de contenedores, estructuras de datos genéricas, &lt;b&gt;metaprogramación&lt;/b&gt;... es una programación que no dispone ningún otro lenguaje mayoritario por el momento)... y otras características más avanzadas como los punteros inteligentes, programación lambda, programación "física"... También se usa como programación por eventos (MFC, Qt, Gtk y otras GUIs). Se usa para cualquier cosa, desde sistemas operativos hasta los juegos 3D de última generación pasando por servidores, pasando por las típicas aplicaciones de escritorio o un Office o OpenOffice, un reproductor WinAMP y Windows Media Player, un explorador web (Internet Explorer, Mozilla, Firefox...), un cliente eMule, un cliente Torrent.<br />
<br />
C# es un invento de Microsoft (lenguaje propietario) que mezcla las características básicas de C++ (no las avanzadas) simplificándolas al estilo Java y ofreciendo un framework. El problema es que es .Net, y deja de ser código nativo/portable. Eso sí, el framework provee bastante facilidad de programación de tareas comunes, al igual que Java. Por ello se genera el debate ¿Java o C#? Su funcionalidad viene a ser parecida. .Net es más nativo y Java más virtual.<br />
....</blockquote>
<br />
<a href="https://sites.google.com/site/efectolinux/diferencias-de-c-y-c" target="_blank" rel="noopener" class="mycode_url">Diferencias de C y C++</a><br />
<br />
Parece que estamos ante un programador de C++ ( experto en "C")<br />
<br />
Muy probablemente "C" haga mucho más.<br />
<br />
Saludos]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Libro de programación en C]]></title>
			<link>https://gambas-es.org/thread-239.html</link>
			<pubDate>Wed, 20 Jan 2021 16:09:15 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=12">tincho</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-239.html</guid>
			<description><![CDATA[Hola a todos.<br />
Les comparto este enlace a un proyecto github que trata de un libro muy bien explicado sobre los inicios de la programación en el lenguaje C.<br />
<a href="https://github.com/gorkau/Libro-Programacion-en-C" target="_blank" rel="noopener" class="mycode_url">https://github.com/gorkau/Libro-Programacion-en-C</a><br />
Espero que les resulte útil.<br />
Saludos.]]></description>
			<content:encoded><![CDATA[Hola a todos.<br />
Les comparto este enlace a un proyecto github que trata de un libro muy bien explicado sobre los inicios de la programación en el lenguaje C.<br />
<a href="https://github.com/gorkau/Libro-Programacion-en-C" target="_blank" rel="noopener" class="mycode_url">https://github.com/gorkau/Libro-Programacion-en-C</a><br />
Espero que les resulte útil.<br />
Saludos.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Stat de corelinux libc en gambas.]]></title>
			<link>https://gambas-es.org/thread-191.html</link>
			<pubDate>Thu, 12 Nov 2020 23:02:23 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=12">tincho</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-191.html</guid>
			<description><![CDATA[Hola a todos.<br />
Como algunos sabrán la función <span style="font-weight: bold;" class="mycode_b">stat</span> de Gambas no devuelve el <span style="font-weight: bold;" class="mycode_b">inode</span>, no se a que se debe. Este hecho me llevo a investigar el tema y gracias a las enseñanzas del maestro Vuott, que siempre deja ejemplos sobre el uso de <span style="font-weight: bold;" class="mycode_b">Extern</span> y puso un ejemplo de uso de <span style="font-weight: bold;" class="mycode_b">stat</span> de <span style="font-weight: bold;" class="mycode_b">corelinux</span>, convertí eso en una función que si se coloca en un módulo hace lo que el Stat de gambas pero con este parámetro (inode) agregado, pero el caso es que funciona mucho mas rápido para leer los metadatos de un archivo y cuando se trata de miles se nota la diferencia.<br />
<span style="text-decoration: underline;" class="mycode_u">Referencia en el foro italiano: </span><a href="https://www.gambas-it.org/wiki/index.php?title=Ottenere_alcune_informazioni_generali_sui_file" target="_blank" rel="noopener" class="mycode_url">Ottenere_alcune_informazioni_generali_sui_file</a><br />
<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>Library "libc:6"<br />
<br />
Public Struct stat_<br />
  st_dev As Long<br />
  st_ino As Long<br />
  st_nlink As Long<br />
  st_mode As Integer<br />
  st_uid As Integer<br />
  st_gid As Integer<br />
  __pad0 As Integer<br />
  st_rdev As Long<br />
  st_size As Long<br />
  st_blksize As Long<br />
  st_blocks As Long<br />
  st_atime As Long<br />
  st_atimensec As Long<br />
  st_mtime As Long<br />
  st_mtimensec As Long<br />
  st_ctime As Long<br />
  st_ctimensec As Long<br />
  __glibc_reserved[3] As Long<br />
End Struct<br />
<br />
Private Const _STAT_VER_LINUX As Integer = 1<br />
Private Extern __xstat(_STAT_VER As Integer, __path As String, __statbuf As Stat_) As Integer<br />
<br />
'' Create a file parameters list using the GNU coreutils program stat. Note: the tags for access to the information are:&lt;br&gt;<br />
'' Dev, Ino, Path, Link, Mode, SetUID, SetGID, Rdev, Size, BlkSize, Blocks, LastAccess, LastModified, LastChange&lt;br&gt;<br />
'' Original &lt;https://www.gambas-it.org/wiki/index.php?title=Stat_()&gt;<br />
<br />
Public Sub Stat(f As String) As Collection<br />
<br />
  Dim i As Integer<br />
  Dim st As New Stat_<br />
  Dim inf As New Collection<br />
<br />
  i = __xstat(_STAT_VER_LINUX, f, st)<br />
  If i &lt; 0 Then Error.Raise("Function error '__xstat()' !")<br />
<br />
  With st<br />
    inf.Add(.st_dev, "Dev")<br />
    inf.Add(.st_ino, "Ino")<br />
    inf.Add(f, "Path")<br />
    inf.Add(.st_nlink, "Link")<br />
    inf.Add(.st_mode, "Mode")<br />
    inf.Add(.st_uid, "SetUID")<br />
    inf.Add(.st_gid, "SetGID")<br />
    inf.Add(.st_rdev, "Rdev")<br />
    inf.Add(.st_size, "Size")<br />
    inf.Add(.st_blksize, "BlkSize")<br />
    inf.Add(.st_blocks, "Blocks")<br />
    inf.Add(.st_atime, "LastAccess")<br />
    inf.Add(.st_mtime, "LastModified")<br />
    inf.Add(.st_ctime, "LastChange")<br />
  End With<br />
  Return inf<br />
End</code></div></div><br />
Saludos.]]></description>
			<content:encoded><![CDATA[Hola a todos.<br />
Como algunos sabrán la función <span style="font-weight: bold;" class="mycode_b">stat</span> de Gambas no devuelve el <span style="font-weight: bold;" class="mycode_b">inode</span>, no se a que se debe. Este hecho me llevo a investigar el tema y gracias a las enseñanzas del maestro Vuott, que siempre deja ejemplos sobre el uso de <span style="font-weight: bold;" class="mycode_b">Extern</span> y puso un ejemplo de uso de <span style="font-weight: bold;" class="mycode_b">stat</span> de <span style="font-weight: bold;" class="mycode_b">corelinux</span>, convertí eso en una función que si se coloca en un módulo hace lo que el Stat de gambas pero con este parámetro (inode) agregado, pero el caso es que funciona mucho mas rápido para leer los metadatos de un archivo y cuando se trata de miles se nota la diferencia.<br />
<span style="text-decoration: underline;" class="mycode_u">Referencia en el foro italiano: </span><a href="https://www.gambas-it.org/wiki/index.php?title=Ottenere_alcune_informazioni_generali_sui_file" target="_blank" rel="noopener" class="mycode_url">Ottenere_alcune_informazioni_generali_sui_file</a><br />
<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>Library "libc:6"<br />
<br />
Public Struct stat_<br />
  st_dev As Long<br />
  st_ino As Long<br />
  st_nlink As Long<br />
  st_mode As Integer<br />
  st_uid As Integer<br />
  st_gid As Integer<br />
  __pad0 As Integer<br />
  st_rdev As Long<br />
  st_size As Long<br />
  st_blksize As Long<br />
  st_blocks As Long<br />
  st_atime As Long<br />
  st_atimensec As Long<br />
  st_mtime As Long<br />
  st_mtimensec As Long<br />
  st_ctime As Long<br />
  st_ctimensec As Long<br />
  __glibc_reserved[3] As Long<br />
End Struct<br />
<br />
Private Const _STAT_VER_LINUX As Integer = 1<br />
Private Extern __xstat(_STAT_VER As Integer, __path As String, __statbuf As Stat_) As Integer<br />
<br />
'' Create a file parameters list using the GNU coreutils program stat. Note: the tags for access to the information are:&lt;br&gt;<br />
'' Dev, Ino, Path, Link, Mode, SetUID, SetGID, Rdev, Size, BlkSize, Blocks, LastAccess, LastModified, LastChange&lt;br&gt;<br />
'' Original &lt;https://www.gambas-it.org/wiki/index.php?title=Stat_()&gt;<br />
<br />
Public Sub Stat(f As String) As Collection<br />
<br />
  Dim i As Integer<br />
  Dim st As New Stat_<br />
  Dim inf As New Collection<br />
<br />
  i = __xstat(_STAT_VER_LINUX, f, st)<br />
  If i &lt; 0 Then Error.Raise("Function error '__xstat()' !")<br />
<br />
  With st<br />
    inf.Add(.st_dev, "Dev")<br />
    inf.Add(.st_ino, "Ino")<br />
    inf.Add(f, "Path")<br />
    inf.Add(.st_nlink, "Link")<br />
    inf.Add(.st_mode, "Mode")<br />
    inf.Add(.st_uid, "SetUID")<br />
    inf.Add(.st_gid, "SetGID")<br />
    inf.Add(.st_rdev, "Rdev")<br />
    inf.Add(.st_size, "Size")<br />
    inf.Add(.st_blksize, "BlkSize")<br />
    inf.Add(.st_blocks, "Blocks")<br />
    inf.Add(.st_atime, "LastAccess")<br />
    inf.Add(.st_mtime, "LastModified")<br />
    inf.Add(.st_ctime, "LastChange")<br />
  End With<br />
  Return inf<br />
End</code></div></div><br />
Saludos.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[LibreDWG types map in Gambas]]></title>
			<link>https://gambas-es.org/thread-168.html</link>
			<pubDate>Sun, 01 Nov 2020 18:14:09 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=12">tincho</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-168.html</guid>
			<description><![CDATA[Hola a todos.<br />
Dejo un resumen de los tipos de variables que maneja LibreDwg y su conversión gambas.<br />
<img src="https://i.imgur.com/n6CtV4t.png" loading="lazy"  alt="[Imagen: n6CtV4t.png]" class="mycode_img" /><br />
Saludos.]]></description>
			<content:encoded><![CDATA[Hola a todos.<br />
Dejo un resumen de los tipos de variables que maneja LibreDwg y su conversión gambas.<br />
<img src="https://i.imgur.com/n6CtV4t.png" loading="lazy"  alt="[Imagen: n6CtV4t.png]" class="mycode_img" /><br />
Saludos.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Traducir una Estructura de C en una de Gambas]]></title>
			<link>https://gambas-es.org/thread-166.html</link>
			<pubDate>Sun, 01 Nov 2020 14:55:23 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=12">tincho</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-166.html</guid>
			<description><![CDATA[Hola a todos.<br />
Me dieron un indicio en la lista internacional de gambas sobre el uso de una librería C en gambas ahora estoy intentando traducir un struct.<br />
<a href="https://git.savannah.gnu.org/cgit/libredwg.git/tree/include/dwg.h#n8846" target="_blank" rel="noopener" class="mycode_url">https://git.savannah.gnu.org/cgit/libred...wg.h#n8846</a><br />
Si alguien puede decirme como se hace esto u orientarme un poco me seria de ayuda.<br />
Saludos.]]></description>
			<content:encoded><![CDATA[Hola a todos.<br />
Me dieron un indicio en la lista internacional de gambas sobre el uso de una librería C en gambas ahora estoy intentando traducir un struct.<br />
<a href="https://git.savannah.gnu.org/cgit/libredwg.git/tree/include/dwg.h#n8846" target="_blank" rel="noopener" class="mycode_url">https://git.savannah.gnu.org/cgit/libred...wg.h#n8846</a><br />
Si alguien puede decirme como se hace esto u orientarme un poco me seria de ayuda.<br />
Saludos.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Usando Extern entendiendo C]]></title>
			<link>https://gambas-es.org/thread-165.html</link>
			<pubDate>Sun, 01 Nov 2020 02:08:41 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=12">tincho</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-165.html</guid>
			<description><![CDATA[Hola a todos.<br />
<br />
Si se tiene una función en un <span style="font-weight: bold;" class="mycode_b">archivo.h</span> de este tipo:<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>EXPORT int dwg_read_file (const char *restrict filename, Dwg_Data *restrict dwg);</code></div></div>Es correcto hacer esto en gambas?<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>Private Extern dwg_read_file(filename As String, Dwg_Data As Pointer) As Integer</code></div></div><br />
Seria esto?<br />
nombre_de_la_funcion(nombre_del_archivo As String, salida_de_los_datos As Pointer) As Integer<br />
<br />
Saludos.]]></description>
			<content:encoded><![CDATA[Hola a todos.<br />
<br />
Si se tiene una función en un <span style="font-weight: bold;" class="mycode_b">archivo.h</span> de este tipo:<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>EXPORT int dwg_read_file (const char *restrict filename, Dwg_Data *restrict dwg);</code></div></div>Es correcto hacer esto en gambas?<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>Private Extern dwg_read_file(filename As String, Dwg_Data As Pointer) As Integer</code></div></div><br />
Seria esto?<br />
nombre_de_la_funcion(nombre_del_archivo As String, salida_de_los_datos As Pointer) As Integer<br />
<br />
Saludos.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Leer datos de DWG Extern y libredwg]]></title>
			<link>https://gambas-es.org/thread-164.html</link>
			<pubDate>Sun, 01 Nov 2020 02:04:00 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://gambas-es.org/member.php?action=profile&uid=12">tincho</a>]]></dc:creator>
			<guid isPermaLink="false">https://gambas-es.org/thread-164.html</guid>
			<description><![CDATA[Hola a todos.<br />
Hice una prueba muy rudimentaria con Extern pero no ha funcionado, dejo el código aquí por si alguien tiene ganas de resolverlo.<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>Library "/usr/local/lib/libredwg:0.0.11"<br />
<br />
'EXPORT int dwg_read_file (const char *restrict filename, Dwg_Data *restrict dwg);<br />
Private Extern dwg_read_file(filename As String, Dwg_Data As Pointer) As Integer<br />
<br />
'EXPORT int dxf_read_file (const char *restrict filename, Dwg_Data *restrict dwg);<br />
Private Extern dxf_read_file(filename As String, Dwg_Data As Pointer) As Integer<br />
<br />
'EXPORT unsigned int dwg_get_layer_count (const Dwg_Data *restrict dwg);<br />
Private Extern dwg_get_layer_count(Dwg_Data As Pointer) As Integer<br />
<br />
Public Function info(f As String) As Pointer<br />
  Dim info As Pointer<br />
  Dim i As Integer<br />
  Dim q As Integer<br />
  i = dwg_read_file(f, info)<br />
  q = dwg_get_layer_count(info)<br />
  Return q<br />
End</code></div></div><br />
El archivo dwg.h se puede consultar aquí<br />
<a href="https://git.savannah.gnu.org/cgit/libredwg.git/tree/include/dwg.h" target="_blank" rel="noopener" class="mycode_url">https://git.savannah.gnu.org/cgit/libred...lude/dwg.h</a><br />
Saludos.]]></description>
			<content:encoded><![CDATA[Hola a todos.<br />
Hice una prueba muy rudimentaria con Extern pero no ha funcionado, dejo el código aquí por si alguien tiene ganas de resolverlo.<br />
<div class="codeblock"><div class="title">Código:</div><div class="body" dir="ltr"><code>Library "/usr/local/lib/libredwg:0.0.11"<br />
<br />
'EXPORT int dwg_read_file (const char *restrict filename, Dwg_Data *restrict dwg);<br />
Private Extern dwg_read_file(filename As String, Dwg_Data As Pointer) As Integer<br />
<br />
'EXPORT int dxf_read_file (const char *restrict filename, Dwg_Data *restrict dwg);<br />
Private Extern dxf_read_file(filename As String, Dwg_Data As Pointer) As Integer<br />
<br />
'EXPORT unsigned int dwg_get_layer_count (const Dwg_Data *restrict dwg);<br />
Private Extern dwg_get_layer_count(Dwg_Data As Pointer) As Integer<br />
<br />
Public Function info(f As String) As Pointer<br />
  Dim info As Pointer<br />
  Dim i As Integer<br />
  Dim q As Integer<br />
  i = dwg_read_file(f, info)<br />
  q = dwg_get_layer_count(info)<br />
  Return q<br />
End</code></div></div><br />
El archivo dwg.h se puede consultar aquí<br />
<a href="https://git.savannah.gnu.org/cgit/libredwg.git/tree/include/dwg.h" target="_blank" rel="noopener" class="mycode_url">https://git.savannah.gnu.org/cgit/libred...lude/dwg.h</a><br />
Saludos.]]></content:encoded>
		</item>
	</channel>
</rss>