Skip to content

Commit 160deac

Browse files
committed
Release 1.0.31
* Task execution mechanism moved task state field from volatile to atomic. * Updated LLTL hashing specifications. * Fixed being ignored. * Updated module versions in dependencies.
2 parents 7857df8 + d11d7e0 commit 160deac

File tree

21 files changed

+625
-211
lines changed

21 files changed

+625
-211
lines changed

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
* RECENT CHANGES
33
*******************************************************************************
44

5+
=== 1.0.31 ===
6+
* Task execution mechanism moved task state field from volatile to atomic.
7+
* Updated LLTL hashing specifications.
8+
* Fixed $XDG_CONFIG_HOME being ignored.
9+
* Updated module versions in dependencies.
10+
511
=== 1.0.30 ===
612
* Added possibility to perform casted fetch from expr::value_t.
713
* Updated module versions in dependencies.

include/lsp-plug.in/expr/Parameters.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2020 Vladimir Sadovnikov <[email protected]>
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <[email protected]>
44
*
55
* This file is part of lsp-runtime-lib
66
* Created on: 19 февр. 2020 г.
@@ -37,9 +37,6 @@ namespace lsp
3737
*/
3838
class Parameters: public Resolver
3939
{
40-
private:
41-
Parameters & operator = (const Parameters &);
42-
4340
protected:
4441
typedef struct param_t
4542
{
@@ -65,6 +62,9 @@ namespace lsp
6562
status_t drop_value(size_t index, value_type_t type, param_t **out);
6663
status_t drop_value(const char *name, value_type_t type, param_t **out);
6764
status_t drop_value(const LSPString *name, value_type_t type, param_t **out);
65+
status_t add_move(const LSPString *name, value_t *value);
66+
status_t add_move(const char *name, value_t *value);
67+
status_t add_move(value_t *value);
6868

6969
protected:
7070
/**
@@ -76,8 +76,13 @@ namespace lsp
7676

7777
public:
7878
explicit Parameters();
79+
Parameters(const Parameters &) = delete;
80+
Parameters(Parameters &&) = delete;
7981
virtual ~Parameters();
8082

83+
Parameters & operator = (const Parameters &) = delete;
84+
Parameters & operator = (Parameters &&) = delete;
85+
8186
public:
8287
virtual status_t resolve(value_t *value, const char *name, size_t num_indexes = 0, const ssize_t *indexes = NULL);
8388

@@ -275,7 +280,7 @@ namespace lsp
275280
inline bool contains(const LSPString *name) const { return get_index(name) >= 0; }
276281
};
277282

278-
} /* namespace calc */
283+
} /* namespace expr */
279284
} /* namespace lsp */
280285

281286
#endif /* LSP_PLUG_IN_EXPR_PARAMETERS_H_ */

include/lsp-plug.in/expr/Variables.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2023 Vladimir Sadovnikov <[email protected]>
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <[email protected]>
44
*
55
* This file is part of lsp-runtime-lib
66
* Created on: 19 сент. 2019 г.
@@ -54,11 +54,14 @@ namespace lsp
5454

5555
protected:
5656
status_t insert_var(const LSPString *name, const value_t *value, size_t idx);
57+
status_t insert_var_move(const LSPString *name, value_t *value, size_t idx);
5758
ssize_t index_of_var(const LSPString *name);
5859

5960
status_t insert_func(const LSPString *name, function_t func, void *context, size_t idx);
6061
ssize_t index_of_func(const LSPString *name);
6162

63+
status_t set_move(const LSPString *name, value_t *value);
64+
6265
public:
6366
explicit Variables();
6467
explicit Variables(Resolver *r);

include/lsp-plug.in/expr/types.h

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,61 @@ namespace lsp
7171
*/
7272
void init_value(value_t *dst);
7373

