示例#1
0
/*----------------------------------------------------------------------------.
 | EXPORT_TO_FILE                                                             |
 | This function is a helper to enable exporting to all supported filetypes.  |
 '----------------------------------------------------------------------------*/
void
high_export_to_file (GSList* data, const char* svg_data, const char* to, dt_configuration* settings)
{
  /* Even though this function is now deprecated, it is a fix for the GLib
   * version that is shipped with Ubuntu 12.04. */
  #ifndef GLIB_VERSION_2_36
  g_type_init ();
  #endif

  if (strlen (to) > 4)
    {
      char* extension = strrchr (to, '.');
      if (!strcmp (extension, ".json"))
	co_json_create_file (to, data);
      else if (!strcmp (extension, ".csv"))
	co_csv_create_file (to, data);
      else
	{
	  char* svg = NULL;
	  /* When no svg data is available yet, create it. */
	  if (svg_data == NULL)
	    svg = co_svg_create (data, to, settings);
	  else
	    svg = (char*)svg_data;

	  /* When there's still no SVG data, there's no point in 
	   * doing anything else. */
	  if (svg == NULL) return;

	  if (!strcmp (extension, ".png"))
	    co_png_export_to_file (to, svg);
	  else if (!strcmp (extension, ".pdf"))
	    co_pdf_export_to_file (to, svg);
	  else if (!strcmp (extension, ".svg"))
	    {
	      FILE* file;
	      file = fopen (to, "w");
	      if (file != NULL)
		fwrite (svg, strlen (svg), 1, file);

	      fclose (file);
	    }
	  else
	    unsupported ();

	  if (svg != svg_data)
	    free (svg);
	}
    }
  else
    unsupported ();
}
	EigendecompositionResult dense(const DenseMatrix& lhs, const DenseMatrix& rhs,
                                   const ComputationStrategy& strategy,
                                   const EigendecompositionStrategy& eigen_strategy,
                                   IndexType target_dimension)
	{
		if (strategy.is(HomogeneousCPUStrategy))
		{
			if (eigen_strategy.is(SmallestEigenvalues))
				return generalized_eigendecomposition_impl_dense
					<DenseMatrix,DenseMatrix,DenseInverseMatrixOperation>
					(lhs,rhs,target_dimension,0);
			unsupported();
		}
		unsupported();
		return EigendecompositionResult();
	}
	EigendecompositionResult arpack(const SparseWeightMatrix& lhs, const DenseDiagonalMatrix& rhs,
                                    const ComputationStrategy& strategy,
                                    const EigendecompositionStrategy& eigen_strategy,
                                    IndexType target_dimension)
	{
		if (strategy.is(HomogeneousCPUStrategy))
		{
			if (eigen_strategy.is(SmallestEigenvalues))
				return generalized_eigendecomposition_impl_arpack
					<SparseWeightMatrix,DenseDiagonalMatrix,SparseInverseMatrixOperation>
					(lhs,rhs,target_dimension,eigen_strategy.skip());
			unsupported();
		}
		unsupported();
		return EigendecompositionResult();
	}
