[fpc-pascal] Question C to Pascal translation ....Re: Wraper for libpciaccess ?

2015-02-05 Thread Brian
Ref  libpciaccess.h
Any suggestions on the conversions below ? Thanks in advance. Brian

C Union
---

00043 struct pci_device_iterator {
unsigned next_index;

enum {
  match_any,
  match_slot,
  match_id
} mode;

union {
  struct pci_slot_match   slot;
  struct pci_id_match id;
} match;
};

... is this conversion correct ?

 pci_device_iterator = packed record
   next_index : longword; // ???
Mode : (match_any, match_slot, match_id);  
 
  match : packed record
   case integer of // union
0 : (
 slot: pci_slot_match;
);
1 : (
 id : pci_id_match;
);
   end;   
end;


--


H2PAS converts this to ...
00245 struct pci_mem_region {
/**
 * When the region is mapped, this is the pointer to the memory.
 *
 * This field is \b only set when the deprecated \c
pci_device_map_region
 * interface is used.  Use \c pci_device_map_range instead.
 *
 * \deprecated
 */
00254 void *memory;


/**
 * Base physical address of the region within its bus / domain.
 *
 * \warning
 * This address is really only useful to other devices in the same
 * domain.  It's probably \b not the address applications will ever
 * use.
 * 
 * \warning
 * Most (all?) platform back-ends leave this field unset.
 */
00268 pciaddr_t bus_addr;


/**
 * Base physical address of the region from the CPU's point of view.
 * 
 * This address is typically passed to \c pci_device_map_range to create
 * a mapping of the region to the CPU's virtual address space.
 */
00277 pciaddr_t base_addr;


/**
 * Size, in bytes, of the region.
 */
00283 pciaddr_t size;


/**
 * Is the region I/O ports or memory?
 */
00289 unsigned is_IO:1;

/**
 * Is the memory region prefetchable?
 *
 * \note
 * This can only be set if \c is_IO is not set.
 */
00297 unsigned is_prefetchable:1;


/**
 * Is the memory at a 64-bit address?
 *
 * \note
 * This can only be set if \c is_IO is not set.
 */
00306 unsigned is_64:1;
};


Not certain if I believe this .

  pci_mem_region = record
  memory : pointer;
  bus_addr : pciaddr_t;
  base_addr : pciaddr_t;
  size : pciaddr_t;
  flag0 : word;
end;


const
  bm_pci_mem_region_is_IO = $1;
  bp_pci_mem_region_is_IO = 0;
  bm_pci_mem_region_is_prefetchable = $2;
  bp_pci_mem_region_is_prefetchable = 1;
  bm_pci_mem_region_is_64 = $4;
  bp_pci_mem_region_is_64 = 2;

function is_IO(var a : pci_mem_region) : dword;
procedure set_is_IO(var a : pci_mem_region; __is_IO : dword);
function is_prefetchable(var a : pci_mem_region) : dword;
procedure set_is_prefetchable(var a : pci_mem_region; __is_prefetchable
: dword);
function is_64(var a : pci_mem_region) : dword;
procedure set_is_64(var a : pci_mem_region; __is_64 : dword);



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Wraper-for-libpciaccess-tp5720127p5720944.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] New Get Lazarus Initiative

2015-02-05 Thread Roland Schäfer
Dear fpc-pascal,

On 02/05/2015 12:00 PM, fpc-pascal-requ...@lists.freepascal.org wrote:
 Date: Wed, 4 Feb 2015 17:43:09 -0500
 From: Anthony Walter sys...@gmail.com
 To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
 Subject: Re: [fpc-pascal] New Get Lazarus Initiative
 
 Ralph, not to be rude, but you are either not paying attention or being
 dense. I said:

I don't know what the problem of this community is, but since this list
has once again been used (EXTENSIVELY, I might add) for stuff that
belongs on fpc-other, and the tone is so often a very unpleasant one, I
am leaving it. It definitely sucked being laughed at at conferences for
writing larger projects in FPC Pascal, but this list sucks worse!

For me, the new Get Lazarus initiative was a highly successful
Finally stop using FPC! initiative. IMHO, the only initiative you need
(that doesn't exist yet) is an FPC foundation to ensure long-term
compiler development.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] New Get Lazarus Initiative

2015-02-05 Thread Jonas Maebe
Hi,

The author of the mail below has in fact unsubscribed himself in the
mean time. I suggest that anyone wanting to react, does so on fpc-other.


Jonas
fpc-mailing list admin

On 05/02/15 15:27, Roland Schäfer wrote:
 Dear fpc-pascal,
 
 On 02/05/2015 12:00 PM, fpc-pascal-requ...@lists.freepascal.org wrote:
 Date: Wed, 4 Feb 2015 17:43:09 -0500
 From: Anthony Walter sys...@gmail.com
 To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
 Subject: Re: [fpc-pascal] New Get Lazarus Initiative

 Ralph, not to be rude, but you are either not paying attention or being
 dense. I said:
 
 I don't know what the problem of this community is, but since this list
 has once again been used (EXTENSIVELY, I might add) for stuff that
 belongs on fpc-other, and the tone is so often a very unpleasant one, I
 am leaving it. It definitely sucked being laughed at at conferences for
 writing larger projects in FPC Pascal, but this list sucks worse!
 
 For me, the new Get Lazarus initiative was a highly successful
 Finally stop using FPC! initiative. IMHO, the only initiative you need
 (that doesn't exist yet) is an FPC foundation to ensure long-term
 compiler development.



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal