]> mj.ucw.cz Git - libucw.git/log
libucw.git
18 years agoconf2: added interface for accessing cf_items from outside
Robert Spalek [Sat, 22 Apr 2006 13:27:39 +0000 (15:27 +0200)]
conf2: added interface for accessing cf_items from outside

- find_item() changed to return a real pointer too
- added cf_find_item() and cf_write_item()
- enum operation moved to the header

18 years agoconf2: implemented a command-line parser and sections supporting unknown items
Robert Spalek [Sat, 22 Apr 2006 13:00:06 +0000 (15:00 +0200)]
conf2: implemented a command-line parser and sections supporting unknown items

18 years agoconf2: full implementation of the parser; only command-line parsing is missing
Robert Spalek [Sat, 22 Apr 2006 12:27:21 +0000 (14:27 +0200)]
conf2: full implementation of the parser; only command-line parsing is missing

plus:
- added macro TRY() polishing the code a bit
- cf_(re)load() and cf_set() return an int, not an error message
- names of operations stringified

18 years agoconf2: added a parser for IP addresses
Robert Spalek [Fri, 21 Apr 2006 18:06:41 +0000 (20:06 +0200)]
conf2: added a parser for IP addresses

plus added two error messages when trying to set an attribute without
giving any value

18 years agoconf2: bugfix in editing and adding before/after a node of a link list
Robert Spalek [Fri, 21 Apr 2006 17:44:13 +0000 (19:44 +0200)]
conf2: bugfix in editing and adding before/after a node of a link list

interpret_add_list() allocates memory himself, hence it is not suitable for
these operations.  since the real code is only 2 lines long, I moved the
functionality to closing_brace().  I changed its interface too, hence it
can be used much simpler and interpret_line() can be returned to its
original form.

18 years agoconf2: bugfix in tracing the recursion
Robert Spalek [Fri, 21 Apr 2006 16:28:16 +0000 (18:28 +0200)]
conf2: bugfix in tracing the recursion

18 years agoconf2: implemented all list operations in the interpreter
Robert Spalek [Fri, 21 Apr 2006 16:20:38 +0000 (18:20 +0200)]
conf2: implemented all list operations in the interpreter

- added operations OP_EDIT, OP_AFTER, OP_BEFORE, and flags OP_1ST, OP_2ND
  denoting the phase (forming a search query vs. filling in the data)
- add_to_list() extended to support all list operations
- definition of stack moved closer to the interpreter, because many
  functions don't need it
- implemented find_list_node(), opening_brace (former increase_stack), and
  closing_brace() that fully support all operations
- the top of interpret_line() rewritten too

18 years agoconf2: record used selectors when searching in lists
Robert Spalek [Fri, 21 Apr 2006 12:45:26 +0000 (14:45 +0200)]
conf2: record used selectors when searching in lists

- store number of entries to section flags
- find_item() fixed so that it correctly handles accesses to unknown
  top-level sections.  also setting an absolute attribute (i.e. not
  relative to the current section) starts with a caret now.
- added an u32 mask to the stack and record_selector() that fills it

18 years agoconf2: implement clearing a dynamic array
Robert Spalek [Fri, 21 Apr 2006 12:04:16 +0000 (14:04 +0200)]
conf2: implement clearing a dynamic array

18 years agoconf2: fix skipping unspecified parameters at the end of the line
Robert Spalek [Fri, 21 Apr 2006 11:49:37 +0000 (13:49 +0200)]
conf2: fix skipping unspecified parameters at the end of the line

Along the way, I precompute flags for each section at the initialization.
Some headers unified.

18 years agoconf2: resolve an issue concerning variable numbers of parameters
Robert Spalek [Fri, 21 Apr 2006 10:40:57 +0000 (12:40 +0200)]
conf2: resolve an issue concerning variable numbers of parameters

When a node of a link list is parsed on one line, then the inner section
is checked for dynamic attributes at the end.  If they are present, the
outer node is just parsed once and the flag allowing dynamic parsing is
passed inside.  If we did not allow this, then an error would have occured
anyway, and this behaviour is actually useful.

