Página 1 de 1

INIT PROCEDURE em C

Enviado: 24 Mar 2017 10:56
por JoséQuintas
Alguém sabe se existe algum equivalente à INIT PROCEDURE em C ?
Estou tentando identificar alguma rotina executada automaticamente, mas que deve estar em C.
Em PRG seria INIT PROCEDURE, mas em C, não sei se existe equivalente.

INIT PROCEDURE em C

Enviado: 24 Mar 2017 19:22
por asimoes
Quintas,

Eu tenho um fonte demo.prg no fonte tem INIT FUNCTION APPSETUP() quando é compilado gera demo.c no demo.c
Todo o demo.c tem HB_FUNC a função APPSETUP() está HB_FUNC_INIT
Não sei se ajuda

Código: Selecionar todos

HB_FUNC_INIT( APPSETUP )
{
	static const HB_BYTE pcode[] =
	{
		51,68,69,77,79,46,80,82,71,58,65,80,80,83,
		69,84,85,80,36,0,36,170,1,176,103,0,106,3,
		80,84,0,20,1,36,171,1,176,104,0,106,6,80,
		84,56,53,48,0,20,1,36,177,1,176,105,0,106,
		7,68,66,70,67,68,88,0,20,1,36,179,1,176,
		106,0,92,14,121,20,2,36,180,1,176,106,0,92,
		31,106,3,79,78,0,20,2,36,181,1,176,106,0,
		92,32,106,4,79,70,70,0,20,2,36,182,1,176,
		106,0,92,11,106,3,79,78,0,20,2,36,184,1,
		176,106,0,92,4,176,107,0,12,0,28,17,106,11,
		121,121,121,121,46,109,109,46,100,100,0,25,13,106,
		9,121,121,46,109,109,46,100,100,0,20,2,36,185,
		1,176,106,0,92,28,106,3,79,78,0,20,2,36,
		186,1,176,106,0,92,4,106,9,68,68,47,77,77,
		47,89,89,0,20,2,36,187,1,176,106,0,92,34,
		106,3,58,58,0,20,2,36,188,1,176,106,0,92,
		8,106,4,79,70,70,0,20,2,36,189,1,176,106,
		0,92,35,106,3,79,78,0,20,2,36,190,1,176,
		106,0,92,5,93,128,7,20,2,36,191,1,176,106,
		0,92,44,106,3,79,78,0,20,2,36,192,1,176,
		106,0,92,45,106,3,79,78,0,20,2,36,193,1,
		176,106,0,92,108,122,20,2,36,194,1,176,106,0,
		92,36,92,24,20,2,176,106,0,92,37,120,20,2,
		36,198,1,176,108,0,106,4,87,86,84,0,20,1,
		36,200,1,176,109,0,20,0,36,202,1,176,110,0,
		92,26,92,80,20,2,36,208,1,176,111,0,20,0,
		36,211,1,100,110,7
	};

	hb_vmExecute( pcode, symbols );
}

INIT PROCEDURE em C

Enviado: 24 Mar 2017 19:47
por Claudio Soto
Un ejemplo:

Código: Selecionar todos

#include <stdio.h> 

void MyInit() __attribute__ ( ( constructor ) ); 

void MyInit() 
{ 
   printf( "Funcion MyInit() run \n "); 
}

INIT PROCEDURE em C

Enviado: 24 Mar 2017 20:40
por JoséQuintas
Na prática quero encontrar na OOHG aonde inicia variáveis C.
Diferente das outras HMGs, ela também inicia variáveis em C.