207 lines
3.8 KiB
C
207 lines
3.8 KiB
C
/************************************************************************************/
|
|
/* This file use the TCl software which follow this copyright: */
|
|
/* */
|
|
/* The TCL software is copyrighted by the Regents of the University of */
|
|
/* California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState */
|
|
/* Corporation and other parties. */
|
|
/************************************************************************************/
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include "tcl.h"
|
|
#include <stdint.h>
|
|
#if defined(WIN32)
|
|
# include <windows.h>
|
|
#endif
|
|
#if defined(UNIX)
|
|
# include <inttypes.h>
|
|
#endif
|
|
|
|
|
|
int nombre ;
|
|
int nombre_1 ;
|
|
int nombre_2 ;
|
|
uint8_t nombreunit8 ;
|
|
uint8_t nombreunit8_1 ;
|
|
uint8_t nombreunit8_2 ;
|
|
uint16_t nombreunit16 ;
|
|
uint16_t nombreunit16_1 ;
|
|
uint16_t nombreunit16_2 ;
|
|
uint32_t nombreunit32 ;
|
|
uint32_t nombreunit32_1 ;
|
|
uint32_t nombreunit32_2 ;
|
|
char * string;
|
|
|
|
|
|
|
|
int * newintptr (void) {
|
|
int * ptr ;
|
|
ptr = &nombre;
|
|
return ptr;
|
|
}
|
|
int * newintptr_1 (void) {
|
|
int * ptr ;
|
|
ptr = &nombre_1;
|
|
return ptr;
|
|
}
|
|
int * newintptr_2 (void) {
|
|
int * ptr ;
|
|
ptr = &nombre_2;
|
|
return ptr;
|
|
}
|
|
void getintpointeur ( int * ptr ) {
|
|
if ( ptr != 0 )
|
|
printf("%x\n", *ptr );
|
|
return ;
|
|
}
|
|
|
|
void setintptr (int * ptr, int val) {
|
|
*ptr = val;
|
|
return;
|
|
}
|
|
|
|
uint8_t newuint8 (int val) {
|
|
return val;
|
|
}
|
|
void getuint8 ( uint8_t ptr ) {
|
|
if ( ptr != 0 )
|
|
printf("0x%x\n", ptr );
|
|
return ;
|
|
}
|
|
|
|
|
|
uint16_t newuint16 (int val) {
|
|
return val;
|
|
}
|
|
void getuint16 ( uint16_t ptr ) {
|
|
if ( ptr != 0 )
|
|
printf("0x%x\n", ptr );
|
|
return ;
|
|
}
|
|
|
|
uint32_t newuint32 (int val) {
|
|
return val;
|
|
}
|
|
void getuint32 ( uint32_t ptr ) {
|
|
if ( ptr != 0 )
|
|
printf("0x%x\n", ptr );
|
|
return ;
|
|
}
|
|
|
|
|
|
uint8_t * newuint8ptr (void) {
|
|
uint8_t * ptr ;
|
|
ptr = &nombreunit8;
|
|
return ptr;
|
|
}
|
|
|
|
uint8_t * newuint8ptr_1 (void) {
|
|
uint8_t * ptr ;
|
|
ptr = &nombreunit8_1;
|
|
return ptr;
|
|
}
|
|
|
|
uint8_t * newuint8ptr_2 (void) {
|
|
uint8_t * ptr ;
|
|
ptr = &nombreunit8_2;
|
|
return ptr;
|
|
}
|
|
void getuint8ptr ( uint8_t * ptr ) {
|
|
if ( ptr != 0 ){
|
|
#if defined(WIN32)
|
|
printf("0x%x\n", *ptr );
|
|
#elif(UNIX)
|
|
printf("0x%"PRIi8"\n", *ptr );
|
|
#endif
|
|
}
|
|
return ;
|
|
}
|
|
|
|
void setuint8ptr (uint8_t * ptr, int val) {
|
|
*ptr = (uint8_t) val;
|
|
return;
|
|
}
|
|
|
|
uint16_t * newuint16ptr (void) {
|
|
uint16_t * ptr ;
|
|
ptr = &nombreunit16;
|
|
return ptr;
|
|
}
|
|
|
|
uint16_t * newuint16ptr_1 (void) {
|
|
uint16_t * ptr ;
|
|
ptr = &nombreunit16_1;
|
|
return ptr;
|
|
}
|
|
|
|
uint16_t * newuint16ptr_2 (void) {
|
|
uint16_t * ptr ;
|
|
ptr = &nombreunit16_2;
|
|
return ptr;
|
|
}
|
|
void getuint16ptr ( uint16_t * ptr ) {
|
|
if ( ptr != 0 ){
|
|
#if defined(WIN32)
|
|
printf("0x%x\n", *ptr );
|
|
#elif(UNIX)
|
|
printf("0x%"PRIi16"\n", *ptr );
|
|
#endif
|
|
}
|
|
return ;
|
|
}
|
|
|
|
void setuint16ptr (uint16_t * ptr, int val) {
|
|
*ptr = val;
|
|
return;
|
|
}
|
|
|
|
|
|
uint32_t * newuint32ptr (void) {
|
|
uint32_t * ptr ;
|
|
ptr = &nombreunit32;
|
|
return ptr;
|
|
}
|
|
uint32_t * newuint32ptr_1 (void) {
|
|
uint32_t * ptr ;
|
|
ptr = &nombreunit32_1;
|
|
return ptr;
|
|
}
|
|
uint32_t * newuint32ptr_2 (void) {
|
|
uint32_t * ptr ;
|
|
ptr = &nombreunit32_2;
|
|
return ptr;
|
|
}
|
|
void getuint32ptr ( uint32_t * ptr ) {
|
|
if ( ptr != 0 ){
|
|
#if defined(WIN32)
|
|
printf("0x%x\n", *ptr );
|
|
#elif(UNIX)
|
|
printf("0x%"PRIi32"\n", *ptr );
|
|
#endif
|
|
}
|
|
return ;
|
|
}
|
|
void setuint32ptr (uint32_t * ptr, int val) {
|
|
*ptr = val;
|
|
return;
|
|
}
|
|
|
|
void setstringptr (char ** ptr, char * val) {
|
|
*ptr = val;
|
|
return;
|
|
}
|
|
char * * newstringptr (void) {
|
|
char * * ptr ;
|
|
ptr = &string;
|
|
return ptr;
|
|
}
|
|
void getstringptr ( char * * ptr ) {
|
|
if ( ptr != 0 )
|
|
printf("%s\n", *ptr );
|
|
|
|
return ;
|
|
}
|
|
|
|
|