/+junk/vala-bit-field

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/vala-bit-field

« back to all changes in this revision

Viewing changes to src/bit_map.vala

  • Committer: Gustav Hartvigsson
  • Date: 2020-11-03 20:46:10 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20201103204610-csia10wdkva1gbr6
* Made the C api better.
* Fixed the CCode for the static version of static_generate_mask ()

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
   * }}}
175
175
   * 
176
176
   */
 
177
  [CCode (cprefix="bit_field_info_", cname="BitFieldInfo")]
177
178
  public struct FieldInfo {
178
179
    int field_id;
179
180
    uint8 start;
221
222
      return 0;
222
223
    }
223
224
    
224
 
    [CCode (cname = "bit_field_field_info_compare")]
 
225
    [CCode (cname = "bit_field_info_compare")]
225
226
    public static extern int static_compare (FieldInfo a, FieldInfo b);
226
227
    
227
228
    
230
231
      return (!((this.start < other.end) || (this.end > other.start)));
231
232
    }
232
233
    
233
 
    [CCode (cname = "bit_field_field_info_overlap")]
 
234
    [CCode (cname = "bit_field_info_overlap")]
234
235
    public static extern bool static_overlap (FieldInfo a, FieldInfo b);
235
236
    
236
237
    
253
254
      return false;
254
255
    }
255
256
    
256
 
    [CCode (cname = "bit_field_field_info_validate")]
 
257
    [CCode (cname = "bit_field_info_validate")]
257
258
    public extern static bool static_validate (FieldInfo info);
258
259
    
259
260
    public uint16 generate_mask () {
269
270
      return mask;
270
271
    }
271
272
    
272
 
    [CCode (cname = "bit_field_field_generate_mask")]
 
273
    [CCode (cname = "bit_field_info_generate_mask")]
273
274
    public extern static uint16 static_generate_mask (FieldInfo info);
274
275
  }
275
276