/drivers/hdf_core/framework/tools/hdi-gen/ast/ |
D | ast_string_type.cpp | 68 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteString(%s, %s)) {\n", parcelName.c_str(), name.c_… in EmitCWriteVar() 69 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 70 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 79 sb.Append(prefix).AppendFormat("if (%s == NULL || %s == 0) {\n", name.c_str(), lenName.c_str()); in EmitCProxyWriteOutVar() 80 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: %s is invalid\", __func__);\n", name… in EmitCProxyWriteOutVar() 81 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyWriteOutVar() 82 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyWriteOutVar() 84 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteUint32(%s, %s)) {\n", parcelName.c_str(), lenName… in EmitCProxyWriteOutVar() 85 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", l… in EmitCProxyWriteOutVar() [all …]
|
D | ast_union_type.cpp | 34 sb.AppendFormat("union %s {\n", name_.c_str()); in Dump() 38 … sb.AppendFormat("%s %s;\n", std::get<1>(it)->ToString().c_str(), std::get<0>(it).c_str()); in Dump() 91 sb.AppendFormat("union %s {\n", name_.c_str()); in EmitCTypeDecl() 96 sb.Append(TAB).AppendFormat("%s %s;\n", member->EmitCType().c_str(), memberName.c_str()); in EmitCTypeDecl() 98 sb.Append(TAB).AppendFormat("uint32_t %sLen;\n", memberName.c_str()); in EmitCTypeDecl() 109 sb.AppendFormat("union %s {\n", name_.c_str()); in EmitCppTypeDecl() 114 sb.Append(TAB).AppendFormat("%s %s;\n", member->EmitCppType().c_str(), memberName.c_str()); in EmitCppTypeDecl() 132 … sb.Append(prefix).AppendFormat("if (!HdfSbufWriteBuffer(%s, (const void *)%s, sizeof(%s))) {\n", in EmitCWriteVar() 135 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteUnpadBuffer(%s, (const uint8_t *)%s, sizeof(%s)))… in EmitCWriteVar() 138 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() [all …]
|
D | ast_enum_type.cpp | 37 sb.AppendFormat("enum %s : %s {\n", name_.c_str(), baseType_->ToString().c_str()); in Dump() 39 sb.AppendFormat("enum %s {\n", name_.c_str()); in Dump() 46 sb.Append(" ").AppendFormat("%s,\n", it->GetName().c_str()); in Dump() 48 … sb.Append(" ").AppendFormat("%s = %s,\n", it->GetName().c_str(), value->Dump("").c_str()); in Dump() 104 sb.AppendFormat("enum %s {\n", name_.c_str()); in EmitCTypeDecl() 108 sb.Append(TAB).AppendFormat("%s,\n", it->GetName().c_str()); in EmitCTypeDecl() 110 …sb.Append(TAB).AppendFormat("%s = %s,\n", it->GetName().c_str(), it->GetExprValue()->EmitCode().c_… in EmitCTypeDecl() 122 sb.AppendFormat("enum %s : %s {\n", name_.c_str(), baseType_->EmitCppType().c_str()); in EmitCppTypeDecl() 124 sb.AppendFormat("enum %s {\n", name_.c_str()); in EmitCppTypeDecl() 129 sb.Append(TAB).AppendFormat("%s,\n", it->GetName().c_str()); in EmitCppTypeDecl() [all …]
|
D | ast_native_buffer_type.cpp | 63 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteNativeBufferHandle(%s, %s)) {\n", parcelName.c_st… in EmitCWriteVar() 65 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: failed to write %s\", __func__);\n",… in EmitCWriteVar() 77 sb.AppendFormat("%s = HdfSbufReadNativeBufferHandle(%s);\n", name.c_str(), parcelName.c_str()); in EmitCProxyReadVar() 78 sb.Append(prefix).AppendFormat("if (%s == NULL) {\n", name.c_str()); in EmitCProxyReadVar() 79 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 80 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 88 …sb.Append(prefix).AppendFormat("%s = HdfSbufReadNativeBufferHandle(%s);\n", name.c_str(), parcelNa… in EmitCStubReadVar() 89 sb.Append(prefix).AppendFormat("if (%s == NULL) {\n", name.c_str()); in EmitCStubReadVar() 90 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_ulong_type.cpp | 69 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteUint64(%s, %s)) {\n", parcelName.c_str(), name.c_… in EmitCWriteVar() 70 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 72 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 79 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadUint64(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCProxyReadVar() 80 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 82 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 89 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadUint64(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCStubReadVar() 90 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_uchar_type.cpp | 69 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteUint8(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCWriteVar() 70 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 72 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 79 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadUint8(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCProxyReadVar() 80 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 82 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 89 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadUint8(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCStubReadVar() 90 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_ushort_type.cpp | 69 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteUint16(%s, %s)) {\n", parcelName.c_str(), name.c_… in EmitCWriteVar() 70 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 72 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 79 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadUint16(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCProxyReadVar() 80 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 82 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 89 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadUint16(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCStubReadVar() 90 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_uint_type.cpp | 69 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteUint32(%s, %s)) {\n", parcelName.c_str(), name.c_… in EmitCWriteVar() 70 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 72 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 79 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadUint32(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCProxyReadVar() 80 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 82 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 89 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadUint32(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCStubReadVar() 90 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_struct_type.cpp | 37 sb.AppendFormat("struct %s {\n", name_.c_str()); in Dump() 41 … sb.AppendFormat("%s %s;\n", std::get<1>(it)->ToString().c_str(), std::get<0>(it).c_str()); in Dump() 94 sb.AppendFormat("struct %s {\n", name_.c_str()); in EmitCTypeDecl() 99 sb.Append(TAB).AppendFormat("%s %s;\n", member->EmitCType().c_str(), memberName.c_str()); in EmitCTypeDecl() 101 sb.Append(TAB).AppendFormat("uint32_t %sLen;\n", memberName.c_str()); in EmitCTypeDecl() 117 sb.AppendFormat("struct %s {\n", name_.c_str()); in EmitCppTypeDecl() 122 sb.Append(TAB).AppendFormat("%s %s;\n", member->EmitCppType().c_str(), memberName.c_str()); in EmitCppTypeDecl() 143 sb.Append(prefix).AppendFormat( in EmitCWriteVar() 145 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 146 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() [all …]
|
D | ast_double_type.cpp | 68 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteDouble(%s, %s)) {\n", parcelName.c_str(), name.c_… in EmitCWriteVar() 69 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 70 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 78 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadDouble(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCProxyReadVar() 79 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 80 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 88 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadDouble(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCStubReadVar() 89 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_short_type.cpp | 68 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteInt16(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCWriteVar() 69 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 70 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 78 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadInt16(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCProxyReadVar() 79 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 80 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 88 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadInt16(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCStubReadVar() 89 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_byte_type.cpp | 68 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteInt8(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCWriteVar() 69 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 70 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 78 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadInt8(%s, %s)) {\n", parcelName.c_str(), name.c_str… in EmitCProxyReadVar() 79 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 80 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 88 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadInt8(%s, %s)) {\n", parcelName.c_str(), name.c_str… in EmitCStubReadVar() 89 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_boolean_type.cpp | 68 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteInt8(%s, %s ? 1 : 0)) {\n", parcelName.c_str(), n… in EmitCWriteVar() 69 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 70 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 78 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadInt8(%s, (int8_t *)%s)) {\n", parcelName.c_str(), … in EmitCProxyReadVar() 79 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 80 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 88 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadInt8(%s, (int8_t *)%s)) {\n", parcelName.c_str(), … in EmitCStubReadVar() 89 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_float_type.cpp | 68 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteFloat(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCWriteVar() 69 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 70 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 78 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadFloat(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCProxyReadVar() 79 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 80 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 88 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadFloat(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCStubReadVar() 89 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_long_type.cpp | 68 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteInt64(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCWriteVar() 69 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 70 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 78 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadInt64(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCProxyReadVar() 79 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 80 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 88 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadInt64(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCStubReadVar() 89 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_integer_type.cpp | 68 …sb.Append(prefix).AppendFormat("if (!HdfSbufWriteInt32(%s, %s)) {\n", parcelName.c_str(), name.c_s… in EmitCWriteVar() 69 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 70 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 78 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadInt32(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCProxyReadVar() 79 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 80 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 81 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 88 …sb.Append(prefix).AppendFormat("if (!HdfSbufReadInt32(%s, %s)) {\n", parcelName.c_str(), name.c_st… in EmitCStubReadVar() 89 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCStubReadVar() [all …]
|
D | ast_smq_type.cpp | 61 sb.Append(prefix).AppendFormat( in EmitCppWriteVar() 63 sb.AppendFormat("!%s->GetMeta()->Marshalling(%s)) {\n", name.c_str(), parcelName.c_str()); in EmitCppWriteVar() 64 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCppWriteVar() 73 sb.Append(prefix).AppendFormat( in EmitCppReadVar() 75 sb.AppendFormat( in EmitCppReadVar() 77 sb.Append(prefix).AppendFormat("if (%s == nullptr) {\n", metaVarName.c_str()); in EmitCppReadVar() 78 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: SharedMemQueueMeta is nullptr\", __f… in EmitCppReadVar() 83 …sb.Append(prefix).AppendFormat("%s %s = ", EmitCppType(TypeMode::LOCAL_VAR).c_str(), name.c_str()); in EmitCppReadVar() 85 sb.Append(prefix).AppendFormat("%s = ", name.c_str()); in EmitCppReadVar() 88 sb.AppendFormat( in EmitCppReadVar() [all …]
|
D | ast_array_type.cpp | 87 …sb.Append(prefix).AppendFormat("if (!WritePodArray(%s, %s, sizeof(%s), %s)) {\n", parcelName.c_str… in EmitCWriteVar() 90 … .AppendFormat("HDF_LOGE(\"%%{public}s: failed to write %s\", __func__);\n", name.c_str()); in EmitCWriteVar() 91 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 92 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 96 sb.Append(prefix).AppendFormat( in EmitCWriteVar() 99 … .AppendFormat("HDF_LOGE(\"%%{public}s: failed to write %s\", __func__);\n", name.c_str()); in EmitCWriteVar() 100 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 101 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 106 sb.Append(prefix).AppendFormat("if ((%s == NULL && %s != 0) || (%s != NULL && %s == 0)) {\n", in EmitCWriteVar() 108 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: %s is invalid\", __func__);\n", name… in EmitCWriteVar() [all …]
|
D | ast_fd_type.cpp | 68 …sb.Append(prefix).AppendFormat("if (!WriteFileDescriptor(%s, %s)) {\n", parcelName.c_str(), name.c… in EmitCWriteVar() 69 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCWriteVar() 70 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCWriteVar() 71 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCWriteVar() 79 …sb.Append(prefix).AppendFormat("if (!ReadFileDescriptor(%s, &%s)) {\n", parcelName.c_str(), name.c… in EmitCProxyReadVar() 81 …sb.Append(prefix).AppendFormat("if (!ReadFileDescriptor(%s, %s)) {\n", parcelName.c_str(), name.c_… in EmitCProxyReadVar() 83 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: read %s failed!\", __func__);\n", na… in EmitCProxyReadVar() 84 sb.Append(prefix + TAB).AppendFormat("%s = HDF_ERR_INVALID_PARAM;\n", ecName.c_str()); in EmitCProxyReadVar() 85 sb.Append(prefix + TAB).AppendFormat("goto %s;\n", gotoLabel.c_str()); in EmitCProxyReadVar() 92 …sb.Append(prefix).AppendFormat("if (!ReadFileDescriptor(%s, &%s)) {\n", parcelName.c_str(), name.c… in EmitCStubReadVar() [all …]
|
D | ast_sequenceable_type.cpp | 81 …sb.Append(prefix).AppendFormat("if (!%s.WriteStrongParcelable(%s)) {\n", parcelName.c_str(), name.… in EmitCppWriteVar() 82 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCppWriteVar() 91 …sb.Append(prefix).AppendFormat("sptr<%s> %s = %s.ReadStrongParcelable<%s>();\n", name_.c_str(), na… in EmitCppReadVar() 94 sb.Append(prefix).AppendFormat( in EmitCppReadVar() 102 …sb.Append(prefix).AppendFormat("if (!%s.WriteStrongParcelable(%s)) {\n", parcelName.c_str(), name.… in EmitCppMarshalling() 103 …sb.Append(prefix + TAB).AppendFormat("HDF_LOGE(\"%%{public}s: write %s failed!\", __func__);\n", n… in EmitCppMarshalling() 112 …sb.Append(prefix).AppendFormat("%s %s = %s.ReadStrongParcelable<%s>();\n", EmitCppType().c_str(), … in EmitCppUnMarshalling() 115 sb.Append(prefix).AppendFormat( in EmitCppUnMarshalling() 124 … sb.Append(prefix).AppendFormat("%s.writeRemoteObject(%s);\n", parcelName.c_str(), name.c_str()); in EmitJavaWriteVar() 127 sb.Append(prefix).AppendFormat("%s.writeSequenceable(%s);\n", parcelName.c_str(), name.c_str()); in EmitJavaWriteVar() [all …]
|
/drivers/hdf_core/framework/tools/hdi-gen/codegen/ |
D | c_service_driver_code_emitter.cpp | 92 sb.AppendFormat("%s\n", file.ToString().c_str()); in EmitLowDriverInclusions() 98 …sb.AppendFormat("static int Hdf%sDriverBind(struct HdfDeviceObject *deviceObject)\n", baseName_.c_… in EmitLowDriverBind() 101 …sb.Append(TAB).AppendFormat("struct %s *serviceImpl = %sGet();\n", implName_.c_str(), implName_.c_… in EmitLowDriverBind() 113 …sb.AppendFormat("static void Hdf%sDriverRelease(struct HdfDeviceObject *deviceObject)\n", baseName… in EmitLowDriverRelease() 121 sb.Append(TAB).AppendFormat( in EmitLowDriverRelease() 124 sb.Append(TAB).Append(TAB).AppendFormat("%sRelease(serviceImpl);\n", implName_.c_str()); in EmitLowDriverRelease() 182 sb.AppendFormat("%s\n", file.ToString().c_str()); in EmitDriverInclusions() 201 sb.AppendFormat("struct Hdf%sHost {\n", baseName_.c_str()); in EmitDriverServiceDecl() 202 sb.Append(TAB).AppendFormat("struct IDeviceIoService ioService;\n"); in EmitDriverServiceDecl() 204 sb.Append(TAB).AppendFormat("struct %s *service;\n", implName_.c_str()); in EmitDriverServiceDecl() [all …]
|
D | cpp_service_driver_code_emitter.cpp | 83 sb.AppendFormat("%s\n", file.ToString().c_str()); in EmitDriverInclusions() 90 sb.AppendFormat("using namespace %s;\n", nspace.c_str()); in EmitDriverUsings() 95 sb.AppendFormat("struct Hdf%sHost {\n", baseName_.c_str()); in EmitDriverServiceDecl() 104 sb.AppendFormat("static int32_t %sDriverDispatch(", baseName_.c_str()); in EmitDriverDispatch() 108 sb.Append(TAB).AppendFormat("auto *%s = CONTAINER_OF(", objName.c_str()); in EmitDriverDispatch() 109 … sb.AppendFormat("client->device->service, struct Hdf%sHost, ioService);\n\n", baseName_.c_str()); in EmitDriverDispatch() 124 sb.Append(TAB).AppendFormat( in EmitDriverDispatch() 131 …sb.AppendFormat("static int Hdf%sDriverInit(struct HdfDeviceObject *deviceObject)\n", baseName_.c_… in EmitDriverInit() 141 …sb.AppendFormat("static int Hdf%sDriverBind(struct HdfDeviceObject *deviceObject)\n", baseName_.c_… in EmitDriverBind() 145 …sb.Append(TAB).AppendFormat("auto *%s = new (std::nothrow) Hdf%sHost;\n", objName.c_str(), baseNam… in EmitDriverBind() [all …]
|
D | c_client_proxy_code_emitter.cpp | 82 sb.AppendFormat("%s\n", file.ToString().c_str()); in EmitPassthroughProxyInclusions() 88 sb.AppendFormat("struct %s *%sGetInstance(const char *serviceName, bool isStub)\n", in EmitPassthroughGetInstanceMethod() 98 …sb.AppendFormat("void %sReleaseInstance(const char *serviceName, struct %s *instance, bool isStub)… in EmitPassthroughReleaseInstanceMethod() 154 sb.AppendFormat("%s\n", file.ToString().c_str()); in EmitProxyInclusions() 191 sb.AppendFormat("struct %sProxy {\n", baseName_.c_str()); in EmitProxyDefinition() 192 sb.Append(TAB).AppendFormat("struct %s impl;\n", interfaceName_.c_str()); in EmitProxyDefinition() 204 … sb.AppendFormat("static int32_t %sProxyCall(struct %s *self, int32_t id, struct HdfSBuf *data,\n", in EmitProxyCallMethodImpl() 210 …sb.Append(TAB).AppendFormat("struct HdfRemoteService *%s = self->AsObject(self);\n", remoteName.c_… in EmitProxyCallMethodImpl() 211 sb.Append(TAB).AppendFormat("if (%s == NULL ||\n", remoteName.c_str()); in EmitProxyCallMethodImpl() 212 sb.Append(TAB).Append(TAB).AppendFormat("%s->dispatcher == NULL ||\n", remoteName.c_str()); in EmitProxyCallMethodImpl() [all …]
|
D | c_service_stub_code_emitter.cpp | 88 sb.AppendFormat("%s\n", file.ToString().c_str()); in EmitStubHeaderInclusions() 94 sb.AppendFormat("struct %sStub {\n", baseName_.c_str()); in EmitCbServiceStubDef() 96 sb.Append(TAB).AppendFormat("struct %s interface;\n", interfaceName_.c_str()); in EmitCbServiceStubDef() 97 …sb.Append(TAB).AppendFormat("int32_t (*OnRemoteRequest)(struct %s *serviceImpl, ", interfaceName_.… in EmitCbServiceStubDef() 101 sb.Append(TAB).AppendFormat("struct %s *interface;\n", interfaceName_.c_str()); in EmitCbServiceStubDef() 109 …sb.AppendFormat("bool %sStubConstruct(struct %sStub *stub);\n", baseName_.c_str(), baseName_.c_str… in EmitCbServiceStubMethodsDcl() 172 sb.AppendFormat("%s\n", file.ToString().c_str()); in EmitStubSourceInclusions() 215 …sb.AppendFormat("struct %s *%sGet(bool isStub)\n", interfaceName_.c_str(), interfaceName_.c_str()); in EmitGetMethodImpl() 217 sb.Append(TAB).AppendFormat( in EmitGetMethodImpl() 224 …sb.AppendFormat("struct %s *%sGetInstance(const char *serviceName, bool isStub)\n", interfaceName_… in EmitGetInstanceMehtodImpl() [all …]
|
D | c_service_impl_code_emitter.cpp | 90 sb.AppendFormat("%s\n", file.ToString().c_str()); in EmitLowServiceImplInclusions() 96 sb.AppendFormat("struct %s {\n", implName_.c_str()); in EmitLowServiceImplDefinition() 97 sb.Append(TAB).AppendFormat("struct %s super;\n", interfaceName_.c_str()); in EmitLowServiceImplDefinition() 128 sb.AppendFormat("struct %s *%sServiceGet(void)\n", implName_.c_str(), baseName_.c_str()); in EmitLowServiceImplGetMethod() 131 …sb.Append(TAB).AppendFormat("struct %s *service = (struct %s *)OsalMemCalloc(sizeof(struct %s));\n… in EmitLowServiceImplGetMethod() 138 sb.Append(TAB).AppendFormat("service->super.%s = %s%s;\n", method->GetName().c_str(), in EmitLowServiceImplGetMethod() 143 sb.Append(TAB).AppendFormat("service->super.%s = %s%s;\n", method->GetName().c_str(), in EmitLowServiceImplGetMethod() 194 sb.AppendFormat("%s\n", file.ToString().c_str()); in EmitServiceImplHeaderInclusions() 206 sb.AppendFormat("struct %s *%sServiceGet(void);\n\n", instTypeName.c_str(), baseName_.c_str()); in EmitServiceImplExternalMethodsDecl() 207 …sb.AppendFormat("void %sServiceRelease(struct %s *instance);\n", baseName_.c_str(), instTypeName.c… in EmitServiceImplExternalMethodsDecl() [all …]
|