示例#4
0
static void gabc_hepisema(FILE *f, const char *prefix, bool connect,
        grehepisema_size size)
{
    fprintf(f, "_%s", prefix);
    if (!connect) {
        fprintf(f, "2");
    }
    switch (size) {
    case H_SMALL_LEFT:
        fprintf(f, "3");
        break;
    case H_SMALL_CENTRE:
        fprintf(f, "4");
        break;
    case H_SMALL_RIGHT:
        fprintf(f, "5");
        break;
    case H_NORMAL:
        /* nothing to print */
        break;
    default:
        /* not reachable unless there's a programming error */
        /* LCOV_EXCL_START */
        unsupported("gabc_hepisema", __LINE__, "hepisema size",
                grehepisema_size_to_string(size));
        break;
        /* LCOV_EXCL_STOP */
    }
}
示例#5
0
// Return device object for the given device name (autodetect the device type)
smart_device * generic_smart_interface::autodetect_smart_device(const char * name)
{
  ARGUSED(name);

  // for the given name return the apropriate device type 
  unsupported();
  return NULL;
}
示例#6
0
// Return device object of the given type with specified name or NULL
smart_device * generic_smart_interface::get_custom_smart_device(const char * name, const char * type)
{
  ARGUSED(name);
  ARGUSED(type);

  unsupported();
  return NULL;
}
示例#7
0
framebuffer_obj_t::framebuffer_obj_t() : id_( 0)
{
    if( !GLEW_EXT_framebuffer_object)
        throw unsupported( "EXT_framebuffer_object");

    glGenFramebuffersEXT( 1, &id_);
    check_error();
}
示例#8
0
//----------------------------------------------------------------------------------------------
// Interface to SCSI devices.  See os_linux.c
int do_scsi_cmnd_io(int fd,struct scsi_cmnd_io * iop,int report)
{
  ARGUSED(fd);
  ARGUSED(iop);
  ARGUSED(report);
  unsupported();
  return -ENOSYS;
}
示例#9
0
//----------------------------------------------------------------------------------------------
int highpoint_command_interface(int fd, smart_command_set command, int select, char *data)
{
  ARGUSED(fd);
  ARGUSED(command);
  ARGUSED(select);
  ARGUSED(data);
  unsupported();
  return -1;
}
示例#10
0
// Fill devlist with all OS's disk devices of given type that match the pattern
bool generic_smart_interface::scan_smart_devices(smart_device_list & devlist,
  const char * type, const char * pattern /*= 0*/)
{
  ARGUSED(devlist);
  ARGUSED(type);
  ARGUSED(pattern);

  unsupported();
  return false;
}
示例#11
0
int areca_command_interface(int fd,int disknum,smart_command_set command,int select,char *data)
{
  ARGUSED(fd);
  ARGUSED(disknum);
  ARGUSED(command);
  ARGUSED(select);
  ARGUSED(data);

  unsupported();
  return -1;
}
示例#12
0
//----------------------------------------------------------------------------------------------
// Interface to ATA devices behind 3ware escalade/apache RAID
// controller cards.  Same description as ata_command_interface()
// above except that 0 <= disknum <= 15 specifies the ATA disk
// attached to the controller, and controller_type specifies the
// precise type of 3ware controller.  See os_linux.c
int escalade_command_interface(int fd,int disknum,int controller_type,smart_command_set command,int select,char *data)
{
  ARGUSED(fd);
  ARGUSED(disknum);
  ARGUSED(controller_type);
  ARGUSED(command);
  ARGUSED(select);
  ARGUSED(data);

  unsupported();
  return -1;
}
示例#13
0
static void gabc_write_bar(FILE *f, gregorio_bar type)
{
    switch (type) {
    case B_VIRGULA:
        fprintf(f, "`");
        break;
    case B_DIVISIO_MINIMA:
        fprintf(f, ",");
        break;
    case B_DIVISIO_MINOR:
        fprintf(f, ";");
        break;
    case B_DIVISIO_MAIOR:
        fprintf(f, ":");
        break;
    case B_DIVISIO_FINALIS:
        fprintf(f, "::");
        break;
    case B_DIVISIO_MINOR_D1:
        fprintf(f, ";1");
        break;
    case B_DIVISIO_MINOR_D2:
        fprintf(f, ";2");
        break;
    case B_DIVISIO_MINOR_D3:
        fprintf(f, ";3");
        break;
    case B_DIVISIO_MINOR_D4:
        fprintf(f, ";4");
        break;
    case B_DIVISIO_MINOR_D5:
        fprintf(f, ";5");
        break;
    case B_DIVISIO_MINOR_D6:
        fprintf(f, ";6");
        break;
    case B_DIVISIO_MINOR_D7:
        fprintf(f, ";7");
        break;
    case B_DIVISIO_MINOR_D8:
        fprintf(f, ";8");
        break;
    default:
        /* not reachable unless there's a programming error */
        /* LCOV_EXCL_START */
        unsupported("gabc_write_bar", __LINE__, "bar type",
                gregorio_bar_to_string(type));
        break;
        /* LCOV_EXCL_STOP */
    }
}
示例#14
0
int
GIFsetGraphAttr(Metafile *mf, int num, Gint code, Gint attr)
{
  int		imf;
  mf_cgmo		**cgmo	= &mf->cgmo;
  for (imf = 0; imf < num; ++imf) {
    GIFmetafile *meta = find_meta(cgmo[imf]);
    assert(meta);
    switch(code){
    case GKSM_POLYLINE_INDEX:
      set_lineColor(meta, attr, GBUNDLED);
      set_lineWidth(meta, 0.0, attr, GBUNDLED);
      set_lineStyle(meta, attr, GBUNDLED);
      break;
    case GKSM_POLYLINE_COLOUR_INDEX:
      set_lineColor(meta, attr, GINDIVIDUAL);
      break;
    case GKSM_LINETYPE:
      set_lineStyle(meta, attr, GINDIVIDUAL);
      break;
    case GKSM_TEXT_COLOUR_INDEX:
      unsupported("GIFsetGraphAttr : GKSM_TEXT_COLOUR_INDEX", attr);
      break;
    case GKSM_FILL_AREA_COLOUR_INDEX:
      set_fillColor(meta, attr);
      break;
    case GKSM_FILL_AREA_STYLE_INDEX:
      set_fillStyle(meta, attr);
      break;
    case GKSM_POLYMARKER_COLOUR_INDEX:
      unsupported("GIFsetGraphAttr : GKSM_POLYMARKER_COLOUR_INDEX", attr);
      break;
    case GKSM_FILL_AREA_INDEX:
      unsupported("GIFsetGraphAttr : GKSM_FILL_AREA_INDEX", attr);
      break;
    case GKSM_MARKER_TYPE:
      unsupported("GIFsetGraphAttr : GKSM_MARKER_TYPE", attr);
      break;
    case GKSM_POLYMARKER_INDEX:
      unsupported("GIFsetGraphAttr : GKSM_POLYMARKER_INDEX", attr);
      break;
    case GKSM_PICK_IDENTIFIER:
      unsupported("GIFsetGraphAttr : GKSM_PICK_IDENTIFIER", attr);
      break;
    case GKSM_TEXT_INDEX:
      unsupported("GIFsetGraphAttr : GKSM_TEXT_INDEX", attr);
      break;
    default:
      msgWarn("GIFsetGraphAttr: Unknown code %d\n", code);
    }
  }
  return OK;
}
示例#15
0
static const char *mora_vposition(gregorio_note *note)
{
    switch (note->mora_vposition) {
    case VPOS_AUTO:
        return "";
    case VPOS_ABOVE:
        return "1";
    case VPOS_BELOW:
        return "0";
    default:
        /* not reachable unless there's a programming error */
        /* LCOV_EXCL_START */
        unsupported("mora_vposition", __LINE__, "vposition",
                gregorio_vposition_to_string(note->mora_vposition));
        return "";
        /* LCOV_EXCL_STOP */
    }
}
示例#16
0
static void gabc_write_begin(FILE *f, grestyle_style style)
{
    switch (style) {
    case ST_ITALIC:
        fprintf(f, "<i>");
        break;
    case ST_COLORED:
        fprintf(f, "<c>");
        break;
    case ST_SMALL_CAPS:
        fprintf(f, "<sc>");
        break;
    case ST_BOLD:
        fprintf(f, "<b>");
        break;
    case ST_FORCED_CENTER:
        fprintf(f, "{");
        break;
    case ST_TT:
        fprintf(f, "<tt>");
        break;
    case ST_UNDERLINED:
        fprintf(f, "<ul>");
        break;
    case ST_ELISION:
        fprintf(f, "<e>");
        break;
    case ST_INITIAL:
    case ST_CENTER:
    case ST_FIRST_WORD:
    case ST_FIRST_SYLLABLE:
    case ST_FIRST_SYLLABLE_INITIAL:
        /* nothing should be emitted for these */
        break;
    default:
        /* not reachable unless there's a programming error */
        /* LCOV_EXCL_START */
        unsupported("gabc_write_begin", __LINE__, "style",
                grestyle_style_to_string(style));
        break;
        /* LCOV_EXCL_STOP */
    }
}
示例#17
0
static void gabc_write_space(FILE *f, gregorio_space type, char *factor,
        bool next_is_space)
{
    switch (type) {
    case SP_NEUMATIC_CUT:
        if (next_is_space) {
            /* if the following is not a space, we omit this because the
             * code always puts a "/" between elements unless there is some
             * other space there */
            fprintf (f, "/");
        }
        break;
    case SP_LARGER_SPACE:
        fprintf(f, "//");
        break;
    case SP_GLYPH_SPACE:
        fprintf(f, " ");
        break;
    case SP_AD_HOC_SPACE:
        fprintf(f, "/[%s]", factor);
        break;
    case SP_NEUMATIC_CUT_NB:
        fprintf(f, "!/");
        break;
    case SP_LARGER_SPACE_NB:
        fprintf(f, "!//");
        break;
    case SP_GLYPH_SPACE_NB:
        fprintf(f, "! ");
        break;
    case SP_AD_HOC_SPACE_NB:
        fprintf(f, "!/[%s]", factor);
        break;
    default:
        /* not reachable unless there's a programming error */
        /* LCOV_EXCL_START */
        unsupported("gabc_write_space", __LINE__, "space type",
                gregorio_space_to_string(type));
        break;
        /* LCOV_EXCL_STOP */
    }
}
示例#18
0
static void gabc_write_bar_signs(FILE *f, gregorio_sign type)
{
    switch (type) {
    case _V_EPISEMA:
        fprintf(f, "'");
        break;
    case _V_EPISEMA_BAR_H_EPISEMA:
        fprintf(f, "'_");
        break;
    case _BAR_H_EPISEMA:
        fprintf(f, "_");
        break;
    case _NO_SIGN:
        /* if there's no sign, don't emit anything */
        break;
    default:
        /* not reachable unless there's a programming error */
        /* LCOV_EXCL_START */
        unsupported("gabc_write_bar_signs", __LINE__, "bar signs",
                gregorio_sign_to_string(type));
        break;
        /* LCOV_EXCL_STOP */
    }
}
示例#19
0
static efi_status
SetVariable(efi_char *name, struct uuid *vendor, uint32_t attrs, u_long datasz,
    void *data)
{
	return (unsupported(__func__));
}
示例#20
0
static efi_status
GetWakeupTime(uint8_t *enabled, uint8_t *pending, struct efi_tm *time)
{
	return (unsupported(__func__));
}
示例#21
0
static efi_status
SetWakeupTime(uint8_t enable, struct efi_tm *time)
{
	return (unsupported(__func__));
}
示例#22
0
/* Validate filter spec against configuration done on the card. */
static int validate_filter(struct net_device *dev,
			   struct ch_filter_specification *fs)
{
	struct adapter *adapter = netdev2adap(dev);
	u32 fconf, iconf;

