Browse Source

Add pidmap_set_val()

Georgi Chorbadzhiyski 13 years ago
parent
commit
a2a3c0b9af
2 changed files with 6 additions and 0 deletions
  1. 1
    0
      tsfuncs.h
  2. 5
    0
      tsfuncs_misc.c

+ 1
- 0
tsfuncs.h View File

280
 
280
 
281
 void			pidmap_clear				(pidmap_t *pm);
281
 void			pidmap_clear				(pidmap_t *pm);
282
 void			pidmap_set					(pidmap_t *pm, uint16_t pid);
282
 void			pidmap_set					(pidmap_t *pm, uint16_t pid);
283
+void			pidmap_set_val				(pidmap_t *pm, uint16_t pid, uint8_t val);
283
 int				pidmap_get					(pidmap_t *pm, uint16_t pid);
284
 int				pidmap_get					(pidmap_t *pm, uint16_t pid);
284
 
285
 
285
 #endif
286
 #endif

+ 5
- 0
tsfuncs_misc.c View File

199
 		(*pm)[pid] = 1;
199
 		(*pm)[pid] = 1;
200
 }
200
 }
201
 
201
 
202
+void pidmap_set_val(pidmap_t *pm, uint16_t pid, uint8_t val) {
203
+	if (pid < sizeof(pidmap_t))
204
+		(*pm)[pid] = val;
205
+}
206
+
202
 int pidmap_get(pidmap_t *pm, uint16_t pid) {
207
 int pidmap_get(pidmap_t *pm, uint16_t pid) {
203
 	if (pid < sizeof(pidmap_t))
208
 	if (pid < sizeof(pidmap_t))
204
 		return (*pm)[pid];
209
 		return (*pm)[pid];

Loading…
Cancel
Save