2007-12-17 20:18:04 +00:00
|
|
|
|
/****************************/
|
|
|
|
|
/* readschematicnetlist.cpp */
|
|
|
|
|
/****************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
2007-12-17 20:18:04 +00:00
|
|
|
|
/* Read a nelist type Eeschema or OrcadPCB2 and buid the component list
|
|
|
|
|
* Manages the lines like :
|
|
|
|
|
* ( XXXXXX VALEUR|(pin1,pin2,...=newalim) ID VALEUR
|
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
|
#include "wxstruct.h"
|
|
|
|
|
#include "common.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
|
#include "confirm.h"
|
|
|
|
|
#include "kicad_string.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
2009-02-04 15:25:03 +00:00
|
|
|
|
#include "cvpcb.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
#include "protos.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
|
#include "cvstruct.h"
|
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
#define SEPARATEUR '|' /* caractere separateur dans netliste */
|
|
|
|
|
|
|
|
|
|
/* routines locales : */
|
|
|
|
|
|
2008-08-01 17:41:51 +00:00
|
|
|
|
static int ReadPinConnection( STORECMP* CurrentCmp );
|
|
|
|
|
static int CmpCompare( void* cmp1, void* cmp2 ); /* routine pour qsort() de tri de liste des composants */
|
|
|
|
|
static STORECMP* TriListeComposants( STORECMP* BaseListe, int nbitems );
|
|
|
|
|
|
|
|
|
|
/* Tri la liste des composants par ordre alphabetique et met a jour le nouveau chainage avant/arriere
|
|
|
|
|
* retourne un pointeur sur le 1er element de la liste */
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
2007-12-17 20:18:04 +00:00
|
|
|
|
#define BUFFER_CHAR_SIZE 1024 // Size of buffers used to store netlist datas
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
/************************************************/
|
2007-09-13 11:55:46 +00:00
|
|
|
|
int WinEDA_CvpcbFrame::ReadSchematicNetlist()
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/************************************************/
|
2008-08-01 17:41:51 +00:00
|
|
|
|
|
|
|
|
|
/** Function ReadSchematicNetlist
|
|
|
|
|
* Read a Eeschema (or OrcadPCB) netlist
|
|
|
|
|
* like:
|
|
|
|
|
* # EESchema Netlist Version 1.1 created 15/5/2008-12:09:21
|
|
|
|
|
* (
|
|
|
|
|
* ( /32568D1E $noname JP1 CONN_8X2 {Lib=CONN_8X2}
|
|
|
|
|
* ( 1 GND )
|
|
|
|
|
* ( 2 /REF10 )
|
|
|
|
|
* ( 3 GND )
|
|
|
|
|
* ( 4 /REF11 )
|
|
|
|
|
* ( 5 GND )
|
|
|
|
|
* ( 6 /REF7 )
|
|
|
|
|
* ( 7 GND )
|
|
|
|
|
* ( 8 /REF9 )
|
|
|
|
|
* ( 9 GND )
|
|
|
|
|
* ( 10 /REF6 )
|
|
|
|
|
* ( 11 GND )
|
|
|
|
|
* ( 12 /REF8 )
|
|
|
|
|
* ( 13 GND )
|
|
|
|
|
* ( 14 /REF4 )
|
|
|
|
|
* ( 15 GND )
|
|
|
|
|
* ( 16 /REF5 )
|
|
|
|
|
* )
|
|
|
|
|
* ( /325679C1 $noname RR1 9x1K {Lib=RR9}
|
|
|
|
|
* ( 1 VCC )
|
|
|
|
|
* ( 2 /REF5 )
|
|
|
|
|
* ( 3 /REF4 )
|
|
|
|
|
* ( 4 /REF8 )
|
|
|
|
|
* ( 5 /REF6 )
|
|
|
|
|
* ( 6 /REF9 )
|
|
|
|
|
* ( 7 /REF7 )
|
|
|
|
|
* ( 8 /REF11 )
|
|
|
|
|
* ( 9 /REF10 )
|
|
|
|
|
* ( 10 ? )
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
* *
|
|
|
|
|
* { Allowed footprints by component:
|
|
|
|
|
* $component R5
|
|
|
|
|
* R?
|
|
|
|
|
* SM0603
|
|
|
|
|
* SM0805
|
|
|
|
|
* $endlist
|
|
|
|
|
* $component C2
|
|
|
|
|
* SM*
|
|
|
|
|
* C?
|
|
|
|
|
* C1-1
|
|
|
|
|
* $endlist
|
|
|
|
|
* $endfootprintlist
|
|
|
|
|
* }
|
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
{
|
2008-08-01 17:41:51 +00:00
|
|
|
|
int i, k, l;
|
2007-12-17 20:18:04 +00:00
|
|
|
|
char* LibName;
|
|
|
|
|
char Line[BUFFER_CHAR_SIZE + 1];
|
2008-08-01 17:41:51 +00:00
|
|
|
|
wxString component_reference; /* buffer for component reference (U1, R4...) */
|
|
|
|
|
wxString schematic_timestamp; /* buffer for component time stamp */
|
|
|
|
|
wxString footprint_name; /* buffer for component footprint field */
|
|
|
|
|
wxString component_value; /* buffer for component values (470K, 22nF ...) */
|
2008-12-08 18:56:43 +00:00
|
|
|
|
char* ptchar;
|
2007-12-17 20:18:04 +00:00
|
|
|
|
STORECMP* Cmp;
|
|
|
|
|
|
|
|
|
|
modified = 0;
|
|
|
|
|
Rjustify = 0;
|
|
|
|
|
g_FlagEESchema = FALSE;
|
|
|
|
|
|
2008-12-08 18:56:43 +00:00
|
|
|
|
/* Clear components buffer */
|
2007-12-17 20:18:04 +00:00
|
|
|
|
if( g_BaseListeCmp )
|
2009-02-21 15:12:26 +00:00
|
|
|
|
FreeMemoryComponents();
|
2007-12-17 20:18:04 +00:00
|
|
|
|
|
|
|
|
|
source = wxFopen( FFileName, wxT( "rt" ) );
|
|
|
|
|
if( source == 0 )
|
|
|
|
|
{
|
|
|
|
|
wxString msg;
|
|
|
|
|
msg.Printf( _( "File <%s> not found" ), FFileName.GetData() );
|
|
|
|
|
DisplayError( this, msg ); return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Read the file header (must be "( { OrCAD PCB" or "({ OrCAD PCB" )
|
|
|
|
|
* or "# EESchema Netliste"
|
|
|
|
|
*/
|
2008-07-31 15:30:57 +00:00
|
|
|
|
fgets( Line, BUFFER_CHAR_SIZE, source );
|
2007-12-17 20:18:04 +00:00
|
|
|
|
/* test for netlist type PCB2 */
|
|
|
|
|
i = strnicmp( Line, "( {", 3 );
|
|
|
|
|
if( i != 0 )
|
|
|
|
|
i = strnicmp( Line, "({", 2 );
|
|
|
|
|
if( i != 0 )
|
|
|
|
|
{
|
|
|
|
|
i = strnicmp( Line, "# EESchema", 7 ); /* net type EESchema */
|
|
|
|
|
if( i == 0 )
|
|
|
|
|
g_FlagEESchema = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( i != 0 )
|
|
|
|
|
{
|
|
|
|
|
wxString msg, Lineconv = CONV_FROM_UTF8( Line );
|
|
|
|
|
msg.Printf( _( "Unknown file format <%s>" ), Lineconv.GetData() );
|
|
|
|
|
DisplayError( this, msg );
|
|
|
|
|
fclose( source ); return -3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetStatusText( _( "Netlist Format: EESchema" ), 0 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Read the netlit */
|
|
|
|
|
for( ; ; )
|
|
|
|
|
{
|
|
|
|
|
/* Search the beginning of a component description */
|
|
|
|
|
|
|
|
|
|
if( fgets( Line, BUFFER_CHAR_SIZE, source ) == 0 )
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* Remove blanks */
|
|
|
|
|
i = 0; while( Line[i] == ' ' )
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
/* remove empty lines : */
|
|
|
|
|
if( Line[i] < ' ' )
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if( strnicmp( &Line[i], "{ Allowed footprints", 20 ) == 0 )
|
|
|
|
|
{
|
|
|
|
|
ReadFootprintFilterList( source );
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( strnicmp( &Line[i], "( ", 2 ) != 0 )
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/*******************************/
|
|
|
|
|
/* Component description found */
|
|
|
|
|
/*******************************/
|
|
|
|
|
while( Line[i] != ' ' )
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
while( Line[i] == ' ' )
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
/* i points the beginning of the schematic time stamp */
|
|
|
|
|
|
2008-08-01 17:41:51 +00:00
|
|
|
|
schematic_timestamp.Empty();
|
|
|
|
|
while( Line[i] != ' ' )
|
|
|
|
|
schematic_timestamp.Append( Line[i++] );
|
2007-12-17 20:18:04 +00:00
|
|
|
|
|
|
|
|
|
/* search val/ref.lib */
|
|
|
|
|
while( Line[i] == ' ' )
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
/* i points the component value */
|
|
|
|
|
LibName = Line + i;
|
|
|
|
|
|
2008-08-01 17:41:51 +00:00
|
|
|
|
component_reference.Empty();
|
|
|
|
|
footprint_name.Empty();
|
|
|
|
|
component_value.Empty();
|
2007-12-17 20:18:04 +00:00
|
|
|
|
memset( alim, 0, sizeof(alim) );
|
|
|
|
|
|
|
|
|
|
/* Read value */
|
|
|
|
|
|
|
|
|
|
ptchar = strstr( &Line[i], " " ); // Search end of value field (space)
|
|
|
|
|
if( ptchar == 0 )
|
|
|
|
|
{
|
|
|
|
|
wxString msg;
|
|
|
|
|
msg.Printf( _( "Netlist error: %s" ), Line );
|
2008-08-01 17:41:51 +00:00
|
|
|
|
DisplayError( this, msg );
|
2007-12-17 20:18:04 +00:00
|
|
|
|
k = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
k = ptchar - Line;
|
|
|
|
|
|
2008-08-01 17:41:51 +00:00
|
|
|
|
for( ; i < k; i++ )
|
2007-12-17 20:18:04 +00:00
|
|
|
|
{
|
|
|
|
|
if( Line[i] == SEPARATEUR )
|
|
|
|
|
break;
|
2008-08-01 17:41:51 +00:00
|
|
|
|
footprint_name.Append( Line[i] );
|
2007-12-17 20:18:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( (Line[++i] == '(') && (Line[k - 1] == ')' ) )
|
|
|
|
|
{
|
|
|
|
|
i++; l = 0; while( k - 1 > i )
|
|
|
|
|
alim[l++] = Line[i++];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
i = k;
|
|
|
|
|
|
|
|
|
|
/* Search component reference */
|
|
|
|
|
while( Line[i] != ' ' )
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
/* goto end of value field */
|
|
|
|
|
while( Line[i] == ' ' )
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
/* goto beginning of reference */
|
|
|
|
|
|
|
|
|
|
/* debut reference trouv<75> */
|
2008-08-01 17:41:51 +00:00
|
|
|
|
for( ; ; i++ )
|
2007-12-17 20:18:04 +00:00
|
|
|
|
{
|
|
|
|
|
if( Line[i] <= ' ' )
|
|
|
|
|
break;
|
2008-08-01 17:41:51 +00:00
|
|
|
|
component_reference.Append( Line[i] );
|
2007-12-17 20:18:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Search component value */
|
|
|
|
|
while( Line[i] == ' ' )
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
/** goto beginning of value */
|
|
|
|
|
|
2008-08-01 17:41:51 +00:00
|
|
|
|
for( ; ; i++ )
|
2007-12-17 20:18:04 +00:00
|
|
|
|
{
|
|
|
|
|
if( Line[i] <= ' ' )
|
|
|
|
|
break;
|
2008-08-01 17:41:51 +00:00
|
|
|
|
component_value.Append( Line[i] );
|
2007-12-17 20:18:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Store info for this component */
|
|
|
|
|
Cmp = new STORECMP();
|
|
|
|
|
Cmp->Pnext = g_BaseListeCmp;
|
|
|
|
|
g_BaseListeCmp = Cmp;
|
2008-08-01 17:41:51 +00:00
|
|
|
|
Cmp->m_Reference = component_reference;
|
|
|
|
|
Cmp->m_Valeur = component_value;
|
2007-12-17 20:18:04 +00:00
|
|
|
|
|
|
|
|
|
if( g_FlagEESchema ) /* copy footprint name: */
|
|
|
|
|
{
|
|
|
|
|
if( strnicmp( LibName, "$noname", 7 ) != 0 )
|
|
|
|
|
{
|
|
|
|
|
while( *LibName > ' ' )
|
|
|
|
|
{
|
|
|
|
|
Cmp->m_Module.Append( *LibName );
|
|
|
|
|
LibName++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-08-01 17:41:51 +00:00
|
|
|
|
Cmp->m_TimeStamp = schematic_timestamp;
|
2007-12-17 20:18:04 +00:00
|
|
|
|
|
|
|
|
|
ReadPinConnection( Cmp );
|
|
|
|
|
|
|
|
|
|
nbcomp++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fclose( source );
|
|
|
|
|
|
|
|
|
|
/* Alpabetic sorting : */
|
2008-08-01 17:41:51 +00:00
|
|
|
|
g_BaseListeCmp = TriListeComposants( g_BaseListeCmp, nbcomp );
|
2007-12-17 20:18:04 +00:00
|
|
|
|
|
|
|
|
|
return 0;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-12-17 20:18:04 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/********************************************************/
|
2007-12-17 20:18:04 +00:00
|
|
|
|
int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/********************************************************/
|
|
|
|
|
{
|
2007-12-17 20:18:04 +00:00
|
|
|
|
char Line[BUFFER_CHAR_SIZE + 1];
|
|
|
|
|
wxString CmpRef;
|
|
|
|
|
STORECMP* Cmp = NULL;
|
|
|
|
|
|
|
|
|
|
for( ; ; )
|
|
|
|
|
{
|
|
|
|
|
if( fgets( Line, BUFFER_CHAR_SIZE, source ) == 0 )
|
|
|
|
|
break;
|
|
|
|
|
if( strnicmp( Line, "$endlist", 8 ) == 0 )
|
|
|
|
|
{
|
|
|
|
|
Cmp = NULL;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if( strnicmp( Line, "$endfootprintlist", 4 ) == 0 )
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if( strnicmp( Line, "$component", 10 ) == 0 ) // New component ref found
|
|
|
|
|
{
|
|
|
|
|
CmpRef = CONV_FROM_UTF8( Line + 11 );
|
|
|
|
|
CmpRef.Trim( TRUE ); CmpRef.Trim( FALSE );
|
|
|
|
|
/* Search the new component in list */
|
|
|
|
|
for( Cmp = g_BaseListeCmp; Cmp != NULL; Cmp = Cmp->Pnext )
|
|
|
|
|
{
|
|
|
|
|
if( Cmp->m_Reference == CmpRef )
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if( Cmp )
|
|
|
|
|
{
|
|
|
|
|
wxString fp = CONV_FROM_UTF8( Line + 1 );
|
|
|
|
|
fp.Trim( FALSE ); fp.Trim( TRUE );
|
|
|
|
|
Cmp->m_FootprintFilter.Add( fp );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************/
|
2007-12-17 20:18:04 +00:00
|
|
|
|
int ReadPinConnection( STORECMP* Cmp )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/***********************************/
|
|
|
|
|
{
|
2007-12-17 20:18:04 +00:00
|
|
|
|
int i, jj;
|
2008-08-01 17:41:51 +00:00
|
|
|
|
wxString numpin;
|
|
|
|
|
wxString net;
|
2007-12-17 20:18:04 +00:00
|
|
|
|
char Line[BUFFER_CHAR_SIZE + 1];
|
|
|
|
|
STOREPIN* Pin = NULL;
|
|
|
|
|
STOREPIN** LastPin = &Cmp->m_Pins;
|
|
|
|
|
|
|
|
|
|
for( ; ; )
|
|
|
|
|
{
|
|
|
|
|
/* debut description trouv<75> */
|
|
|
|
|
for( ; ; )
|
|
|
|
|
{
|
|
|
|
|
if( fgets( Line, BUFFER_CHAR_SIZE, source ) == 0 )
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
/* remove blanks from the beginning of the line */
|
|
|
|
|
i = 0; while( Line[i] == ' ' )
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
while( Line[i] == '(' )
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
while( Line[i] == ' ' )
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
/* remove empty lines : */
|
|
|
|
|
if( Line[i] < ' ' )
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* fin de description ? */
|
|
|
|
|
if( Line[i] == ')' )
|
|
|
|
|
return 0;
|
|
|
|
|
|
2008-08-01 17:41:51 +00:00
|
|
|
|
net.Empty();
|
|
|
|
|
numpin.Empty();
|
2007-12-17 20:18:04 +00:00
|
|
|
|
|
2008-07-31 15:30:57 +00:00
|
|
|
|
/* Read pin name , 4 letters */
|
2007-12-17 20:18:04 +00:00
|
|
|
|
for( jj = 0; jj < 4; jj++, i++ )
|
|
|
|
|
{
|
|
|
|
|
if( Line[i] == ' ' )
|
|
|
|
|
break;
|
2008-08-01 17:41:51 +00:00
|
|
|
|
numpin.Append( Line[i] );
|
2007-12-17 20:18:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Read netname */
|
|
|
|
|
while( Line[i] == ' ' )
|
|
|
|
|
i++;
|
|
|
|
|
|
2008-08-01 17:41:51 +00:00
|
|
|
|
for( ; ; i++ )
|
2007-12-17 20:18:04 +00:00
|
|
|
|
{
|
|
|
|
|
if( Line[i] <= ' ' )
|
|
|
|
|
break;
|
2008-08-01 17:41:51 +00:00
|
|
|
|
net.Append( Line[i] );
|
2007-12-17 20:18:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Pin = new STOREPIN();
|
|
|
|
|
*LastPin = Pin; LastPin = &Pin->Pnext;
|
2008-08-01 17:41:51 +00:00
|
|
|
|
Pin->m_PinNum = numpin;
|
|
|
|
|
Pin->m_PinNet = net;
|
2007-12-17 20:18:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************/
|
2008-08-01 17:41:51 +00:00
|
|
|
|
STORECMP* TriListeComposants( STORECMP* BaseListe, int nbitems )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/****************************************************************/
|
2007-12-17 20:18:04 +00:00
|
|
|
|
|
|
|
|
|
/* Sort the component list( this is a linked list)
|
|
|
|
|
* retourn the beginning of the list
|
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
{
|
2007-12-17 20:18:04 +00:00
|
|
|
|
STORECMP** bufferptr, * Item;
|
|
|
|
|
int ii;
|
|
|
|
|
|
|
|
|
|
if( nbitems <= 0 )
|
|
|
|
|
return NULL;
|
|
|
|
|
bufferptr = (STORECMP**) MyZMalloc( (nbitems + 2) * sizeof(STORECMP*) );
|
|
|
|
|
|
|
|
|
|
for( ii = 1, Item = BaseListe; Item != NULL; Item = Item->Pnext, ii++ )
|
|
|
|
|
{
|
|
|
|
|
bufferptr[ii] = Item;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Here: bufferptr[0] = NULL and bufferptr[nbitem+1] = NULL.
|
|
|
|
|
* These 2 values are the first item back link, and the last item forward link
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
qsort( bufferptr + 1, nbitems, sizeof(STORECMP*),
|
|
|
|
|
( int( * ) ( const void*, const void* ) )CmpCompare );
|
|
|
|
|
/* Update linked list */
|
|
|
|
|
for( ii = 1; ii <= nbitems; ii++ )
|
|
|
|
|
{
|
|
|
|
|
Item = bufferptr[ii];
|
|
|
|
|
Item->m_Num = ii;
|
|
|
|
|
Item->Pnext = bufferptr[ii + 1];
|
|
|
|
|
Item->Pback = bufferptr[ii - 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return bufferptr[1];
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/****************************************/
|
2007-12-17 20:18:04 +00:00
|
|
|
|
int CmpCompare( void* mod1, void* mod2 )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/****************************************/
|
2007-12-17 20:18:04 +00:00
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/*
|
2008-12-08 18:56:43 +00:00
|
|
|
|
* Compare function for qsort() : alphabetic sorting, with numbering order
|
2007-12-17 20:18:04 +00:00
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
{
|
2007-12-17 20:18:04 +00:00
|
|
|
|
int ii;
|
|
|
|
|
STORECMP* pt1, * pt2;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
2007-12-17 20:18:04 +00:00
|
|
|
|
pt1 = *( (STORECMP**) mod1 );
|
|
|
|
|
pt2 = *( (STORECMP**) mod2 );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2008-12-08 18:56:43 +00:00
|
|
|
|
ii = StrNumICmp( pt1->m_Reference.GetData(), pt2->m_Reference.GetData() );
|
2007-12-17 20:18:04 +00:00
|
|
|
|
return ii;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|