All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gen.lib.pack.pack__c Maven / Gradle / Ivy

// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
/* +=======================================================================
 * |
 * |      PlantUML : a free UML diagram generator
 * |
 * +=======================================================================
 *
 * (C) Copyright 2009-2024, Arnaud Roques
 *
 * Project Info:  https://plantuml.com
 *
 * If you like this project or if you find it useful, you can support us at:
 *
 * https://plantuml.com/patreon (only 1$ per month!)
 * https://plantuml.com/liberapay (only 1€ per month!)
 * https://plantuml.com/paypal
 *
 *
 * PlantUML is free software; you can redistribute it and/or modify it
 * under the terms of the Revised BSD License.
 *
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * * Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 * * Neither the name of the University of California, Berkeley nor the
 *   names of its contributors may be used to endorse or promote products
 *   derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * PlantUML can occasionally display sponsored or advertising messages. Those
 * messages are usually generated on welcome or error images and never on
 * functional diagrams.
 * See https://plantuml.com/professional if you want to remove them
 *
 * Images (whatever their format : PNG, SVG, EPS...) generated by running PlantUML
 * are owned by the author of their corresponding sources code (that is, their
 * textual description in PlantUML language). Those images are not covered by
 * this BSD license.
 *
 * The generated images can then be used without any reference to the BSD license.
 * It is not even necessary to stipulate that they have been generated with PlantUML,
 * although this will be appreciated by the PlantUML team.
 *
 * There is an exception : if the textual description in PlantUML language is also covered
 * by any license, then the generated images are logically covered
 * by the very same license.
 *
 * This is the IGY distribution (Install GraphViz by Yourself).
 * You have to install GraphViz and to setup the GRAPHVIZ_DOT environment variable
 * (see https://plantuml.com/graphviz-dot )
 *
 * Icons provided by OpenIconic :  https://useiconic.com/open
 * Archimate sprites provided by Archi :  http://www.archimatetool.com
 * Stdlib AWS provided by https://github.com/milo-minderbinder/AWS-PlantUML
 * Stdlib Icons provided https://github.com/tupadr3/plantuml-icon-font-sprites
 * ASCIIMathML (c) Peter Jipsen http://www.chapman.edu/~jipsen
 * ASCIIMathML (c) David Lippman http://www.pierce.ctc.edu/dlippman
 * CafeUndZopfli ported by Eugene Klyuchnikov https://github.com/eustas/CafeUndZopfli
 * Brotli (c) by the Brotli Authors https://github.com/google/brotli
 * Themes (c) by Brett Schwarz https://github.com/bschwarz/puml-themes
 * Twemoji (c) by Twitter at https://twemoji.twitter.com/
 *
 */
package gen.lib.pack;
import static gen.lib.cgraph.attr__c.agget;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;

import gen.annotation.Original;
import gen.annotation.Reviewed;
import h.EN_pack_mode;
import h.ST_Agraph_s;
import h.ST_pack_info;
import smetana.core.CString;
import smetana.core.Globals;