74+
/**
75+
* Init value as NULL
76+
* @param dst target to set
77+
*/
78+
void init_value_null(value_t *dst);
79+
80+
/**
81+
* Init value as UNDEF
82+
* @param dst target to set
83+
*/
84+
void init_value_undef(value_t *dst);
85+
86+
/**
87+
* Init value as integer
88+
* @param dst target to set
89+
* @param value integer value to set
90+
*/
91+
void init_value_int(value_t *dst, ssize_t value);
92+
93+
/**
94+
* Init value as floating point
95+
* @param dst target to set
96+
* @param value floating-point value to set
97+
*/
98+
void init_value_float(value_t *dst, double value);
99+
100+
/**
101+
* Init value as boolean
102+
* @param dst target to set
103+
* @param value boolean value to set
104+
*/
105+
void init_value_bool(value_t *dst, bool value);
106+
107+
/**
108+
* Init value as string
109+
* @param dst target to set
110+
* @param value string value to set
111+
*/
112+
status_t init_value_string(value_t *dst, const LSPString *value);
113+
114+
/**
115+
* Init value as string
116+
* @param dst target to set
117+
* @param value UTF-8 string to set
118+
*/
119+
status_t init_value_string(value_t *dst, const char *value);
120+
121+
/**
122+
* Init value as string
123+
* @param dst target to set
124+
* @param value native string to set
125+
* @param charset native charset name
126+
*/
127+
status_t init_value_string(value_t *dst, const char *value, const char *charset);
128+
74129
/**
75130
* Initialize value with another value by copying contents
76131
* @param dst destination value
@@ -79,6 +134,14 @@ namespace lsp
79134
*/
80135
status_t init_value(value_t *dst, const value_t *src);
81136

137+
/**
138+
* Initialize value with move. Moves contents of source value to destination value
139+
* and resets source value to undef
140+
* @param dst destination value to perform copy
141+
* @param src source value to take data from
142+
*/
143+
void init_value_move(value_t *dst, value_t *src);
144+
82145
/**
83146
* Copy value. Frees previously used value if it was set
84147
* @param dst destination value to perform copy
@@ -87,6 +150,21 @@ namespace lsp
87150
*/
88151
status_t copy_value(value_t *dst, const value_t *src);
89152

153+
/**
154+
* Move value. Moves contents of source value to destination value
155+
* and resets source value to undef
156+
* @param dst destination value to perform copy
157+
* @param src source value to take data from
158+
*/
159+
void move_value(value_t *dst, value_t *src);
160+
161+
/**
162+
* Swap value. Swaps contents of source value and destination value
163+
* @param dst destination value to perform copy
164+
* @param src source value to take data from
165+
*/
166+
void swap_value(value_t *dst, value_t *src);
167+
90168
/**
91169
* Set value to NULL
92170
* @param dst target to set
@@ -125,7 +203,7 @@ namespace lsp
125203
* @param dst target to set
126204
* @param value string value to set
127205
*/
128-
status_t set_value_string(value_t *dst, LSPString *value);
206+
status_t set_value_string(value_t *dst, const LSPString *value);
129207

130208
/**
131209
* Set value to string
@@ -134,6 +212,15 @@ namespace lsp
134212
*/
135213
status_t set_value_string(value_t *dst, const char *value);
136214

