summaryrefslogtreecommitdiffstats
path: root/src/sim/core.c
Commit message (Collapse)AuthorAgeFilesLines
* make all library-internal static buffers thread-localHarald Welte2019-06-041-2/+1
| | | | | | | | | | | | | | | We have a number of library-internal static global buffers which are mainly used for various stringification functions. This worked as all of the related Osmocom programs were strictly single-threaded. Let's make those buffers at least thread-local. This way every thread gets their own set of buffers, and it's safe for multiple threads to execute the same functions once. They're of course still not re-entrant. If you need re-entrancy, you will need to use the _c() or _buf() suffix version of those functions and work with your own (stack or heap) buffers. Change-Id: I50eb2436a7c1261d79a9d2955584dce92780ca07
* Add _c versions of functions that otherwise return static buffersHarald Welte2019-04-101-0/+8
| | | | | | | | | | | | | | We have a habit of returning static buffers from some functions, particularly when generating some kind of string values. This is convenient in terms of memory management, but it comes at the expense of not being thread-safe, and not allowing for two calls of the related function within one printf() statement. Let's introduce _c suffix versions of those functions where the caller passes in a talloc context from which the output buffer shall be allocated. Change-Id: I8481c19b68ff67cfa22abb93c405ebcfcb0ab19b
* Add _buf() functions to bypass static string buffersHarald Welte2019-04-031-11/+13
| | | | | | | | | | | | | | | We have a number of static buffers in use in libosmo*. This means the related functions are not usable in a thread-safe way. While we so far don't have many multi-threaded programs in the osmocom universe, the static buffers also prevent us from calling the same e.g. string-ify function twice within a single printf() call. Let's make sure there's an alternative function in all those cases, where the user can pass in a caller-allocated buffer + size, and make the 'classic' function with the static buffer a wrapper around that _buf() variant. Change-Id: Ibf85f79e93244f53b2684ff6f1095c5b41203e05
* Fix/Update copyright notices; Add SPDX annotationHarald Welte2017-11-131-0/+2
| | | | | | | | Let's fix some erroneous/accidential references to wrong license, update copyright information where applicable and introduce a SPDX-License-Identifier to all files. Change-Id: I39af26c6aaaf5c926966391f6565fc5936be21af
* doxygen: unify use of \file across the boardNeels Hofmeyr2017-06-231-1/+2
| | | | | | | | | | | | | | | | | Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
* doxygen: enable AUTOBRIEF, drop \briefNeels Hofmeyr2017-06-231-1/+1
| | | | | | | | | | Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
* sim/core.c: drop useless double assignmentVadim Yanitskiy2017-06-131-1/+1
| | | | Change-Id: I3bfcabd80b57aeb7f110b306350802e6e82c847a
* rename osim_file_find_* to osim_file_desc_find_*Harald Welte2016-03-111-3/+5
| | | | they return an osim_file_desc, and not an osim_file, so fix the naming
* sim: Add osim_file_find_{fid,sfid}() functionsHarald Welte2016-03-111-0/+25
| | | | | We don't always want to look-up by name, but the latter is the only implemented 'find' function so far. Let's change that.
* sim: More talloc return NULL checkingHarald Welte2014-10-261-0/+8
|
* sim: Only one default_decode() function for all card typesHarald Welte2014-10-261-0/+12
|
* sim: further updates/fixesHarald Welte2014-10-261-0/+11
|
* sim: add decoding of status wordsHarald Welte2014-10-261-2/+54
|
* sim: replaced function/structure comments with doxygen commentsKevin Redon2014-10-261-8/+12
| | | | | affected files: sim.h, sim/core.c affected funtions/strucutres: osim_new_apdumsg, osim_apdu_case,osim_apdu_cmd_hdr, osim_msgb_cb
* sim: renamed case to the one defined in ISO7816-3Kevin Redon2014-10-261-6/+6
| | | | | | | | | APDU_CASE_2 becomes APDU_CASE_2S APDU_CASE_2_EXT becmoes APDU_CASE_2E APDU_CASE_3 becomes APDU_CASE_3S APDU_CASE_3_EXT becmoes APDU_CASE_3E APDU_CASE_4 becomes APDU_CASE_4S APDU_CASE_4_EXT becmoes APDU_CASE_4E
* sim: comment/explain signature of osim_new_apdumsgKevin Redon2014-10-261-2/+9
|
* sim: add copyright notices and merge file_codec.c into core.cHarald Welte2014-10-261-4/+50
|
* initial checkin of 'libosmosim'Harald Welte2014-10-261-0/+172