	/* Check for unconfigured fields being used. */
	fconf = adapter->params.tp.vlan_pri_map;
	iconf = adapter->params.tp.ingress_config;

	if (unsupported(fconf, FCOE_F, fs->val.fcoe, fs->mask.fcoe) ||
	    unsupported(fconf, PORT_F, fs->val.iport, fs->mask.iport) ||
	    unsupported(fconf, TOS_F, fs->val.tos, fs->mask.tos) ||
	    unsupported(fconf, ETHERTYPE_F, fs->val.ethtype,
			fs->mask.ethtype) ||
	    unsupported(fconf, MACMATCH_F, fs->val.macidx, fs->mask.macidx) ||
	    unsupported(fconf, MPSHITTYPE_F, fs->val.matchtype,
			fs->mask.matchtype) ||
	    unsupported(fconf, FRAGMENTATION_F, fs->val.frag, fs->mask.frag) ||
	    unsupported(fconf, PROTOCOL_F, fs->val.proto, fs->mask.proto) ||
	    unsupported(fconf, VNIC_ID_F, fs->val.pfvf_vld,
			fs->mask.pfvf_vld) ||
	    unsupported(fconf, VNIC_ID_F, fs->val.ovlan_vld,
			fs->mask.ovlan_vld) ||
	    unsupported(fconf, VLAN_F, fs->val.ivlan_vld, fs->mask.ivlan_vld))
		return -EOPNOTSUPP;