public class pack__c {
    // ::remove folder when __HAXE__



/* parsePackModeInfo;
 * Return pack_mode of graph using "packmode" attribute.
 * If not defined, return dflt
 */
@Reviewed(when = "12/11/2020")
@Original(version="2.38.0", path="lib/pack/pack.c", name="parsePackModeInfo", key="dyb1n3lhbi0wnr9kvmu6onux9", definition="pack_mode  parsePackModeInfo(char* p, pack_mode dflt, pack_info* pinfo)")
public static EN_pack_mode parsePackModeInfo(CString p, EN_pack_mode dflt, ST_pack_info pinfo) {
ENTERING("dyb1n3lhbi0wnr9kvmu6onux9","parsePackModeInfo");
try {
    float v;
    int i;
    //assert (pinfo);
    pinfo.flags = 0;
    pinfo.mode = dflt;
    pinfo.sz = 0;
    pinfo.vals = null;
    if (p!=null && p.charAt(0)!='\0') {
UNSUPPORTED("2ybrtqq8efxouph8wjbrnowxz"); // 	switch (*p) {
UNSUPPORTED("2v5u3irq50r1n2ccuna0y09lk"); // 	case 'a':
UNSUPPORTED("4o68zbwd6291pxryyntjh2432"); // 	    if ((!strncmp(p,"array",(sizeof("array")/sizeof(char) - 1)))) {
UNSUPPORTED("3cxht114gc0fn4wl8xjy515bv"); // 		pinfo->mode = l_array;
UNSUPPORTED("edkaa80od81ojkn7d4h0q1zbu"); // 		p += (sizeof("array")/sizeof(char) - 1);
UNSUPPORTED("106zhcf9a6frvafctbbgrbws3"); // 		p = chkFlags (p, pinfo);
UNSUPPORTED("epac8gmlq3r1q3g6lh3fb9nzh"); // 		if ((sscanf (p, "%d", &i)>0) && (i > 0))
UNSUPPORTED("2e563kaxakuuou2t5kqvv33w5"); // 		    pinfo->sz = i;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // 	    }
UNSUPPORTED("38dve3snq2grkwui6y1tpc6r1"); // 	    else if ((!strncmp(p,"aspect",(sizeof("aspect")/sizeof(char) - 1)))) {
UNSUPPORTED("ems4wqj0nbd0vi3sttf36tnir"); // 		pinfo->mode = l_aspect;
UNSUPPORTED("3ckdfsy55ba8os2xhymh002al"); // 		if ((sscanf (p + (sizeof("array")/sizeof(char) - 1), "%f", &v)>0) && (v > 0))
UNSUPPORTED("1i6xlg2sfqvjqjdu811xm5398"); // 		    pinfo->aspect = v;
UNSUPPORTED("7e1uy5mzei37p66t8jp01r3mk"); // 		else
UNSUPPORTED("b3tzhasiwa1p83l47nhl6k5x8"); // 		    pinfo->aspect = 1;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // 	    }
UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // 	    break;
UNSUPPORTED("f3lyz2cejs6yn5fyckhn7ba1"); // 	case 'c':
UNSUPPORTED("d6yjom2gtqleeq1vf5l72eazl"); // 	    if ((*(p)==*("cluster")&&!strcmp(p,"cluster")))
UNSUPPORTED("2xe2y3s32q27l74dshw3831hu"); // 		pinfo->mode = l_clust;
UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // 	    break;
UNSUPPORTED("e00kor2k58i044hvvxytt9dhg"); // 	case 'g':
UNSUPPORTED("8vzhimdinzz48u15tcx34gzgs"); // 	    if ((*(p)==*("graph")&&!strcmp(p,"graph")))
UNSUPPORTED("coafx7pn3ah1ulp0o7a0z119r"); // 		pinfo->mode = l_graph;
UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // 	    break;
UNSUPPORTED("f187wptsr73liavtlyoyfovp3"); // 	case 'n':
UNSUPPORTED("aqi1ed010xc3cj8xoye8vqkqe"); // 	    if ((*(p)==*("node")&&!strcmp(p,"node")))
UNSUPPORTED("epewq8yin5pr1meeofxvntjes"); // 		pinfo->mode = l_node;
UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // 	    break;
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // 	}
    }
    //if (Verbose) {
	//fprintf (stderr, "pack info:\n");
	//fprintf (stderr, "  mode   %s\n", mode2Str(pinfo->mode));
	//if (pinfo->mode == l_aspect)
	//    fprintf (stderr, "  aspect %f\n", pinfo->aspect);
	//fprintf (stderr, "  size   %d\n", pinfo->sz);
	//fprintf (stderr, "  flags  %d\n", pinfo->flags);
    //}
    return pinfo.mode;
} finally {
LEAVING("dyb1n3lhbi0wnr9kvmu6onux9","parsePackModeInfo");
}
}




/* getPackModeInfo;
 * Return pack_mode of graph using "packmode" attribute.
 * If not defined, return dflt
 */
@Reviewed(when = "12/11/2020")
@Original(version="2.38.0", path="lib/pack/pack.c", name="getPackModeInfo", key="bnxqpsmvz6tyekstfjte4pzwj", definition="pack_mode  getPackModeInfo(Agraph_t * g, pack_mode dflt, pack_info* pinfo)")
public static EN_pack_mode getPackModeInfo(Globals zz, ST_Agraph_s g, EN_pack_mode dflt, ST_pack_info pinfo) {
ENTERING("bnxqpsmvz6tyekstfjte4pzwj","getPackModeInfo");
try {
    return parsePackModeInfo (agget(zz, g, new CString("packmode")), dflt, pinfo);
} finally {
LEAVING("bnxqpsmvz6tyekstfjte4pzwj","getPackModeInfo");
}
}





/* getPack:
 * Return "pack" attribute of g.
 * If not defined or negative, return not_def.
 * If defined but not specified, return dflt.
 */
@Reviewed(when = "12/11/2020")
@Original(version="2.38.0", path="lib/pack/pack.c", name="getPack", key="ata97fmix5q1oikrmk5pezvrf", definition="int getPack(Agraph_t * g, int not_def, int dflt)")
public static int getPack(Globals zz, ST_Agraph_s g, int not_def, int dflt) {
ENTERING("ata97fmix5q1oikrmk5pezvrf","getPack");
try {
    CString p;
    int i;
    int v = not_def;
    if ((p = agget(zz, g, new CString("pack")))!=null) {
UNSUPPORTED("enpqar7c7okvibe7xhe0vjtfn"); // 	if ((sscanf(p, "%d", &i) == 1) && (i >= 0))
UNSUPPORTED("3puzxwczcmpxvlw8cvmeyio74"); // 	    v = i;
UNSUPPORTED("65w8fxtw319slbg2c6nvtmow8"); // 	else if ((*p == 't') || (*p == 'T'))
UNSUPPORTED("5lifdir9mxnvpi8ur34qo0jej"); // 	    v = dflt;
    }
    return v;
} finally {
LEAVING("ata97fmix5q1oikrmk5pezvrf","getPack");
}
}




@Reviewed(when = "12/11/2020")
@Original(version="2.38.0", path="lib/pack/pack.c", name="getPackInfo", key="ce4a70w8ddkj4l9efi74h61s6", definition="pack_mode  getPackInfo(Agraph_t * g, pack_mode dflt, int dfltMargin, pack_info* pinfo)")
public static EN_pack_mode getPackInfo(Globals zz, ST_Agraph_s g, EN_pack_mode dflt, int dfltMargin, ST_pack_info pinfo) {
ENTERING("ce4a70w8ddkj4l9efi74h61s6","getPackInfo");
try {
    pinfo.margin = getPack(zz, g, dfltMargin, dfltMargin);
    //if (Verbose) {
	//fprintf (stderr, "  margin %d\n", pinfo->margin);
    //}
    pinfo.doSplines = 0;
    pinfo.fixed = null;
    getPackModeInfo(zz, g, dflt, pinfo);
    return pinfo.mode;
} finally {
LEAVING("ce4a70w8ddkj4l9efi74h61s6","getPackInfo");
}
}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy