TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Pascal Schmidt
from: Bo Simonsen
date: 2003-10-17 12:58:32
subject: Memory matters

Hello Pascal!

Oct 17 00:43 03, Pascal Schmidt wrote to Bo Simonsen:

 JB>>> another is not to allocate them but instead have them as ordinary 
 JB>>> global variables
 BS>> ?

...

 PS> The decls are from a parser which only needs to handle one element at 
 PS> a time, they are then inserted into a linked list in the scene when 
 PS> the next element comes up - so I only need to have that one element_t 
 PS> pointer available in the parser code, not one for each element 
 PS> present.

Unfortionally I'm talking of a huge structure which look like this,

   ----- cfg.h begins -----
typedef struct link_
{
    char* name;
    fidoaddr* aka;
    char* password;
    char** group;
    int autocreate;
    int groupC;
    int notic;
    int flavour;
} slink;

typedef struct anngroup_
{
    char* mask;
    char* msgarea;
    char* msgareapath;
    char* header;
    char* footer;
    char* origin;
    char* from;
    char* to;
    char* subject;
    int msgareatype;
    fidoaddr* aka;    
} anngroup;

typedef struct ffindarea_
{
    char* msgarea;
    char* msgareapath;
    char* header;
    char* footer;
    char* origin;
    char* from;
    char* to;
    char* subject;
    int msgareatype;
    fidoaddr* aka;    
} ffindarea;


typedef struct area_
{
    char* name;
    char* path;
    char* group;
    fidoaddr* aka;
    fidoaddr** links;
    int linksC;
} area;

typedef struct filelist_
{
    char* name;
    char* filename;
    char* footer;
    char* header;
    char* mask;
} filelist;

typedef struct CFG_
{
    char* name;
    char* sysop;
    char* inbound;
    char* outbound;
    char* tmpoutb;
    char* badtic;
    char* netmaildir;
    int netmailtype;
    char* helpfile;
    char* filesidx;
    char* annque;
    char* logfile;
    char* statfile;
    char* magicfile;
    char* newareadir;
    char* dupelog;
    
    /* robotnames */
    char** robotnames;
    int robotC;
    
    /* akas */
    int akaC;
    fidoaddr** akas;
    
    /* links */
    slink** links;
    int linkC;
    
    /* areas */
    area** areas;
    int areaC;
    
    /* announces */
    anngroup** anngrps;
    int annC;
    
    filelist** flists;
    int flistC;
    
    ffindarea** ffindareas;
    int ffindC;
    
    int allowreplace;
    
} CFG;

extern CFG cfg;
   ----- cfg.h ends -----

I could limit some of chars hardcoding a value.. But anyway it would be
waste of memory..

Regards,
Bo

--- Msged/LNX 6.1.2 (Linux/2.4.18-586tsc (i586))
* Origin: The Night Express, Roennede Dk (2:236/100)
SEEN-BY: 633/267 270
@PATH: 236/100 237/9 20/11 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.