Skip to content

Commit 27f85f4

Browse files
committed
Add copyright notices.
1 parent 5be62f4 commit 27f85f4

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

analytics/generate_windows_stubs.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,43 @@
11
#!/usr/bin/env python3
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
"""Generate stubs and function pointers for Windows SDK"""
217

318
import argparse
419
import os
520
import re
621
import sys
722

823
HEADER_GUARD_PREFIX = "FIREBASE_ANALYTICS_SRC_WINDOWS_"
9-
INCLUDE_PATH = "src/windows"
24+
INCLUDE_PATH = "src/windows/"
1025
INCLUDE_PREFIX = "analytics/" + INCLUDE_PATH
26+
COPYRIGHT_NOTICE = """// Copyright 2025 Google LLC
27+
//
28+
// Licensed under the Apache License, Version 2.0 (the "License");
29+
// you may not use this file except in compliance with the License.
30+
// You may obtain a copy of the License at
31+
//
32+
// http://www.apache.org/licenses/LICENSE-2.0
33+
//
34+
// Unless required by applicable law or agreed to in writing, software
35+
// distributed under the License is distributed on an "AS IS" BASIS,
36+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37+
// See the License for the specific language governing permissions and
38+
// limitations under the License.
39+
40+
"""
1141

1242
def generate_function_pointers(header_file_path, output_h_path, output_c_path):
1343
"""
@@ -85,6 +115,7 @@ def generate_function_pointers(header_file_path, output_h_path, output_c_path):
85115
# --- Write the self-contained Header File (.h) ---
86116
header_guard = f"{HEADER_GUARD_PREFIX}{os.path.basename(output_h_path).upper().replace('.', '_')}_"
87117
with open(output_h_path, 'w', encoding='utf-8') as f:
118+
f.write(f"{COPYRIGHT_NOTICE}")
88119
f.write(f"// Generated from {os.path.basename(header_file_path)}\n")
89120
f.write(f"// This is a self-contained header file.\n\n")
90121
f.write(f"#ifndef {header_guard}\n")
@@ -114,6 +145,7 @@ def generate_function_pointers(header_file_path, output_h_path, output_c_path):
114145

115146
# --- Write the Source File (.c) ---
116147
with open(output_c_path, 'w', encoding='utf-8') as f:
148+
f.write(f"{COPYRIGHT_NOTICE}")
117149
f.write(f"// Generated from {os.path.basename(header_file_path)}\n\n")
118150
f.write(f'#include "{INCLUDE_PREFIX}{os.path.basename(output_h_path)}"\n')
119151
f.write('#include <stddef.h> // For NULL\n\n')

analytics/src/windows/analytics_dynamic.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
// Generated from analytics.h
216

3-
#include "analytics/src/windowsanalytics_dynamic.h"
17+
#include "analytics/src/windows/analytics_dynamic.h"
418
#include <stddef.h> // For NULL
519

620
// --- Stub Function Definitions ---

analytics/src/windows/analytics_dynamic.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
// Generated from analytics.h
216
// This is a self-contained header file.
317

0 commit comments

Comments
 (0)