X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=TguhU2WNYGM0s8pmquDMid8wBWLvbTJ5f8apZkRgCtQ=; b=Y9mIcxLKRXPQ6POgYxiVMmPFNHu59ycAHzF0p0REIl4irafKVrZc2SOui5CYTU8sey QRSV0MybqzM+dv6YGlkXuPZHWbNhbQtiSBiRcr9wdpnZgsDhrZ0Q6UpYeRKmz5YvG94C BO8rvo8KBzF3VdEMZwyOIwGW6y+ZjjCmAD089LYzIf8+QtGxjYXuzXFQwit6D/jtZYwE LQWSTwnG+pavNrhDaAN9UJeKIug7bzaJHewni5qm6XG/osRDIW9zEgnBiXSdiPgZ6SoY P0gaKdqAWGCRkfgnVaaXznXAMdjNvcD9TNKyJEWheImrl7KD+8liO0RhawO06IndBD+u Yvvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=TguhU2WNYGM0s8pmquDMid8wBWLvbTJ5f8apZkRgCtQ=; b=T6wriD1VmGUE6ceTbigRcbMVbPC6PtyIIAwmGpJReh++ElEIW5HbC5XcHi29ByzyW0 hsOW6o4pJoW3dpiUIndOmPSEoHlTtCVRLkioWyMVmkWWKgC+T7sdEAmAbmDBl7vW+wUj yzXyLU565xfkj7+1Rib/Sg8VKQyK/yU5wiJBOwUmaR1eDDUThfMcVZF0l20TbYLXm7eB O6CmQTCko/Nccmff8F7lEtDcg8GrH5GAXOu2sfjnKJhpViBU3d6uS7mvDbHc4pkVDRLx ru95YmfQwfJLKL0a10w9mvdI5pnhGO0jaRcJ/pV3kVKNdXZyWZW0zOOoc2X+Y9lcmR7O 5vSQ== X-Gm-Message-State: AG10YOQJNuL7B8u5pGUEUHxuM6TheKS2zHhhpGUjZgGMKzti1jHkK7OrGrWTmZBue92y/g== X-Received: by 10.28.134.147 with SMTP id i141mr10485715wmd.87.1453071596907; Sun, 17 Jan 2016 14:59:56 -0800 (PST) Date: Sun, 17 Jan 2016 23:59:51 +0100 From: "Nicklas Karlsson (nicklas DOT karlsson17 AT gmail DOT com) [via geda-user AT delorie DOT com]" To: geda-user AT delorie DOT com Subject: Re: [geda-user] PCB netlist storage ? Message-Id: <20160117235951.cd644f53495ce746bcba28a4@gmail.com> In-Reply-To: <569C0C4F.2030908@iee.org> References: <20160117223434 DOT 3a82b1b69b8a9614cc490965 AT gmail DOT com> <569C0C4F DOT 2030908 AT iee DOT org> X-Mailer: Sylpheed 3.5.0beta1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > On 17/01/16 21:34, Nicklas Karlsson (nicklas DOT karlsson17 AT gmail DOT com) [via > geda-user AT delorie DOT com] wrote: > > Netnames are stored in PCB->NetlistLib.Menu[i].Name as text. > > Refdes pin number is stored in PCB->NetlistLib.Menu[i].Entry[j].ListEntry as text. > > > > Different programming styles, coding standards, position of braces, ... do not disturb me. Variable reuse and type reuse however I consider bad. I usually try to keep variables as local as possible and sometimes even add braces with an extra block just to get a local variable within this block. > > > > Do anyone more than me think it would be a good idea to give netlists an own type hierarchy? > > > > Nicklas Karlsson > Idiot question here .. but what on earth is the significance of "Menu[i]" ?! > > Nicklas, possibly some better type-d structures, but not knowing the > internal code .. couldn't say possibly how!! Menu[i] is number "i" netlist stored, the following row print the netlist name and refdes-pin: printf(" in [%s] (%s)\n", PCB->NetlistLib.Menu[i].Name, PCB->NetlistLib.Menu[i].Entry[j].ListEntry); Name of fields make me confused. This is varariable there netlists are stored: LibraryType NetlistLib; Variable "MenuN" is number of stored netlists, variable "Menu" is the array of netlists: typedef struct { Cardinal MenuN; /*!< Number of objects. */ Cardinal MenuMax; /*!< Number of reserved memory locations. */ LibraryMenuType *Menu; /*!< The entries. */ } LibraryType; Variable "Name" is the name of the netlist, variable "Entry" is the refdes-pin values for this netlist: typedef struct { char *Name; /*!< Name of the menu entry. */ char *directory; /*!< Directory name library elements are from. */ char *Style; /*!< Routing style. */ Cardinal EntryN; /*!< Number of objects. */ Cardinal EntryMax; /*!< Number of reserved memory locations. */ LibraryEntryType *Entry; /*!< The entries. */ char flag; /*!< Used by the netlist window to enable/disable nets. */ char internal; /*!< If set, this is an internal-only entry, not * part of the global netlist. */ } LibraryMenuType; Name of this fields for the refdes-pin values make me confused: typedef struct { char *ListEntry; /*!< The string for the selection box. */ char *AllocatedMemory; /*!< Pointer to allocated memory; all others point to parts of the string. */ char *Template; /*!< m4 template name. */ char *Package; /*!< Package. */ char *Value; /*!< The value field. */ char *Description; /*!< Some descriptional text. */ } LibraryEntryType; It works so I do not suggest any changes but it make me confused. Nicklas Karlsson