Changeset e187445 for filterelement.c


Ignore:
Timestamp:
Jun 22, 2003, 1:40:49 PM (15 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
53f421b
Parents:
a6560fe
Message:
reformatted filter, filterelement and regex to new code style
File:
1 edited

Legend:

Unmodified
Added
Removed
  • filterelement.c

    r1aee7d9 re187445  
    1414
    1515
    16 void owl_filterelement_create_null(owl_filterelement *fe) {
     16void owl_filterelement_create_null(owl_filterelement *fe)
     17{
    1718  fe->type=OWL_FILTERELEMENT_NULL;
    1819  fe->field=NULL;
    1920}
    2021
    21 void owl_filterelement_create_openbrace(owl_filterelement *fe) {
     22void owl_filterelement_create_openbrace(owl_filterelement *fe)
     23{
    2224  fe->type=OWL_FILTERELEMENT_OPENBRACE;
    2325  fe->field=NULL;
    2426}
    2527
    26 void owl_filterelement_create_closebrace(owl_filterelement *fe) {
     28void owl_filterelement_create_closebrace(owl_filterelement *fe)
     29{
    2730  fe->type=OWL_FILTERELEMENT_CLOSEBRACE;
    2831  fe->field=NULL;
    2932}
    3033
    31 void owl_filterelement_create_and(owl_filterelement *fe) {
     34void owl_filterelement_create_and(owl_filterelement *fe)
     35{
    3236  fe->type=OWL_FILTERELEMENT_AND;
    3337  fe->field=NULL;
    3438}
    3539
    36 void owl_filterelement_create_or(owl_filterelement *fe) {
     40void owl_filterelement_create_or(owl_filterelement *fe)
     41{
    3742  fe->type=OWL_FILTERELEMENT_OR;
    3843  fe->field=NULL;
    3944}
    4045
    41 void owl_filterelement_create_not(owl_filterelement *fe) {
     46void owl_filterelement_create_not(owl_filterelement *fe)
     47{
    4248  fe->type=OWL_FILTERELEMENT_NOT;
    4349  fe->field=NULL;
    4450}
    4551
    46 void owl_filterelement_create_true(owl_filterelement *fe) {
     52void owl_filterelement_create_true(owl_filterelement *fe)
     53{
    4754  fe->type=OWL_FILTERELEMENT_TRUE;
    4855  fe->field=NULL;
    4956}
    5057
    51 void owl_filterelement_create_false(owl_filterelement *fe) {
     58void owl_filterelement_create_false(owl_filterelement *fe)
     59{
    5260  fe->type=OWL_FILTERELEMENT_FALSE;
    5361  fe->field=NULL;
    5462}
    5563
    56 void owl_filterelement_create_re(owl_filterelement *fe, char *field, char *re) {
     64void owl_filterelement_create_re(owl_filterelement *fe, char *field, char *re)
     65{
    5766  fe->type=OWL_FILTERELEMENT_RE;
    5867  fe->field=owl_strdup(field);
     
    6069}
    6170
    62 void owl_filterelement_free(owl_filterelement *fe) {
     71void owl_filterelement_free(owl_filterelement *fe)
     72{
    6373  if (fe->field) owl_free(fe->field);
    6474}
    6575
    66 int owl_filterelement_is_null(owl_filterelement *fe) {
     76int owl_filterelement_is_null(owl_filterelement *fe)
     77{
    6778  if (fe->type==OWL_FILTERELEMENT_NULL) return(1);
    6879  return(0);
    6980}
    7081
    71 int owl_filterelement_is_openbrace(owl_filterelement *fe) {
     82int owl_filterelement_is_openbrace(owl_filterelement *fe)
     83{
    7284  if (fe->type==OWL_FILTERELEMENT_OPENBRACE) return(1);
    7385  return(0);
    7486}
    7587
    76 int owl_filterelement_is_closebrace(owl_filterelement *fe) {
     88int owl_filterelement_is_closebrace(owl_filterelement *fe)
     89{
    7790  if (fe->type==OWL_FILTERELEMENT_CLOSEBRACE) return(1);
    7891  return(0);
    7992}
    8093
    81 int owl_filterelement_is_and(owl_filterelement *fe) {
     94int owl_filterelement_is_and(owl_filterelement *fe)
     95{
    8296  if (fe->type==OWL_FILTERELEMENT_AND) return(1);
    8397  return(0);
    8498}
    8599
    86 int owl_filterelement_is_or(owl_filterelement *fe) {
     100int owl_filterelement_is_or(owl_filterelement *fe)
     101{
    87102  if (fe->type==OWL_FILTERELEMENT_OR) return(1);
    88103  return(0);
    89104}
    90105
    91 int owl_filterelement_is_not(owl_filterelement *fe) {
     106int owl_filterelement_is_not(owl_filterelement *fe)
     107{
    92108  if (fe->type==OWL_FILTERELEMENT_NOT) return(1);
    93109  return(0);
    94110}
    95111
    96 int owl_filterelement_is_true(owl_filterelement *fe) {
     112int owl_filterelement_is_true(owl_filterelement *fe)
     113{
    97114  if (fe->type==OWL_FILTERELEMENT_TRUE) return(1);
    98115  return(0);
    99116}
    100117
    101 int owl_filterelement_is_false(owl_filterelement *fe) {
     118int owl_filterelement_is_false(owl_filterelement *fe)
     119{
    102120  if (fe->type==OWL_FILTERELEMENT_FALSE) return(1);
    103121  return(0);
    104122}
    105123
    106 int owl_filterelement_is_re(owl_filterelement *fe) {
     124int owl_filterelement_is_re(owl_filterelement *fe)
     125{
    107126  if (fe->type==OWL_FILTERELEMENT_RE) return(1);
    108127  return(0);
    109128}
    110129
    111 owl_regex *owl_filterelement_get_re(owl_filterelement *fe) {
     130owl_regex *owl_filterelement_get_re(owl_filterelement *fe)
     131{
    112132  return(&(fe->re));
    113133}
    114134
    115 char *owl_filterelement_get_field(owl_filterelement *fe) {
     135char *owl_filterelement_get_field(owl_filterelement *fe)
     136{
    116137  return(fe->field);
    117138}
    118139
    119 int owl_filterelement_is_value(owl_filterelement *fe) {
     140int owl_filterelement_is_value(owl_filterelement *fe)
     141{
    120142  if ( (fe->type==OWL_FILTERELEMENT_TRUE) ||
    121143       (fe->type==OWL_FILTERELEMENT_FALSE) ||
     
    127149
    128150
    129 char *owl_filterelement_to_string(owl_filterelement *fe) {
     151char *owl_filterelement_to_string(owl_filterelement *fe)
     152{
    130153  /* return must be freed by caller */
    131154 
Note: See TracChangeset for help on using the changeset viewer.