[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-wget] Big refactoring
From: |
illusionoflife |
Subject: |
[Bug-wget] Big refactoring |
Date: |
Tue, 07 Aug 2012 19:12:58 +0400 |
User-agent: |
KMail/4.8.4 (Linux/3.5.0-2-LIBRE; KDE/4.8.4; x86_64; ; ) |
Hello, Free Hackers!
I fed wget source to GNU complexity and It suggested me to look at
parse_netrc. So I came with some ideas -- they are not so fast to implement,
so I want to discuss them, to not waste work.
So, first of all, parse_netrc is huge. >200 lines. Well-commented, but still
huge. And have strange standalone application in source. So I have idea to
make some sort of api -- move routines of parsing netrc to `libwget'. I am not
very familiar with code, but I think it will be good for Wget because:
* Less code duplicate
* Need to upkeep external api force betted code structure
Also, I propose folloing idea -- move all utility functions to another
library, internal one. Why? Because, for example
while (*p && isspace(*p))
++p;
is less readable, then `p = string_skip_while(p,isspace)`.
Also, I have idea of using list.h and analog for single linked version. Why?
Just again, because of code duplicate.
Many algorithms, implemented in parse_netrc, should be moved to separated
function, like reverse_list. But this function is way more generic, then `void
(*)(acc_t *)`. Also, we can more actively use gl_list, but I find kernel
solution way more elegant.
I really want to contribute to Wget, but I am afraid that such radical changes
will not be accepted with
--
Best regards, illusionoflife
Contact me on address@hidden
Please, read rfc1855, if did not already.
signature.asc
Description: This is a digitally signed message part.
- [Bug-wget] Big refactoring,
illusionoflife <=