=================================================================== Modification le : Thu Sep 27 16:05:40 MET DST 2001 Par : fred =================================================================== Update of /users/outil/alliance/cvsroot/alliance/sources/genlib In directory odroz:/users/cao/fred/alliance/sources/genlib Modified Files: genlib.c Log Message: Added a genLOINSA function that accepts an array instead of a list as parameter. The array is assumed to be NULL terminated =================================================================== Index: genlib.c =================================================================== RCS file: /users/outil/alliance/cvsroot/alliance/sources/genlib/genlib.c,v retrieving revision 1.16 retrieving revision 1.17 diff -r1.16 -r1.17 2674d2673 < 2772a2772,2901 > } > > /******************************************************************************* > * function LOINSA * > Aceepts an array to pass the signal values instead of a va_list > *******************************************************************************/ > #define MAX_ARRAY_SIGS 1024 > /* Put that outside of the LOINSA function in order to minimize the > * stack frame required, and we don't need to be reentrant */ > static char *_[MAX_ARRAY_SIGS]; /* Accepts only that many signals, I hope it is > enough for one level of hierarchy */ > void genLOINSA(char *model, char *instance, char *signals[]) > { > int ns; > > for (ns = 0; > signals[ns]; > ns++); > if (ns > MAX_ARRAY_SIGS) { > fprintf(stderr, "LOINSA: Too many signals in array\n"); > exit(1); > } > /* And now a very nice call, to be presented in programmation > * booklets as an exemple */ > memset(_, 0, (ns + 1) * sizeof(*_)); > memcpy(_, signals, ns * sizeof(*_)); > genLOINS(model, instance, > _[0], _[1], _[2], _[3], _[4], _[5], _[6], _[7], _[8], _[9], _[10], _[11], > _[12], _[13], _[14], _[15], _[16], _[17], _[18], _[19], _[20], _[21], > _[22], _[23], _[24], _[25], _[26], _[27], _[28], _[29], _[30], _[31], > _[32], _[33], _[34], _[35], _[36], _[37], _[38], _[39], _[40], _[41], > _[42], _[43], _[44], _[45], _[46], _[47], _[48], _[49], _[50], _[51], > _[52], _[53], _[54], _[55], _[56], _[57], _[58], _[59], _[60], _[61], > _[62], _[63], _[64], _[65], _[66], _[67], _[68], _[69], _[70], _[71], > _[72], _[73], _[74], _[75], _[76], _[77], _[78], _[79], _[80], _[81], > _[82], _[83], _[84], _[85], _[86], _[87], _[88], _[89], _[90], _[91], > _[92], _[93], _[94], _[95], _[96], _[97], _[98], _[99], _[100], _[101], > _[102], _[103], _[104], _[105], _[106], _[107], _[108], _[109], _[110], _[111], > _[112], _[113], _[114], _[115], _[116], _[117], _[118], _[119], _[120], _[121], > _[122], _[123], _[124], _[125], _[126], _[127], _[128], _[129], _[130], _[131], > _[132], _[133], _[134], _[135], _[136], _[137], _[138], _[139], _[140], _[141], =================================================================== Ce message est envoyé au personnes abonnées à alliance-programmers Pour plus d'information sur cette mailling-list, visitez : http://www-asim.lip6.fr/alliance/mailing-lists/