Example, Addr_table_index( ) built-in function, Syntax – Echelon Neuron C User Manual
Page 92: Ansi_memcpy( ) function
72
Functions
Example
#include
network output SNVT_amp nvoAmpere;
nv_struct nv_copy;
void f(void)
{
nv_copy = *(access_nv(nv_table_index(nvoAmpere));
}
addr_table_index( )
Built-in Function
The addr_table_index( ) built-in function is used to determine the address table
index of a message tag as allocated by the Neuron C compiler. The returned
value is in the range of 0 to 14.
The Neuron C compiler does not allow this function to be used for a non-bindable
message tag (that is, a message tag declared with the bind_info(nonbind) option).
Syntax
unsigned int addr_table_index (
message-tag
);
Example
int mt_index;
msg_tag my_mt;
void f(void)
{
mt_index = addr_table_index(my_mt);
}
ansi_memcpy( )
Function
The ansi_memcpy( ) function copies a block of
len
bytes from
src
to
dest
. It
returns the first argument, which is a pointer to the
dest
memory area. This
function cannot be used to copy overlapping areas of memory, or to write into
EEPROM or flash memory.
The ansi_memcpy( ) function as implemented here conforms to the ANSI
definition for memcpy( ), as it returns a pointer to the destination array. See
memcpy( ) for a non-conforming implementation (does not have a return value),
which is a more efficient implementation if the return value is not needed. See
also ansi_memset( ), eeprom_memcpy( ), memccpy( ), memchr( ), memcmp( ),
memcpy( ), and memset( ).
Syntax
#include
void *ansi_memcpy (void *
dest
, void *
src
, unsigned long
len
);