~ubuntu-branches/debian/sid/mplayer/sid

« back to all changes in this revision

Viewing changes to m_struct.c

  • Committer: Bazaar Package Importer
  • Author(s): A Mennucc1
  • Date: 2009-03-23 10:05:45 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090323100545-x8h79obawnnte7kk
Tags: 1.0~rc2+svn20090303-5
debian/control : move docbook-xml,docbook-xsl,xsltproc from 
Build-Depends-Indep to Build-Depends, since they are needed to run
configure

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#include "m_struct.h"
12
12
#include "mp_msg.h"
13
13
 
14
 
m_option_t*
15
 
m_struct_get_field(m_struct_t* st,const char* f) {
 
14
const m_option_t*
 
15
m_struct_get_field(const m_struct_t* st,const char* f) {
16
16
  int i;
17
17
 
18
18
  for(i = 0 ; st->fields[i].name ; i++) {
23
23
}
24
24
 
25
25
void*
26
 
m_struct_alloc(m_struct_t* st) {
 
26
m_struct_alloc(const m_struct_t* st) {
27
27
  int i;
28
28
  void* r;
29
29
 
51
51
}
52
52
 
53
53
int
54
 
m_struct_set(m_struct_t* st, void* obj, char* field, char* param) {
55
 
  m_option_t* f = m_struct_get_field(st,field);
 
54
m_struct_set(const m_struct_t* st, void* obj, char* field, char* param) {
 
55
  const m_option_t* f = m_struct_get_field(st,field);
56
56
 
57
57
  if(!f) {
58
58
    mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Struct %s doesn't have any %s field\n",
70
70
}
71
71
 
72
72
void
73
 
m_struct_reset(m_struct_t* st, void* obj, const char* field) {
74
 
  m_option_t* f;
 
73
m_struct_reset(const m_struct_t* st, void* obj, const char* field) {
 
74
  const m_option_t* f;
75
75
 
76
76
  if(!field) { // Reset all options
77
77
    int i;
92
92
 
93
93
/// Free an allocated struct
94
94
void
95
 
m_struct_free(m_struct_t* st, void* obj) {
 
95
m_struct_free(const m_struct_t* st, void* obj) {
96
96
  int i;
97
97
 
98
98
  for(i = 0 ; st->fields[i].name ; i++)
101
101
}
102
102
 
103
103
void*
104
 
m_struct_copy(m_struct_t* st, void* obj) {
 
104
m_struct_copy(const m_struct_t* st, void* obj) {
105
105
  void* r = malloc(st->size);
106
106
  int i;
107
107