| 1 | /* ======================================================================== |
| 2 | * PlantUML : a free UML diagram generator |
| 3 | * ======================================================================== |
| 4 | * |
| 5 | * Project Info: http://plantuml.com |
| 6 | * |
| 7 | * If you like this project or if you find it useful, you can support us at: |
| 8 | * |
| 9 | * http://plantuml.com/patreon (only 1$ per month!) |
| 10 | * http://plantuml.com/paypal |
| 11 | * |
| 12 | * This file is part of Smetana. |
| 13 | * Smetana is a partial translation of Graphviz/Dot sources from C to Java. |
| 14 | * |
| 15 | * (C) Copyright 2009-2020, Arnaud Roques |
| 16 | * |
| 17 | * This translation is distributed under the same Licence as the original C program: |
| 18 | * |
| 19 | ************************************************************************* |
| 20 | * Copyright (c) 2011 AT&T Intellectual Property |
| 21 | * All rights reserved. This program and the accompanying materials |
| 22 | * are made available under the terms of the Eclipse Public License v1.0 |
| 23 | * which accompanies this distribution, and is available at |
| 24 | * http://www.eclipse.org/legal/epl-v10.html |
| 25 | * |
| 26 | * Contributors: See CVS logs. Details at http://www.graphviz.org/ |
| 27 | ************************************************************************* |
| 28 | * |
| 29 | * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC |
| 30 | * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0] |
| 31 | * |
| 32 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES |
| 33 | * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. |
| 34 | * |
| 35 | * You may obtain a copy of the License at |
| 36 | * |
| 37 | * http://www.eclipse.org/legal/epl-v10.html |
| 38 | * |
| 39 | * Unless required by applicable law or agreed to in writing, software |
| 40 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 41 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 42 | * See the License for the specific language governing permissions and |
| 43 | * limitations under the License. |
| 44 | * |
| 45 | */ |
| 46 | package h; |
| 47 | |
| 48 | import smetana.core.CString; |
| 49 | import smetana.core.HardcodedStruct; |
| 50 | import smetana.core.OFFSET; |
| 51 | import smetana.core.UnsupportedStructAndPtr; |
| 52 | import smetana.core.__ptr__; |
| 53 | import smetana.core.amiga.StarStruct; |
| 54 | |
| 55 | //2 38c2s12koxcpi2c7vwl72qrsp |
| 56 | |
| 57 | public class ST_Agsym_s extends UnsupportedStructAndPtr implements HardcodedStruct { |
| 58 | public final ST_dtlink_s link = new ST_dtlink_s(this); |
| 59 | |
| 60 | public CString name; /* attribute's name */ |
| 61 | public CString defval; /* its default value for initialization */ |
| 62 | |
| 63 | public int id; /* its index in attr[] */ |
| 64 | public int kind; /* referent object type */ |
| 65 | public int fixed; /* immutable value */ |
| 66 | public int print; /* always print */ |
| 67 | |
| 68 | public ST_Agsym_s(StarStruct parent) { |
| 69 | } |
| 70 | |
| 71 | @Override |
| 72 | public Object addVirtualBytes(int virtualBytes) { |
| 73 | if (virtualBytes == 0) { |
| 74 | return this; |
| 75 | } |
| 76 | final OFFSET offset = OFFSET.fromInt(virtualBytes); |
| 77 | if (offset.toString().equals("h.ST_Agsym_s::name")) { |
| 78 | return name; |
| 79 | } |
| 80 | if (offset.toString().equals("h.ST_Agsym_s::link")) { |
| 81 | return link; |
| 82 | } |
| 83 | System.err.println("virtualBytes=" + virtualBytes); |
| 84 | System.err.println("offset=" + offset); |
| 85 | return super.addVirtualBytes(virtualBytes); |
| 86 | } |
| 87 | |
| 88 | public ST_Agsym_s() { |
| 89 | this(null); |
| 90 | } |
| 91 | |
| 92 | @Override |
| 93 | public boolean isSameThan(StarStruct other) { |
| 94 | ST_Agsym_s other2 = (ST_Agsym_s) other; |
| 95 | return this == other2; |
| 96 | } |
| 97 | |
| 98 | |
| 99 | @Override |
| 100 | public __ptr__ setPtr(String fieldName, __ptr__ newData) { |
| 101 | if (fieldName.equals("name")) { |
| 102 | this.name = (CString) newData; |
| 103 | return name; |
| 104 | } |
| 105 | if (fieldName.equals("defval")) { |
| 106 | this.defval = (CString) newData; |
| 107 | return defval; |
| 108 | } |
| 109 | return super.setPtr(fieldName, newData); |
| 110 | } |
| 111 | |
| 112 | @Override |
| 113 | public void setInt(String fieldName, int data) { |
| 114 | if (fieldName.equals("kind")) { |
| 115 | this.kind = data; |
| 116 | return; |
| 117 | } |
| 118 | if (fieldName.equals("id")) { |
| 119 | this.id = data; |
| 120 | return; |
| 121 | } |
| 122 | super.setInt(fieldName, data); |
| 123 | } |
| 124 | |
| 125 | public StarStruct from_link(ST_dtlink_s from) { |
| 126 | if (from == link) { |
| 127 | return this; |
| 128 | } |
| 129 | throw new IllegalArgumentException(); |
| 130 | } |
| 131 | |
| 132 | // public static List<String> DEFINITION = Arrays.asList( |
| 133 | // "struct Agsym_s", |
| 134 | // "{", |
| 135 | // "Dtlink_t link", |
| 136 | // "char *name", |
| 137 | // "char *defval", |
| 138 | // "int id", |
| 139 | // "unsigned char kind", |
| 140 | // "unsigned char fixed", |
| 141 | // "unsigned char print", |
| 142 | // "}"); |
| 143 | } |
| 144 | |
| 145 | // struct Agsym_s { /* symbol in one of the above dictionaries */ |
| 146 | // Dtlink_t link; |
| 147 | // char *name; /* attribute's name */ |
| 148 | // char *defval; /* its default value for initialization */ |
| 149 | // int id; /* its index in attr[] */ |
| 150 | // unsigned char kind; /* referent object type */ |
| 151 | // unsigned char fixed; /* immutable value */ |
| 152 | // unsigned char print; /* always print */ |
| 153 | // }; |