Along the way, I unified the headers and semantics of most interpreters and
cleaned up the code.

18 years agoconf2: enhanced the interpreter so that it can parse almost anything on 1 line
Robert Spalek [Fri, 21 Apr 2006 09:26:24 +0000 (11:26 +0200)]
conf2: enhanced the interpreter so that it can parse almost anything on 1 line

I cleaned up the subroutines so that they form a nice recursive structure
that allows to parse almost anything (static and dynamic arrays, lists,
parsed value, and sections in all combinations) on 1 line, while detecting
ambiguities.

18 years agosmall fixes
Robert Spalek [Thu, 20 Apr 2006 23:15:19 +0000 (01:15 +0200)]
small fixes

18 years agoadded CF_UNS, because (int*) and (uns*) are uncompatible pointers
Robert Spalek [Thu, 20 Apr 2006 23:14:25 +0000 (01:14 +0200)]
added CF_UNS, because (int*) and (uns*) are uncompatible pointers

18 years agoimplemented parser of a single line and top-level sections unified
Robert Spalek [Thu, 20 Apr 2006 22:56:54 +0000 (00:56 +0200)]
implemented parser of a single line and top-level sections unified

- we store registered sections in the same format as subsections so that we
  can search/process them in a uniform way
- implemented find_item() that can parse both absolute and relative paths
- all parsers of basic types simplified to take care of only 1 value;
  arrays are handled by the caller
- implemented a part of the interpretter: it gets parsed line (attribute
  name, desired operations, and parameters) and loads the values into
  memory.  since declarations can be nested and they can span over multiple
  lines, the interpretter operates on a stack

18 years agothe init-hook of the main section inserts a few nodes into the link-list
Robert Spalek [Thu, 20 Apr 2006 17:31:55 +0000 (19:31 +0200)]
the init-hook of the main section inserts a few nodes into the link-list

18 years agoadded declaration and initialization of sections
Robert Spalek [Thu, 20 Apr 2006 17:31:05 +0000 (19:31 +0200)]
added declaration and initialization of sections

18 years agocf_pool exported, journal not mandatory, and simplified swapping data
Robert Spalek [Thu, 20 Apr 2006 16:24:08 +0000 (18:24 +0200)]
cf_pool exported, journal not mandatory, and simplified swapping data

18 years agoseparated size of bucket ID (4 vs 5) and size of pointer (4 vs 8)
Robert Spalek [Thu, 20 Apr 2006 16:11:03 +0000 (18:11 +0200)]
separated size of bucket ID (4 vs 5) and size of pointer (4 vs 8)

the first one belongs to sherlock.h and depends on the configuration and
the second one belongs to lib/config.h and depends on the architecture

18 years agoimplemented journal and safe (re)loading of cf/files and setting variables
Robert Spalek [Thu, 20 Apr 2006 13:32:53 +0000 (15:32 +0200)]
implemented journal and safe (re)loading of cf/files and setting variables

18 years agoparsers of basic types exported and got rid of the journaling switch
Robert Spalek [Thu, 20 Apr 2006 12:01:42 +0000 (14:01 +0200)]
parsers of basic types exported and got rid of the journaling switch

18 years agomacros don't end by a comma, and CF_ITEMS/CF_END reintroduced
Robert Spalek [Thu, 20 Apr 2006 11:52:46 +0000 (13:52 +0200)]
macros don't end by a comma, and CF_ITEMS/CF_END reintroduced

the reason is auto-indentation.  in this setting, editors don't get
confused and indent everything well

18 years agosubstantially changed the interface again
Robert Spalek [Thu, 20 Apr 2006 10:50:44 +0000 (12:50 +0200)]
substantially changed the interface again

I realised that in the last interface I couldn't distinguish between static
and dynamic arrays of length exactly 1.  thinking about how to resolve the
problem led me to a different solution that is as easy to use as before,
but easier to implement, easier to extend by new basic types, and as a
bonus I get a natural interface for static arrays.

I then immediately scratched a duplicate code for parsing dynamic arrays,
because it can be easily unified now.  also, CF_ITEMS does not expect a
parameter now, because they the compiler messes up line numbers when an
error occurs.

18 years agoimplemented a few functions of the new configuration mechanism:
Robert Spalek [Wed, 19 Apr 2006 10:02:37 +0000 (12:02 +0200)]
implemented a few functions of the new configuration mechanism:
- memory allocation
- skeleton of future journal functions
- parsers of all basic types and arrays of these types

18 years ago- added prototypes of memory allocation and journal functions
Robert Spalek [Wed, 19 Apr 2006 10:00:02 +0000 (12:00 +0200)]
- added prototypes of memory allocation and journal functions
- rearranged some declarations
- added proper copyright

18 years agosignificant simplifications of the interface
Robert Spalek [Tue, 18 Apr 2006 12:37:31 +0000 (14:37 +0200)]
significant simplifications of the interface

- instead of letting the user to set cf_section.{size,init,commit}
  directly, macros CF_{TYPE,INIT,COMMIT} should be used
- another macro CF_ITEMS creates a CT_END-delimited list of cf_items
- all these macros automatically add commas so that declaring a list of
  cf_items behaves similarly to other preprocessor-made lists
- removed parameter name from parser hooks, because either the parser
  doesn't care and only uses *ptr, or it does and then it should be set up
  to pass the name in ptr
- no need to define hooks using _void_ *ptr; one can use any pointers
  according to his taste and the hook-function is automatically retyped
- renamed (to make it shorter) some enumerations and macros
- CHECK_VAR_TYPE and CF_FIELD renamed to CHECK_PTR_TYPE and PTR_TO, and
  moved to lib/lib.h

18 years agoadded macros CHECK_PTR_TYPE and PTR_TO
Robert Spalek [Tue, 18 Apr 2006 12:26:59 +0000 (14:26 +0200)]
added macros CHECK_PTR_TYPE and PTR_TO

18 years agointerface simplified and a few bugs removed
Robert Spalek [Tue, 18 Apr 2006 09:57:57 +0000 (11:57 +0200)]
interface simplified and a few bugs removed

- array macros renamed and extended
- CF_FUNCTION renamed to CF_PARSER, and a number of parameters and a
  pointer to the target variable are passed into the parser function
- init-, commit-, and parser-hooks only get parameters that they need and
  they get it in a nice way so that they don't have to work much
- fixed CHECK_VAR_TYPE and a few other thingies

18 years agodesigned the interface of the new configuration reader. no code has been
Robert Spalek [Mon, 17 Apr 2006 18:15:39 +0000 (20:15 +0200)]
designed the interface of the new configuration reader.  no code has been
written yet, because I better wait for an opinion first.  a tester app that
currently just checks compilability of all messy cf-declaration macros is
included.  don't worry about filenames; they will be eventually renamed.

18 years agoRewritten KMP... incomplete comments and some useful hooks for statistics
Pavel Charvat [Sun, 16 Apr 2006 11:40:08 +0000 (13:40 +0200)]
Rewritten KMP... incomplete comments and some useful hooks for statistics

18 years agoMerge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git
Martin Mares [Wed, 12 Apr 2006 10:51:18 +0000 (12:51 +0200)]
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git

Synchronized the dev-analyser branch with current state of the mainline.

18 years agoCleaned up CONFIG_CENTRUM_xxx switches:
Martin Mares [Wed, 12 Apr 2006 10:44:51 +0000 (12:44 +0200)]
Cleaned up CONFIG_CENTRUM_xxx switches:

  o  Everything related to the catalog is controlled by
     CONFIG_CENTRUM_CATALOG.
  o  Paid weights are implied by the catalog and the PL customization,
     which doesn't use them, just defines empty {get,set}_paid_weight().
  o  Nothing depends on CONFIG_CENTRUM_{CZ,SK,PL} now, but I am keeping
     them, because it's likely that it will be needed for some exceptions
     or experiments again soon.