	/* T4 inconveniently uses the same FT_VNIC_ID_W bits for both the Outer
	 * VLAN Tag and PF/VF/VFvld fields based on VNIC_F being set
	 * in TP_INGRESS_CONFIG.  Hense the somewhat crazy checks
	 * below.  Additionally, since the T4 firmware interface also
	 * carries that overlap, we need to translate any PF/VF
	 * specification into that internal format below.
	 */
	if (is_field_set(fs->val.pfvf_vld, fs->mask.pfvf_vld) &&
	    is_field_set(fs->val.ovlan_vld, fs->mask.ovlan_vld))
		return -EOPNOTSUPP;
	if (unsupported(iconf, VNIC_F, fs->val.pfvf_vld, fs->mask.pfvf_vld) ||
	    (is_field_set(fs->val.ovlan_vld, fs->mask.ovlan_vld) &&
	     (iconf & VNIC_F)))
		return -EOPNOTSUPP;
	if (fs->val.pf > 0x7 || fs->val.vf > 0x7f)
		return -ERANGE;
	fs->mask.pf &= 0x7;
	fs->mask.vf &= 0x7f;

	/* If the user is requesting that the filter action loop
	 * matching packets back out one of our ports, make sure that
	 * the egress port is in range.
	 */
	if (fs->action == FILTER_SWITCH &&
	    fs->eport >= adapter->params.nports)
		return -ERANGE;

