Browse Source

merge in default

doxygen_doc
Sofia Balicka 11 months ago
parent
commit
a2b62d983f
4 changed files with 46 additions and 44 deletions
  1. +28
    -36
      build-windows/generate_code.cmd
  2. +6
    -4
      build-windows/libpEpasn1/libpEpasn1.vcxproj
  3. +0
    -4
      build-windows/pEpEngine.vcxproj
  4. +12
    -0
      src/stringpair.c

+ 28
- 36
build-windows/generate_code.cmd View File

@ -1,58 +1,46 @@
@ECHO OFF
PUSHD .
SET pwd=%cd%
CD %pwd%\sync
:: The script is located in ...\pEpEngine\build-windows\
SET current_directory=%~dp0
SET engine_directory=%current_directory:~0,-14%
ECHO %engine_directory%
PUSHD %engine_directory%\sync
IF NOT EXIST generated MKDIR generated
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_actions.ysl2 sync.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_actions.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
IF %ERRORLEVEL% NEQ 0 GOTO end
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_codec.ysl2 distribution.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_codec.ysl2 distribution.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
IF %ERRORLEVEL% NEQ 0 GOTO end
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_codec.ysl2 sync.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_codec.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
IF %ERRORLEVEL% NEQ 0 GOTO end
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_messages.ysl2 sync.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_messages.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
IF %ERRORLEVEL% NEQ 0 GOTO end
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_messages.ysl2 distribution.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_messages.ysl2 distribution.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
IF %ERRORLEVEL% NEQ 0 GOTO end
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_message_func.ysl2 sync.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_message_func.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
IF %ERRORLEVEL% NEQ 0 GOTO end
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_statemachine.ysl2 sync.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_statemachine.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
IF %ERRORLEVEL% NEQ 0 GOTO end
xcopy /y generated\*.asn1 ..\asn.1\
xcopy /y generated\*.c ..\src\
xcopy /y generated\*.h ..\src\
XCOPY /y generated\*.asn1 ..\asn.1\
XCOPY /y generated\*.c ..\src\
XCOPY /y generated\*.h ..\src\
CD %pwd%\asn.1
CD %engine_directory%\asn.1
DEL *.h
DEL *.c
@ -70,9 +58,13 @@ IF %ERRORLEVEL% NEQ 0 (
DEL *-sample.c
CD %pwd%\..
CD %engine_directory%\..
RD /S/Q pEp
MKDIR pEp
XCOPY pEpEngine\src\*.h pEp\ /Y/F/I
:end
POPD
IF %ERRORLEVEL% NEQ 0 EXIT /B 1

+ 6
- 4
build-windows/libpEpasn1/libpEpasn1.vcxproj View File

@ -60,6 +60,9 @@
<Link>
<SubSystem>Windows</SubSystem>
</Link>
<PreBuildEvent>
<Command>IF EXIST ".\Debug\libpEpasn1.tlog\unsuccessfulbuild" CALL ..\generate_code.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@ -77,6 +80,9 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>IF EXIST ".\Release\libpEpasn1.tlog\unsuccessfulbuild" CALL ..\generate_code.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
@ -92,8 +98,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<Target Name="BeforeRebuild">
<Message Text="Generating Code for pEp Sync" />
<Exec Command="CD &quot;$(ProjectDir)..\..&quot; &amp;&amp; &quot;$(ProjectDir)..\generate_code.cmd&quot;" />
</Target>
</Project>

+ 0
- 4
build-windows/pEpEngine.vcxproj View File

@ -87,8 +87,6 @@
</Link>
<PreBuildEvent>
<Command>cargo build --manifest-path="$(SolutionDir)sequoia\Cargo.toml" -p sequoia-openpgp-ffi</Command>
<Message>
</Message>
</PreBuildEvent>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)sequoia\target\debug\sequoia_openpgp_ffi.dll" "$(TargetDir)" /Y</Command>
@ -121,8 +119,6 @@
</Link>
<PreBuildEvent>
<Command>cargo build --manifest-path="$(SolutionDir)sequoia\Cargo.toml" --release -p sequoia-openpgp-ffi</Command>
<Message>
</Message>
</PreBuildEvent>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)sequoia\target\release\sequoia_openpgp_ffi.dll" "$(TargetDir)" /Y</Command>


+ 12
- 0
src/stringpair.c View File

@ -118,6 +118,9 @@ DYNAMIC_API stringpair_list_t *stringpair_list_add(
{
assert(value);
if (!value)
return NULL;
// empty list (no nodes)
if (stringpair_list == NULL)
return new_stringpair_list(value);
@ -182,6 +185,9 @@ DYNAMIC_API int stringpair_list_length(
const stringpair_list_t *stringpair_list
)
{
if (!stringpair_list)
return 0;
int len = 0;
for (const stringpair_list_t *_sl = stringpair_list; _sl && _sl->value; _sl = _sl->next)
@ -208,6 +214,9 @@ DYNAMIC_API stringpair_list_t *stringpair_list_delete_by_key(
assert(sp_list);
assert(key);
if (!key || !sp_list)
return NULL;
if (sp_list->value == NULL) {
free_stringpair_list(sp_list);
return NULL;
@ -241,6 +250,9 @@ DYNAMIC_API stringpair_list_t *stringpair_list_find(
{
assert(key);
if (!key || !stringpair_list || !stringpair_list->value)
return NULL;
for (stringpair_list_t *_l = stringpair_list; _l; _l = _l->next) {
if (strcoll(key, _l->value->key) == 0)
return _l;


Loading…
Cancel
Save