215+
/**
216+
* Set value to string
217+
* @param dst target to set
218+
* @param value native string to set
219+
* @param charset character set to use
220+
*/
221+
status_t set_value_string(value_t *dst, const char *value, const char *charset);
222+
223+
137224
/**
138225
* Destroy value and all internal contents associated with it
139226
* The value remains valid and available for further operations but set to UNDEF

include/lsp-plug.in/fmt/config/types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ namespace lsp
5656
SF_COMMENT = 1 << 9, //!< SF_COMMENT Parameter has comment
5757
SF_TYPE_SET = 1 << 10, //!< SF_TYPE_SET Explicitly specify type
5858
SF_DECIBELS = 1 << 11, //!< SF_DECIBELS Serialize value as decibels
59+
SF_FRIENDLY = 1 << 12, //!< SF_FRIENDLY User-friendly values
5960
};
6061

6162
/**

include/lsp-plug.in/io/Path.h

Lines changed: 63 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2024 Vladimir Sadovnikov <[email protected]>
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <[email protected]>
44
*
55
* This file is part of lsp-runtime-lib
66
* Created on: 8 февр. 2019 г.
@@ -541,40 +541,77 @@ namespace lsp
541541
// LLTL specialization for Path class
542542
namespace lltl
543543
{
544+
// Non-const specification
544545
template <>
545-
struct hash_spec<io::Path>: public hash_iface
546+
struct hash_spec<io::Path>: public hash_iface
547+
{
548+
static size_t hash_func(const void *ptr, size_t size);
549+
550+
explicit hash_spec()
546551
{
547-
static size_t hash_func(const void *ptr, size_t size);
552+
hash = hash_func;
553+
}
554+
};
548555

549-
explicit hash_spec()
550-
{
551-
hash = hash_func;
552-
}
553-
};
556+
template <>
557+
struct compare_spec<io::Path>: public compare_iface
558+
{
559+
static ssize_t cmp_func(const void *a, const void *b, size_t size);
560+
561+
explicit compare_spec()
562+
{
563+
compare = cmp_func;
564+
}
565+
};
554566

555567
template <>
556-
struct compare_spec<io::Path>: public compare_iface
568+
struct allocator_spec<io::Path>: public allocator_iface
569+
{
570+
static void *clone_func(const void *src, size_t size);
571+
static void free_func(void *ptr);
572+
573+
explicit allocator_spec()
557574
{
558-
static ssize_t cmp_func(const void *a, const void *b, size_t size);
575+
clone = clone_func;
576+
free = free_func;
577+
}
578+
};
559579

560-
explicit compare_spec()
561-
{
562-
compare = cmp_func;
563-
}
564-
};
580+
// Const specification
581+
template <>
582+
struct hash_spec<const io::Path>: public hash_iface
583+
{
584+
static size_t hash_func(const void *ptr, size_t size);
585+
586+
explicit hash_spec()
587+
{
588+
hash = hash_func;
589+
}
590+
};
565591

566592
template <>
567-
struct allocator_spec<io::Path>: public allocator_iface
593+
struct compare_spec<const io::Path>: public compare_iface
594+
{
595+
static ssize_t cmp_func(const void *a, const void *b, size_t size);
596+
597+
explicit compare_spec()
568598
{
569-
static void *clone_func(const void *src, size_t size);
570-
static void free_func(void *ptr);
571-
572-
explicit allocator_spec()
573-
{
574-
clone = clone_func;
575-
free = free_func;
576-
}
577-
};
599+
compare = cmp_func;
600+
}
601+
};
602+
603+
template <>
604+
struct allocator_spec<const io::Path>: public allocator_iface
605+
{
606+
static void *clone_func(const void *src, size_t size);
607+
static void free_func(void *ptr);
608+
609+
explicit allocator_spec()
610+
{
611+
clone = clone_func;
612+
free = free_func;
613+
}
614+
};
578615
} /* namespace lltl */
579616
} /* namespace lsp */
580617

include/lsp-plug.in/ipc/IExecutor.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ namespace lsp
3333
class IExecutor
3434
{
3535
protected:
36-
static inline void change_task_state(ITask *task, ITask::task_state_t state)
36+
static inline void set_task_state(ITask *task, ITask::task_state_t state)
3737
{
38-
task->nState = state;
38+
atomic_store(&task->nState, state);
39+
}
40+
41+
static inline bool change_task_state(ITask *task, ITask::task_state_t old_state, ITask::task_state_t new_state)
42+
{
43+
return atomic_cas(&task->nState, old_state, new_state);
3944
}
4045

4146
static inline void link_task(ITask *tail, ITask *link)

0 commit comments

Comments
 (0)