All customizations compile except for centrum/* with shared libraries,
but the dependencies for that are already fixed in the dev-analyser branch.

18 years agoImproved description of CONFIG_ALLOW_ANY.
Martin Mares [Wed, 12 Apr 2006 09:47:29 +0000 (11:47 +0200)]
Improved description of CONFIG_ALLOW_ANY.

18 years agoTest at least one configuration with CONFIG_ALLOW_ANY.
Martin Mares [Wed, 12 Apr 2006 09:45:45 +0000 (11:45 +0200)]
Test at least one configuration with CONFIG_ALLOW_ANY.

18 years agoNew switch description
Pavel Charvat [Wed, 12 Apr 2006 09:12:15 +0000 (11:12 +0200)]
New switch description

18 years agoMerge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git#v3.8
Martin Mares [Tue, 11 Apr 2006 08:57:37 +0000 (10:57 +0200)]
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git#v3.8

The image weighting backports in v3.8 have created some conflicts due to
formatting changes, so I have kept the mainline versions everywhere.
Weights were inherited from v3.8 except for IP and CK[WP]A.

18 years agoIP parsing code moved to lib/conf.c, closes Bug #2375.
Pavel Charvat [Mon, 10 Apr 2006 10:53:31 +0000 (12:53 +0200)]
IP parsing code moved to lib/conf.c, closes Bug #2375.

18 years agoAdded a guard against double inclusion (out-of-order merge from v3.8).
Martin Mares [Thu, 6 Apr 2006 21:33:19 +0000 (23:33 +0200)]
Added a guard against double inclusion (out-of-order merge from v3.8).

18 years agoRemoving the images directory which has leaked from the dev-img branch.
Martin Mares [Thu, 6 Apr 2006 17:57:53 +0000 (19:57 +0200)]
Removing the images directory which has leaked from the dev-img branch.

18 years agoAdded a work-around for make's desires.
Martin Mares [Thu, 6 Apr 2006 16:02:28 +0000 (18:02 +0200)]
Added a work-around for make's desires.

18 years agoInitial testing version of image signatures... very simple yet :-)
Pavel Charvat [Thu, 6 Apr 2006 09:42:07 +0000 (11:42 +0200)]
Initial testing version of image signatures... very simple yet :-)

18 years agoNew version of SubStrings analyser...
Pavel Charvat [Wed, 5 Apr 2006 08:49:33 +0000 (10:49 +0200)]
New version of SubStrings analyser...
- KMP uses continuous read of fastbuf streams
- the tag is OR combination of groups masks

18 years agoNew version of substring search analyser (bug 2315).
Pavel Charvat [Tue, 4 Apr 2006 12:02:17 +0000 (14:02 +0200)]
New version of substring search analyser (bug 2315).

18 years agoForgotten comment
Pavel Charvat [Tue, 4 Apr 2006 10:53:19 +0000 (12:53 +0200)]
Forgotten comment

18 years agokmp_enter_raw_string uses zero-terminated array of kmp_char_t characters
Pavel Charvat [Tue, 4 Apr 2006 10:48:59 +0000 (12:48 +0200)]
kmp_enter_raw_string uses zero-terminated array of kmp_char_t characters
instead of bytes

18 years agoUTF-8 bug hunted in substring search
Pavel Charvat [Tue, 4 Apr 2006 09:45:22 +0000 (11:45 +0200)]
UTF-8 bug hunted in substring search

18 years agoadded #ifndef for header file
Vladimir Jelen [Thu, 30 Mar 2006 10:20:08 +0000 (12:20 +0200)]
added #ifndef for header file

18 years agoGIT uses mutt's default value of allow_8bit when sending a mail
Pavel Charvat [Sat, 25 Mar 2006 22:02:50 +0000 (23:02 +0100)]
GIT uses mutt's default value of allow_8bit when sending a mail
and prefers ascii/iso-8859-2 charsets if possible.

18 years agoGIT commit mails are now in UTF-8
Pavel Charvat [Fri, 24 Mar 2006 15:55:27 +0000 (16:55 +0100)]
GIT commit mails are now in UTF-8

18 years agoRenamed fb-gbuf to fb-grow as Robert suggested.
Martin Mares [Tue, 21 Mar 2006 09:24:36 +0000 (10:24 +0100)]
Renamed fb-gbuf to fb-grow as Robert suggested.

18 years agoExclude the TAGS file as well.
Martin Mares [Mon, 20 Mar 2006 12:34:05 +0000 (13:34 +0100)]
Exclude the TAGS file as well.

18 years agoNaming of the growing fastbuf was completely silly. This is hopefully better.
Martin Mares [Fri, 17 Mar 2006 22:30:35 +0000 (23:30 +0100)]
Naming of the growing fastbuf was completely silly. This is hopefully better.

That's all for today (once more) :)

18 years agoSupport seeks on fbbuf streams.
Martin Mares [Fri, 17 Mar 2006 21:27:40 +0000 (22:27 +0100)]
Support seeks on fbbuf streams.

18 years agoAdded a recyclable fastbuf over a growing buffer.
Martin Mares [Fri, 17 Mar 2006 21:02:05 +0000 (22:02 +0100)]
Added a recyclable fastbuf over a growing buffer.
(Ideal for use in the indexer.)

18 years agoMerge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git#v3.8
Martin Mares [Fri, 10 Mar 2006 16:55:20 +0000 (17:55 +0100)]
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git#v3.8

18 years agoMux no longer crashes, removing the trap.
Martin Mares [Fri, 10 Mar 2006 11:24:29 +0000 (12:24 +0100)]
Mux no longer crashes, removing the trap.

18 years ago{stk,mp}_conv --> {stk,mp}_strconv
Pavel Charvat [Wed, 8 Mar 2006 21:25:04 +0000 (22:25 +0100)]
{stk,mp}_conv --> {stk,mp}_strconv

18 years agoSlightly faster mp-charconv... minor change
Pavel Charvat [Wed, 8 Mar 2006 20:46:05 +0000 (21:46 +0100)]
Slightly faster mp-charconv... minor change

18 years agoWell, a simple variant of stk_conv.
Pavel Charvat [Mon, 6 Mar 2006 12:06:20 +0000 (13:06 +0100)]
Well, a simple variant of stk_conv.
I leave the complex one for experiments... ;)

18 years agoCharset conversion with allocation on the stack do not
Pavel Charvat [Sun, 5 Mar 2006 22:26:54 +0000 (23:26 +0100)]
Charset conversion with allocation on the stack do not
depend on string_table's lengths now.

18 years agoFix: .h indentation and ifdef names; some comments; stk-conv enlarges
Pavel Charvat [Sat, 4 Mar 2006 19:45:08 +0000 (20:45 +0100)]
Fix: .h indentation and ifdef names; some comments; stk-conv enlarges
string 3 times; warning in string_table generator.

18 years agoConversion between charsets with allocation on the stack
Pavel Charvat [Sat, 4 Mar 2006 18:10:05 +0000 (19:10 +0100)]
Conversion between charsets with allocation on the stack
or a given memory pool. I will propably add some optimalizations...

18 years agogcc-4.1 should so far use the the same switches as 4.0.
Martin Mares [Thu, 2 Mar 2006 17:11:52 +0000 (18:11 +0100)]
gcc-4.1 should so far use the the same switches as 4.0.

18 years agoMerged with v3.8
Martin Mares [Thu, 2 Mar 2006 12:20:25 +0000 (13:20 +0100)]
Merged with v3.8

18 years agoget rid of return's after ASSERT's. that only caused warnings with (buggy)
Robert Spalek [Thu, 2 Mar 2006 04:14:10 +0000 (14:14 +1000)]
get rid of return's after ASSERT's.  that only caused warnings with (buggy)
gcc4

18 years agoget rid of return's after ASSERT's. that only caused warnings with (buggy)
Robert Spalek [Thu, 2 Mar 2006 04:11:44 +0000 (14:11 +1000)]
get rid of return's after ASSERT's.  that only caused warnings with (buggy)
gcc4

18 years agoMerged with v3.8
Martin Mares [Tue, 28 Feb 2006 21:49:15 +0000 (22:49 +0100)]
Merged with v3.8

18 years agoReverted most of the Robert's confused commit (the rest should be
Martin Mares [Mon, 27 Feb 2006 15:27:57 +0000 (16:27 +0100)]
Reverted most of the Robert's confused commit (the rest should be
harmless).

18 years agoMerge with 3.8 (my small changes due to trying to release the free version)
Robert Spalek [Mon, 27 Feb 2006 04:57:56 +0000 (14:57 +1000)]
Merge with 3.8 (my small changes due to trying to release the free version)

I wanted to push my local 3.8 repository to the remote v3.8 one, but it
failed.  trying to push it at least to the mainline...

18 years agoavoid compiler warnings with debugging turned off
Robert Spalek [Mon, 27 Feb 2006 04:50:05 +0000 (14:50 +1000)]
avoid compiler warnings with debugging turned off

18 years agoCONFIG_INCREMENTAL doesn't belong to the free version
Robert Spalek [Mon, 27 Feb 2006 04:41:20 +0000 (14:41 +1000)]
CONFIG_INCREMENTAL doesn't belong to the free version

18 years agoDebugging traps should dwell only in v3.8, so reverting them after
Martin Mares [Fri, 24 Feb 2006 14:18:48 +0000 (15:18 +0100)]
Debugging traps should dwell only in v3.8, so reverting them after
the automatic merge brought them into mainline.

18 years agoMerge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git#v3.8
Martin Mares [Fri, 24 Feb 2006 14:16:12 +0000 (15:16 +0100)]
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git#v3.8

18 years agoOne more file to exclude.
Martin Mares [Fri, 24 Feb 2006 13:31:06 +0000 (14:31 +0100)]
One more file to exclude.

18 years ago.cvsignore is no longer needed.
Martin Mares [Fri, 24 Feb 2006 13:27:23 +0000 (14:27 +0100)]
.cvsignore is no longer needed.

18 years agoAdded the update hook script to the repository.
Martin Mares [Fri, 24 Feb 2006 13:26:31 +0000 (14:26 +0100)]
Added the update hook script to the repository.

18 years agoAdded an exclude file, symlink it to .git/info/exclude if you wish.
Martin Mares [Fri, 24 Feb 2006 13:25:21 +0000 (14:25 +0100)]
Added an exclude file, symlink it to .git/info/exclude if you wish.

18 years agoTemporarily disabled signal trapping, backtraces over signal handlers
Martin Mares [Wed, 22 Feb 2006 20:35:09 +0000 (20:35 +0000)]
Temporarily disabled signal trapping, backtraces over signal handlers
don't seem to work well in the version of gdb present in Woody.

18 years agoMerged from rel-3-8:
Martin Mares [Wed, 22 Feb 2006 20:29:21 +0000 (20:29 +0000)]
Merged from rel-3-8:

Don't reset the pid field on process_del(), it's not tested anywhere anyway.

Hmm, there was one reference to mp->pid, but the ASSERT didn't make
much sense anyway, so I am removing it.

18 years agoHmm, there was one reference to mp->pid, but the ASSERT didn't make
Martin Mares [Wed, 22 Feb 2006 20:26:34 +0000 (20:26 +0000)]
Hmm, there was one reference to mp->pid, but the ASSERT didn't make
much sense anyway, so I am removing it.

18 years agoDon't reset the pid field on process_del(), it's not tested anywhere anyway.
Martin Mares [Wed, 22 Feb 2006 20:21:40 +0000 (20:21 +0000)]
Don't reset the pid field on process_del(), it's not tested anywhere anyway.

18 years agoMainline heads for v3.9.
Martin Mares [Sun, 12 Feb 2006 20:40:59 +0000 (20:40 +0000)]
Mainline heads for v3.9.

18 years agoCentrum roles have changed.
Martin Mares [Sun, 12 Feb 2006 20:03:57 +0000 (20:03 +0000)]
Centrum roles have changed.

18 years agoCentrum roles have changed.
Martin Mares [Sun, 12 Feb 2006 20:03:42 +0000 (20:03 +0000)]
Centrum roles have changed.

18 years agoThe Polish customization no longer has a default role.
Martin Mares [Sun, 29 Jan 2006 23:33:22 +0000 (23:33 +0000)]
The Polish customization no longer has a default role.

18 years agoMade gcc-3.4 the default compiler for customization checking.
Martin Mares [Sun, 29 Jan 2006 23:06:20 +0000 (23:06 +0000)]
Made gcc-3.4 the default compiler for customization checking.

18 years agoAdded getproctitle().
Martin Mares [Sun, 29 Jan 2006 20:31:50 +0000 (20:31 +0000)]
Added getproctitle().

18 years agoReplaced the long-lived "close(0) if logging to file" hack by closing
Martin Mares [Sat, 28 Jan 2006 21:08:13 +0000 (21:08 +0000)]
Replaced the long-lived "close(0) if logging to file" hack by closing
stdin in the daemon-helper.

18 years agoAdded bit_array_assign(), replaced BIT_ARRAY_ALLOC by functions.
Martin Mares [Fri, 27 Jan 2006 18:21:30 +0000 (18:21 +0000)]
Added bit_array_assign(), replaced BIT_ARRAY_ALLOC by functions.

18 years agomain_init() really re-initializes everything. Previously, it could
Martin Mares [Fri, 20 Jan 2006 19:49:02 +0000 (19:49 +0000)]
main_init() really re-initializes everything. Previously, it could
result in malformed poll tables being built.

Also improved the debugging messages a lot.

18 years agoIt seems that signal safety of time-related functions is even more subtle
Martin Mares [Fri, 20 Jan 2006 19:47:21 +0000 (19:47 +0000)]
It seems that signal safety of time-related functions is even more subtle
than I thought -- strftime() and localtime_r() can deadlock each other,
probably due to access to time zone information. Replaced strftime() by
a mere sprintf.

18 years agoAdded a possibility of logging with microsecond timestamps.
Martin Mares [Fri, 20 Jan 2006 18:34:28 +0000 (18:34 +0000)]
Added a possibility of logging with microsecond timestamps.

18 years agoCleaned up includes.
Martin Mares [Mon, 16 Jan 2006 20:03:01 +0000 (20:03 +0000)]
Cleaned up includes.

18 years agoxfree() macro has been turned into a regular function. This is much cleaner,
Martin Mares [Mon, 16 Jan 2006 20:02:42 +0000 (20:02 +0000)]
xfree() macro has been turned into a regular function. This is much cleaner,
allows for easy memory allocation tracking and also avoids including
<stdlib.h> at random places.

18 years agoCheck partmap-is-mmap configuration as well.
Martin Mares [Mon, 16 Jan 2006 19:42:11 +0000 (19:42 +0000)]
Check partmap-is-mmap configuration as well.

18 years agoOn 64-bit architectures, partmap is just an mmap.
Martin Mares [Mon, 16 Jan 2006 19:41:56 +0000 (19:41 +0000)]
On 64-bit architectures, partmap is just an mmap.
On all architectures, it calls madvise() to optimize for sequential access.

18 years agoInstead of adding HEAP_INCREASE_POS as Tom requested, I've modified
Martin Mares [Mon, 16 Jan 2006 14:00:03 +0000 (14:00 +0000)]
Instead of adding HEAP_INCREASE_POS as Tom requested, I've modified
HEAP_INCREASE. I think this is a better solution, because increasing
the value of the root element is too special and knowing that doesn't
enable us to do any special optimizations anyway.

18 years agoFixed stk_strndup(): it works on non-terminated input strings now
Martin Mares [Mon, 16 Jan 2006 13:32:54 +0000 (13:32 +0000)]
Fixed stk_strndup(): it works on non-terminated input strings now
and without an off-by-one bug :)

18 years agolog() is now signal-safe.
Martin Mares [Wed, 14 Dec 2005 10:45:42 +0000 (10:45 +0000)]
log() is now signal-safe.

18 years agoAdded a (so far trivial) library of functions for shell scripts.
Martin Mares [Wed, 7 Dec 2005 22:27:54 +0000 (22:27 +0000)]
Added a (so far trivial) library of functions for shell scripts.