summaryrefslogtreecommitdiff
path: root/rpmio
AgeCommit message (Collapse)AuthorFilesLines
2010-10-05Tolerate NULL args in argvSplitString()Panu Matilainen1-1/+5
2010-09-27Handle non-terminated substrings centrally in expandMacro()Panu Matilainen1-41/+22
- expandMacro() is big and ugly already, but handling the non-terminated substrings there once and for all avoids having to ping-pong recurse through couple of helpers to get there.
2010-09-27Dynamic expansion buffer reallocation for lua macros tooPanu Matilainen1-6/+12
2010-09-27Whoops, fix typo/thinko from commit dc258bac41e32e754b15a413d844160f34b6a12ePanu Matilainen1-1/+1
2010-09-27Eliminate the internal in-place-expansion buffer limitationPanu Matilainen1-30/+32
- Return the dynamically allocated expansion buffer to callers from expandU(), except using a slightly less cryptic expandThis() name for it now. Also deal with non-terminated strings centrally in expandThis() instead of doing alloc + copy to terminate in every caller.
2010-09-27Simplify / sanitize expandU() a bitPanu Matilainen1-12/+7
- Instead of saving and restoring the bits we'll mess with, just make a temporary expansion state struct with non-buffer state copied from "parent".
2010-09-27Dynamically reallocate macro expansion buffer (ticket #45)Panu Matilainen1-14/+15
- Eliminate the underlying limitation of macro expansion limit by growing the buffer as needed when adding characters to it. This doesn't fix the entire issue yet however: expandU() and expandMacros() are still limited to caller-specified buffer size, and output from lua-macros isn't dynamically resized. One step at a time...
2010-09-27Let expandMacro() allocate its own bufferPanu Matilainen1-16/+17
- More pre-requisites for dynamic buffer resizing, callers have no clue how much expandMacro() is going to need.
2010-09-27Track current expansion point via distance to buffer startPanu Matilainen1-21/+23
- Supposedly no functional changes, just paving way for dynamic buffer resizing which is impossible when accessing pointers directly.
2010-09-27Push the macro buffer size limit down by one levelPanu Matilainen1-24/+24
- Turn expandMacros() into a wrapper around internal doExpandMacros() which returns the expanded string in a newly allocated buffer, use the internal version for rpmExpand() too.
2010-09-27Eliminate unused spec field from macro expansion state structPanu Matilainen1-3/+0
2010-09-27Avoid calloc() in macro findEntry()Panu Matilainen1-5/+4
- It's just the macro name we're grabbing here, that ought to fit on stack comfortably enough.
2010-09-27Avoid unnecessary round-trip through expandT() where possiblePanu Matilainen1-3/+3
- In the cases where expandT() was called with strlen(source) we can now just bypass it and call expandMacro() directly, avoiding an unnecessary string copy.
2010-09-27Use function arguments to pass, duh, arguments into functions. Duh.Panu Matilainen1-20/+9
- No functional changes, just eliminating mindless save-and-restore ping-pong through macro expansion state struct.
2010-09-22Remove double const in urlstring structPanu Matilainen1-1/+1
2010-09-22Make rpmsqAction compatible to sa_sigactionPanu Matilainen2-5/+4
2010-09-21Add "c++ protection" to (hopefully) all of our internal headersPanu Matilainen3-0/+24
2010-09-21Add "C++ protection" to the public rpmutil.h header, oops...Panu Matilainen1-0/+8
2010-09-21Return typed pointers from rpmluaFree() and rpmluavFree()Panu Matilainen2-4/+4
2010-09-21Adjust pgpMpiSet() dest type to match actual usePanu Matilainen1-2/+2
2010-09-21Error string is const char *, not void pointerPanu Matilainen2-3/+3
2010-09-21Adjust internal io read, write and digest update to take buf as void pointerPanu Matilainen1-22/+22
- This matches ffread() and read() much better, avoiding pile of casts. - By some stroke of genious, glibc cookie interfaces disagree with the other file stream protos by using char * for buf. Argh. Add explicit cast for the schizophrenia.
2010-09-21Avoid using void pointer when we have a real type for the memfail functionPanu Matilainen2-3/+3
2010-09-21Change fdstat functions to take fdOpx enum to fix int/enum mismatchesPanu Matilainen1-2/+2
2010-09-21Fix up silly int/enum and type vs variable name mixups in urlPath()Panu Matilainen1-4/+4
2010-09-21Stop abusing enum typedefs for bitfield typesPanu Matilainen2-4/+9
- Enums are fine for defining the bitfield flags, but the bitfield itself is not an enumeration. Add a separate typedef on "rpmFlags" type (presenting a bitfield of flags) for all of these. Compilers hardly care, but the typedefs give a nice visual clue for us humans using these flags far away from ho^H^H definitions.
2010-09-13Eliminate all fooUnlink() functions out of the APIPanu Matilainen2-16/+5
- These are internal helpers only, all refcount users need to use fooFree() or similar for correct operation. Add fwd declarations where necessary to avoid moving code around unnecessarily. - We could add these back later as aliases to fooFree() but for now, just get them out of the way.
2010-09-08Fix _USE_LIBIO testPanu Matilainen1-4/+4
- Commit 05b2d979e8097d648f91c773f2535a1f6013cb79 caused the _USE_LIBIO test in rpmio.c to always fail as <stdio.h> wasn't included yet at the time of the check, causing silent fallback to not using libio even if actually available. Which in turn revealed funky other little bugs, addressed in commits d960e8c18764f7206ad723963f407e960dfb8ad9 and be3c34dd15814d70a410b6fd646a2be7de14a1b5. Ptooey.
2010-07-13Redirect macro stack backtrace printing to debug log.Jindrich Novy1-4/+4
2010-07-13Fix cryptic macro evaluation error message (RhBug:613010)Jindrich Novy1-2/+1
2010-06-29Tell rpm about SHA-224 existence (RhBug:608599)Jiri Kastner2-0/+2
- Fixes "Unknown hash algorithm" message but this is cosmetic only as NSS doesn't currently support SHA-224.
2010-06-03Fix "empty reply from server" curl-syndrome with url retrieval (RhBug:598988)Panu Matilainen1-1/+1
- We were adding a trailing newline to urlhelper command line passed to execvp(), with the newline ending up in the URL passed to curl. Many servers dont seem to mind the extra newline, but some do. Oh well...
2010-06-01Permit DOS line-endings in PGP armors (RhBug:532992)Panu Matilainen1-4/+7
- RFC-4880 doesn't requires unix-style line-endings, we shouldn't either. This is probably still oversly strict as RFC-4880 appears to permit any whitespace to follow armor headers but ... shrug.
2010-05-19Add public pgpValString() function + enum for the various typesPanu Matilainen2-8/+46
- The equivalent used to be possible in 4.4.x era as the value tables were all exported, but this way we need to export far less and the implementation details stay internal.
2010-05-19Bury struct pgpValTbl_s definition inside rpmpgp.cPanu Matilainen2-7/+5
- as all the value tables are static inside rpmpgp.c, exposing this is pointless (should've been unexported long time ago)
2010-03-29Lose long since unused fdReadable() and fdWritable()Panu Matilainen2-106/+0
- these have been unused since rpm 4.6.0, and can be implemented without access to rpmio internals too if somebody cares...
2010-03-29Lose long since unused url control structure and related functionsPanu Matilainen2-198/+0
- these have been unused since rpm 4.6.0, and rpm is not in the url business, rip.
2010-03-22Further rpmio NULL sanity checksPanu Matilainen1-20/+22
- instead of blowing up with asserts, return error codes / NULLs
2010-03-22Lose FDSANE() macro, check in c2f() and callers insteadPanu Matilainen1-8/+3
2010-03-22Change most of the FDSANE() asserts into good old NULL-checksPanu Matilainen1-28/+22
- blowing up with an assert failure deep inside io "library" is not a very friendly thing to do...
2010-03-22Lose the useless rpmio refcounting debug junkPanu Matilainen2-43/+34
- the rpmio API always had this goo, should've gotten rid of it back in commit dbdbe8010cd944f026a5a4e5d071eb31d29d81c4 but .. oh well
2010-03-19Bury FTS inside librpmbuild and eliminate from public ABIPanu Matilainen3-1358/+2
2010-03-15Add an enhanced argvSplitString() function for splitting strings to argv'sPanu Matilainen2-3/+25
- Returns the newly created argv instead of useless "this always returns 0" - By default make a "real" split, including empty strings - Flags argument allows controlling behavior, for now only flag is to preserve argvSplit() behavior but leaves room for future enhancements such as quoted splitting etc
2010-02-10Split elf dependency extraction out of librpmbuild to external helperPanu Matilainen1-1/+0
- Elf dependency extraction code code lifted from rpmfcELF() and refactored to saner pieces. Having it in separate executable also frees librpmbuild of libelf dependency, clean up the unnecessary linkage etc from autofoo - This lets internal dependency generator for elf files be overridden without losing file coloring (which is required for correct multilib handling). It also permits non-native elf files (eg when cross-building) to be handled by providing a custom elf dependency helper - On the flip side, this inevitably slows down builds somewhat as two fork-exec's are needed for every elf file, but unlike invoking something like the python interpreter, this is a slim helper... - All dependency extractors of the internal dependency generator are now external helpers (how twisted is that, huh? :) and thus can be customized and filtered through %__foo_provides|requires macros
2010-02-03Kill RPMTAG_FSNAMES and RPMTAG_FSSIZES and everything implementing themFlorian Festi1-4/+0
2010-01-07Revert "Always free locally defined macros when they go out of scope"Panu Matilainen1-2/+3
- the "fix" breaks seemingly legitimate use in fedora font package macros, possibly some funky interaction with %{lua: } macros or something - this reverts commit f895acd285366cf58cc3c97b5f188fecbfd782a8.
2010-01-05Move <stdio.h> includes out of system.h to the places that need itPanu Matilainen3-0/+3
2010-01-05Move <ctype.h> include out of system.h to the places that need itPanu Matilainen1-0/+1
2010-01-05Move <errno.h> include out of system.h to the places that need itPanu Matilainen4-0/+4
2010-01-05Remove <string.h> include from system.h into the few places that still needPanu Matilainen2-0/+2
- most of the places get it through <rpm/rpmstring.h> already