Skip to content

Commit

Permalink
Merged master
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeo077 committed Jun 16, 2023
2 parents d226287 + 3259f23 commit cbe25c2
Show file tree
Hide file tree
Showing 23 changed files with 211 additions and 1 deletion.
10 changes: 10 additions & 0 deletions extract.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include "extract.h"
#include "filename.h"
#include "logger.h"
Expand Down
12 changes: 11 additions & 1 deletion extract.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

package extract

import (
Expand Down Expand Up @@ -91,7 +101,7 @@ func RecognizeExtension(file string) bool {
return false
}

//filepath -> file name, full extension (including .tar), extension
// filepath -> file name, full extension (including .tar), extension
func SplitExt(s string) (string, string, string) {
ext := filepath.Ext(s)
fileName := strings.TrimSuffix(s, ext)
Expand Down
10 changes: 10 additions & 0 deletions extract.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include "status.h"

//extract requires pwd to be the destination directory
Expand Down
10 changes: 10 additions & 0 deletions filename.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#line 1 "src/filename.rl"

/*
Expand Down
10 changes: 10 additions & 0 deletions filename.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include <stdbool.h>

typedef struct filename_struct {
Expand Down
10 changes: 10 additions & 0 deletions filepath.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include <string.h>
#include <stdlib.h>

Expand Down
10 changes: 10 additions & 0 deletions filepath.h
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

char* join(const char *a, const char *b);
10 changes: 10 additions & 0 deletions hex.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
Expand Down
10 changes: 10 additions & 0 deletions hex.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#ifndef WR_HEX
#define WR_HEX

Expand Down
10 changes: 10 additions & 0 deletions lib.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
Expand Down
10 changes: 10 additions & 0 deletions lib.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include <stdbool.h>
#include "status.h"

Expand Down
10 changes: 10 additions & 0 deletions logger.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include "logger.h"
#include <stdarg.h>
#include <stdio.h>
Expand Down
10 changes: 10 additions & 0 deletions logger.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include <stdio.h>

int vlog(const char* format, ...);
Expand Down
10 changes: 10 additions & 0 deletions normalize.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Expand Down
10 changes: 10 additions & 0 deletions normalize.h
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

char* normalize(const char* s);
10 changes: 10 additions & 0 deletions sha1.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include <openssl/sha.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
10 changes: 10 additions & 0 deletions sha1.h
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

char* sha1(const char* filepath);
10 changes: 10 additions & 0 deletions status.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include "status.h"

#include <stdlib.h>
Expand Down
10 changes: 10 additions & 0 deletions status.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#ifndef WR_STATUS
#define WR_STATUS

Expand Down
Binary file removed test/c/extract_c.bin
Binary file not shown.
Binary file removed test/go/extract_test.bin
Binary file not shown.
10 changes: 10 additions & 0 deletions warnings.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#include "warnings.h"

#include <stdlib.h>
Expand Down
10 changes: 10 additions & 0 deletions warnings.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2020 Wind River Systems, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.

#ifndef WR_WARN
#define WR_WARN

Expand Down

0 comments on commit cbe25c2

Please sign in to comment.