aboutsummaryrefslogtreecommitdiffstats
path: root/backends/json/Makefile.inc
blob: a463daf914718f1521eb0ff41e2d4c830d20523d (plain)
1
2
3
OBJS += backends/json/json.o
s */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/****************************************************************
 * acm_endian.h 
 * 
 * Copyright (C) 2005 IBM Corporation
 *
 * Author:
 * Stefan Berger <stefanb@watson.ibm.com>
 * 
 * Contributions:
 * Reiner Sailer <sailer@watson.ibm.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, version 2 of the
 * License.
 *
 * sHype header file defining endian-dependent functions for the
 * big-endian policy interface
 *
 */

#ifndef _ACM_ENDIAN_H
#define _ACM_ENDIAN_H

/* don't use these functions in performance critical sections! */

/* set during initialization by testing */
extern u8 little_endian;

static inline u32 ntohl(u32 x) 
{
    if (little_endian)
        return 
            ( (((x) >> 24) & 0xff      )| 
              (((x) >>  8) & 0xff00    )| 
              (((x) <<  8) & 0xff0000  )|
              (((x) << 24) & 0xff000000) );
    else
        return x;
}

static inline u16 ntohs(u16 x) 
{
    if (little_endian)
        return 
            ( (((x) >> 8) & 0xff   )|
              (((x) << 8) & 0xff00 ) );
    else
        return x;
}

#define htonl(x) ntohl(x)
#define htons(x) ntohs(x)

static inline void arrcpy16(u16 *dest, const u16 *src, size_t n)
{
    unsigned int i = 0;
    while (i < n) {
        dest[i] = htons(src[i]);
        i++;
    }
}

static inline void arrcpy32(u32 *dest, const u32 *src, size_t n)
{
    unsigned int i = 0;
    while (i < n) {
        dest[i] = htonl(src[i]);
        i++;
    }
}

static inline void arrcpy(void *dest, const void *src, unsigned int elsize, size_t n)
{
    switch (elsize) {
    case sizeof(u16):
        arrcpy16((u16 *)dest, (u16 *)src, n);
        break;

    case sizeof(u32):
        arrcpy32((u32 *)dest, (u32 *)src, n);
        break;

    default:
        memcpy(dest, src, elsize*n);
    }
}

#endif

/*
 * Local variables:
 * mode: C
 * c-set-style: "BSD"
 * c-basic-offset: 4
 * tab-width: 4
 * indent-tabs-mode: nil
 * End:
 */