	/* Don't allow various trivially obvious bogus out-of-range values... */
	if (fs->val.iport >= adapter->params.nports)
		return -ERANGE;

	/* T4 doesn't support removing VLAN Tags for loop back filters. */
	if (is_t4(adapter->params.chip) &&
	    fs->action == FILTER_SWITCH &&
	    (fs->newvlan == VLAN_REMOVE ||
	     fs->newvlan == VLAN_REWRITE))
		return -EOPNOTSUPP;

	return 0;
}
示例#23
0
文件: IMG_tga.c 项目: chinaktv/gxgui
/* Load a TGA type image from an SDL datasource */
SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src)
{
    struct TGAheader hdr;
    int rle = 0;
    int alpha = 0;
    int indexed = 0;
    int grey = 0;
    int ckey = -1;
    int ncols, w, h;
    SDL_Surface *img;
    Uint32 rmask, gmask, bmask, amask;
    Uint8 *dst;
    int i;
    int bpp;
    int lstep;
    Uint32 pixel;
    int count, rep;

    if ( !src ) {
        /* The error message has been set in SDL_RWFromFile */
        return NULL;
    }

    if(!SDL_RWread(src, &hdr, sizeof(hdr), 1))
	goto error;
    ncols = LE16(hdr.cmap_len);
    switch(hdr.type) {
    case TGA_TYPE_RLE_INDEXED:
	rle = 1;
	/* fallthrough */
    case TGA_TYPE_INDEXED:
	if(!hdr.has_cmap || hdr.pixel_bits != 8 || ncols > 256)
	    goto error;
	indexed = 1;
	break;

    case TGA_TYPE_RLE_RGB:
	rle = 1;
	/* fallthrough */
    case TGA_TYPE_RGB:
	indexed = 0;
	break;

    case TGA_TYPE_RLE_BW:
	rle = 1;
	/* fallthrough */
    case TGA_TYPE_BW:
	if(hdr.pixel_bits != 8)
	    goto error;
	/* Treat greyscale as 8bpp indexed images */
	indexed = grey = 1;
	break;

    default:
        unsupported();
	return NULL;
    }

    bpp = (hdr.pixel_bits + 7) >> 3;
    rmask = gmask = bmask = amask = 0;
    switch(hdr.pixel_bits) {
    case 8:
	if(!indexed) {
	    unsupported();
	    return NULL;
	}
	break;

    case 15:
    case 16:
	/* 15 and 16bpp both seem to use 5 bits/plane. The extra alpha bit
	   is ignored for now. */
	rmask = 0x7c00;
	gmask = 0x03e0;
	bmask = 0x001f;
	break;

    case 32:
	alpha = 1;
	/* fallthrough */
    case 24:
	if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {
	    int s = alpha ? 0 : 8;
	    amask = 0x000000ff >> s;
	    rmask = 0x0000ff00 >> s;
	    gmask = 0x00ff0000 >> s;
	    bmask = 0xff000000 >> s;
	} else {
示例#24
0
static efi_status
ConvertPointer(u_long debug, void **addr)
{
	return (unsupported(__func__));
}
示例#25
0
static efi_status
GetNextVariableName(u_long *namesz, efi_char *name, struct uuid *vendor)
{
	return (unsupported(__func__));
}
示例#26
0
static efi_status
ResetSystem(enum efi_reset type, efi_status status, u_long datasz,
    efi_char *data)
{
	return (unsupported(__func__));
}
示例#27
0
// makes a list of ATA or SCSI devices for the DEVICESCAN directive of
// smartd.  Returns number N of devices, or -1 if out of
// memory. Allocates N+1 arrays: one of N pointers (devlist); the
// other N arrays each contain null-terminated character strings.  In
// the case N==0, no arrays are allocated because the array of 0
// pointers has zero length, equivalent to calling malloc(0).
int make_device_names (char*** devlist, const char* name) {
  ARGUSED(devlist);
  ARGUSED(name);
  unsupported();
  return 0;
}